~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aaf296c
)
src/noise.c: Make `bitcount' table be static and constant.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000
(09:26 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 4 Jun 2016 13:55:30 +0000
(14:55 +0100)
rand/noise.c
patch
|
blob
|
blame
|
history
diff --git
a/rand/noise.c
b/rand/noise.c
index
3969b4e
..
ee2adcc
100644
(file)
--- 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];