]> granicus.if.org Git - apache/commitdiff
the zero-length hash key is valid. use (-1) as the discrimnator for
authorGreg Stein <gstein@apache.org>
Mon, 16 Oct 2000 02:58:15 +0000 (02:58 +0000)
committerGreg Stein <gstein@apache.org>
Mon, 16 Oct 2000 02:58:15 +0000 (02:58 +0000)
auto-computed string-length hash keys

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86604 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/main/liveprop.c
modules/dav/main/providers.c

index 5e083b7061372b05eed32cad70a4481ac395b285..7388536dbe075e229d3184a89b96b6285f3609ac 100644 (file)
@@ -87,19 +87,20 @@ DAV_DECLARE(void) dav_register_liveprop_namespace(apr_pool_t *p,
         apr_register_cleanup(p, NULL, dav_cleanup_liveprops, apr_null_cleanup);
     }
 
-    value = (int)apr_hash_get(dav_liveprop_uris, uri, 0);
+    value = (int)apr_hash_get(dav_liveprop_uris, uri, APR_HASH_KEY_STRING);
     if (value != 0) {
         /* already registered */
         return;
     }
 
     /* start at 1, and count up */
-    apr_hash_set(dav_liveprop_uris, uri, 0, (void *)++dav_liveprop_count);
+    apr_hash_set(dav_liveprop_uris, uri, APR_HASH_KEY_STRING,
+                 (void *)++dav_liveprop_count);
 }
 
 DAV_DECLARE(int) dav_get_liveprop_ns_index(const char *uri)
 {
-    return (int)apr_hash_get(dav_liveprop_uris, uri, 0);
+    return (int)apr_hash_get(dav_liveprop_uris, uri, APR_HASH_KEY_STRING);
 }
 
 int dav_get_liveprop_ns_count(void)
index 2fa704e51d65a59f601d3fdc3de020443dd65c0a..1a534514dfdaee221baad780e91e244f5cd3fbd4 100644 (file)
@@ -70,7 +70,7 @@ static apr_status_t dav_cleanup_providers(void *ctx)
 }
 
 DAV_DECLARE(void) dav_register_provider(apr_pool_t *p, const char *name,
-                                       const dav_provider *provider)
+                                        const dav_provider *provider)
 {
     /* ### ignore the pool; it is NULL right now */
     p = ap_global_hook_pool;
@@ -81,10 +81,10 @@ DAV_DECLARE(void) dav_register_provider(apr_pool_t *p, const char *name,
     }
 
     /* just set it. no biggy if it was there before. */
-    apr_hash_set(dav_repos_providers, name, 0, provider);
+    apr_hash_set(dav_repos_providers, name, APR_HASH_KEY_STRING, provider);
 }
 
 const dav_provider * dav_lookup_provider(const char *name)
 {
-    return apr_hash_get(dav_repos_providers, name, 0);
+    return apr_hash_get(dav_repos_providers, name, APR_HASH_KEY_STRING);
 }