Author: rhuijben
Date: Wed Mar 11 11:54:35 2015
New Revision: 1665851

URL: http://svn.apache.org/r1665851
Log:
* subversion/libsvn_delta/compat.c
  (alter_file_cb): Resolve compiler warning by combining two ifs.
    Move a few variable updates to before the file copy to keep comments valid.
    This also allows reducing the variable scope of the variables causing the
    warning.

Modified:
    subversion/trunk/subversion/libsvn_delta/compat.c

Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1665851&r1=1665850&r2=1665851&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Wed Mar 11 11:54:35 2015
@@ -1223,15 +1223,23 @@ alter_file_cb(void *baton,
               apr_pool_t *scratch_pool)
 {
   struct editor_baton *eb = baton;
-  const char *tmp_filename;
   svn_stream_t *tmp_stream;
-  svn_checksum_t *md5_checksum;
   struct change_node *change = insert_change(relpath, eb->changes);
 
+  /* Note: this node may already have information in CHANGE as a result
+     of an earlier copy/move operation.  */
+
   /* ### should we verify the kind is truly a file?  */
+  change->kind = svn_node_file;
+  change->changing = revision;
+  if (props != NULL)
+    change->props = svn_prop_hash_dup(props, eb->edit_pool);
 
   if (contents)
     {
+      const char *tmp_filename;
+      svn_checksum_t *md5_checksum;
+
       /* We may need to re-checksum these contents */
       if (checksum && checksum->kind == svn_checksum_md5)
         md5_checksum = (svn_checksum_t *)checksum;
@@ -1246,17 +1254,7 @@ alter_file_cb(void *baton,
                                      eb->edit_pool, scratch_pool));
       SVN_ERR(svn_stream_copy3(contents, tmp_stream, NULL, NULL,
                                scratch_pool));
-    }
 
-  /* Note: this node may already have information in CHANGE as a result
-     of an earlier copy/move operation.  */
-
-  change->kind = svn_node_file;
-  change->changing = revision;
-  if (props != NULL)
-    change->props = svn_prop_hash_dup(props, eb->edit_pool);
-  if (contents != NULL)
-    {
       change->contents_changed = TRUE;
       change->contents_abspath = tmp_filename;
       change->checksum = svn_checksum_dup(md5_checksum, eb->edit_pool);


Reply via email to