summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nscd
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2009-06-13 00:54:52 +0000
committerdes <des@FreeBSD.org>2009-06-13 00:54:52 +0000
commit698cfdd8eaf0b617203b53b41a1bbe6e4307a1f7 (patch)
tree5cb9085d6dc0d787df33729ed9038117e96902b6 /usr.sbin/nscd
parent1a324d66748d58663e9fe166cad7d58896ff8fd4 (diff)
downloadFreeBSD-src-698cfdd8eaf0b617203b53b41a1bbe6e4307a1f7.zip
FreeBSD-src-698cfdd8eaf0b617203b53b41a1bbe6e4307a1f7.tar.gz
Change hashtable_index_t to unsigned.
Generate prototypes for our hash table. MFC after: 1 week
Diffstat (limited to 'usr.sbin/nscd')
-rw-r--r--usr.sbin/nscd/cachelib.c6
-rw-r--r--usr.sbin/nscd/hashtable.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/nscd/cachelib.c b/usr.sbin/nscd/cachelib.c
index 27c34e2..d348a97 100644
--- a/usr.sbin/nscd/cachelib.c
+++ b/usr.sbin/nscd/cachelib.c
@@ -146,6 +146,7 @@ ht_item_hash_func(const void *p, size_t cache_entries_size)
return retval;
}
+HASHTABLE_PROTOTYPE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_);
HASHTABLE_GENERATE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_, data,
ht_item_hash_func, ht_items_cmp_func);
@@ -291,7 +292,7 @@ clear_cache_entry(struct cache_entry_ *entry)
struct cache_policy_ *policy;
struct cache_policy_item_ *item, *next_item;
size_t entry_size;
- int i;
+ unsigned int i;
if (entry->params->entry_type == CET_COMMON) {
common_entry = (struct cache_common_entry_ *)entry;
@@ -396,7 +397,6 @@ flush_cache_policy(struct cache_common_entry_ *entry,
hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &entry->items,
&ht_key);
- assert(hash >= 0);
assert(hash < HASHTABLE_ENTRIES_COUNT(&entry->items));
ht_item = HASHTABLE_GET_ENTRY(&(entry->items), hash);
@@ -718,7 +718,6 @@ cache_read(struct cache_entry_ *entry, const char *key, size_t key_size,
hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items,
&item_data);
- assert(hash >= 0);
assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items));
item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash);
@@ -822,7 +821,6 @@ cache_write(struct cache_entry_ *entry, const char *key, size_t key_size,
hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items,
&item_data);
- assert(hash >= 0);
assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items));
item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash);
diff --git a/usr.sbin/nscd/hashtable.h b/usr.sbin/nscd/hashtable.h
index a763bf0..5f8da82 100644
--- a/usr.sbin/nscd/hashtable.h
+++ b/usr.sbin/nscd/hashtable.h
@@ -32,7 +32,7 @@
#include <string.h>
#define HASHTABLE_INITIAL_ENTRIES_CAPACITY 8
-typedef int hashtable_index_t;
+typedef unsigned int hashtable_index_t;
/*
* This file contains queue.h-like macro definitions for hash tables.
OpenPOWER on IntegriCloud