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

Re: svn commit: r31941 - branches/issue-2843-dev/subversion/libsvn_wc

From: Rui, Guo <timmyguo_at_mail.ustc.edu.cn>
Date: Wed, 2 Jul 2008 16:25:20 +0800

On Tue, Jul 01, 2008 at 06:50:54AM -0700, Blair Zajac wrote:
>> Modified: branches/issue-2843-dev/subversion/libsvn_wc/entries.c
>> URL: http://svn.collab.net/viewvc/svn/branches/issue-2843-dev/subversion/libsvn_wc/entries.c?pathrev=31941&r1=31940&r2=31941
>> ==============================================================================
>> --- branches/issue-2843-dev/subversion/libsvn_wc/entries.c Tue Jul 1 02:43:13 2008 (r31940)
>> +++ branches/issue-2843-dev/subversion/libsvn_wc/entries.c Tue Jul 1 06:31:16 2008 (r31941)
>> @@ -492,9 +492,28 @@ read_entry(svn_wc_entry_t **new_entry,
>> const char *result;
>> SVN_ERR(read_val(&result, buf, end));
>> if (result)
>> - entry->depth = svn_depth_from_word(result);
>> + {
>> + svn_boolean_t invalid;
>> + svn_boolean_t is_this_dir;
>> +
>> + entry->depth = svn_depth_from_word(result);
>> +
>> + /* Verify the depth value: + THIS_DIR should not
>> have an excluded value and SUB_DIR should only
>> + have excluded value. Remember that infinity value is not stored and
>> + should not show up here. Otherwise, something bad may have
>> + happened. However, infinity value itself will always be okay. */
>> + is_this_dir = !name;
>> + invalid = is_this_dir ^ (entry->depth != svn_depth_exclude);
>
> I'm pretty sure as a style issue we don't use bitwise operations in
> boolean operations here. If you could rewrite that in normal !, && and
> || that would be clearer.
The logic here is indeed XOR. What if I change this to the following?
        invalid = (is_this_dir ^ (entry->depth != svn_depth_exclude)) == 1;

Regards,
Rui

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-02 10:25:42 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.