X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fworm.c;h=92bdb254986719d46a2fb42c53a70a11ea14a260;hp=0d2209915c96654b7f0706291b098556227ff9e0;hb=58552e8c761a70f8f0bd591fecdf576fa8216e3e;hpb=a1e63be290fce9e589bc57c9f753be09e8ac0cc7 diff --git a/test/worm.c b/test/worm.c index 0d220991..92bdb254 100644 --- a/test/worm.c +++ b/test/worm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2012 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.63 2013/01/13 01:00:11 tom Exp $ + $Id: worm.c,v 1.66 2016/09/17 21:12:30 tom Exp $ */ #include @@ -217,7 +217,7 @@ cleanup(void) endwin(); } -static RETSIGTYPE +static void onsig(int sig GCC_UNUSED) { cleanup(); @@ -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