]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/worm.c
ncurses 6.0 - patch 20170513
[ncurses.git] / test / worm.c
index c3fc0da822ef2619246c5ed831c0d9eb9bee48af..365266af8da2431ee77e432e5546edfcfb43eb0e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 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            *
  *                                                                          *
  * 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.
 
   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.65 2013/06/22 20:01:41 tom Exp $
+  $Id: worm.c,v 1.68 2017/04/15 14:15:00 tom Exp $
 */
 
 #include <test.priv.h>
 */
 
 #include <test.priv.h>
@@ -324,9 +324,9 @@ draw_worm(WINDOW *win, void *data)
 static bool
 quit_worm(int bitnum)
 {
 static bool
 quit_worm(int bitnum)
 {
-    pending |= (1 << bitnum);
+    pending = (pending | (unsigned) (1 << bitnum));
     napms(10);                 /* let the other thread(s) have a chance */
     napms(10);                 /* let the other thread(s) have a chance */
-    pending &= ~(1 << bitnum);
+    pending = (pending & (unsigned) ~(1 << bitnum));
     return quitting;
 }
 
     return quitting;
 }
 
@@ -335,7 +335,7 @@ start_worm(void *arg)
 {
     unsigned long compare = 0;
     Trace(("start_worm"));
 {
     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
        while (compare < sequence) {
            ++compare;
 #if HAVE_USE_WINDOW
@@ -608,7 +608,7 @@ main(int argc, char *argv[])
 
     Trace(("Cleanup"));
     cleanup();
 
     Trace(("Cleanup"));
     cleanup();
-#ifdef NO_LEAKS
+#if NO_LEAKS
     for (y = 0; y < max_refs; y++) {
        free(refs[y]);
     }
     for (y = 0; y < max_refs; y++) {
        free(refs[y]);
     }