diff --git a/src/block_alloc.h b/src/block_alloc.h index 10c8087abf33ad22a709cf9f936763d3908a4f4d..aca9d1372847fba534ddc1b877da90130d3e8f0f 100644 --- a/src/block_alloc.h +++ b/src/block_alloc.h @@ -2,7 +2,7 @@ || 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,v 1.71 2004/04/03 15:55:15 mast Exp $ +|| $Id: block_alloc.h,v 1.72 2004/05/31 23:51:28 nilsson Exp $ */ #undef PRE_INIT_BLOCK @@ -528,7 +528,7 @@ int PIKE_CONCAT(remove_,DATA)(void *ptr) \ \ void PIKE_CONCAT3(low_init_,DATA,_hash)(size_t size) \ { \ - extern INT32 hashprimes[32]; \ + extern const INT32 hashprimes[32]; \ extern int my_log2(size_t x); \ PIKE_CONCAT3(init_,DATA,_blocks)(); \ DO_IF_RUN_UNLOCKED(mt_lock(&PIKE_CONCAT(DATA,_mutex))); \ @@ -591,7 +591,7 @@ LOW_PTR_HASH_ALLOC(DATA,BSIZE) \ static void PIKE_CONCAT(DATA,_rehash)() \ { \ /* Time to re-hash */ \ - extern INT32 hashprimes[32]; \ + extern const INT32 hashprimes[32]; \ struct DATA **old_hash; \ struct DATA *p; \ PIKE_HASH_T hval; \ diff --git a/src/stuff.c b/src/stuff.c index 4663198bb54f1eca1ff923659b244a762befe988..20ce26052f436e464c7c92d3db77ebda6f55d64d 100644 --- a/src/stuff.c +++ b/src/stuff.c @@ -2,7 +2,7 @@ || 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: stuff.c,v 1.21 2002/10/11 01:39:38 nilsson Exp $ +|| $Id: stuff.c,v 1.22 2004/05/31 23:51:27 nilsson Exp $ */ #include "global.h" @@ -10,7 +10,7 @@ #include "stralloc.h" /* Not all of these are primes, but they should be adequate */ -PMOD_EXPORT INT32 hashprimes[32] = +PMOD_EXPORT const INT32 hashprimes[32] = { 31, /* ~ 2^0 = 1 */ 31, /* ~ 2^1 = 2 */ @@ -51,7 +51,7 @@ PMOD_EXPORT INT32 hashprimes[32] = PMOD_EXPORT int my_log2(size_t x) { - static signed char bit[256] = + static const signed char bit[256] = { -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, @@ -99,7 +99,7 @@ PMOD_EXPORT int count_bits(unsigned INT32 x) X+1,X+2,X+2,X+3,\ X+1,X+2,X+2,X+3,\ X+2,X+3,X+3,X+4 - static char bits[256] = + static const char bits[256] = { B(0), B(1), B(1), B(2), B(1), B(2), B(2), B(3), diff --git a/src/stuff.h b/src/stuff.h index 251d921ba8cd5d2c03ddcd5bd6cef8645ba2b52f..608e3f46164c0fca9be26d99bf357a79547c13da 100644 --- a/src/stuff.h +++ b/src/stuff.h @@ -2,7 +2,7 @@ || 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: stuff.h,v 1.17 2004/05/19 00:13:13 nilsson Exp $ +|| $Id: stuff.h,v 1.18 2004/05/31 23:51:27 nilsson Exp $ */ #ifndef STUFF_H @@ -19,6 +19,6 @@ PMOD_EXPORT unsigned INT32 my_sqrt(unsigned INT32 n) ATTRIBUTE((const)); unsigned long find_good_hash_size(unsigned long x) ATTRIBUTE((const)); /* Prototypes end here */ -PMOD_EXPORT extern INT32 hashprimes[32]; +PMOD_EXPORT extern const INT32 hashprimes[32]; #endif