[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: David Glasser <glasser_at_davidglasser.net>
Date: Mon, 20 Apr 2009 15:43:27 -0700

2009/4/19 Branko Cibej <brane_at_xbc.nu>:
> 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.

This seems like a reasonable place to apply Postel's Law.

--dave

-- 
glasser_at_davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1831647
Received on 2009-04-21 00:43:50 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.