View Single Post
Old 03-25-2008, 12:02 PM   #14 (permalink)
doma
'05 SY #0038
 
doma's Avatar
 
Join Date: Oct 2004
Location: Belmont, CA
Posts: 2,217
Images: 6
Quote:
Originally Posted by Conan View Post
It's not just "down there." Pretty much the entire country has the logic:

Code:
if(goingToTheTrack){
    event = dragRace | oval;
}

[I'm such a geek ]


I think I see a bug You use '|' which is bitwise OR. That means you are or-ing dragRace and oval together. The result is that event is both a dragRace and an oval.

Right, so if
#define dragRace 0x01
#define oval 0x02

then event becomes equal to 0x03.

Perhaps instead did you intended to use logical or? '||'. Then, as long as you either have an oval, or a dragRace, you will then get event set to true.

So instead...
Code:
if(goingToTheTrack){
    event = dragRace || oval;
}
Sorry... I'm home sick today and going bonkers.
I'd like to submit my above comments as the 'most stupid' comment. :-)
__________________
Braille Battery - Micromirror - Alpine Head Unit & Speakers - HID Headlights - H&T Pad - Snorkel Delete - Non Dust Brake Pads - JL Stealthbox - JL Amps - Sirius Sat - Rudolph Antlers and Nose Kit
Astronomy Picture of the Day
doma is offline