You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/02/20 19:54:13 UTC
svn commit: r1570301 - /subversion/trunk/tools/server-side/fsfs-stats.c
Author: breser
Date: Thu Feb 20 18:54:13 2014
New Revision: 1570301
URL: http://svn.apache.org/r1570301
Log:
Fix a compiler warning in fsfs-stats.
* tools/server-side/fsfs-stats.c
(read_revisions): Cast the nelts argument to apr_array_make as an int.
Modified:
subversion/trunk/tools/server-side/fsfs-stats.c
Modified: subversion/trunk/tools/server-side/fsfs-stats.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/fsfs-stats.c?rev=1570301&r1=1570300&r2=1570301&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/fsfs-stats.c (original)
+++ subversion/trunk/tools/server-side/fsfs-stats.c Thu Feb 20 18:54:13 2014
@@ -1551,9 +1551,14 @@ read_revisions(fs_t **fs,
SVN_ERR(fs_open(fs, path, pool));
ffd = (*fs)->fs->fsap_data;
- /* create data containers and caches */
+ /* create data containers and caches
+ * Note: this assumes that int is at least 32-bits and that we only support
+ * 32-bit wide revision numbers (actually 31-bits due to the signedness
+ * of both the nelts field of the array and our revision numbers). This
+ * means this code will fail on platforms where int is less than 32-bits
+ * and the repository has more revisions than int can hold. */
(*fs)->revisions = apr_array_make(pool,
- ffd->youngest_rev_cache + 1,
+ (int) ffd->youngest_rev_cache + 1,
sizeof(revision_info_t *));
(*fs)->null_base = apr_pcalloc(pool, sizeof(*(*fs)->null_base));
initialize_largest_changes(*fs, 64, pool);