X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fechochar.c;h=93a4644213af01d46b96bc54fc50178e00eeb646;hb=02f1dee48fe8af6ce054388fba739aa4f975004e;hp=be8e68fc6fa404f1b2cefffadea3b78cf94d37ae;hpb=7fa7badf32c514211478cf9f79c70f20d435c2f2;p=ncurses.git diff --git a/test/echochar.c b/test/echochar.c index be8e68fc..93a46442 100644 --- a/test/echochar.c +++ b/test/echochar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2014,2017 Free Software Foundation, Inc. * + * Copyright (c) 2006-2017,2019 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 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: echochar.c,v 1.17 2017/10/11 08:16:12 tom Exp $ + * $Id: echochar.c,v 1.20 2019/12/14 23:25:29 tom Exp $ * * Demonstrate the echochar function (compare to dots.c). * Thomas Dickey - 2006/11/4 @@ -43,7 +43,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 +81,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; @@ -96,7 +96,7 @@ main(int argc GCC_UNUSED, opt_r = TRUE; break; default: - fprintf(stderr, "usage: echochar [-r]\n"); + fprintf(stderr, "Usage: echochar [-r]\n"); ExitProgram(EXIT_FAILURE); } } @@ -121,13 +121,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;