diff options
Diffstat (limited to 'contrib/ncurses/test/hanoi.c')
-rw-r--r-- | contrib/ncurses/test/hanoi.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/contrib/ncurses/test/hanoi.c b/contrib/ncurses/test/hanoi.c index 0b032f8318ca..ef09514e08e4 100644 --- a/contrib/ncurses/test/hanoi.c +++ b/contrib/ncurses/test/hanoi.c @@ -14,17 +14,15 @@ * * Date: 05.Nov.90 * - * $Id: hanoi.c,v 1.19 2000/09/02 18:51:16 tom Exp $ + * $Id: hanoi.c,v 1.23 2002/03/24 00:40:01 tom Exp $ */ #include <test.priv.h> -#include <string.h> - #define NPEGS 3 /* This is not configurable !! */ #define MINTILES 3 #define MAXTILES 9 -#define DEFAULTTILES 7 +#define DEFAULTTILES 7 #define TOPLINE 6 #define BASELINE 16 #define STATUSLINE (LINES-3) @@ -70,7 +68,7 @@ int main(int argc, char **argv) { int NTiles, FromCol, ToCol; - unsigned char AutoFlag = 0; + bool AutoFlag = 0; switch (argc) { case 1: @@ -80,24 +78,24 @@ main(int argc, char **argv) NTiles = atoi(argv[1]); if (NTiles > MAXTILES || NTiles < MINTILES) { fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 3: if (strcmp(argv[2], "a")) { Usage(); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } NTiles = atoi(argv[1]); if (NTiles > MAXTILES || NTiles < MINTILES) { fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } AutoFlag = TRUE; break; default: Usage(); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } #ifdef TRACE trace(TRACE_MAXIMUM); @@ -118,7 +116,7 @@ main(int argc, char **argv) if (LINES < 24) { endwin(); fprintf(stderr, "Min screen length 24 lines\n"); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } if (AutoFlag) { curs_set(0); @@ -154,7 +152,7 @@ main(int argc, char **argv) } } endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } static int @@ -295,7 +293,7 @@ Solved(int NumTiles) } static void -Usage() +Usage(void) { fprintf(stderr, "Usage: hanoi [<No Of Tiles>] [a]\n"); fprintf(stderr, |