diff options
author | Simon Rettberg | 2021-04-06 14:23:46 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-04-06 14:23:46 +0200 |
commit | 26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9 (patch) | |
tree | a51e1637554bcd84e63cccb1cb220c898a2c4ee8 /hacks/glx/peepers.c | |
parent | 5.44 (diff) | |
download | xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.tar.gz xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.tar.xz xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.zip |
xscreensaver 6.00
Diffstat (limited to 'hacks/glx/peepers.c')
-rw-r--r-- | hacks/glx/peepers.c | 7 |
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; |