diff options
author | Wayne Davison <wayned@samba.org> | 2008-02-04 07:29:22 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-02-04 07:29:22 -0800 |
commit | d6e6333a02a900c2863200a0feff4349d4003a8d (patch) | |
tree | 4a572bdff4d1ec6368ffbcec59686268758f43f0 /hashtable.c | |
parent | 970ce063ee0c17b69ee5343d6934faab479f6ed8 (diff) | |
download | rsync-d6e6333a02a900c2863200a0feff4349d4003a8d.tar.gz rsync-d6e6333a02a900c2863200a0feff4349d4003a8d.tar.bz2 rsync-d6e6333a02a900c2863200a0feff4349d4003a8d.zip |
Store the key64 flag from hashtable_create() in the hashtable structure
so that hashtable_find() knows which hashtable is which on a 64-bit
architecture.
Diffstat (limited to 'hashtable.c')
-rw-r--r-- | hashtable.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hashtable.c b/hashtable.c index d1be1b8a..c5ba0f58 100644 --- a/hashtable.c +++ b/hashtable.c @@ -24,7 +24,7 @@ struct hashtable *hashtable_create(int size, int key64) { struct hashtable *tbl; - int node_size = key64 ? sizeof (struct ht_int64_node ) + int node_size = key64 ? sizeof (struct ht_int64_node) : sizeof (struct ht_int32_node); /* Pick a power of 2 that can hold the requested size. */ @@ -41,6 +41,7 @@ struct hashtable *hashtable_create(int size, int key64) tbl->size = size; tbl->entries = 0; tbl->node_size = node_size; + tbl->key64 = key64; return tbl; } @@ -55,7 +56,7 @@ void hashtable_destroy(struct hashtable *tbl) * already existing. Returns NULL if not allocating and not found. */ void *hashtable_find(struct hashtable *tbl, int64 key, int allocate_if_missing) { - int key64 = (tbl->node_size > sizeof (struct ht_int32_node)); + int key64 = tbl->key64; struct ht_int32_node *node; uint32 ndx; |