]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/echochar.c
ncurses 6.2 - patch 20200418
[ncurses.git] / test / echochar.c
index 19ba9acd07e34a20f710d5dd034945af506810ff..ce7f03d385fe83d7253cf2fe31b791e1d144765c 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 2006-2014,2017 Free Software Foundation, Inc.              *
+ * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 2006-2014,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            *
@@ -26,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: echochar.c,v 1.18 2017/10/18 23:04:52 tom Exp $
+ * $Id: echochar.c,v 1.21 2020/02/02 23:34:34 tom Exp $
  *
  * Demonstrate the echochar function (compare to dots.c).
  * Thomas Dickey - 2006/11/4
@@ -43,7 +44,7 @@ static time_t started;
 static void
 cleanup(void)
 {
-    exit_curses();
+    stop_curses();
 
     printf("\n\n%ld total cells, rate %.2f/sec\n",
           total_chars,
@@ -81,7 +82,7 @@ int
 main(int argc GCC_UNUSED,
      char *argv[]GCC_UNUSED)
 {
-    int ch, x, y, z, p;
+    int ch;
     double r;
     double c;
     bool use_colors;
@@ -121,13 +122,13 @@ main(int argc GCC_UNUSED,
     started = time((time_t *) 0);
 
     while (!interrupted) {
-       x = (int) (c * ranf()) + 2;
-       y = (int) (r * ranf()) + 2;
-       p = (ranf() > 0.9) ? '*' : ' ';
+       int x = (int) (c * ranf()) + 2;
+       int y = (int) (r * ranf()) + 2;
+       int p = (ranf() > 0.9) ? '*' : ' ';
 
        move(y, x);
        if (use_colors > 0) {
-           z = (int) (ranf() * COLORS);
+           int z = (int) (ranf() * COLORS);
            if (ranf() > 0.01) {
                set_color(my_pairs, z, last_bg);
                last_fg = z;