summaryrefslogtreecommitdiffstats
path: root/hacks/glx/peepers.c
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-06 14:43:39 +0200
committerSimon Rettberg2021-04-07 13:38:37 +0200
commit38886de0c3e9ea5729ef23e4c653fa2822f52e8f (patch)
tree9b799c8c968a92cc77746a95e0e8bdd90b6b13c3 /hacks/glx/peepers.c
parentMaybe not remove, but ... (diff)
downloadxscreensaver-openslx.tar.gz
xscreensaver-openslx.tar.xz
xscreensaver-openslx.zip
xscreensaver 6.00v28r1openslx
Diffstat (limited to 'hacks/glx/peepers.c')
-rw-r--r--hacks/glx/peepers.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hacks/glx/peepers.c b/hacks/glx/peepers.c
index 3dc8fc1..1554616 100644
--- a/hacks/glx/peepers.c
+++ b/hacks/glx/peepers.c
@@ -27,9 +27,6 @@
#define DEF_SPEED "1.0"
#define DEF_MODE "random"
-#undef countof
-#define countof(x) (sizeof((x))/sizeof((*x)))
-
#undef BELLRAND
#define BELLRAND(n) ((frand((n)) + frand((n)) + frand((n))) / 3)
#undef RANDSIGN
@@ -233,10 +230,10 @@ reset_floater (ModeInfo *mi, floater *f)
p += c[i].pct;
p = frand(p);
- for (i = 0; i < countof(c); i++)
+ for (i = 0; i < countof(c) - 1; i++)
{
- if (t > p) break;
t += c[i].pct;
+ if (t > p) break;
}
if (c[i].c == 0xFFAA88) f->jaundice = 2;