Branch: Tag:

2004-05-31

2004-05-31 23:51:28 by Martin Nilsson <mani@lysator.liu.se>

Save 170 bytes through constant tables.

Rev: src/block_alloc.h:1.72
Rev: src/stuff.c:1.22
Rev: src/stuff.h:1.18

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: 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:   #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:      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:    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),