From 9332366ee32e7c89e9d2fabbe9755cbd86877127 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] src/noise.c: Make `bitcount' table be static and constant. --- rand/noise.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]; -- 2.11.0