summaryrefslogtreecommitdiff
path: root/tables
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2002-12-30 06:17:38 +0000
committerJustin Erenkrantz <jerenkrantz@apache.org>2002-12-30 06:17:38 +0000
commit9b3ceafc4b5746e95b7b017a749f7ad9cc2476e8 (patch)
tree680378e45d6ad37dfc1bde4931a5ef6d1915f327 /tables
parentbab7f47e83c17283547776af11a9463aa450450e (diff)
downloadapr-9b3ceafc4b5746e95b7b017a749f7ad9cc2476e8.tar.gz
Use apr_uint32_t rather than apr_size_t for the maximum hash table size.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64240 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r--tables/apr_hash.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tables/apr_hash.c b/tables/apr_hash.c
index 3947ecf6e..0db19ecb4 100644
--- a/tables/apr_hash.c
+++ b/tables/apr_hash.c
@@ -84,7 +84,7 @@ typedef struct apr_hash_entry_t apr_hash_entry_t;
struct apr_hash_entry_t {
apr_hash_entry_t *next;
- apr_size_t hash;
+ apr_uint32_t hash;
const void *key;
apr_ssize_t klen;
const void *val;
@@ -100,7 +100,7 @@ struct apr_hash_entry_t {
struct apr_hash_index_t {
apr_hash_t *ht;
apr_hash_entry_t *this, *next;
- apr_size_t index;
+ apr_uint32_t index;
};
/*
@@ -114,7 +114,7 @@ struct apr_hash_t {
apr_pool_t *pool;
apr_hash_entry_t **array;
apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */
- apr_size_t count, max;
+ apr_uint32_t count, max;
};
#define INITIAL_MAX 15 /* tunable == 2^n - 1 */
@@ -124,7 +124,7 @@ struct apr_hash_t {
* Hash creation functions.
*/
-static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max)
+static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_uint32_t max)
{
return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1));
}
@@ -192,12 +192,12 @@ static void expand_array(apr_hash_t *ht)
{
apr_hash_index_t *hi;
apr_hash_entry_t **new_array;
- apr_size_t new_max;
+ apr_uint32_t new_max;
new_max = ht->max * 2 + 1;
new_array = alloc_array(ht, new_max);
for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) {
- apr_size_t i;
+ apr_uint32_t i;
i = hi->this->hash & new_max;
hi->this->next = new_array[i];
@@ -223,7 +223,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht,
{
apr_hash_entry_t **hep, *he;
const unsigned char *p;
- apr_size_t hash;
+ apr_uint32_t hash;
apr_ssize_t i;
/*
@@ -304,7 +304,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
{
apr_hash_t *ht;
apr_hash_entry_t *new_vals;
- apr_size_t i, j;
+ apr_uint32_t i, j;
ht = apr_palloc(pool, sizeof(apr_hash_t) +
sizeof(*ht->array) * (orig->max + 1) +
@@ -371,7 +371,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht,
/* else key not present and val==NULL */
}
-APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht)
+APR_DECLARE(apr_uint32_t) apr_hash_count(apr_hash_t *ht)
{
return ht->count;
}
@@ -398,7 +398,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
apr_hash_entry_t *new_vals = NULL;
apr_hash_entry_t *iter;
apr_hash_entry_t *ent;
- apr_size_t i,j,k;
+ apr_uint32_t i,j,k;
#ifdef POOL_DEBUG
/* we don't copy keys and values, so it's necessary that