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/08/16 23:30:49 UTC
svn commit: r1696166 - in /subversion/trunk: subversion/libsvn_client/ra.c
subversion/libsvn_repos/log.c subversion/mod_dav_svn/repos.c
subversion/tests/libsvn_repos/repos-test.c tools/dev/fsfs-access-map.c
Author: stefan2
Date: Sun Aug 16 21:30:48 2015
New Revision: 1696166
URL: http://svn.apache.org/r1696166
Log:
When accessing an APR hash with a non-string key, take the key size from
the key variable instead of its type. This makes the code more robust in
case we want to change the key type in the future.
* subversion/libsvn_client/ra.c
(repos_locations): Take the key size from the key variable.
* subversion/libsvn_repos/log.c
(do_logs): Same.
* subversion/mod_dav_svn/repos.c
(parse_querystring): Same.
* subversion/tests/libsvn_repos/repos-test.c
(file_rev_handler,
verify_locations,
set_expected): Same.
* tools/dev/fsfs-access-map.c
(open_file): Same.
Modified:
subversion/trunk/subversion/libsvn_client/ra.c
subversion/trunk/subversion/libsvn_repos/log.c
subversion/trunk/subversion/mod_dav_svn/repos.c
subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
subversion/trunk/tools/dev/fsfs-access-map.c
Modified: subversion/trunk/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ra.c?rev=1696166&r1=1696165&r2=1696166&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ra.c (original)
+++ subversion/trunk/subversion/libsvn_client/ra.c Sun Aug 16 21:30:48 2015
@@ -727,7 +727,7 @@ repos_locations(const char **start_url,
/* We'd better have all the paths we were looking for! */
if (start_url)
{
- start_path = apr_hash_get(rev_locs, &start_revnum, sizeof(svn_revnum_t));
+ start_path = apr_hash_get(rev_locs, &start_revnum, sizeof(start_revnum));
if (! start_path)
return svn_error_createf
(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
@@ -739,7 +739,7 @@ repos_locations(const char **start_url,
if (end_url)
{
- end_path = apr_hash_get(rev_locs, &end_revnum, sizeof(svn_revnum_t));
+ end_path = apr_hash_get(rev_locs, &end_revnum, sizeof(end_revnum));
if (! end_path)
return svn_error_createf
(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
Modified: subversion/trunk/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/log.c?rev=1696166&r1=1696165&r2=1696166&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/log.c (original)
+++ subversion/trunk/subversion/libsvn_repos/log.c Sun Aug 16 21:30:48 2015
@@ -2176,7 +2176,7 @@ do_logs(svn_fs_t *fs,
if (rev_mergeinfo)
{
struct added_deleted_mergeinfo *add_and_del_mergeinfo =
- apr_hash_get(rev_mergeinfo, ¤t, sizeof(svn_revnum_t));
+ apr_hash_get(rev_mergeinfo, ¤t, sizeof(current));
added_mergeinfo = add_and_del_mergeinfo->added_mergeinfo;
deleted_mergeinfo = add_and_del_mergeinfo->deleted_mergeinfo;
has_children = (apr_hash_count(added_mergeinfo) > 0
Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1696166&r1=1696165&r2=1696166&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Sun Aug 16 21:30:48 2015
@@ -2067,7 +2067,7 @@ parse_querystring(request_rec *r, const
return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
"Couldn't trace history.", pool);
- newpath = apr_hash_get(locations, &working_rev, sizeof(svn_revnum_t));
+ newpath = apr_hash_get(locations, &working_rev, sizeof(working_rev));
if (! newpath)
return dav_svn__new_error(pool, HTTP_NOT_FOUND, 0, 0,
"path doesn't exist in that revision.");
Modified: subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_repos/repos-test.c?rev=1696166&r1=1696165&r2=1696166&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_repos/repos-test.c Sun Aug 16 21:30:48 2015
@@ -2999,7 +2999,7 @@ file_rev_handler(void *baton, const char
{
apr_hash_t *ht = baton;
const char *author;
- file_revs_t *file_rev = apr_hash_get(ht, &rev, sizeof(svn_revnum_t));
+ file_revs_t *file_rev = apr_hash_get(ht, &rev, sizeof(rev));
if (!file_rev)
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
@@ -3017,7 +3017,7 @@ file_rev_handler(void *baton, const char
/* Remove this revision from this list so we'll be able to verify that we
have seen all expected revisions. */
- apr_hash_set(ht, &rev, sizeof(svn_revnum_t), NULL);
+ apr_hash_set(ht, &rev, sizeof(rev), NULL);
return SVN_NO_ERROR;
}
@@ -3680,7 +3680,7 @@ verify_locations(apr_hash_t *actual,
for (hi = apr_hash_first(pool, expected); hi; hi = apr_hash_next(hi))
{
const svn_revnum_t *rev = apr_hash_this_key(hi);
- const char *path = apr_hash_get(actual, rev, sizeof(svn_revnum_t));
+ const char *path = apr_hash_get(actual, rev, sizeof(*rev));
if (!path)
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
@@ -3696,7 +3696,7 @@ verify_locations(apr_hash_t *actual,
for (hi = apr_hash_first(pool, actual); hi; hi = apr_hash_next(hi))
{
const svn_revnum_t *rev = apr_hash_this_key(hi);
- const char *path = apr_hash_get(expected, rev, sizeof(svn_revnum_t));
+ const char *path = apr_hash_get(expected, rev, sizeof(*rev));
if (!path)
return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
@@ -3723,7 +3723,7 @@ set_expected(apr_hash_t *expected,
{
svn_revnum_t *rp = apr_palloc(pool, sizeof(svn_revnum_t));
*rp = rev;
- apr_hash_set(expected, rp, sizeof(svn_revnum_t), path);
+ apr_hash_set(expected, rp, sizeof(*rp), path);
}
static svn_error_t *
Modified: subversion/trunk/tools/dev/fsfs-access-map.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/fsfs-access-map.c?rev=1696166&r1=1696165&r2=1696166&view=diff
==============================================================================
--- subversion/trunk/tools/dev/fsfs-access-map.c (original)
+++ subversion/trunk/tools/dev/fsfs-access-map.c Sun Aug 16 21:30:48 2015
@@ -225,7 +225,7 @@ open_file(const char *name, int handle)
*key = handle;
handle_info = apr_pcalloc(pool, sizeof(*handle_info));
- apr_hash_set(handles, key, sizeof(handle), handle_info);
+ apr_hash_set(handles, key, sizeof(*key), handle_info);
}
/* link handle to file */