httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p.@sweng.stortek.com
Subject Re: cvs commit: apache-2.0/src/os/win32/installer/installdll/test
Date Fri, 28 Apr 2000 19:56:47 GMT
In a recent note, Jim Jagielski said:

> Date: Fri, 28 Apr 2000 15:39:31 -0400 (EDT)
> 
> point was we're saying that if FALSE isn't defined, set it to
> (0), and maybe that's not quite anal enough :) We _require_ it
> to be (0), so we almost want:
> 
>     #undef FALSE
>     #undef TRUE
>     #define FALSE (0)
>     #define TRUE (!FALSE)
> 
> But this could break stupid setups that use a magic number for TRUE,
> so that's why I thought APR_TRUE/APR_FALSE might be best.
> 
The stupid setups are likely to break only on the amateurish
construct:

    if ( flag == TRUE ) { ... }

Yes, we've all seen this in place of the more rational:

    if ( flag ) { ... }

I suppose one could do:

    #define TRUE ( 1 == 1 )

and hope that no modern compiler would impose any penalty in runtime
efficiency, nor fail on:

    assert( ( !FALSE ) == ( 1 == 1 ) );

BTW, in:

    #define FALSE (0)

are the parentheses useful, or just a good habit?

-- gil
-- 
StorageTek
INFORMATION made POWERFUL

Mime
View raw message