diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-20 21:06:11 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-20 21:06:11 +0000 |
commit | d995703cfd255f9da09ed9a9373a61685b51eb7b (patch) | |
tree | cb4e811f8dbe4bc4a5e2e78f1387b8f042405cb9 /plugins/MirOTR/ekhtml/src/hash.c | |
parent | e0f46c2d5689121e4ef533617940fea85a6910c3 (diff) |
fully compiled version
git-svn-id: http://svn.miranda-ng.org/main/trunk@504 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/ekhtml/src/hash.c')
-rw-r--r-- | plugins/MirOTR/ekhtml/src/hash.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/MirOTR/ekhtml/src/hash.c b/plugins/MirOTR/ekhtml/src/hash.c index 441e4cb9be..95651d4e76 100644 --- a/plugins/MirOTR/ekhtml/src/hash.c +++ b/plugins/MirOTR/ekhtml/src/hash.c @@ -54,7 +54,6 @@ static const char rcsid[] = "$Id: hash.c,v 1.1 2002/09/17 02:49:36 jick Exp $"; #define table hash_table #define chain hash_chain -#define hash_val_t_bit (compute_bits()) static hnode_t *hnode_alloc(void *context); static void hnode_free(hnode_t *node, void *context); @@ -76,7 +75,18 @@ int hash_val_t_bit; * right, replacing the topmost bit by zero. */ +static void compute_bits(void) +{ + hash_val_t val = HASH_VAL_T_MAX; /* 1 */ + int bits = 0; + + while (val) { /* 2 */ + bits++; + val >>= 1; + } + hash_val_t_bit = bits; +} /* * Verify whether the given argument is a power of two. |