From d995703cfd255f9da09ed9a9373a61685b51eb7b Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 20 Jun 2012 21:06:11 +0000 Subject: fully compiled version git-svn-id: http://svn.miranda-ng.org/main/trunk@504 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirOTR/ekhtml/src/hash.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'plugins/MirOTR/ekhtml/src/hash.c') 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. -- cgit v1.2.3