[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: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Thu, 16 Apr 2009 21:52:22 +0200

Lieven Govaerts wrote:
> On 04/16/2009 09:39 PM, Stefan Küng wrote:
>> On Thu, Apr 16, 2009 at 21:30, Stefan Küng<tortoisesvn_at_gmail.com> wrote:
> ..
>>
>> A quick search through the files revealed:
>>
>> libsvn_ra_serf\locks.c, line 720 (1.6.x branch), function
>> svn_ra_serf__unlock():
>> if (force == TRUE&& (!token || token[0] == '\0'))
>>
>> libsvn_ra_serf\locks.c, line 329(1.6.x branch), function
>> set_lock_headers():
>> if (lock_ctx->force == TRUE)
>>
>
> I would find it very counter-intuitive to change these to:
> if (lock_ctx->force != FALSE) ...
> ... and to ensure that people are going to remember a rule like this in
> the future.

Well, not
  if (lock_ctx->force != FALSE)
but simply
  if (lock_ctx->force)

And I think it's less intuitive to call all svn functions with

svn_function( myBOOLparam ? TRUE : FALSE );

instead of just
svn_function( myBOOLparam );

Also, I've learned very early that you should *never* compare a value to
TRUE or 1.

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1753845

Received on 2009-04-16 21:52: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.