X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fworm.c;h=5f645ac6d7bea71044a9c04f41657715da217ade;hp=19d163475442383ff4230a7aebc5a4727d764e1a;hb=a924c24b2535cccdc0f5f991cd8ddcadcfa1f0d2;hpb=fd52bfa49753d67673ba8d7aef9239f5b16c1ad0 diff --git a/test/worm.c b/test/worm.c index 19d16347..5f645ac6 100644 --- a/test/worm.c +++ b/test/worm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -61,7 +61,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.64 2013/04/27 19:50:17 tom Exp $ + $Id: worm.c,v 1.67 2017/04/09 00:27:42 tom Exp $ */ #include @@ -324,9 +324,9 @@ draw_worm(WINDOW *win, void *data) static bool quit_worm(int bitnum) { - pending |= (1 << bitnum); + pending = (pending | (unsigned) (1 << bitnum)); napms(10); /* let the other thread(s) have a chance */ - pending &= ~(1 << bitnum); + pending = (pending & (unsigned) ~(1 << bitnum)); return quitting; } @@ -335,7 +335,7 @@ start_worm(void *arg) { unsigned long compare = 0; Trace(("start_worm")); - while (!quit_worm(((struct worm *) arg) - worm)) { + while (!quit_worm((int) (((struct worm *) arg) - worm))) { while (compare < sequence) { ++compare; #if HAVE_USE_WINDOW @@ -362,8 +362,7 @@ draw_all_worms(void) if (first) { first = FALSE; for (n = 0, w = &worm[0]; n < number; n++, w++) { - int rc; - rc = pthread_create(&(w->thread), NULL, start_worm, w); + (void) pthread_create(&(w->thread), NULL, start_worm, w); } } #else @@ -609,7 +608,7 @@ main(int argc, char *argv[]) Trace(("Cleanup")); cleanup(); -#ifdef NO_LEAKS +#if NO_LEAKS for (y = 0; y < max_refs; y++) { free(refs[y]); }