From: Mark Wooding Date: Thu, 26 May 2016 08:26:09 +0000 (+0100) Subject: src/noise.c: Make `bitcount' table be static and constant. X-Git-Tag: 2.2.3~1^2~9 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/9332366ee32e7c89e9d2fabbe9755cbd86877127?hp=aaf296c8b4ac5515bc09fe7ec3c98f5e5f311e12 src/noise.c: Make `bitcount' table be static and constant. --- diff --git a/rand/noise.c b/rand/noise.c index 3969b4e4..ee2adcce 100644 --- a/rand/noise.c +++ b/rand/noise.c @@ -87,8 +87,8 @@ static gid_t noise_gid = NOISE_NOSETGID; /* Gid to set to spawn processes */ static int bitcount(unsigned long x) { - char ctab[] = { 0, 1, 1, 2, 1, 2, 2, 3, - 1, 2, 2, 3, 2, 3, 3, 4 }; + static const char ctab[] = { 0, 1, 1, 2, 1, 2, 2, 3, + 1, 2, 2, 3, 2, 3, 3, 4 }; int count = 0; while (x) { count += ctab[x & 0xfu];