]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/dots.c
ncurses 6.2 - patch 20200418
[ncurses.git] / test / dots.c
index 36509ee0f887ca28d2763f1bf658319dc1ce0e97..d34473c1bb7e50f9fd16af350a6b6eb330cb3edb 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1999-2017,2019 Free Software Foundation, Inc.              *
+ * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 1999-2013,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            *
@@ -29,7 +30,7 @@
 /*
  * Author: Thomas E. Dickey <dickey@clark.net> 1999
  *
- * $Id: dots.c,v 1.34 2019/01/21 14:20:18 tom Exp $
+ * $Id: dots.c,v 1.36 2020/02/02 23:34:34 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -136,7 +137,7 @@ int
 main(int argc,
      char *argv[])
 {
-    int x, y, z, p;
+    int ch;
     double r;
     double c;
     int my_colors;
@@ -146,8 +147,8 @@ main(int argc,
     size_t need;
     char *my_env;
 
-    while ((x = getopt(argc, argv, "T:efm:s:")) != -1) {
-       switch (x) {
+    while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) {
+       switch (ch) {
        case 'T':
            need = 6 + strlen(optarg);
            my_env = malloc(need);
@@ -195,13 +196,13 @@ main(int argc,
     started = time((time_t *) 0);
 
     while (!interrupted) {
-       x = (int) (c * ranf()) + m_option;
-       y = (int) (r * ranf()) + m_option;
-       p = (ranf() > 0.9) ? '*' : ' ';
+       int x = (int) (c * ranf()) + m_option;
+       int y = (int) (r * ranf()) + m_option;
+       int p = (ranf() > 0.9) ? '*' : ' ';
 
        tputs(tparm3(cursor_address, y, x), 1, outc);
        if (my_colors > 0) {
-           z = (int) (ranf() * my_colors);
+           int z = (int) (ranf() * my_colors);
            if (ranf() > 0.01) {
                tputs(tparm2(set_a_foreground, z), 1, outc);
            } else {