diff --git a/src/array.c b/src/array.c index 3f58f961d58bc0caea107016035313de749d546e..f3d61c5937ffabcbeae31b9f177cb13a30f594ff 100644 --- a/src/array.c +++ b/src/array.c @@ -2098,6 +2098,12 @@ int array_is_constant(struct array *a, p); } +/* Return true for integers with more than one bit set */ +static inline int is_more_than_one_bit(unsigned INT32 x) +{ + return !!(x & (x-1)); +} + node *make_node_from_array(struct array *a) { struct svalue s; diff --git a/src/stuff.c b/src/stuff.c index 0458c57b50008ac1b0616961b231390a8d976c14..e336d28f75c930a898ef83e164e1458b3a25a1aa 100644 --- a/src/stuff.c +++ b/src/stuff.c @@ -29,7 +29,7 @@ PMOD_EXPORT const char Pike_is8bitalnum_vector[] = "1111111011111111"; /* Not all of these are primes, but they should be adequate */ -PMOD_EXPORT const INT32 hashprimes[32] = +const INT32 hashprimes[32] = { 31, /* ~ 2^0 = 1 */ 31, /* ~ 2^1 = 2 */ @@ -111,6 +111,7 @@ PMOD_EXPORT int my_log2(size_t x) } +#if 0 /* Return the number of bits in a 32-bit integer */ PMOD_EXPORT int count_bits(unsigned INT32 x) { @@ -131,12 +132,7 @@ PMOD_EXPORT int count_bits(unsigned INT32 x) bits[(x>>16) & 255] + bits[(x>>24) & 255]); } - -/* Return true for integers with more than one bit set */ -PMOD_EXPORT int is_more_than_one_bit(unsigned INT32 x) -{ - return !!(x & (x-1)); -} +#endif PMOD_EXPORT double my_strtod(char *nptr, char **endptr) { @@ -165,6 +161,7 @@ PMOD_EXPORT unsigned INT32 my_sqrt(unsigned INT32 n) return x; } +#if 0 /* This routine basically finds a prime number * which is larger than 'x' */ @@ -430,6 +427,7 @@ unsigned long find_good_hash_size(unsigned long num) return primes[y]; } +#endif /* * This rounds an integer up to the next power of two. For x a power diff --git a/src/stuff.h b/src/stuff.h index a39f04b93410549962d04798c85267f9f3e07326..d6af0fa1103b00484210443b1b6d779b83d485d9 100644 --- a/src/stuff.h +++ b/src/stuff.h @@ -13,13 +13,12 @@ /* Prototypes begin here */ PMOD_EXPORT int my_log2(size_t x) ATTRIBUTE((const)); PMOD_EXPORT int count_bits(unsigned INT32 x) ATTRIBUTE((const)); -PMOD_EXPORT int is_more_than_one_bit(unsigned INT32 x) ATTRIBUTE((const)); PMOD_EXPORT double my_strtod(char *nptr, char **endptr); PMOD_EXPORT unsigned INT32 my_sqrt(unsigned INT32 n) ATTRIBUTE((const)); -unsigned long find_good_hash_size(unsigned long x) ATTRIBUTE((const)); +/* unsigned long find_good_hash_size(unsigned long x) ATTRIBUTE((const)); */ unsigned INT32 find_next_power(unsigned INT32 x) ATTRIBUTE((const)); /* Prototypes end here */ -PMOD_EXPORT extern const INT32 hashprimes[32]; +extern const INT32 hashprimes[32]; #endif