jerenkrantz 2002/12/29 22:17:38
Modified: include apr_hash.h
tables apr_hash.c
Log:
Use apr_uint32_t rather than apr_size_t for the maximum hash table size.
Revision Changes Path
1.37 +1 -1 apr/include/apr_hash.h
Index: apr_hash.h
===================================================================
RCS file: /home/cvs/apr/include/apr_hash.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -u -r1.36 -r1.37
--- apr_hash.h 23 Dec 2002 20:41:16 -0000 1.36
+++ apr_hash.h 30 Dec 2002 06:17:38 -0000 1.37
@@ -190,7 +190,7 @@
* @param ht The hash table
* @return The number of key/value pairs in the hash table.
*/
-APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht);
+APR_DECLARE(apr_uint32_t) apr_hash_count(apr_hash_t *ht);
/**
* Merge two hash tables into one new hash table. The values of the overlay
1.33 +10 -10 apr/tables/apr_hash.c
Index: apr_hash.c
===================================================================
RCS file: /home/cvs/apr/tables/apr_hash.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -u -r1.32 -r1.33
--- apr_hash.c 23 Dec 2002 20:41:17 -0000 1.32
+++ apr_hash.c 30 Dec 2002 06:17:38 -0000 1.33
@@ -84,7 +84,7 @@
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_index_t {
apr_hash_t *ht;
apr_hash_entry_t *this, *next;
- apr_size_t index;
+ apr_uint32_t index;
};
/*
@@ -114,7 +114,7 @@
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 @@
* 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 @@
{
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 @@
{
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_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 @@
/* 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_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