• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
symbols and {}
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

symbols and {}


  • Subject: symbols and {}
  • From: Markian Hlynka <email@hidden>
  • Date: Wed, 3 Nov 2004 16:07:50 -0700

I have some code that seems to be acting funny to me.

regardless of whether the symbol DOMAINHASH is defined or not, the following fails to compile with the error
/Users/markian/Documents/School/PhD/Development/CodeGen/SearchEngine/ TT.cc:90: error: parse error before `return'


for(i=0;i<TT_SIZE;i++)
{
TransTable[i].depth=-1; //set all unused transposition entries to have
//an invalid depth of -1
}
#ifndef DOMAINHASH
{
//if we're using the generic TT Hash
GetTTHash = Generic_GetTTHash;
GetZobristkey = Generic_GetZobristkey;


   for(i=0;i<ZOBRIST_SIZE;i++)
      for(j=0;j<ZOBRIST_DEPTH;j++)
      {
         bluff=(int*)(&(Zobrist[i][j]));
         bluff[0]=random();
         bluff[1]=random();

      }//for j
		#ifdef DEBUG_VERBOSE
		printf("\nUsing generic Zobrist\n\n");
		#endif
	#elif defined(DOMAINHASH) & defined(DEBUG_VERBOSE)
	printf("\nUsing domain-provided hash function\n\n");
	//call hooks to initialize domain zobrist, etc. inside Board Init.
}
#endif


yet the following compiles fine. Note the different placement of the {} around the outer #ifdef block.
Am I doing something wrong, or is there a bug in the parser here? And is it a xcode bug, or a gcc bug?


for(i=0;i<TT_SIZE;i++)
{
TransTable[i].depth=-1; //set all unused transposition entries to have
//an invalid depth of -1
}
{
#ifndef DOMAINHASH


	//if we're using the generic TT Hash
	GetTTHash = Generic_GetTTHash;
	GetZobristkey = Generic_GetZobristkey;

   for(i=0;i<ZOBRIST_SIZE;i++)
      for(j=0;j<ZOBRIST_DEPTH;j++)
      {
         bluff=(int*)(&(Zobrist[i][j]));
         bluff[0]=random();
         bluff[1]=random();

      }//for j
		#ifdef DEBUG_VERBOSE
		printf("\nUsing generic Zobrist\n\n");
		#endif
	#elif defined(DOMAINHASH) & defined(DEBUG_VERBOSE)
	printf("\nUsing domain-provided hash function\n\n");
	//call hooks to initialize domain zobrist, etc. inside Board Init.
#endif
}

Thanks!

Markian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: symbols and {}
      • From: Eric Albert <email@hidden>
  • Prev by Date: error importing from CodeWarrior
  • Next by Date: "Preprocess"... nothing is displayed
  • Previous by thread: Re: error importing from CodeWarrior
  • Next by thread: Re: symbols and {}
  • Index(es):
    • Date
    • Thread