X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fhashtest.c;h=849922173c8f43877d8262fc6a5beceeb8232d2c;hp=737731ea61298dfae2f687259bcd2d74f00dc891;hb=21c8ffa0edf2e389f3f674f0c08009002c6f357d;hpb=d44d7f381ba0173521cb788ba3adb12e261e5c96 diff --git a/test/hashtest.c b/test/hashtest.c index 737731ea..84992217 100644 --- a/test/hashtest.c +++ b/test/hashtest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2013 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 * @@ -30,7 +30,7 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.28 2008/02/23 23:02:41 tom Exp $ + * $Id: hashtest.c,v 1.32 2013/04/27 19:50:17 tom Exp $ */ #include @@ -54,7 +54,7 @@ cleanup(void) endwin(); } -static RETSIGTYPE +static void finish(int sig GCC_UNUSED) { cleanup(); @@ -86,7 +86,8 @@ genlines(int base) move(head_lines, 0); for (i = head_lines; i < LINES - foot_lines; i++) { - chtype c = (base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) + LO_CHAR; + chtype c = (chtype) ((base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) + + LO_CHAR); int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1; for (j = 0; j < hi; j++) addch(c); @@ -140,10 +141,10 @@ run_test(bool optimized GCC_UNUSED) #endif if (reverse_loops) - for (ch = hi; ch >= lo; ch--) + for (ch = (char) hi; ch >= lo; ch--) one_cycle(ch); else - for (ch = lo; ch <= hi; ch++) + for (ch = (char) lo; ch <= hi; ch++) one_cycle(ch); } @@ -195,6 +196,7 @@ main(int argc, char *argv[]) break; case 'l': test_loops = atoi(optarg); + assert(test_loops >= 0); break; case 'n': test_normal = TRUE;