You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/05/20 07:43:02 UTC

svn commit: r1596113 - /subversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c

Author: stefan2
Date: Tue May 20 05:43:02 2014
New Revision: 1596113

URL: http://svn.apache.org/r1596113
Log:
Prevent type mismatch warnings.

* tools/server-side/svnfsfs/load-index-cmd.c
  (parse_index_line): Use an intermediate variable of a fixed type and
                      then cast to the respective platform type.  We
                      can't test for value ranges here as there is no
                      suitable MAX constant for apr_off_t.  OTOH, this
                      is an expert tool and the user is ultimately
                      responsible for providing correct / valid data.

Found by: gbg

Modified:
    subversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c

Modified: subversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c?rev=1596113&r1=1596112&r2=1596113&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c (original)
+++ subversion/trunk/tools/server-side/svnfsfs/load-index-cmd.c Tue May 20 05:43:02 2014
@@ -292,11 +292,15 @@ parse_index_line(svn_fs_fs__p2l_entry_t 
   apr_array_header_t *tokens = svn_cstring_split(line->data, " ", TRUE,
                                                  scratch_pool);
   svn_fs_fs__p2l_entry_t *result = apr_pcalloc(result_pool, sizeof(*result));
+  apr_int64_t value;
 
   /* Parse the hex columns. */
-  SVN_ERR(token_to_i64(&result->offset, tokens, 0));
-  SVN_ERR(token_to_i64(&result->size, tokens, 1));
-  SVN_ERR(token_to_i64(&result->item.number, tokens, 4));
+  SVN_ERR(token_to_i64(&value, tokens, 0));
+  result->offset = (apr_off_t)value;
+  SVN_ERR(token_to_i64(&value, tokens, 1));
+  result->size = (apr_off_t)value;
+  SVN_ERR(token_to_i64(&value, tokens, 4));
+  result->item.number = (apr_uint64_t)value;
 
   /* We now know that there were at least 5 columns.
    * Parse the non-hex columns without index check. */