subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1505482 - in /subversion/trunk: configure.ac subversion/libsvn_subr/compress.c
Date Sun, 21 Jul 2013 22:27:02 GMT
Author: gstein
Date: Sun Jul 21 22:27:02 2013
New Revision: 1505482

URL: http://svn.apache.org/r1505482
Log:
Followup to r1461851 and its merge to trunk in r1502712:

Fix the while() construction to properly have parens. We should not
rely on the macro expression to provide parentheses.

Fix the non-GCC expansion of SVN__PREDICT_*() to actually perform the
test(!).

* configure.ac:
  (svn_private_config:SVN__PREDICT_*): default to (x)

* subversion/libsvn_subr/compress.c:
  (svn__decode_uint): add parens for the while() statement.

Modified:
    subversion/trunk/configure.ac
    subversion/trunk/subversion/libsvn_subr/compress.c

Modified: subversion/trunk/configure.ac
URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1505482&r1=1505481&r2=1505482&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Sun Jul 21 22:27:02 2013
@@ -739,8 +739,8 @@ AH_BOTTOM([
 # define SVN__PREDICT_FALSE(x) (__builtin_expect(x, 0))
 # define SVN__PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
 #else
-# define SVN__PREDICT_FALSE(x)
-# define SVN__PREDICT_TRUE(x)
+# define SVN__PREDICT_FALSE(x) (x)
+# define SVN__PREDICT_TRUE(x) (x)
 #endif
 
 #if defined(SVN_DEBUG)

Modified: subversion/trunk/subversion/libsvn_subr/compress.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/compress.c?rev=1505482&r1=1505481&r2=1505482&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/compress.c (original)
+++ subversion/trunk/subversion/libsvn_subr/compress.c Sun Jul 21 22:27:02 2013
@@ -78,7 +78,7 @@ svn__decode_uint(apr_uint64_t *val,
     end = p + SVN__MAX_ENCODED_UINT_LEN;
 
   /* Decode bytes until we're done. */
-  while SVN__PREDICT_TRUE(p < end)
+  while (SVN__PREDICT_TRUE(p < end))
     {
       unsigned int c = *p++;
 



Mime
View raw message