Re: prototypes in function popup menu
Re: prototypes in function popup menu
- Subject: Re: prototypes in function popup menu
- From: Markian Hlynka <email@hidden>
- Date: Thu, 10 Jun 2004 10:48:44 -0600
On Jun 10, 2004, at 7:22, Heath Raftery wrote:
> Hi Markian,
>
> On 10/06/2004, at 10:29 AM, Markian Hlynka wrote:
>
>> why don't function prototypes show up in my function popup menu in
>> xcode?
>
> They do.
>
>> ie, I have a .h file with:
>
> I copied and pasted your code into a new .h file and everything
> appeared in the menu as you expect. The defined function appeared in a
> plain typeface, while the prototypes appeared in italics.
>
what?? this makes no sense. I have done 2 things;
1. used my code file with #pragmas. actually, a copy of it. it looks
like this:
[demime 0.98b removed an attachment of type application/pdf which had a name of Picture 1.pdf]
Notice that it completely lacks function prototypes except for the
inline function CalculateElapsedTime.
Then, I've removed the #pragmas from my typedefs:
[demime 0.98b removed an attachment of type application/pdf which had a name of Picture 2.pdf]
see? it's broken!
List subscribers can see the pictures here:
http://www.cs.ualberta.ca/~markian/xcode/
Here is the exact code I'm using. The version without pragmas:
---------------------------------------------------------------
#ifndef SEARCH
#define SEARCH
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <assert.h>
#include "applicationDependencies.h"
extern int STOP; //controls signal stop of search
extern int MaxTime;
/
/-----------------------------------------------------------------------
-------
typedef struct __MDHNodeFlags
{
//put stuff in here
Move_T legalMoveList[MAX_LEGAL_MOVES];
__MDHNodeFlags & operator +=(const struct __MDHNodeFlags &x)
{
//nothing here;
return *this;
}
} NodeFlags;
/
/-----------------------------------------------------------------------
-------
typedef struct __MySearchFlags
{
//put stuff in here
unsigned int nodesExpandedPerSearch;
unsigned int leavesExpandedPerSearch;
int bestMoveIndexAtRoot;
Move_T bestMoveAtRoot;
int score; //score at root
int depth; //depth of this search; ie total
__MySearchFlags & operator +=(const struct __MySearchFlags &x)
{
this->nodesExpandedPerSearch += x.nodesExpandedPerSearch;
this->leavesExpandedPerSearch += x.leavesExpandedPerSearch;
this->bestMoveAtRoot = x.bestMoveAtRoot;
this->score = x.score;
return *this;
}
}SearchFlags;
/
/-----------------------------------------------------------------------
-------
typedef struct __MyTimeData
{
clock_t start_time, end_time; //processor time
int maxTime; //max time allowed
double elapsed_time;
long int elapsed_ticks;
__MyTimeData & operator+=(const struct __MyTimeData &x)
{
this->elapsed_time += x.elapsed_time;
this->elapsed_ticks += x.elapsed_ticks;
return *this;
}
} TimeData;
/
/-----------------------------------------------------------------------
-------
typedef struct __MDHSearchDataType
{
SearchFlags g; //globals search stuff
NodeFlags l; //local stuff
TimeData t; //timer stuff;
__MDHSearchDataType & operator +=(const struct __MDHSearchDataType
&x)
{
this->g += x.g;
this->l += x.l;
this->t += x.t;
return *this;
}
} SearchData;
/
/-----------------------------------------------------------------------
-------
inline void CalculateElapsedTime(TimeData &timer)
{
timer.elapsed_ticks = timer.end_time - timer.start_time;
timer.elapsed_time = ((double)timer.elapsed_ticks) /
(double)CLOCKS_PER_SEC;
}
void InitSearchFlags(SearchFlags &a);
void InitTimer(TimeData &t);
void InitSearchData(SearchData &f);
void StartTimer(TimeData &t);
void SetAlarm();
void StopTimer(TimeData &t);
int IDDrivePlainAB(Board_T &p, int depth, SearchData &f);
int DoSearch(Board_T &p, int depth);
//This is the main search driver. it will determine which search
algorithms to
//call, what parameters, enhancements, etc.
int DrivePlainAB(Board_T &p, int maxdepth, SearchData &f);
int PlainAlphaBeta(Board_T &p, int alpha, int beta, int depth,
NodeFlags local,
SearchFlags &g);
//this is a plain alpha-beta routine
void PrintSummary(SearchData f);
#endif
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.