/****************************************************************************
- * Copyright (c) 1998-2008,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
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.68 2017/04/15 14:15:00 tom Exp $
*/
#include <test.priv.h>
endwin();
}
-static RETSIGTYPE
+static void
onsig(int sig GCC_UNUSED)
{
cleanup();
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;
}
{
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
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
Trace(("Cleanup"));
cleanup();
-#ifdef NO_LEAKS
+#if NO_LEAKS
for (y = 0; y < max_refs; y++) {
free(refs[y]);
}