pike.git / src / hashtable.c

version» Context lines:

pike.git/src/hashtable.c:2:   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h"   #include "hashtable.h"   #include "stralloc.h"   #include "stuff.h"   #include "error.h"    - RCSID("$Id: hashtable.c,v 1.5 1998/11/22 11:02:51 hubbe Exp $"); + RCSID("$Id: hashtable.c,v 1.6 1999/04/17 13:48:01 grubba Exp $");      static unsigned INT32 gobble(struct pike_string *s)   {    unsigned INT32 i;    i=my_hash_string(s);    i+=i >> 3;    i+=i >> 7;    i+=i >> 12;    return i;   }
pike.git/src/hashtable.c:77:   /*    * rehash - ugh    */   struct hash_table *hash_rehash(struct hash_table *h,int size)   {    struct hash_table *new;    int e;      #ifdef PIKE_DEBUG    if( 1 << my_log2(size) != size) -  fatal("Size is not a exponent of two!\n"); +  fatal("Size is not a power of two!\n");   #endif       new=(struct hash_table *)calloc(1,sizeof(struct hash_table)+    (size-1)*sizeof(struct hash_entry *));    new->mask = size - 1;    new->entries = h->entries;       for(e=0; e<=h->mask; e++)    rehash_list_backwards(new,h->htable[e]);