aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/test/worm.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
commit7a69bbfb278952228c9aa1eca241e65fcdef425e (patch)
treee83b2ef47811e687a6c54035c9af6d4a2b7f14e1 /contrib/ncurses/test/worm.c
parent18259542b2f8fa7e3f76f4bb0dd37995dfd424aa (diff)
downloadsrc-7a69bbfb278952228c9aa1eca241e65fcdef425e.tar.gz
src-7a69bbfb278952228c9aa1eca241e65fcdef425e.zip
Import ncurses-5.2-20010512 onto the vendor branch
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=76726
Diffstat (limited to 'contrib/ncurses/test/worm.c')
-rw-r--r--contrib/ncurses/test/worm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/ncurses/test/worm.c b/contrib/ncurses/test/worm.c
index 142982aef221..02d9e1f5b6f3 100644
--- a/contrib/ncurses/test/worm.c
+++ b/contrib/ncurses/test/worm.c
@@ -34,7 +34,7 @@ Options:
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
- $Id: worm.c,v 1.31 2000/09/02 18:41:01 tom Exp $
+ $Id: worm.c,v 1.32 2000/12/31 01:54:07 tom Exp $
*/
#include <test.priv.h>
@@ -45,7 +45,6 @@ static chtype flavor[] =
{
'O', '*', '#', '$', '%', '0', '@',
};
-#define MAXWORMS (sizeof(flavor)/sizeof(chtype))
static const short xinc[] =
{
1, 1, 1, 0, -1, -1, -1, 0
@@ -378,7 +377,7 @@ main(int argc, char *argv[])
for (n = 0, w = &worm[0]; n < number; n++, w++) {
if ((x = w->xpos[h = w->head]) < 0) {
move(y = w->ypos[h] = bottom, x = w->xpos[h] = 0);
- addch(flavor[n % MAXWORMS]);
+ addch(flavor[n % SIZEOF(flavor)]);
ref[y][x]++;
} else {
y = w->ypos[h];
@@ -419,7 +418,7 @@ main(int argc, char *argv[])
if (y < 0)
y = 0;
- addch(flavor[n % MAXWORMS]);
+ addch(flavor[n % SIZEOF(flavor)]);
ref[w->ypos[h] = y][w->xpos[h] = x]++;
}
napms(10);