summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-05-12 20:15:39 +0000
committerJeremy Allison <jra@samba.org>2001-05-12 20:15:39 +0000
commit495aa4c28a76bcdecd02e3d9527b29f62b3ec33f (patch)
tree4aa1f386134ceef8beb347d90a5084c501846fe3 /source3
parent9c54ddc7f9adeb63b5bc83fb7cd1b90bf0faf6ec (diff)
downloadsamba-495aa4c28a76bcdecd02e3d9527b29f62b3ec33f.tar.gz
samba-495aa4c28a76bcdecd02e3d9527b29f62b3ec33f.tar.bz2
samba-495aa4c28a76bcdecd02e3d9527b29f62b3ec33f.zip
string_hash() should be static. hash_clear() should be void.
Jeremy. (This used to be commit e8ab89fbc0b6cec9f3e80fe4327992b2ec7a4a40)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/lib/hash.c10
2 files changed, 5 insertions, 8 deletions
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;
}