diff options
-rw-r--r-- | include/apr_hash.h | 15 | ||||
-rw-r--r-- | tables/apr_hash.c | 14 |
2 files changed, 15 insertions, 14 deletions
diff --git a/include/apr_hash.h b/include/apr_hash.h index 5bb50c0f2..3473ea516 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -95,10 +95,10 @@ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * If the length is 0 it is assumed to be strlen(key)+1 * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. - * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val) + * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val) */ -APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, - const void *val); +APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, + apr_size_t klen, const void *val); /** * Look up the value associated with a key in a hash table. @@ -107,9 +107,10 @@ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, * @param klen Length of the key * If the length is 0 it is assumed to be strlen(key)+1 * @return Returns NULL if the key is not present. - * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen) + * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ -APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen); +APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, + apr_size_t klen); /** * Start iterating over the entries in a hash table. @@ -155,10 +156,10 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * @param val Return pointer for the associated value. * @tip The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. - * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val); + * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); */ APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, - size_t *klen, void **val); + apr_size_t *klen, void **val); #ifdef __cplusplus } diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 31ccc12aa..123d18fb2 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -86,7 +86,7 @@ struct apr_hash_entry_t { apr_hash_entry_t *next; int hash; const void *key; - size_t klen; + apr_size_t klen; const void *val; }; @@ -100,7 +100,7 @@ struct apr_hash_entry_t { struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; - size_t count, max; + apr_size_t count, max; }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -114,7 +114,7 @@ struct apr_hash_t { struct apr_hash_index_t { apr_hash_t *ht; apr_hash_entry_t *this, *next; - size_t index; + apr_size_t index; }; @@ -168,7 +168,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, - size_t *klen, + apr_size_t *klen, void **val) { if (key) *key = hi->this->key; @@ -207,7 +207,7 @@ static void resize_array(apr_hash_t *ht) static apr_hash_entry_t **find_entry(apr_hash_t *ht, const void *key, - size_t klen, + apr_size_t klen, const void *val) { apr_hash_entry_t **hep, *he; @@ -282,7 +282,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, const void *key, - size_t klen) + apr_size_t klen) { apr_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); @@ -294,7 +294,7 @@ APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, - size_t klen, + apr_size_t klen, const void *val) { apr_hash_entry_t **hep; |