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 2015/01/16 20:35:15 UTC

svn commit: r1652502 - in /subversion/trunk/subversion/libsvn_fs_x: util.c util.h

Author: stefan2
Date: Fri Jan 16 19:35:15 2015
New Revision: 1652502

URL: http://svn.apache.org/r1652502
Log:
Switch the last function in FSX/utils.* to using two-pool paradigm compliant
parameter names.

* subversion/libsvn_fs_x/util.c
  (svn_fs_x__check_file_buffer_numeric): The POOL is a SCRATCH_POOL. 
                                         Drop redundant docstring.
  (svn_fs_x__read_content): The POOL is a pure RESULT_POOL - see called
                            function.  Drop redundant docstring.

* subversion/libsvn_fs_x/util.h
  (svn_fs_x__check_file_buffer_numeric,
   svn_fs_x__read_content): Make header match the implementation.
  (svn_fs_x__update_min_unpacked_rev): Same. The implementation already used
                                       the correct POOL name.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/util.c
    subversion/trunk/subversion/libsvn_fs_x/util.h

Modified: subversion/trunk/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/util.c?rev=1652502&r1=1652501&r2=1652502&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/util.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/util.c Fri Jan 16 19:35:15 2015
@@ -484,17 +484,12 @@ svn_fs_x__path_txn_node_children(svn_fs_
                                  scratch_pool);
 }
 
-
-/* Check that BUF, a nul-terminated buffer of text from file PATH,
-   contains only digits at OFFSET and beyond, raising an error if not.
-   TITLE contains a user-visible description of the file, usually the
-   short file name.
-
-   Uses POOL for temporary allocation. */
-svn_error_t *
-svn_fs_x__check_file_buffer_numeric(const char *buf, apr_off_t offset,
-                                    const char *path, const char *title,
-                                    apr_pool_t *pool)
+svn_error_t *
+svn_fs_x__check_file_buffer_numeric(const char *buf,
+                                    apr_off_t offset,
+                                    const char *path,
+                                    const char *title,
+                                    apr_pool_t *scratch_pool)
 {
   const char *p;
 
@@ -502,7 +497,7 @@ svn_fs_x__check_file_buffer_numeric(cons
     if (!svn_ctype_isdigit(*p))
       return svn_error_createf(SVN_ERR_BAD_VERSION_FILE_FORMAT, NULL,
         _("%s file '%s' contains unexpected non-digit '%c' within '%s'"),
-        title, svn_dirent_local_style(path, pool), *p, buf);
+        title, svn_dirent_local_style(path, scratch_pool), *p, buf);
 
   return SVN_NO_ERROR;
 }
@@ -660,12 +655,10 @@ svn_fs_x__get_file_offset(apr_off_t *off
   return SVN_NO_ERROR;
 }
 
-/* Read the 'current' file FNAME and store the contents in *BUF.
-   Allocations are performed in POOL. */
 svn_error_t *
 svn_fs_x__read_content(svn_stringbuf_t **content,
                        const char *fname,
-                       apr_pool_t *pool)
+                       apr_pool_t *result_pool)
 {
   int i;
   *content = NULL;
@@ -673,12 +666,12 @@ svn_fs_x__read_content(svn_stringbuf_t *
   for (i = 0; !*content && (i < SVN_FS_X__RECOVERABLE_RETRY_COUNT); ++i)
     SVN_ERR(svn_fs_x__try_stringbuf_from_file(content, NULL,
                            fname, i + 1 < SVN_FS_X__RECOVERABLE_RETRY_COUNT,
-                           pool));
+                           result_pool));
 
   if (!*content)
     return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                              _("Can't read '%s'"),
-                             svn_dirent_local_style(fname, pool));
+                             svn_dirent_local_style(fname, result_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_fs_x/util.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/util.h?rev=1652502&r1=1652501&r2=1652502&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/util.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/util.h Fri Jan 16 19:35:15 2015
@@ -372,13 +372,13 @@ svn_fs_x__path_txn_node_children(svn_fs_
    TITLE contains a user-visible description of the file, usually the
    short file name.
 
-   Uses POOL for temporary allocation. */
+   Uses SCRATCH_POOL for temporary allocation. */
 svn_error_t *
 svn_fs_x__check_file_buffer_numeric(const char *buf,
                                     apr_off_t offset,
                                     const char *path,
                                     const char *title,
-                                    apr_pool_t *pool);
+                                    apr_pool_t *scratch_pool);
 
 /* Set *MIN_UNPACKED_REV to the integer value read from the file returned
  * by #svn_fs_fs__path_min_unpacked_rev() for FS.
@@ -390,11 +390,11 @@ svn_fs_x__read_min_unpacked_rev(svn_revn
                                 apr_pool_t *scratch_pool);
 
 /* Re-read the MIN_UNPACKED_REV member of FS from disk.
- * Use POOL for temporary allocations.
+ * Use SCRATCH_POOL for temporary allocations.
  */
 svn_error_t *
 svn_fs_x__update_min_unpacked_rev(svn_fs_t *fs,
-                                  apr_pool_t *pool);
+                                  apr_pool_t *scratch_pool);
 
 /* Atomically update the 'min-unpacked-rev' file in FS to hold the specifed
  * REVNUM.  Perform temporary allocations in SCRATCH_POOL.
@@ -442,11 +442,11 @@ svn_fs_x__get_file_offset(apr_off_t *off
                           apr_pool_t *scratch_pool);
 
 /* Read the file FNAME and store the contents in *BUF.
-   Allocations are performed in POOL. */
+   Allocations are performed in RESULT_POOL. */
 svn_error_t *
 svn_fs_x__read_content(svn_stringbuf_t **content,
                        const char *fname,
-                       apr_pool_t *pool);
+                       apr_pool_t *result_pool);
 
 /* Reads a line from STREAM and converts it to a 64 bit integer to be
  * returned in *RESULT.  If we encounter eof, set *HIT_EOF and leave