You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/04/05 07:29:34 UTC
svn commit: r1464833 [7/11] - in /subversion/branches/verify-keep-going: ./
build/ build/generator/ contrib/client-side/svncopy/ notes/
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/...
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/log.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/log.c Fri Apr 5 05:29:29 2013
@@ -27,6 +27,7 @@
#include "svn_compat.h"
#include "svn_private_config.h"
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_error.h"
#include "svn_path.h"
@@ -340,8 +341,7 @@ detect_changed(apr_hash_t **changed,
}
}
}
- apr_hash_set(*changed, apr_pstrdup(pool, path),
- APR_HASH_KEY_STRING, item);
+ svn_hash_sets(*changed, apr_pstrdup(pool, path), item);
}
svn_pool_destroy(subpool);
@@ -715,8 +715,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, root,
query_paths, svn_mergeinfo_inherited,
FALSE, TRUE, iterpool, iterpool));
- tmp_mergeinfo = apr_hash_get(tmp_catalog, changed_path,
- APR_HASH_KEY_STRING);
+ tmp_mergeinfo = svn_hash_gets(tmp_catalog, changed_path);
if (tmp_mergeinfo)
SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_value,
tmp_mergeinfo,
@@ -734,8 +733,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, base_root,
query_paths, svn_mergeinfo_inherited,
FALSE, TRUE, iterpool, iterpool));
- tmp_mergeinfo = apr_hash_get(tmp_catalog, base_path,
- APR_HASH_KEY_STRING);
+ tmp_mergeinfo = svn_hash_gets(tmp_catalog, base_path);
if (tmp_mergeinfo)
SVN_ERR(svn_mergeinfo_to_string(&prev_mergeinfo_value,
tmp_mergeinfo,
@@ -766,10 +764,8 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
/* Toss interesting stuff into our return catalogs. */
hash_path = apr_pstrdup(result_pool, changed_path);
- apr_hash_set(*deleted_mergeinfo_catalog, hash_path,
- APR_HASH_KEY_STRING, deleted);
- apr_hash_set(*added_mergeinfo_catalog, hash_path,
- APR_HASH_KEY_STRING, added);
+ svn_hash_sets(*deleted_mergeinfo_catalog, hash_path, deleted);
+ svn_hash_sets(*added_mergeinfo_catalog, hash_path, added);
}
}
@@ -858,7 +854,7 @@ get_combined_mergeinfo_changes(svn_merge
/* If this path is represented in the changed-mergeinfo hashes,
we'll deal with it in the loop below. */
- if (apr_hash_get(deleted_mergeinfo_catalog, path, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(deleted_mergeinfo_catalog, path))
continue;
/* Figure out what path/rev to compare against. Ignore
@@ -1080,14 +1076,10 @@ fill_log_entry(svn_log_entry_t *log_entr
{
/* ... but we can only return author/date. */
log_entry->revprops = svn_hash__make(pool);
- apr_hash_set(log_entry->revprops, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING,
- apr_hash_get(r_props, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING));
- apr_hash_set(log_entry->revprops, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING,
- apr_hash_get(r_props, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING));
+ svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_AUTHOR,
+ svn_hash_gets(r_props, SVN_PROP_REVISION_AUTHOR));
+ svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_DATE,
+ svn_hash_gets(r_props, SVN_PROP_REVISION_DATE));
}
else
/* ... so return all we got. */
@@ -1100,8 +1092,7 @@ fill_log_entry(svn_log_entry_t *log_entr
for (i = 0; i < revprops->nelts; i++)
{
char *name = APR_ARRAY_IDX(revprops, i, char *);
- svn_string_t *value = apr_hash_get(r_props, name,
- APR_HASH_KEY_STRING);
+ svn_string_t *value = svn_hash_gets(r_props, name);
if (censor_revprops
&& !(strcmp(name, SVN_PROP_REVISION_AUTHOR) == 0
|| strcmp(name, SVN_PROP_REVISION_DATE) == 0))
@@ -1109,8 +1100,7 @@ fill_log_entry(svn_log_entry_t *log_entr
continue;
if (log_entry->revprops == NULL)
log_entry->revprops = svn_hash__make(pool);
- apr_hash_set(log_entry->revprops, name,
- APR_HASH_KEY_STRING, value);
+ svn_hash_sets(log_entry->revprops, name, value);
}
}
}
@@ -1767,8 +1757,7 @@ reduce_search(apr_array_header_t *paths,
for (i = 0; i < paths->nelts; ++i)
{
const char *path = APR_ARRAY_IDX(paths, i, const char *);
- svn_rangelist_t *ranges = apr_hash_get(processed, path,
- APR_HASH_KEY_STRING);
+ svn_rangelist_t *ranges = svn_hash_gets(processed, path);
int j;
if (!ranges)
@@ -1848,8 +1837,7 @@ store_search(svn_mergeinfo_t processed,
range->end = end;
range->inheritable = TRUE;
APR_ARRAY_PUSH(ranges, svn_merge_range_t *) = range;
- apr_hash_set(mergeinfo, apr_pstrdup(processed_pool, path),
- APR_HASH_KEY_STRING, ranges);
+ svn_hash_sets(mergeinfo, apr_pstrdup(processed_pool, path), ranges);
}
SVN_ERR(svn_mergeinfo_merge2(processed, mergeinfo,
apr_hash_pool_get(processed), scratch_pool));
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/replay.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/replay.c Fri Apr 5 05:29:29 2013
@@ -218,10 +218,10 @@ add_subdir(svn_fs_root_t *source_root,
changed path (because it was modified after the copy but before the
commit), we remove it from the changed_paths hash so that future
calls to path_driver_cb_func will ignore it. */
- change = apr_hash_get(changed_paths, new_edit_path, APR_HASH_KEY_STRING);
+ change = svn_hash_gets(changed_paths, new_edit_path);
if (change)
{
- apr_hash_set(changed_paths, new_edit_path, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(changed_paths, new_edit_path, NULL);
/* If it's a delete, skip this entry. */
if (change->change_kind == svn_fs_path_change_delete)
@@ -491,7 +491,7 @@ path_driver_cb_func(void **dir_baton,
edit_path))
apr_array_pop(cb->copies);
- change = apr_hash_get(cb->changed_paths, edit_path, APR_HASH_KEY_STRING);
+ change = svn_hash_gets(cb->changed_paths, edit_path);
if (! change)
{
/* This can only happen if the path was removed from cb->changed_paths
@@ -1062,11 +1062,10 @@ add_subdir_ev2(svn_fs_root_t *source_roo
changed path (because it was modified after the copy but before the
commit), we remove it from the changed_paths hash so that future
calls to path_driver_cb_func will ignore it. */
- change = apr_hash_get(changed_paths, child_relpath, APR_HASH_KEY_STRING);
+ change = svn_hash_gets(changed_paths, child_relpath);
if (change)
{
- apr_hash_set(changed_paths, child_relpath, APR_HASH_KEY_STRING,
- NULL);
+ svn_hash_sets(changed_paths, child_relpath, NULL);
/* If it's a delete, skip this entry. */
if (change->change_kind == svn_fs_path_change_delete)
@@ -1191,7 +1190,7 @@ replay_node(svn_fs_root_t *root,
repos_relpath) == NULL) )
apr_array_pop(copies);
- change = apr_hash_get(changed_paths, repos_relpath, APR_HASH_KEY_STRING);
+ change = svn_hash_gets(changed_paths, repos_relpath);
if (! change)
{
/* This can only happen if the path was removed from changed_paths
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/reporter.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/reporter.c Fri Apr 5 05:29:29 2013
@@ -22,6 +22,7 @@
*/
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_types.h"
#include "svn_error.h"
@@ -486,12 +487,10 @@ get_revision_info(report_baton_t *b,
scratch_pool));
/* Extract the committed-date. */
- cdate = apr_hash_get(r_props, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING);
+ cdate = svn_hash_gets(r_props, SVN_PROP_REVISION_DATE);
/* Extract the last-author. */
- author = apr_hash_get(r_props, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING);
+ author = svn_hash_gets(r_props, SVN_PROP_REVISION_AUTHOR);
/* Create a result object */
info = apr_palloc(b->pool, sizeof(*info));
@@ -1190,16 +1189,16 @@ delta_dirs(report_baton_t *b, svn_revnum
item is a delete, remove the entry from the source hash,
but don't update the entry yet. */
if (s_entries)
- apr_hash_set(s_entries, name, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(s_entries, name, NULL);
continue;
}
e_fullpath = svn_relpath_join(e_path, name, subpool);
t_fullpath = svn_fspath__join(t_path, name, subpool);
- t_entry = apr_hash_get(t_entries, name, APR_HASH_KEY_STRING);
+ t_entry = svn_hash_gets(t_entries, name);
s_fullpath = s_path ? svn_fspath__join(s_path, name, subpool) : NULL;
s_entry = s_entries ?
- apr_hash_get(s_entries, name, APR_HASH_KEY_STRING) : NULL;
+ svn_hash_gets(s_entries, name) : NULL;
/* The only special cases here are
@@ -1220,12 +1219,12 @@ delta_dirs(report_baton_t *b, svn_revnum
DEPTH_BELOW_HERE(requested_depth), subpool));
/* Don't revisit this name in the target or source entries. */
- apr_hash_set(t_entries, name, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(t_entries, name, NULL);
if (s_entries
/* Keep the entry for later process if it is reported as
excluded and got deleted in repos. */
&& (! info || info->depth != svn_depth_exclude || t_entry))
- apr_hash_set(s_entries, name, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(s_entries, name, NULL);
/* pathinfo entries live in their own subpools due to lookahead,
so we need to clear each one out as we finish with it. */
@@ -1246,8 +1245,7 @@ delta_dirs(report_baton_t *b, svn_revnum
svn_pool_clear(subpool);
s_entry = svn__apr_hash_index_val(hi);
- if (apr_hash_get(t_entries, s_entry->name,
- APR_HASH_KEY_STRING) == NULL)
+ if (svn_hash_gets(t_entries, s_entry->name) == NULL)
{
svn_revnum_t deleted_rev;
@@ -1306,7 +1304,7 @@ delta_dirs(report_baton_t *b, svn_revnum
/* Look for an entry with the same name
in the source dirents. */
s_entry = s_entries ?
- apr_hash_get(s_entries, t_entry->name, APR_HASH_KEY_STRING)
+ svn_hash_gets(s_entries, t_entry->name)
: NULL;
s_fullpath = s_entry ?
svn_fspath__join(s_path, t_entry->name, subpool) : NULL;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c Fri Apr 5 05:29:29 2013
@@ -1147,14 +1147,15 @@ create_conf(svn_repos_t *repos, apr_pool
"### With svnserve, the LANG environment variable of the svnserve process" NL
"### must be set to the same value as given here." NL
"[default]" NL
-"# LANG = en_US.UTF-8" NL
+"LANG = en_US.UTF-8" NL
"" NL
"### This sets the PATH environment variable for the pre-commit hook." NL
-"# [pre-commit]" NL
-"# PATH = /usr/local/bin:/usr/bin:/usr/sbin" NL;
+"[pre-commit]" NL
+"PATH = /usr/local/bin:/usr/bin:/usr/sbin" NL;
SVN_ERR_W(svn_io_file_create(svn_dirent_join(repos->conf_path,
- SVN_REPOS__CONF_HOOKS_ENV,
+ SVN_REPOS__CONF_HOOKS_ENV \
+ SVN_REPOS__HOOK_DESC_EXT,
pool),
hooks_env_contents, pool),
_("Creating hooks-env file"));
@@ -1184,15 +1185,15 @@ parse_hooks_env_option(const char *name,
apr_pool_t *result_pool = apr_hash_pool_get(bo->hooks_env);
apr_hash_t *hook_env;
- hook_env = apr_hash_get(bo->hooks_env, bo->section, APR_HASH_KEY_STRING);
+ hook_env = svn_hash_gets(bo->hooks_env, bo->section);
if (hook_env == NULL)
{
hook_env = apr_hash_make(result_pool);
- apr_hash_set(bo->hooks_env, apr_pstrdup(result_pool, bo->section),
- APR_HASH_KEY_STRING, hook_env);
+ svn_hash_sets(bo->hooks_env, apr_pstrdup(result_pool, bo->section),
+ hook_env);
}
- apr_hash_set(hook_env, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, apr_pstrdup(result_pool, value));
+ svn_hash_sets(hook_env, apr_pstrdup(result_pool, name),
+ apr_pstrdup(result_pool, value));
return TRUE;
}
@@ -1291,10 +1292,8 @@ create_repos_structure(svn_repos_t *repo
/* Create the DAV sandbox directory if pre-1.4 or pre-1.5-compatible. */
if (fs_config
- && (apr_hash_get(fs_config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE,
- APR_HASH_KEY_STRING)
- || apr_hash_get(fs_config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE,
- APR_HASH_KEY_STRING)))
+ && (svn_hash_gets(fs_config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE)
+ || svn_hash_gets(fs_config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE)))
{
const char *dav_path = svn_dirent_join(repos->path,
SVN_REPOS__DAV_DIR, pool);
@@ -1688,8 +1687,7 @@ svn_repos_has_capability(svn_repos_t *re
const char *capability,
apr_pool_t *pool)
{
- const char *val = apr_hash_get(repos->repository_capabilities,
- capability, APR_HASH_KEY_STRING);
+ const char *val = svn_hash_gets(repos->repository_capabilities, capability);
if (val == capability_yes)
{
@@ -1718,9 +1716,8 @@ svn_repos_has_capability(svn_repos_t *re
if (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
{
svn_error_clear(err);
- apr_hash_set(repos->repository_capabilities,
- SVN_REPOS_CAPABILITY_MERGEINFO,
- APR_HASH_KEY_STRING, capability_no);
+ svn_hash_sets(repos->repository_capabilities,
+ SVN_REPOS_CAPABILITY_MERGEINFO, capability_no);
*has = FALSE;
}
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND)
@@ -1729,9 +1726,8 @@ svn_repos_has_capability(svn_repos_t *re
in r0, so we're likely to get this error -- but it
means the repository supports mergeinfo! */
svn_error_clear(err);
- apr_hash_set(repos->repository_capabilities,
- SVN_REPOS_CAPABILITY_MERGEINFO,
- APR_HASH_KEY_STRING, capability_yes);
+ svn_hash_sets(repos->repository_capabilities,
+ SVN_REPOS_CAPABILITY_MERGEINFO, capability_yes);
*has = TRUE;
}
else
@@ -1741,9 +1737,8 @@ svn_repos_has_capability(svn_repos_t *re
}
else
{
- apr_hash_set(repos->repository_capabilities,
- SVN_REPOS_CAPABILITY_MERGEINFO,
- APR_HASH_KEY_STRING, capability_yes);
+ svn_hash_sets(repos->repository_capabilities,
+ SVN_REPOS_CAPABILITY_MERGEINFO, capability_yes);
*has = TRUE;
}
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.h?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.h Fri Apr 5 05:29:29 2013
@@ -310,25 +310,19 @@ svn_repos__hooks_post_unlock(svn_repos_t
/* Read authz configuration data from PATH into *AUTHZ_P, allocated
in POOL. If GROUPS_PATH is set, use the global groups parsed from it.
- PATH and GROUPS_PATH may be a file or a registry path and iff ACCEPT_URLS
- is set it may also be a repos relative url or an absolute file url. When
- ACCEPT_URLS is FALSE REPOS_ROOT can be NULL.
+ PATH and GROUPS_PATH may be a dirent or a registry path and iff ACCEPT_URLS
+ is set it may also be an absolute file url.
If PATH or GROUPS_PATH is not a valid authz rule file, then return
SVN_AUTHZ_INVALID_CONFIG. The contents of *AUTHZ_P is then
undefined. If MUST_EXIST is TRUE, a missing authz or global groups file
- is also an error.
-
- If PATH is a repos relative URL then REPOS_ROOT must be set to
- the root of the repository the authz configuration will be used with.
- The same applies to GROUPS_PATH if it is being used. */
+ is also an error. */
svn_error_t *
svn_repos__authz_read(svn_authz_t **authz_p,
const char *path,
const char *groups_path,
svn_boolean_t must_exist,
svn_boolean_t accept_urls,
- const char *repos_root,
apr_pool_t *pool);
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/rev_hunt.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/rev_hunt.c Fri Apr 5 05:29:29 2013
@@ -25,6 +25,7 @@
#include <string.h>
#include "svn_compat.h"
#include "svn_private_config.h"
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_error.h"
#include "svn_error_codes.h"
@@ -1005,7 +1006,7 @@ get_path_mergeinfo(apr_hash_t **mergeinf
svn_mergeinfo_inherited, FALSE, TRUE,
result_pool, scratch_pool));
- *mergeinfo = apr_hash_get(tmp_catalog, path, APR_HASH_KEY_STRING);
+ *mergeinfo = svn_hash_gets(tmp_catalog, path);
if (!*mergeinfo)
*mergeinfo = apr_hash_make(result_pool);
@@ -1021,7 +1022,7 @@ is_path_in_hash(apr_hash_t *duplicate_pa
const char *key = apr_psprintf(pool, "%s:%ld", path, revision);
void *ptr;
- ptr = apr_hash_get(duplicate_path_revs, key, APR_HASH_KEY_STRING);
+ ptr = svn_hash_gets(duplicate_path_revs, key);
return ptr != NULL;
}
@@ -1060,9 +1061,7 @@ get_merged_mergeinfo(apr_hash_t **merged
SVN_ERR(svn_fs_paths_changed2(&changed_paths, root, scratch_pool));
while (1)
{
- svn_fs_path_change2_t *changed_path = apr_hash_get(changed_paths,
- path,
- APR_HASH_KEY_STRING);
+ svn_fs_path_change2_t *changed_path = svn_hash_gets(changed_paths, path);
if (changed_path && changed_path->prop_mod)
break;
if (svn_fspath__is_root(path, strlen(path)))
@@ -1211,10 +1210,10 @@ find_interesting_revisions(apr_array_hea
/* Add the path/rev pair to the hash, so we can filter out future
occurrences of it. We only care about this if including merged
revisions, 'cause that's the only time we can have duplicates. */
- apr_hash_set(duplicate_path_revs,
- apr_psprintf(result_pool, "%s:%ld", path_rev->path,
- path_rev->revnum),
- APR_HASH_KEY_STRING, (void *)0xdeadbeef);
+ svn_hash_sets(duplicate_path_revs,
+ apr_psprintf(result_pool, "%s:%ld", path_rev->path,
+ path_rev->revnum),
+ (void *)0xdeadbeef);
if (path_rev->revnum <= start)
break;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/auth.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/auth.c Fri Apr 5 05:29:29 2013
@@ -26,6 +26,7 @@
#include <apr_tables.h>
#include <apr_strings.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_string.h"
#include "svn_error.h"
@@ -151,17 +152,14 @@ svn_auth_open(svn_auth_baton_t **auth_ba
provider = APR_ARRAY_IDX(providers, i, svn_auth_provider_object_t *);
/* Add it to the appropriate table in the auth_baton */
- table = apr_hash_get(ab->tables,
- provider->vtable->cred_kind, APR_HASH_KEY_STRING);
+ table = svn_hash_gets(ab->tables, provider->vtable->cred_kind);
if (! table)
{
table = apr_pcalloc(pool, sizeof(*table));
table->providers
= apr_array_make(pool, 1, sizeof(svn_auth_provider_object_t *));
- apr_hash_set(ab->tables,
- provider->vtable->cred_kind, APR_HASH_KEY_STRING,
- table);
+ svn_hash_sets(ab->tables, provider->vtable->cred_kind, table);
}
APR_ARRAY_PUSH(table->providers, svn_auth_provider_object_t *)
= provider;
@@ -177,14 +175,14 @@ svn_auth_set_parameter(svn_auth_baton_t
const char *name,
const void *value)
{
- apr_hash_set(auth_baton->parameters, name, APR_HASH_KEY_STRING, value);
+ svn_hash_sets(auth_baton->parameters, name, value);
}
const void *
svn_auth_get_parameter(svn_auth_baton_t *auth_baton,
const char *name)
{
- return apr_hash_get(auth_baton->parameters, name, APR_HASH_KEY_STRING);
+ return svn_hash_gets(auth_baton->parameters, name);
}
@@ -207,7 +205,7 @@ svn_auth_first_credentials(void **creden
const char *cache_key;
/* Get the appropriate table of providers for CRED_KIND. */
- table = apr_hash_get(auth_baton->tables, cred_kind, APR_HASH_KEY_STRING);
+ table = svn_hash_gets(auth_baton->tables, cred_kind);
if (! table)
return svn_error_createf(SVN_ERR_AUTHN_NO_PROVIDER, NULL,
_("No provider registered for '%s' credentials"),
@@ -215,8 +213,7 @@ svn_auth_first_credentials(void **creden
/* First, see if we have cached creds in the auth_baton. */
cache_key = apr_pstrcat(pool, cred_kind, ":", realmstring, (char *)NULL);
- creds = apr_hash_get(auth_baton->creds_cache,
- cache_key, APR_HASH_KEY_STRING);
+ creds = svn_hash_gets(auth_baton->creds_cache, cache_key);
if (creds)
{
got_first = FALSE;
@@ -229,9 +226,11 @@ svn_auth_first_credentials(void **creden
{
provider = APR_ARRAY_IDX(table->providers, i,
svn_auth_provider_object_t *);
- SVN_ERR(provider->vtable->first_credentials
- (&creds, &iter_baton, provider->provider_baton,
- auth_baton->parameters, realmstring, auth_baton->pool));
+ SVN_ERR(provider->vtable->first_credentials(&creds, &iter_baton,
+ provider->provider_baton,
+ auth_baton->parameters,
+ realmstring,
+ auth_baton->pool));
if (creds != NULL)
{
@@ -257,10 +256,9 @@ svn_auth_first_credentials(void **creden
*state = iterstate;
/* Put the creds in the cache */
- apr_hash_set(auth_baton->creds_cache,
- apr_pstrdup(auth_baton->pool, cache_key),
- APR_HASH_KEY_STRING,
- creds);
+ svn_hash_sets(auth_baton->creds_cache,
+ apr_pstrdup(auth_baton->pool, cache_key),
+ creds);
}
*credentials = creds;
@@ -289,27 +287,24 @@ svn_auth_next_credentials(void **credent
svn_auth_provider_object_t *);
if (! state->got_first)
{
- SVN_ERR(provider->vtable->first_credentials
- (&creds, &(state->provider_iter_baton),
- provider->provider_baton, auth_baton->parameters,
- state->realmstring, auth_baton->pool));
+ SVN_ERR(provider->vtable->first_credentials(
+ &creds, &(state->provider_iter_baton),
+ provider->provider_baton, auth_baton->parameters,
+ state->realmstring, auth_baton->pool));
state->got_first = TRUE;
}
- else
+ else if (provider->vtable->next_credentials)
{
- if (provider->vtable->next_credentials)
- SVN_ERR(provider->vtable->next_credentials
- (&creds, state->provider_iter_baton,
- provider->provider_baton, auth_baton->parameters,
- state->realmstring, auth_baton->pool));
+ SVN_ERR(provider->vtable->next_credentials(
+ &creds, state->provider_iter_baton,
+ provider->provider_baton, auth_baton->parameters,
+ state->realmstring, auth_baton->pool));
}
if (creds != NULL)
{
/* Put the creds in the cache */
- apr_hash_set(auth_baton->creds_cache,
- state->cache_key, APR_HASH_KEY_STRING,
- creds);
+ svn_hash_sets(auth_baton->creds_cache, state->cache_key, creds);
break;
}
@@ -337,15 +332,13 @@ svn_auth_save_credentials(svn_auth_iters
return SVN_NO_ERROR;
auth_baton = state->auth_baton;
- creds = apr_hash_get(state->auth_baton->creds_cache,
- state->cache_key, APR_HASH_KEY_STRING);
+ creds = svn_hash_gets(state->auth_baton->creds_cache, state->cache_key);
if (! creds)
return SVN_NO_ERROR;
/* Do not save the creds if SVN_AUTH_PARAM_NO_AUTH_CACHE is set */
- no_auth_cache = apr_hash_get(auth_baton->parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ no_auth_cache = svn_hash_gets(auth_baton->parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
if (no_auth_cache)
return SVN_NO_ERROR;
@@ -629,7 +622,7 @@ svn_auth_cleanup_walk(svn_auth_baton_t *
apr_pool_t *scratch_pool)
{
- if (apr_hash_get(baton->tables, SVN_AUTH_CRED_SIMPLE, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(baton->tables, SVN_AUTH_CRED_SIMPLE))
{
SVN_ERR(svn_auth__simple_cleanup_walk(baton, cleanup, cleanup_baton,
baton->creds_cache, scratch_pool));
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/cache-membuffer.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/cache-membuffer.c Fri Apr 5 05:29:29 2013
@@ -116,11 +116,11 @@
/* By default, don't create cache segments smaller than this value unless
* the total cache size itself is smaller.
*/
-#define DEFAULT_MIN_SEGMENT_SIZE 0x2000000ull
+#define DEFAULT_MIN_SEGMENT_SIZE APR_UINT64_C(0x2000000)
/* The minimum segment size we will allow for multi-segmented caches
*/
-#define MIN_SEGMENT_SIZE 0x10000ull
+#define MIN_SEGMENT_SIZE APR_UINT64_C(0x10000)
/* The maximum number of segments allowed. Larger numbers reduce the size
* of each segment, in turn reducing the max size of a cachable item.
@@ -133,7 +133,7 @@
/* As of today, APR won't allocate chunks of 4GB or more. So, limit the
* segment size to slightly below that.
*/
-#define MAX_SEGMENT_SIZE 0xffff0000ull
+#define MAX_SEGMENT_SIZE APR_UINT64_C(0xffff0000)
/* We don't mark the initialization status for every group but initialize
* a number of groups at once. That will allow for a very small init flags
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/cache.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/cache.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/cache.c Fri Apr 5 05:29:29 2013
@@ -75,6 +75,10 @@ svn_cache__get(void **value_p,
/* In case any errors happen and are quelched, make sure we start
out with FOUND set to false. */
*found = FALSE;
+#ifdef SVN_DEBUG
+ if (getenv("SVN_X_DOES_NOT_MARK_THE_SPOT"))
+ return SVN_NO_ERROR;
+#endif
cache->reads++;
err = handle_error(cache,
@@ -114,6 +118,12 @@ svn_cache__iter(svn_boolean_t *completed
void *user_baton,
apr_pool_t *scratch_pool)
{
+#ifdef SVN_DEBUG
+ if (getenv("SVN_X_DOES_NOT_MARK_THE_SPOT"))
+ /* Pretend CACHE is empty. */
+ return SVN_NO_ERROR;
+#endif
+
return (cache->vtable->iter)(completed,
cache->cache_internal,
user_cb,
@@ -135,6 +145,10 @@ svn_cache__get_partial(void **value,
/* In case any errors happen and are quelched, make sure we start
out with FOUND set to false. */
*found = FALSE;
+#ifdef SVN_DEBUG
+ if (getenv("SVN_X_DOES_NOT_MARK_THE_SPOT"))
+ return SVN_NO_ERROR;
+#endif
cache->reads++;
err = handle_error(cache,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/cmdline.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/cmdline.c Fri Apr 5 05:29:29 2013
@@ -46,6 +46,7 @@
#include "svn_ctype.h"
#include "svn_dso.h"
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_pools.h"
#include "svn_error.h"
@@ -144,7 +145,9 @@ svn_cmdline_init(const char *progname, F
_set_error_mode(_OUT_TO_STDERR);
/* In _DEBUG mode: Redirect all debug output (E.g. assert() to stderr.
- (Ignored in releas builds) */
+ (Ignored in release builds) */
+ _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR);
+ _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
@@ -747,7 +750,7 @@ svn_cmdline__apply_config_options(apr_ha
APR_ARRAY_IDX(config_options, i,
svn_cmdline__config_argument_t *);
- cfg = apr_hash_get(config, arg->file, APR_HASH_KEY_STRING);
+ cfg = svn_hash_gets(config, arg->file);
if (cfg)
{
@@ -973,8 +976,7 @@ find_editor_binary(const char **editor,
/* If not found then fall back on the config file. */
if (! e)
{
- cfg = config ? apr_hash_get(config, SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING) : NULL;
+ cfg = config ? svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG) : NULL;
svn_config_get(cfg, &e, SVN_CONFIG_SECTION_HELPERS,
SVN_CONFIG_OPTION_EDITOR_CMD, NULL);
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/compat.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/compat.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/compat.c Fri Apr 5 05:29:29 2013
@@ -24,6 +24,7 @@
#include <apr_pools.h>
#include <apr_strings.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_compat.h"
@@ -75,12 +76,9 @@ svn_compat_log_revprops_clear(apr_hash_t
{
if (revprops)
{
- apr_hash_set(revprops, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING, NULL);
- apr_hash_set(revprops, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING, NULL);
- apr_hash_set(revprops, SVN_PROP_REVISION_LOG,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(revprops, SVN_PROP_REVISION_AUTHOR, NULL);
+ svn_hash_sets(revprops, SVN_PROP_REVISION_DATE, NULL);
+ svn_hash_sets(revprops, SVN_PROP_REVISION_LOG, NULL);
}
}
@@ -105,14 +103,11 @@ svn_compat_log_revprops_out(const char *
*author = *date = *message = NULL;
if (revprops)
{
- if ((author_s = apr_hash_get(revprops, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING)))
+ if ((author_s = svn_hash_gets(revprops, SVN_PROP_REVISION_AUTHOR)))
*author = author_s->data;
- if ((date_s = apr_hash_get(revprops, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING)))
+ if ((date_s = svn_hash_gets(revprops, SVN_PROP_REVISION_DATE)))
*date = date_s->data;
- if ((message_s = apr_hash_get(revprops, SVN_PROP_REVISION_LOG,
- APR_HASH_KEY_STRING)))
+ if ((message_s = svn_hash_gets(revprops, SVN_PROP_REVISION_LOG)))
*message = message_s->data;
}
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/config.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/config.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/config.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/config.c Fri Apr 5 05:29:29 2013
@@ -29,6 +29,7 @@
#include <apr_general.h>
#include <apr_lib.h>
+#include "svn_hash.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "config_impl.h"
@@ -589,7 +590,7 @@ svn_config_addsection(svn_config_t *cfg,
else
s->hash_key = make_hash_key(apr_pstrdup(cfg->pool, section));
s->options = apr_hash_make(cfg->pool);
- apr_hash_set(cfg->sections, s->hash_key, APR_HASH_KEY_STRING, s);
+ svn_hash_sets(cfg->sections, s->hash_key, s);
*sec = s;
}
@@ -677,7 +678,7 @@ svn_config_set(svn_config_t *cfg,
svn_config_addsection(cfg, section, &sec);
}
- apr_hash_set(sec->options, opt->hash_key, APR_HASH_KEY_STRING, opt);
+ svn_hash_sets(sec->options, opt->hash_key, opt);
}
@@ -1170,6 +1171,6 @@ svn_config_has_section(svn_config_t *cfg
if (! cfg->section_names_case_sensitive)
make_hash_key(cfg->tmp_key->data);
- sec = apr_hash_get(cfg->sections, cfg->tmp_key->data, APR_HASH_KEY_STRING);
+ sec = svn_hash_gets(cfg->sections, cfg->tmp_key->data);
return sec != NULL;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/config_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/config_auth.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/config_auth.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/config_auth.c Fri Apr 5 05:29:29 2013
@@ -128,8 +128,8 @@ svn_config_write_auth_data(apr_hash_t *h
/* Add the realmstring to the hash, so programs (or users) can
verify exactly which set of credentials this file holds. */
- apr_hash_set(hash, SVN_CONFIG_REALMSTRING_KEY, APR_HASH_KEY_STRING,
- svn_string_create(realmstring, pool));
+ svn_hash_sets(hash, SVN_CONFIG_REALMSTRING_KEY,
+ svn_string_create(realmstring, pool));
SVN_ERR_W(svn_io_file_open(&authfile, auth_path,
(APR_WRITE | APR_CREATE | APR_TRUNCATE
@@ -146,7 +146,7 @@ svn_config_write_auth_data(apr_hash_t *h
/* To be nice, remove the realmstring from the hash again, just in
case the caller wants their hash unchanged. */
- apr_hash_set(hash, SVN_CONFIG_REALMSTRING_KEY, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(hash, SVN_CONFIG_REALMSTRING_KEY, NULL);
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/debug.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/debug.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/debug.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/debug.c Fri Apr 5 05:29:29 2013
@@ -32,6 +32,9 @@
#include "svn_types.h"
#include "svn_string.h"
+#ifndef SVN_DBG__PROTOTYPES
+#define SVN_DBG__PROTOTYPES
+#endif
#include "private/svn_debug.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/deprecated.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/deprecated.c Fri Apr 5 05:29:29 2013
@@ -32,6 +32,7 @@
deprecated functions in this file. */
#define SVN_DEPRECATED
+#include "svn_hash.h"
#include "svn_subst.h"
#include "svn_path.h"
#include "svn_opt.h"
@@ -72,38 +73,28 @@ kwstruct_to_kwhash(const svn_subst_keywo
if (kwstruct->revision)
{
- apr_hash_set(kwhash, SVN_KEYWORD_REVISION_LONG,
- APR_HASH_KEY_STRING, kwstruct->revision);
- apr_hash_set(kwhash, SVN_KEYWORD_REVISION_MEDIUM,
- APR_HASH_KEY_STRING, kwstruct->revision);
- apr_hash_set(kwhash, SVN_KEYWORD_REVISION_SHORT,
- APR_HASH_KEY_STRING, kwstruct->revision);
+ svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_LONG, kwstruct->revision);
+ svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_MEDIUM, kwstruct->revision);
+ svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_SHORT, kwstruct->revision);
}
if (kwstruct->date)
{
- apr_hash_set(kwhash, SVN_KEYWORD_DATE_LONG,
- APR_HASH_KEY_STRING, kwstruct->date);
- apr_hash_set(kwhash, SVN_KEYWORD_DATE_SHORT,
- APR_HASH_KEY_STRING, kwstruct->date);
+ svn_hash_sets(kwhash, SVN_KEYWORD_DATE_LONG, kwstruct->date);
+ svn_hash_sets(kwhash, SVN_KEYWORD_DATE_SHORT, kwstruct->date);
}
if (kwstruct->author)
{
- apr_hash_set(kwhash, SVN_KEYWORD_AUTHOR_LONG,
- APR_HASH_KEY_STRING, kwstruct->author);
- apr_hash_set(kwhash, SVN_KEYWORD_AUTHOR_SHORT,
- APR_HASH_KEY_STRING, kwstruct->author);
+ svn_hash_sets(kwhash, SVN_KEYWORD_AUTHOR_LONG, kwstruct->author);
+ svn_hash_sets(kwhash, SVN_KEYWORD_AUTHOR_SHORT, kwstruct->author);
}
if (kwstruct->url)
{
- apr_hash_set(kwhash, SVN_KEYWORD_URL_LONG,
- APR_HASH_KEY_STRING, kwstruct->url);
- apr_hash_set(kwhash, SVN_KEYWORD_URL_SHORT,
- APR_HASH_KEY_STRING, kwstruct->url);
+ svn_hash_sets(kwhash, SVN_KEYWORD_URL_LONG, kwstruct->url);
+ svn_hash_sets(kwhash, SVN_KEYWORD_URL_SHORT, kwstruct->url);
}
if (kwstruct->id)
{
- apr_hash_set(kwhash, SVN_KEYWORD_ID,
- APR_HASH_KEY_STRING, kwstruct->id);
+ svn_hash_sets(kwhash, SVN_KEYWORD_ID, kwstruct->id);
}
return kwhash;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/dso.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/dso.c Fri Apr 5 05:29:29 2013
@@ -22,6 +22,7 @@
#include <apr_thread_mutex.h>
#include <apr_hash.h>
+#include "svn_hash.h"
#include "svn_dso.h"
#include "svn_pools.h"
#include "svn_private_config.h"
@@ -64,7 +65,7 @@ svn_dso_initialize2(void)
static svn_error_t *
svn_dso_load_internal(apr_dso_handle_t **dso, const char *fname)
{
- *dso = apr_hash_get(dso_cache, fname, APR_HASH_KEY_STRING);
+ *dso = svn_hash_gets(dso_cache, fname);
/* First check to see if we've been through this before... We do this
to avoid calling apr_dso_load multiple times for a given library,
@@ -91,19 +92,13 @@ svn_dso_load_internal(apr_dso_handle_t *
*dso = NULL;
/* It wasn't found, so set the special "we didn't find it" value. */
- apr_hash_set(dso_cache,
- apr_pstrdup(dso_pool, fname),
- APR_HASH_KEY_STRING,
- NOT_THERE);
+ svn_hash_sets(dso_cache, apr_pstrdup(dso_pool, fname), NOT_THERE);
return SVN_NO_ERROR;
}
/* Stash the dso so we can use it next time. */
- apr_hash_set(dso_cache,
- apr_pstrdup(dso_pool, fname),
- APR_HASH_KEY_STRING,
- *dso);
+ svn_hash_sets(dso_cache, apr_pstrdup(dso_pool, fname), *dso);
}
return SVN_NO_ERROR;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/error.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/error.c Fri Apr 5 05:29:29 2013
@@ -30,6 +30,9 @@
#include <zlib.h>
+#ifndef SVN_ERR__TRACING
+#define SVN_ERR__TRACING
+#endif
#include "svn_cmdline.h"
#include "svn_error.h"
#include "svn_pools.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/hash.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/hash.c Fri Apr 5 05:29:29 2013
@@ -96,11 +96,14 @@ hash_read(apr_hash_t *hash, svn_stream_t
svn_stringbuf_t *buf;
svn_boolean_t eof;
apr_size_t len, keylen, vallen;
- char c, *end, *keybuf, *valbuf;
+ char c, *keybuf, *valbuf;
apr_pool_t *iterpool = svn_pool_create(pool);
while (1)
{
+ svn_error_t *err;
+ apr_uint64_t ui64;
+
svn_pool_clear(iterpool);
/* Read a key length line. Might be END, though. */
@@ -119,10 +122,12 @@ hash_read(apr_hash_t *hash, svn_stream_t
if ((buf->len >= 3) && (buf->data[0] == 'K') && (buf->data[1] == ' '))
{
/* Get the length of the key */
- keylen = (size_t) strtoul(buf->data + 2, &end, 10);
- if (keylen == (size_t) ULONG_MAX || *end != '\0')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ err = svn_cstring_strtoui64(&ui64, buf->data + 2,
+ 0, APR_SIZE_MAX, 10);
+ if (err)
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
_("Serialized hash malformed"));
+ keylen = (apr_size_t)ui64;
/* Now read that much into a buffer. */
keybuf = apr_palloc(pool, keylen + 1);
@@ -141,10 +146,12 @@ hash_read(apr_hash_t *hash, svn_stream_t
if ((buf->data[0] == 'V') && (buf->data[1] == ' '))
{
- vallen = (size_t) strtoul(buf->data + 2, &end, 10);
- if (vallen == (size_t) ULONG_MAX || *end != '\0')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ err = svn_cstring_strtoui64(&ui64, buf->data + 2,
+ 0, APR_SIZE_MAX, 10);
+ if (err)
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
_("Serialized hash malformed"));
+ vallen = (apr_size_t)ui64;
valbuf = apr_palloc(iterpool, vallen + 1);
SVN_ERR(svn_stream_read(stream, valbuf, &vallen));
@@ -169,10 +176,12 @@ hash_read(apr_hash_t *hash, svn_stream_t
&& (buf->data[0] == 'D') && (buf->data[1] == ' '))
{
/* Get the length of the key */
- keylen = (size_t) strtoul(buf->data + 2, &end, 10);
- if (keylen == (size_t) ULONG_MAX || *end != '\0')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ err = svn_cstring_strtoui64(&ui64, buf->data + 2,
+ 0, APR_SIZE_MAX, 10);
+ if (err)
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
_("Serialized hash malformed"));
+ keylen = (apr_size_t)ui64;
/* Now read that much into a buffer. */
keybuf = apr_palloc(iterpool, keylen + 1);
@@ -230,11 +239,16 @@ hash_write(apr_hash_t *hash, apr_hash_t
continue;
}
+ if (item->klen < 0)
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Cannot serialize negative length"));
+
/* Write it out. */
SVN_ERR(svn_stream_printf(stream, subpool,
- "K %" APR_SSIZE_T_FMT "\n%s\n"
+ "K %" APR_SIZE_T_FMT "\n%s\n"
"V %" APR_SIZE_T_FMT "\n",
- item->klen, (const char *) item->key,
+ (apr_size_t) item->klen,
+ (const char *) item->key,
valstr->len));
len = valstr->len;
SVN_ERR(svn_stream_write(stream, valstr->data, &len));
@@ -501,31 +515,28 @@ svn_hash_from_cstring_keys(apr_hash_t **
{
const char *key =
apr_pstrdup(pool, APR_ARRAY_IDX(keys, i, const char *));
- apr_hash_set(hash, key, APR_HASH_KEY_STRING, key);
+ svn_hash_sets(hash, key, key);
}
*hash_p = hash;
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_hash__clear(apr_hash_t *hash, apr_pool_t *pool)
+#if !APR_VERSION_AT_LEAST(1, 3, 0)
+void
+svn_hash__clear(apr_hash_t *hash)
{
-#if APR_VERSION_AT_LEAST(1, 3, 0)
- apr_hash_clear(hash);
-#else
apr_hash_index_t *hi;
const void *key;
apr_ssize_t klen;
- for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
+ for (hi = apr_hash_first(NULL, hash); hi; hi = apr_hash_next(hi))
{
apr_hash_this(hi, &key, &klen, NULL);
apr_hash_set(hash, key, klen, NULL);
}
-#endif
- return SVN_NO_ERROR;
}
+#endif
@@ -538,7 +549,7 @@ svn_hash__get_cstring(apr_hash_t *hash,
{
if (hash)
{
- const char *value = apr_hash_get(hash, key, APR_HASH_KEY_STRING);
+ const char *value = svn_hash_gets(hash, key);
return value ? value : default_value;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/io.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/io.c Fri Apr 5 05:29:29 2013
@@ -51,6 +51,7 @@
#include <arch/win32/apr_arch_file_io.h>
#endif
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -2476,7 +2477,7 @@ svn_io_get_dirents3(apr_hash_t **dirents
dirent->mtime = this_entry.mtime;
}
- apr_hash_set(*dirents, name, APR_HASH_KEY_STRING, dirent);
+ svn_hash_sets(*dirents, name, dirent);
}
}
@@ -2581,7 +2582,7 @@ svn_io_stat_dirent2(const svn_io_dirent2
else
SVN_ERR(err);
- if (! apr_hash_get(dirents, requested_name, APR_HASH_KEY_STRING))
+ if (! svn_hash_gets(dirents, requested_name))
{
if (ignore_enoent)
{
@@ -2824,7 +2825,7 @@ svn_io_run_cmd(const char *path,
{
apr_proc_t cmd_proc;
- SVN_ERR(svn_io_start_cmd2(&cmd_proc, path, cmd, args, inherit,
+ SVN_ERR(svn_io_start_cmd3(&cmd_proc, path, cmd, args, NULL, inherit,
FALSE, infile, FALSE, outfile, FALSE, errfile,
pool));
@@ -2994,8 +2995,7 @@ svn_io_run_diff3_3(int *exitcode,
svn_config_t *cfg;
SVN_ERR(svn_config_get_config(&config, pool));
- cfg = config ? apr_hash_get(config, SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING) : NULL;
+ cfg = config ? svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG) : NULL;
SVN_ERR(svn_config_get_bool(cfg, &has_arg, SVN_CONFIG_SECTION_HELPERS,
SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG,
TRUE));
@@ -3111,7 +3111,7 @@ svn_io_parse_mimetypes_file(apr_hash_t *
* we know svn_cstring_split() allocated it in 'pool' for us. */
char *ext = APR_ARRAY_IDX(tokens, i, char *);
fileext_tolower(ext);
- apr_hash_set(types, ext, APR_HASH_KEY_STRING, type);
+ svn_hash_sets(types, ext, type);
}
}
if (eof)
@@ -3162,8 +3162,7 @@ svn_io_detect_mimetype2(const char **mim
svn_path_splitext sets it to "". */
svn_path_splitext(NULL, (const char **)&path_ext, file, pool);
fileext_tolower(path_ext);
- if ((type_from_map = apr_hash_get(mimetype_map, path_ext,
- APR_HASH_KEY_STRING)))
+ if ((type_from_map = svn_hash_gets(mimetype_map, path_ext)))
{
*mimetype = type_from_map;
return SVN_NO_ERROR;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/mergeinfo.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/mergeinfo.c Fri Apr 5 05:29:29 2013
@@ -649,11 +649,7 @@ svn_rangelist__combine_adjacent_ranges(s
if (lastrange->inheritable == range->inheritable)
{
lastrange->end = MAX(range->end, lastrange->end);
- if (i + 1 < rangelist->nelts)
- memmove(rangelist->elts + (rangelist->elt_size * i),
- rangelist->elts + (rangelist->elt_size * (i + 1)),
- rangelist->elt_size * (rangelist->nelts - i));
- rangelist->nelts--;
+ svn_sort__array_delete(rangelist, i, 1);
i--;
}
}
@@ -1853,16 +1849,14 @@ svn_mergeinfo_intersect2(svn_mergeinfo_t
svn_rangelist_t *rangelist2;
svn_pool_clear(iterpool);
- rangelist2 = apr_hash_get(mergeinfo2, path, APR_HASH_KEY_STRING);
+ rangelist2 = svn_hash_gets(mergeinfo2, path);
if (rangelist2)
{
SVN_ERR(svn_rangelist_intersect(&rangelist2, rangelist1, rangelist2,
consider_inheritance, iterpool));
if (rangelist2->nelts > 0)
- apr_hash_set(*mergeinfo,
- apr_pstrdup(result_pool, path),
- APR_HASH_KEY_STRING,
- svn_rangelist_dup(rangelist2, result_pool));
+ svn_hash_sets(*mergeinfo, apr_pstrdup(result_pool, path),
+ svn_rangelist_dup(rangelist2, result_pool));
}
}
svn_pool_destroy(iterpool);
@@ -1993,10 +1987,8 @@ svn_mergeinfo_catalog_dup(svn_mergeinfo_
const char *key = svn__apr_hash_index_key(hi);
svn_mergeinfo_t val = svn__apr_hash_index_val(hi);
- apr_hash_set(new_mergeinfo_catalog,
- apr_pstrdup(pool, key),
- APR_HASH_KEY_STRING,
- svn_mergeinfo_dup(val, pool));
+ svn_hash_sets(new_mergeinfo_catalog, apr_pstrdup(pool, key),
+ svn_mergeinfo_dup(val, pool));
}
return new_mergeinfo_catalog;
@@ -2131,7 +2123,7 @@ svn_mergeinfo__remove_empty_rangelists(s
if (rangelist->nelts == 0)
{
- apr_hash_set(mergeinfo, path, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(mergeinfo, path, NULL);
removed_some_ranges = TRUE;
}
}
@@ -2160,7 +2152,7 @@ svn_mergeinfo__remove_prefix_from_catalo
new_path = svn_fspath__skip_ancestor(prefix_path, original_path);
SVN_ERR_ASSERT(new_path);
- apr_hash_set(*out_catalog, new_path, APR_HASH_KEY_STRING, value);
+ svn_hash_sets(*out_catalog, new_path, value);
}
return SVN_NO_ERROR;
@@ -2187,9 +2179,9 @@ svn_mergeinfo__add_prefix_to_catalog(svn
if (original_path[0] == '/')
original_path++;
- apr_hash_set(*out_catalog,
- svn_dirent_join(prefix_path, original_path, result_pool),
- APR_HASH_KEY_STRING, value);
+ svn_hash_sets(*out_catalog,
+ svn_dirent_join(prefix_path, original_path, result_pool),
+ value);
}
return SVN_NO_ERROR;
@@ -2215,10 +2207,9 @@ svn_mergeinfo__add_suffix_to_mergeinfo(s
const char *fspath = svn__apr_hash_index_key(hi);
svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
- apr_hash_set(*out_mergeinfo,
- svn_fspath__join(fspath, suffix_relpath, result_pool),
- APR_HASH_KEY_STRING,
- rangelist);
+ svn_hash_sets(*out_mergeinfo,
+ svn_fspath__join(fspath, suffix_relpath, result_pool),
+ rangelist);
}
return SVN_NO_ERROR;
@@ -2389,10 +2380,8 @@ svn_mergeinfo__filter_catalog_by_ranges(
result_pool,
scratch_pool));
if (apr_hash_count(filtered_mergeinfo))
- apr_hash_set(*filtered_cat,
- apr_pstrdup(result_pool, path),
- APR_HASH_KEY_STRING,
- filtered_mergeinfo);
+ svn_hash_sets(*filtered_cat,
+ apr_pstrdup(result_pool, path), filtered_mergeinfo);
}
return SVN_NO_ERROR;
@@ -2436,10 +2425,8 @@ svn_mergeinfo__filter_mergeinfo_by_range
! include_range, FALSE, result_pool));
if (new_rangelist->nelts)
- apr_hash_set(*filtered_mergeinfo,
- apr_pstrdup(result_pool, path),
- APR_HASH_KEY_STRING,
- new_rangelist);
+ svn_hash_sets(*filtered_mergeinfo,
+ apr_pstrdup(result_pool, path), new_rangelist);
}
}
}
@@ -2491,8 +2478,8 @@ svn_mergeinfo__adjust_mergeinfo_rangelis
}
if (adjusted_rangelist->nelts)
- apr_hash_set(*adjusted_mergeinfo, apr_pstrdup(result_pool, path),
- APR_HASH_KEY_STRING, adjusted_rangelist);
+ svn_hash_sets(*adjusted_mergeinfo, apr_pstrdup(result_pool, path),
+ adjusted_rangelist);
}
}
return SVN_NO_ERROR;
@@ -2568,7 +2555,7 @@ svn_mergeinfo__mergeinfo_from_segments(s
/* See if we already stored ranges for this path. If not, make
a new list. */
- path_ranges = apr_hash_get(mergeinfo, source_path, APR_HASH_KEY_STRING);
+ path_ranges = svn_hash_gets(mergeinfo, source_path);
if (! path_ranges)
path_ranges = apr_array_make(pool, 1, sizeof(range));
@@ -2585,7 +2572,7 @@ svn_mergeinfo__mergeinfo_from_segments(s
range->end = segment->range_end;
range->inheritable = TRUE;
APR_ARRAY_PUSH(path_ranges, svn_merge_range_t *) = range;
- apr_hash_set(mergeinfo, source_path, APR_HASH_KEY_STRING, path_ranges);
+ svn_hash_sets(mergeinfo, source_path, path_ranges);
}
*mergeinfo_p = mergeinfo;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/opt.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/opt.c Fri Apr 5 05:29:29 2013
@@ -34,6 +34,7 @@
#include <apr_lib.h>
#include <apr_file_info.h>
+#include "svn_hash.h"
#include "svn_cmdline.h"
#include "svn_version.h"
#include "svn_types.h"
@@ -978,7 +979,7 @@ svn_opt_parse_revprop(apr_hash_t **revpr
_("'%s' is not a valid Subversion property name"),
propname);
- apr_hash_set(*revprop_table_p, propname, APR_HASH_KEY_STRING, propval);
+ svn_hash_sets(*revprop_table_p, propname, propval);
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c Fri Apr 5 05:29:29 2013
@@ -130,8 +130,8 @@ svn_pool_create_allocator(svn_boolean_t
if (thread_safe)
{
apr_thread_mutex_t *mutex;
- apr_thread_mutex_create (&mutex, APR_THREAD_MUTEX_DEFAULT, pool);
- apr_allocator_mutex_set (allocator, mutex);
+ apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool);
+ apr_allocator_mutex_set(allocator, mutex);
}
#endif
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/properties.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/properties.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/properties.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/properties.c Fri Apr 5 05:29:29 2013
@@ -27,6 +27,7 @@
#include <apr_hash.h>
#include <apr_tables.h>
#include <string.h> /* for strncmp() */
+#include "svn_hash.h"
#include "svn_string.h"
#include "svn_props.h"
#include "svn_error.h"
@@ -331,7 +332,7 @@ svn_prop__patch(const apr_hash_t *origin
{
const svn_prop_t *p = &APR_ARRAY_IDX(prop_changes, i, svn_prop_t);
- apr_hash_set(props, p->name, APR_HASH_KEY_STRING, p->value);
+ svn_hash_sets(props, p->name, p->value);
}
return props;
}
@@ -429,7 +430,7 @@ svn_prop_array_to_hash(const apr_array_h
for (i = 0; i < properties->nelts; i++)
{
const svn_prop_t *prop = &APR_ARRAY_IDX(properties, i, svn_prop_t);
- apr_hash_set(prop_hash, prop->name, APR_HASH_KEY_STRING, prop->value);
+ svn_hash_sets(prop_hash, prop->name, prop->value);
}
return prop_hash;
@@ -497,7 +498,7 @@ svn_prop_get_value(const apr_hash_t *pro
if (!props)
return NULL;
- str = apr_hash_get((apr_hash_t *)props, prop_name, APR_HASH_KEY_STRING);
+ str = svn_hash_gets((apr_hash_t *)props, prop_name);
if (str)
return str->data;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/simple_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/simple_providers.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/simple_providers.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/simple_providers.c Fri Apr 5 05:29:29 2013
@@ -81,10 +81,10 @@ svn_auth__simple_password_get(svn_boolea
*done = FALSE;
- str = apr_hash_get(creds, AUTHN_USERNAME_KEY, APR_HASH_KEY_STRING);
+ str = svn_hash_gets(creds, AUTHN_USERNAME_KEY);
if (str && username && strcmp(str->data, username) == 0)
{
- str = apr_hash_get(creds, AUTHN_PASSWORD_KEY, APR_HASH_KEY_STRING);
+ str = svn_hash_gets(creds, AUTHN_PASSWORD_KEY);
if (str && str->data)
{
*password = str->data;
@@ -107,8 +107,7 @@ svn_auth__simple_password_set(svn_boolea
svn_boolean_t non_interactive,
apr_pool_t *pool)
{
- apr_hash_set(creds, AUTHN_PASSWORD_KEY, APR_HASH_KEY_STRING,
- svn_string_create(password, pool));
+ svn_hash_sets(creds, AUTHN_PASSWORD_KEY, svn_string_create(password, pool));
*done = TRUE;
return SVN_NO_ERROR;
@@ -123,7 +122,7 @@ simple_username_get(const char **usernam
svn_boolean_t non_interactive)
{
svn_string_t *str;
- str = apr_hash_get(creds, AUTHN_USERNAME_KEY, APR_HASH_KEY_STRING);
+ str = svn_hash_gets(creds, AUTHN_USERNAME_KEY);
if (str && str->data)
{
*username = str->data;
@@ -143,24 +142,18 @@ svn_auth__simple_creds_cache_get(void **
const char *passtype,
apr_pool_t *pool)
{
- const char *config_dir = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_DIR,
- APR_HASH_KEY_STRING);
- svn_config_t *cfg = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING);
- const char *server_group = apr_hash_get(parameters,
- SVN_AUTH_PARAM_SERVER_GROUP,
- APR_HASH_KEY_STRING);
- const char *username = apr_hash_get(parameters,
- SVN_AUTH_PARAM_DEFAULT_USERNAME,
- APR_HASH_KEY_STRING);
- const char *password = apr_hash_get(parameters,
- SVN_AUTH_PARAM_DEFAULT_PASSWORD,
- APR_HASH_KEY_STRING);
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
+ const char *config_dir = svn_hash_gets(parameters, SVN_AUTH_PARAM_CONFIG_DIR);
+ svn_config_t *cfg = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS);
+ const char *server_group = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SERVER_GROUP);
+ const char *username = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_DEFAULT_USERNAME);
+ const char *password = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_DEFAULT_PASSWORD);
+ svn_boolean_t non_interactive = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NON_INTERACTIVE)
+ != NULL;
const char *default_username = NULL; /* Default username from cache. */
const char *default_password = NULL; /* Default password from cache. */
@@ -191,7 +184,7 @@ svn_auth__simple_creds_cache_get(void **
/* The password type in the auth data must match the
mangler's type, otherwise the password must be
interpreted by another provider. */
- str = apr_hash_get(creds_hash, AUTHN_PASSTYPE_KEY, APR_HASH_KEY_STRING);
+ str = svn_hash_gets(creds_hash, AUTHN_PASSTYPE_KEY);
if (str && str->data)
if (passtype && (0 == strcmp(str->data, passtype)))
have_passtype = TRUE;
@@ -319,16 +312,14 @@ svn_auth__simple_creds_cache_set(svn_boo
const char *config_dir;
svn_error_t *err;
svn_boolean_t dont_store_passwords =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
- APR_HASH_KEY_STRING) != NULL;
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
+ svn_hash_gets(parameters, SVN_AUTH_PARAM_DONT_STORE_PASSWORDS) != NULL;
+ svn_boolean_t non_interactive = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NON_INTERACTIVE)
+ != NULL;
svn_boolean_t no_auth_cache =
- (! creds->may_save) || (apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING) != NULL);
+ (! creds->may_save) || (svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE)
+ != NULL);
/* Make sure we've been passed a passtype. */
SVN_ERR_ASSERT(passtype != NULL);
@@ -338,14 +329,12 @@ svn_auth__simple_creds_cache_set(svn_boo
if (no_auth_cache)
return SVN_NO_ERROR;
- config_dir = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_DIR,
- APR_HASH_KEY_STRING);
+ config_dir = svn_hash_gets(parameters, SVN_AUTH_PARAM_CONFIG_DIR);
/* Put the username into the credentials hash. */
creds_hash = apr_hash_make(pool);
- apr_hash_set(creds_hash, AUTHN_USERNAME_KEY, APR_HASH_KEY_STRING,
- svn_string_create(creds->username, pool));
+ svn_hash_sets(creds_hash, AUTHN_USERNAME_KEY,
+ svn_string_create(creds->username, pool));
/* Don't store passwords in any form if the user has told
* us not to do so. */
@@ -371,9 +360,7 @@ svn_auth__simple_creds_cache_set(svn_boo
may_save_password = FALSE;
#else
const char *store_plaintext_passwords =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
- APR_HASH_KEY_STRING);
+ svn_hash_gets(parameters, SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS);
simple_provider_baton_t *b =
(simple_provider_baton_t *)provider_baton;
@@ -393,9 +380,8 @@ svn_auth__simple_creds_cache_set(svn_boo
*
* Check for a cached answer before prompting. */
svn_boolean_t *cached_answer;
- cached_answer = apr_hash_get(b->plaintext_answers,
- realmstring,
- APR_HASH_KEY_STRING);
+ cached_answer = svn_hash_gets(b->plaintext_answers,
+ realmstring);
if (cached_answer != NULL)
may_save_password = *cached_answer;
else
@@ -421,8 +407,8 @@ svn_auth__simple_creds_cache_set(svn_boo
cached_answer = apr_palloc(cached_answer_pool,
sizeof(svn_boolean_t));
*cached_answer = may_save_password;
- apr_hash_set(b->plaintext_answers, realmstring,
- APR_HASH_KEY_STRING, cached_answer);
+ svn_hash_sets(b->plaintext_answers, realmstring,
+ cached_answer);
}
}
else
@@ -475,8 +461,8 @@ svn_auth__simple_creds_cache_set(svn_boo
if (*saved && passtype)
/* Store the password type with the auth data, so that we
know which provider owns the password. */
- apr_hash_set(creds_hash, AUTHN_PASSTYPE_KEY, APR_HASH_KEY_STRING,
- svn_string_create(passtype, pool));
+ svn_hash_sets(creds_hash, AUTHN_PASSTYPE_KEY,
+ svn_string_create(passtype, pool));
}
}
@@ -620,7 +606,8 @@ svn_auth__simple_cleanup_walk(svn_auth_b
}
{
- const svn_string_t *realm = svn_hash_gets(file_data, SVN_CONFIG_REALMSTRING_KEY);
+ const svn_string_t *realm = svn_hash_gets(file_data,
+ SVN_CONFIG_REALMSTRING_KEY);
svn_boolean_t delete_file = FALSE;
if (! realm)
@@ -724,16 +711,14 @@ prompt_for_simple_creds(svn_auth_cred_si
so. */
if (first_time)
{
- default_username = apr_hash_get(parameters,
- SVN_AUTH_PARAM_DEFAULT_USERNAME,
- APR_HASH_KEY_STRING);
+ default_username = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_DEFAULT_USERNAME);
/* No default username? Try the auth cache. */
if (! default_username)
{
- const char *config_dir = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_DIR,
- APR_HASH_KEY_STRING);
+ const char *config_dir = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_CONFIG_DIR);
apr_hash_t *creds_hash = NULL;
svn_string_t *str;
svn_error_t *err;
@@ -743,8 +728,7 @@ prompt_for_simple_creds(svn_auth_cred_si
svn_error_clear(err);
if (! err && creds_hash)
{
- str = apr_hash_get(creds_hash, AUTHN_USERNAME_KEY,
- APR_HASH_KEY_STRING);
+ str = svn_hash_gets(creds_hash, AUTHN_USERNAME_KEY);
if (str && str->data)
default_username = str->data;
}
@@ -753,12 +737,10 @@ prompt_for_simple_creds(svn_auth_cred_si
/* Still no default username? Try the 'servers' file. */
if (! default_username)
{
- svn_config_t *cfg = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING);
- const char *server_group = apr_hash_get(parameters,
- SVN_AUTH_PARAM_SERVER_GROUP,
- APR_HASH_KEY_STRING);
+ svn_config_t *cfg = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS);
+ const char *server_group = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SERVER_GROUP);
default_username =
svn_config_get_server_setting(cfg, server_group,
SVN_CONFIG_OPTION_USERNAME,
@@ -769,9 +751,8 @@ prompt_for_simple_creds(svn_auth_cred_si
if (! default_username)
default_username = svn_user_get_name(pool);
- default_password = apr_hash_get(parameters,
- SVN_AUTH_PARAM_DEFAULT_PASSWORD,
- APR_HASH_KEY_STRING);
+ default_password = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_DEFAULT_PASSWORD);
}
/* If we have defaults, just build the cred here and return it.
@@ -809,9 +790,8 @@ simple_prompt_first_creds(void **credent
{
simple_prompt_provider_baton_t *pb = provider_baton;
simple_prompt_iter_baton_t *ibaton = apr_pcalloc(pool, sizeof(*ibaton));
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
SVN_ERR(prompt_for_simple_creds((svn_auth_cred_simple_t **) credentials_p,
pb, parameters, realmstring, TRUE,
@@ -836,9 +816,8 @@ simple_prompt_next_creds(void **credenti
{
simple_prompt_iter_baton_t *ib = iter_baton;
simple_prompt_provider_baton_t *pb = provider_baton;
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
if ((pb->retry_limit >= 0) && (ib->retries >= pb->retry_limit))
{
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/sorts.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/sorts.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/sorts.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/sorts.c Fri Apr 5 05:29:29 2013
@@ -28,6 +28,7 @@
#include <apr_tables.h>
#include <stdlib.h> /* for qsort() */
#include <assert.h>
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_sorts.h"
#include "svn_error.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_providers.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_providers.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_providers.c Fri Apr 5 05:29:29 2013
@@ -29,6 +29,7 @@
/*** Includes. ***/
#include <apr_pools.h>
+#include "svn_hash.h"
#include "svn_auth.h"
#include "svn_error.h"
#include "svn_config.h"
@@ -48,12 +49,10 @@ ssl_client_cert_file_first_credentials(v
const char *realmstring,
apr_pool_t *pool)
{
- svn_config_t *cfg = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING);
- const char *server_group = apr_hash_get(parameters,
- SVN_AUTH_PARAM_SERVER_GROUP,
- APR_HASH_KEY_STRING);
+ svn_config_t *cfg = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS);
+ const char *server_group = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SERVER_GROUP);
const char *cert_file;
cert_file =
@@ -139,9 +138,8 @@ ssl_client_cert_prompt_first_cred(void *
ssl_client_cert_prompt_provider_baton_t *pb = provider_baton;
ssl_client_cert_prompt_iter_baton_t *ib =
apr_pcalloc(pool, sizeof(*ib));
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
SVN_ERR(pb->prompt_func((svn_auth_cred_ssl_client_cert_t **) credentials_p,
pb->prompt_baton, realmstring, ! no_auth_cache,
@@ -165,9 +163,8 @@ ssl_client_cert_prompt_next_cred(void **
apr_pool_t *pool)
{
ssl_client_cert_prompt_iter_baton_t *ib = iter_baton;
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
if ((ib->pb->retry_limit >= 0) && (ib->retries >= ib->pb->retry_limit))
{
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_pw_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_pw_providers.c?rev=1464833&r1=1464832&r2=1464833&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_pw_providers.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/ssl_client_cert_pw_providers.c Fri Apr 5 05:29:29 2013
@@ -25,6 +25,7 @@
#include <apr_pools.h>
+#include "svn_hash.h"
#include "svn_auth.h"
#include "svn_error.h"
#include "svn_config.h"
@@ -74,7 +75,7 @@ svn_auth__ssl_client_cert_pw_get(svn_boo
apr_pool_t *pool)
{
svn_string_t *str;
- str = apr_hash_get(creds, AUTHN_PASSPHRASE_KEY, APR_HASH_KEY_STRING);
+ str = svn_hash_gets(creds, AUTHN_PASSPHRASE_KEY);
if (str && str->data)
{
*passphrase = str->data;
@@ -97,8 +98,8 @@ svn_auth__ssl_client_cert_pw_set(svn_boo
svn_boolean_t non_interactive,
apr_pool_t *pool)
{
- apr_hash_set(creds, AUTHN_PASSPHRASE_KEY, APR_HASH_KEY_STRING,
- svn_string_create(passphrase, pool));
+ svn_hash_sets(creds, AUTHN_PASSPHRASE_KEY,
+ svn_string_create(passphrase, pool));
*done = TRUE;
return SVN_NO_ERROR;
}
@@ -113,15 +114,13 @@ svn_auth__ssl_client_cert_pw_cache_get(v
const char *passtype,
apr_pool_t *pool)
{
- svn_config_t *cfg = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING);
- const char *server_group = apr_hash_get(parameters,
- SVN_AUTH_PARAM_SERVER_GROUP,
- APR_HASH_KEY_STRING);
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
+ svn_config_t *cfg = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_CONFIG_CATEGORY_SERVERS);
+ const char *server_group = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SERVER_GROUP);
+ svn_boolean_t non_interactive = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NON_INTERACTIVE)
+ != NULL;
const char *password =
svn_config_get_server_setting(cfg, server_group,
SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD,
@@ -130,9 +129,8 @@ svn_auth__ssl_client_cert_pw_cache_get(v
{
svn_error_t *err;
apr_hash_t *creds_hash = NULL;
- const char *config_dir = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_DIR,
- APR_HASH_KEY_STRING);
+ const char *config_dir = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_CONFIG_DIR);
/* Try to load passphrase from the auth/ cache. */
err = svn_config_read_auth_data(&creds_hash,
@@ -179,25 +177,20 @@ svn_auth__ssl_client_cert_pw_cache_set(s
const char *config_dir;
svn_error_t *err;
svn_boolean_t dont_store_passphrase =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
- APR_HASH_KEY_STRING) != NULL;
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
+ svn_hash_gets(parameters, SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP)
+ != NULL;
+ svn_boolean_t non_interactive =
+ svn_hash_gets(parameters, SVN_AUTH_PARAM_NON_INTERACTIVE) != NULL;
svn_boolean_t no_auth_cache =
- (! creds->may_save) || (apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING) != NULL);
+ (! creds->may_save)
+ || (svn_hash_gets(parameters, SVN_AUTH_PARAM_NO_AUTH_CACHE) != NULL);
*saved = FALSE;
if (no_auth_cache)
return SVN_NO_ERROR;
- config_dir = apr_hash_get(parameters,
- SVN_AUTH_PARAM_CONFIG_DIR,
- APR_HASH_KEY_STRING);
+ config_dir = svn_hash_gets(parameters, SVN_AUTH_PARAM_CONFIG_DIR);
creds_hash = apr_hash_make(pool);
/* Don't store passphrase in any form if the user has told
@@ -222,9 +215,8 @@ svn_auth__ssl_client_cert_pw_cache_set(s
may_save_passphrase = FALSE;
#else
const char *store_ssl_client_cert_pp_plaintext =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
- APR_HASH_KEY_STRING);
+ svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT);
ssl_client_cert_pw_file_provider_baton_t *b =
(ssl_client_cert_pw_file_provider_baton_t *)provider_baton;
@@ -248,8 +240,7 @@ svn_auth__ssl_client_cert_pw_cache_set(s
"cached answer is no" and "no answer has been
cached yet". */
svn_boolean_t *cached_answer =
- apr_hash_get(b->plaintext_answers, realmstring,
- APR_HASH_KEY_STRING);
+ svn_hash_gets(b->plaintext_answers, realmstring);
if (cached_answer != NULL)
{
@@ -279,8 +270,8 @@ svn_auth__ssl_client_cert_pw_cache_set(s
cached_answer = apr_palloc(cached_answer_pool,
sizeof(*cached_answer));
*cached_answer = may_save_passphrase;
- apr_hash_set(b->plaintext_answers, realmstring,
- APR_HASH_KEY_STRING, cached_answer);
+ svn_hash_sets(b->plaintext_answers, realmstring,
+ cached_answer);
}
}
else
@@ -317,9 +308,8 @@ svn_auth__ssl_client_cert_pw_cache_set(s
if (*saved && passtype)
{
- apr_hash_set(creds_hash, AUTHN_PASSTYPE_KEY,
- APR_HASH_KEY_STRING,
- svn_string_create(passtype, pool));
+ svn_hash_sets(creds_hash, AUTHN_PASSTYPE_KEY,
+ svn_string_create(passtype, pool));
}
/* Save credentials to disk. */
@@ -445,9 +435,8 @@ ssl_client_cert_pw_prompt_first_cred(voi
ssl_client_cert_pw_prompt_provider_baton_t *pb = provider_baton;
ssl_client_cert_pw_prompt_iter_baton_t *ib =
apr_pcalloc(pool, sizeof(*ib));
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
SVN_ERR(pb->prompt_func((svn_auth_cred_ssl_client_cert_pw_t **)
credentials_p, pb->prompt_baton, realmstring,
@@ -471,9 +460,8 @@ ssl_client_cert_pw_prompt_next_cred(void
apr_pool_t *pool)
{
ssl_client_cert_pw_prompt_iter_baton_t *ib = iter_baton;
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
if ((ib->pb->retry_limit >= 0) && (ib->retries >= ib->pb->retry_limit))
{