[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: boolean issue with serf

From: Branko Cibej <brane_at_xbc.nu>
Date: Sun, 19 Apr 2009 19:19:43 +0200

Greg Stein wrote:
> On Sat, Apr 18, 2009 at 14:07, Stefan Küng <tortoisesvn_at_gmail.com> wrote:
>
>> ...
>> I've attached a patch which replaces all if(xxx == TRUE) statements with
>> if(xxx) (well, all that I found in trunk with a simple grep search).
>>
>> Not sure about the commit message though: is it really necessary to list
>> all functions that are affected for such a change?
>>
>
> I'd say "nah, don't bother."
>
> I'd also recommend the log message uses svn-style for the code :-)
> (space after 'if' and no extra in-paren spaces)
>
> And lastly, I'd suggest you update your code to pass 0/1 rather than
> 0/nonzero for svn_boolean_t. Who knows what other code might be
> written "knowing" that an svn_boolean_t only has 0 or 1 values.
>

True ... I must say, though, that any such code is quite fundamentally
broken. Regardless of our definition of svn_boolean_t and TRUE and FALSE
(note that we don't even define those macrose if some external header
already defines them for us!!). It's quite simply wrong to test "x ==
TRUE" or "x == 1" in a boolean context in C. IMNSHO.

-- Brane

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1809395
Received on 2009-04-19 19:20:09 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.