Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdahl!oliveb!felix!arcturus!evil From: evil@arcturus.UUCP (Wade Guthrie) Newsgroups: comp.lang.c Subject: Re: Definition of boolean type Message-ID: <3670@arcturus> Date: 13 Feb 89 16:49:20 GMT References: <10@dbase.UUCP> <9609@smoke.BRL.MIL> <3645@arcturus> <15906@mimsy.UUCP> Organization: Rockwell International, Anaheim, CA Lines: 34 Attempting to fill the part of those called 'reader': In article <15906@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > #define FALSE 0 > #define TRUE ~FALSE /* TRUE has the bit pattern 1111 ... 1111, not 0000 ... 0001 */ > ... > /* these macros return TRUE when the queue is empty/full/... */ > #define ISEMPTY(eq) ((eq)->head.foo == (eq)->tail.foo) /* causing the macro ISEMPTY to evaluate to 1 or 0 */ > The code then read > > if (ESEMPTY(eq) == TRUE) bar(); /* * since 1111 ... 1111 never equals either 1 or 0, * bar() never gets called */ > It is left as an exercise to the reader to determine why this test > will never call function bar(). Do I pass the test? Wade Guthrie evil@arcturus.UUCP Rockwell International Anaheim, CA (Rockwell doesn't necessarily believe / stand by what I'm saying; how could they when *I* don't even know what I'm talking about???)