Branch: Tag:

2003-02-24

2003-02-24 17:06:54 by Henrik Grubbström (Grubba) <grubba@grubba.org>

More HASH_T fixes.

Rev: src/block_alloc.h:1.61
Rev: src/block_alloc_h.h:1.19

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: block_alloc_h.h,v 1.18 2002/12/01 02:51:51 mast Exp $ + || $Id: block_alloc_h.h,v 1.19 2003/02/24 17:06:54 grubba Exp $   */      #undef BLOCK_ALLOC
12:   #undef PTR_HASH_ALLOC_FILL_PAGES   #undef PTR_HASH_ALLOC_FIXED_FILL_PAGES    + #ifndef PIKE_HASH_T + #define PIKE_HASH_T unsigned INT32 + #endif /* !PIKE_HASH_T */ +    #define BLOCK_ALLOC(DATA,SIZE) \   struct DATA *PIKE_CONCAT(alloc_,DATA)(void); \   void PIKE_CONCAT3(really_free_,DATA,_unlocked)(struct DATA *d); \
26:   extern struct DATA **PIKE_CONCAT(DATA,_hash_table); \   extern size_t PIKE_CONCAT(DATA,_hash_table_size); \   struct DATA *PIKE_CONCAT(find_,DATA)(void *ptr); \ - struct DATA *PIKE_CONCAT3(make_,DATA,_unlocked)(void *ptr, size_t hval); \ + struct DATA *PIKE_CONCAT3(make_,DATA,_unlocked) \ +  (void *ptr, PIKE_HASH_T hval); \   struct DATA *PIKE_CONCAT(make_,DATA)(void *ptr); \   struct DATA *PIKE_CONCAT(get_,DATA)(void *ptr); \   int PIKE_CONCAT3(check_,DATA,_semafore)(void *ptr); \
44:   #define PTR_HASH_ALLOC_FIXED_FILL_PAGES(DATA,PAGES) PTR_HASH_ALLOC_FIXED(DATA, n/a)      #define PTR_HASH_LOOP(DATA,HVAL,PTR) \ -  for ((HVAL) = PIKE_CONCAT(DATA,_hash_table_size); (HVAL)-- > 0;) \ +  for ((HVAL) = (PIKE_HASH_T)PIKE_CONCAT(DATA,_hash_table_size); (HVAL)-- > 0;) \    for ((PTR) = PIKE_CONCAT(DATA,_hash_table)[HVAL]; \    (PTR); (PTR) = (PTR)->BLOCK_ALLOC_NEXT)