You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/06/13 16:48:51 UTC

svn commit: r1349889 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/io.c

Author: julianfoad
Date: Wed Jun 13 14:48:51 2012
New Revision: 1349889

URL: http://svn.apache.org/viewvc?rev=1349889&view=rev
Log:
Stylistic tweaks.  Use 'TRUE' and 'FALSE' for Boolean variables instead of 0
and 1, and don't initialize variables that will be initialized again before
use.

* subversion/include/svn_io.h
  (svn_io_filesizes_different_p): Use 'TRUE' and 'FALSE' in the doc string.

* subversion/libsvn_subr/io.c
  (contents_identical_p): Remove redundant initializations.
  (svn_io_files_contents_same_p): Use 'TRUE' and 'FALSE'.

Modified:
    subversion/trunk/subversion/include/svn_io.h
    subversion/trunk/subversion/libsvn_subr/io.c

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1349889&r1=1349888&r2=1349889&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Wed Jun 13 14:48:51 2012
@@ -592,14 +592,14 @@ svn_io_set_file_affected_time(apr_time_t
 void
 svn_io_sleep_for_timestamps(const char *path, apr_pool_t *pool);
 
-/** Set @a *different_p to non-zero if @a file1 and @a file2 have different
- * sizes, else set to zero.  Both @a file1 and @a file2 are utf8-encoded.
+/** Set @a *different_p to TRUE if @a file1 and @a file2 have different
+ * sizes, else set to FALSE.  Both @a file1 and @a file2 are utf8-encoded.
  *
  * Setting @a *different_p to zero does not mean the files definitely
  * have the same size, it merely means that the sizes are not
  * definitely different.  That is, if the size of one or both files
  * cannot be determined, then the sizes are not known to be different,
- * so @a *different_p is set to 0.
+ * so @a *different_p is set to FALSE.
  */
 svn_error_t *
 svn_io_filesizes_different_p(svn_boolean_t *different_p,

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1349889&r1=1349888&r2=1349889&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Wed Jun 13 14:48:51 2012
@@ -4020,8 +4020,8 @@ contents_identical_p(svn_boolean_t *iden
   apr_size_t bytes_read1, bytes_read2;
   char *buf1 = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
   char *buf2 = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
-  apr_file_t *file1_h = NULL;
-  apr_file_t *file2_h = NULL;
+  apr_file_t *file1_h;
+  apr_file_t *file2_h;
   svn_boolean_t eof1 = FALSE;
   svn_boolean_t eof2 = FALSE;
 
@@ -4084,16 +4084,16 @@ svn_io_files_contents_same_p(svn_boolean
 
   if (q)
     {
-      *same = 0;
+      *same = FALSE;
       return SVN_NO_ERROR;
     }
 
   SVN_ERR(contents_identical_p(&q, file1, file2, pool));
 
   if (q)
-    *same = 1;
+    *same = TRUE;
   else
-    *same = 0;
+    *same = FALSE;
 
   return SVN_NO_ERROR;
 }