Can some one explain this line

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can some one explain this line

2,254 Views
NZ_Design
Contributor I
I a have a graphics libray that I have used in ICC but are now trying to change to code warrier.
 
I are having issues with library.
 
I have never come accross this before.
 
#define gishwfont() (gcurvp->pfont->psymbols == NULL)
 
  if( gishwfont() )
      c = ghw_setcursor( type );
ghw_setcursor( type); is never reached.
 
can some one please explain what this line is saying
 
#define gishwfont() (gcurvp->pfont->psymbols == NULL)
 
 
Labels (1)
0 Kudos
3 Replies

225 Views
bigmac
Specialist III
Hello,


NZ-Design wrote:
 
can some one please explain what this line is saying
 
#define gishwfont() (gcurvp->pfont->psymbols == NULL)
 

I would assume there is a structure identified as gcurvp, and this contains an element gcurvp.pfont.psymbols.  The code defines a macro that appears to test whether the address of this structure element is located at a valid (non-zero) address, i.e. has been initialised.  It would return TRUE if invalid.
 
Regards,
Mac
 
0 Kudos

225 Views
bigmac
Specialist III
Hello,
 
To correct my previous post -
 
gcurvp would appear to be a pointer to a structure containing the element pfont, whose value is a pointer to another structure containing the element psymbols.  The name suggests that this may also be a pointer to something else.  The macro would seem to test the value of psymbols within the second array.
 
Regards,
Mac
 
0 Kudos

225 Views
Saga
Contributor II
Its a macro, the preprocessor replace it before the compiler starts. So at the moment you write

gishwfont() it's like you write

(gcurvp->pfont->psymbols == NULL)

It will return a true if psymbols inside those structures has a NULL value.
0 Kudos