Thread: boolean
View Single Post
  #7   Spotlight this post!  
Unread 21-12-2004, 17:56
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: boolean

In reply to previous concerns:
As long as you use the logical operators (&& || !) instead of the bitwise ones (& | ~ ^), you shold be ok.

If you need to use == and !=, I would recomend using one of this macros around the operands (the values being compared).
Code:
// CBOOL Converts to BOOLean
#define CBOOL(val) ((val) ? TRUE : FALSE)
// LOGically EQuivalent
#define LOG_EQ(val1,val2) (CBOOL(val1) == CBOOL(val2))
// LOGically Not EQuivalent
#define LOG_NEQ(val1,val2) (CBOOL(val1) != CBOOL(val2))