]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/dots_termcap.c
ncurses 6.2 - patch 20211009
[ncurses.git] / test / dots_termcap.c
index 0fc1a89e1cbad46834617a1e5b2f2d838493e8ef..5e4c17d1adaf8288de69f3877d9f2d2c6fa90429 100644 (file)
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_termcap.c,v 1.23 2020/05/10 00:32:22 tom Exp $
+ * $Id: dots_termcap.c,v 1.26 2020/09/05 17:58:47 juergen Exp $
  *
  * A simple demo of the termcap interface.
  */
 #define USE_TINFO
 #include <test.priv.h>
 
-#if !defined(_WIN32)
+#if !defined(_NC_WINDOWS)
 #include <sys/time.h>
 #endif
 
@@ -154,8 +154,8 @@ static void
 my_napms(int ms)
 {
     if (ms > 0) {
-#if defined(_WIN32) || !HAVE_GETTIMEOFDAY
-       Sleep((DWORD) ms);
+#if defined(_NC_WINDOWS) || !HAVE_GETTIMEOFDAY
+       Sleep((unsigned int) ms);
 #else
        struct timeval data;
        data.tv_sec = 0;
@@ -297,7 +297,8 @@ main(int argc, char *argv[])
                tputs(tgoto(t_AF, 0, z), 1, outc);
            } else {
                tputs(tgoto(t_AB, 0, z), 1, outc);
-               my_napms(s_option);
+               if (s_option)
+                   my_napms(s_option);
            }
        } else if (VALID_STRING(t_me)
                   && VALID_STRING(t_mr)) {
@@ -305,7 +306,8 @@ main(int argc, char *argv[])
                outs((ranf() > 0.6)
                     ? t_mr
                     : t_me);
-               my_napms(s_option);
+               if (s_option)
+                   my_napms(s_option);
            }
        }
        outc(p);