summaryrefslogtreecommitdiff
path: root/source3/lib/hash.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-22 12:22:06 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-22 12:22:06 +0000
commit7e110f782a55d4dca1fb3fedd95bf059c9ec0638 (patch)
tree2e27934bd9c23ed79a80d9ea4a02396cd0516b3c /source3/lib/hash.c
parent0dde23a7b24edf1cbf4d7d7e5afea485e37498e5 (diff)
downloadsamba-7e110f782a55d4dca1fb3fedd95bf059c9ec0638.tar.gz
samba-7e110f782a55d4dca1fb3fedd95bf059c9ec0638.tar.bz2
samba-7e110f782a55d4dca1fb3fedd95bf059c9ec0638.zip
More signed/unsigned fixes (yes, I run with funny compiler options) and
make x_fwrite() match fwrite() in returning a size_t. Andrew Bartlett (This used to be commit 2943c695787b742e9a96b2eefe2d75f681bacf7c)
Diffstat (limited to 'source3/lib/hash.c')
-rw-r--r--source3/lib/hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/lib/hash.c b/source3/lib/hash.c
index 6b7a8476b1..95af485707 100644
--- a/source3/lib/hash.c
+++ b/source3/lib/hash.c
@@ -28,7 +28,7 @@
#include "includes.h"
static BOOL enlarge_hash_table(hash_table *table);
-static int primes[] =
+static unsigned primes[] =
{17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411};
/****************************************************************************
@@ -47,9 +47,9 @@ static int primes[] =
****************************************************************************
*/
-BOOL hash_table_init(hash_table *table, int num_buckets, compare_function compare_func)
+BOOL hash_table_init(hash_table *table, unsigned num_buckets, compare_function compare_func)
{
- int i;
+ unsigned i;
ubi_dlList *bucket;
table->num_elements = 0;
@@ -118,7 +118,7 @@ static hash_element *hash_chain_find(hash_table *table, ubi_dlList *hash_chain,
{
hash_element *hash_elem;
ubi_dlNodePtr lru_item;
- int i = 0;
+ unsigned int i = 0;
for (hash_elem = (hash_element *)(ubi_dlFirst(hash_chain)); i < hash_chain->count;
i++, hash_elem = (hash_element *)(ubi_dlNext(hash_elem))) {
@@ -299,7 +299,7 @@ static BOOL enlarge_hash_table(hash_table *table)
void hash_clear(hash_table *table)
{
- int i;
+ unsigned int i;
ubi_dlList *bucket = table->buckets;
hash_element *hash_elem;
for (i = 0; i < table->size; bucket++, i++) {