You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Blair Zajac <bl...@orcaware.com> on 2009/02/02 16:05:14 UTC

Re: svn commit: r35631 - in trunk/subversion: libsvn_client libsvn_fs_base libsvn_fs_base/bdb libsvn_fs_base/util libsvn_fs_fs libsvn_ra_local libsvn_ra_neon libsvn_ra_serf libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc mod_dav_svn svn svnlook svnserve tests/libsvn_subr

Julian Foad wrote:
> Author: julianfoad
> Date: Mon Feb  2 07:56:44 2009
> New Revision: 35631
> 
> Log:
> Replace the expressions "? TRUE : FALSE" and "? FALSE : TRUE", which are ugly
> and redundant or almost redundant, with more direct ways to express the
> boolean test that is meant, throughout the C code base. No functional change.
> 
> The changes are similar to these:
>   boolean ? TRUE : FALSE   =>   boolean
>   boolean ? FALSE : TRUE   =>   ! (boolean)
>   x == y  ? TRUE : FALSE   =>   x != y

I haven't reviewed all the changes, but for the third one you mean

x == y  ? FALSE : TRUE  =>   x != y

Are there
Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1091233

Re: svn commit: r35631 - in trunk/subversion: libsvn_client libsvn_fs_base libsvn_fs_base/bdb libsvn_fs_base/util libsvn_fs_fs libsvn_ra_local libsvn_ra_neon libsvn_ra_serf libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc mod_dav_svn svn svnlook svnserve tests/libsvn_subr

Posted by Julian Foad <ju...@btopenworld.com>.
Martin Furter wrote:
> Index: trunk/subversion/libsvn_subr/sqlite.c
[...]
> -  return (sqlite3_column_int64(stmt->s3stmt, column) == 0
> -          ? FALSE : TRUE);
> +  return (sqlite3_column_int64(stmt->s3stmt, column) == 0);
[...]
> No matter how long I stare at this one, it still looks wrong to me.
> Shouldn't it be !=0 instead of ==0 ?

Yes, you're right. Thanks ever so much for finding my mistake.

Fixed in r35675.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1103301

Re: svn commit: r35631 - in trunk/subversion: libsvn_client libsvn_fs_base libsvn_fs_base/bdb libsvn_fs_base/util libsvn_fs_fs libsvn_ra_local libsvn_ra_neon libsvn_ra_serf libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc mod_dav_svn svn svnlook svnserve tests/libsvn_subr

Posted by Martin Furter <mf...@rola.ch>.
On Mon, 2 Feb 2009, Julian Foad wrote:

> On Mon, 2009-02-02 at 08:05 -0800, Blair Zajac wrote:
>> Julian Foad wrote:
>>> Author: julianfoad
>>> Date: Mon Feb  2 07:56:44 2009
>>> New Revision: 35631
>>>
>>> Log:
>>> Replace the expressions "? TRUE : FALSE" and "? FALSE : TRUE", which are ugly
>>> and redundant or almost redundant, with more direct ways to express the
>>> boolean test that is meant, throughout the C code base. No functional change.
>>>
>>> The changes are similar to these:
>>>   boolean ? TRUE : FALSE   =>   boolean
>>>   boolean ? FALSE : TRUE   =>   ! (boolean)
>>>   x == y  ? TRUE : FALSE   =>   x != y
>>
>> I haven't reviewed all the changes, but for the third one you mean
>>
>> x == y  ? FALSE : TRUE  =>   x != y
>
> Yes. Thanks. Just a log message typo, I hope. I've edited the log
> message.

Good work!

But...

Index: trunk/subversion/libsvn_subr/sqlite.c
===================================================================
--- trunk/subversion/libsvn_subr/sqlite.c	(revision 35630)
+++ trunk/subversion/libsvn_subr/sqlite.c	(revision 35631)
@@ -304,8 +304,7 @@
  svn_boolean_t
  svn_sqlite__column_boolean(svn_sqlite__stmt_t *stmt, int column)
  {
-  return (sqlite3_column_int64(stmt->s3stmt, column) == 0
-          ? FALSE : TRUE);
+  return (sqlite3_column_int64(stmt->s3stmt, column) == 0);
  }

  int

No matter how long I stare at this one, it still looks wrong to me.
Shouldn't it be !=0 instead of ==0 ?

Martin

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1099228

Re: svn commit: r35631 - in trunk/subversion: libsvn_client libsvn_fs_base libsvn_fs_base/bdb libsvn_fs_base/util libsvn_fs_fs libsvn_ra_local libsvn_ra_neon libsvn_ra_serf libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc mod_dav_svn svn svnlook svnserve tests/libsvn_subr

Posted by Julian Foad <ju...@btopenworld.com>.
On Mon, 2009-02-02 at 08:05 -0800, Blair Zajac wrote:
> Julian Foad wrote:
> > Author: julianfoad
> > Date: Mon Feb  2 07:56:44 2009
> > New Revision: 35631
> > 
> > Log:
> > Replace the expressions "? TRUE : FALSE" and "? FALSE : TRUE", which are ugly
> > and redundant or almost redundant, with more direct ways to express the
> > boolean test that is meant, throughout the C code base. No functional change.
> > 
> > The changes are similar to these:
> >   boolean ? TRUE : FALSE   =>   boolean
> >   boolean ? FALSE : TRUE   =>   ! (boolean)
> >   x == y  ? TRUE : FALSE   =>   x != y
> 
> I haven't reviewed all the changes, but for the third one you mean
> 
> x == y  ? FALSE : TRUE  =>   x != y

Yes. Thanks. Just a log message typo, I hope. I've edited the log
message.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1091240