From 495aa4c28a76bcdecd02e3d9527b29f62b3ec33f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 12 May 2001 20:15:39 +0000 Subject: string_hash() should be static. hash_clear() should be void. Jeremy. (This used to be commit e8ab89fbc0b6cec9f3e80fe4327992b2ec7a4a40) --- source3/include/proto.h | 3 +-- source3/lib/hash.c | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 92fd8d9566..6f12e4e275 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -136,11 +136,10 @@ char *getsmbpass(char *prompt) ; /*The following definitions come from lib/hash.c */ BOOL hash_table_init(hash_table *table, int num_buckets, compare_function compare_func); -int string_hash(int hash_size, const char *key); hash_element *hash_lookup(hash_table *table, char *key); hash_element *hash_insert(hash_table *table, char *value, char *key); void hash_remove(hash_table *table, hash_element *hash_elem); -BOOL hash_clear(hash_table *table); +void hash_clear(hash_table *table); /*The following definitions come from lib/interface.c */ diff --git a/source3/lib/hash.c b/source3/lib/hash.c index c96315f37e..92840a4c98 100644 --- a/source3/lib/hash.c +++ b/source3/lib/hash.c @@ -92,7 +92,7 @@ BOOL hash_table_init(hash_table *table, int num_buckets, compare_function compar ************************************************************** */ -int string_hash(int hash_size, const char *key) +static int string_hash(int hash_size, const char *key) { int j=0; while (*key) @@ -147,7 +147,7 @@ static hash_element *hash_chain_find(hash_table *table, ubi_dlList *hash_chain, hash_element *hash_lookup(hash_table *table, char *key) { - return (hash_chain_find(table, &(table->buckets[string_hash(table->size, key)]), key)); + return (hash_chain_find(table, &table->buckets[string_hash(table->size, key)], key)); } /* *************************************************************** @@ -198,7 +198,7 @@ hash_element *hash_insert(hash_table *table, char *value, char *key) table->num_elements += 1; } - bucket = &(table->buckets[string_hash(table->size, key)]); + bucket = &table->buckets[string_hash(table->size, key)]; /* Since we only have 1-byte for the key string, we need to * allocate extra space in the hash_element to store the entire key @@ -301,7 +301,7 @@ static BOOL enlarge_hash_table(hash_table *table) ************************************************************************* */ -BOOL hash_clear(hash_table *table) +void hash_clear(hash_table *table) { int i; ubi_dlList *bucket = table->buckets; @@ -319,6 +319,4 @@ BOOL hash_clear(hash_table *table) if(table->buckets) free((char *) table->buckets); table->buckets = NULL; - - return True; } -- cgit