From ddc6d175603058ee2bdf83f22fce9b119fdae82f Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Mon, 30 Jan 2012 03:01:34 +0100 Subject: [PATCH] unsigned long bla = -1; ... yeah! --- prefix/prefix.c | 6 +++--- scan/scan.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prefix/prefix.c b/prefix/prefix.c index 43e626e..57304b9 100644 --- a/prefix/prefix.c +++ b/prefix/prefix.c @@ -14,7 +14,7 @@ char* binname = "unset"; void usage () { fprintf (stderr, "\nUsage: %s [-f ] [-n ]\n", binname); fprintf (stderr, "\t -f: set the filename of the randfile. (defaults to \"numlist.bin\")\n"); - fprintf (stderr, "\t -n: set the number count to read from randfile. (defaults to -1 = read all)\n"); + fprintf (stderr, "\t -n: set the number count to read from randfile. (defaults to 0 = read all)\n"); fprintf (stderr, "\nThis application prints only TIME-INFO to stdout. Everything else goes to stderr.\n"); exit(1); } @@ -36,7 +36,7 @@ int main (int argc, char* argv[]) { double startTime, endTime; /* options */ - unsigned long n = -1; + unsigned long n = 0; char *filename = "numlist.bin"; /* store out name for usage(); */ @@ -71,7 +71,7 @@ int main (int argc, char* argv[]) { struct stat st; stat(filename, &st); size = st.st_size; - if (n == -1 || n > size){ + if (n <= 0 || n > size){ n = size; } }else{ diff --git a/scan/scan.c b/scan/scan.c index 9789cb6..04e7398 100755 --- a/scan/scan.c +++ b/scan/scan.c @@ -20,7 +20,7 @@ char* binname = "unset"; void usage () { fprintf(stderr, "\nUsage: mpirun -node 1-32 -nnp 1 %s [-f ] [-n ]\n", binname); fprintf(stderr, "\t -f: set the filename of the randfile. (defaults to \"numlist.bin\")\n"); - fprintf(stderr, "\t -n: set the number count to read from randfile. (defaults to -1 = read all)\n"); + fprintf(stderr, "\t -n: set the number count to read from randfile. (defaults to 0 = read all)\n"); #ifdef DEBUG fprintf(stderr, "***** BIG RED WARNING: COMPILED WITH XDEBUG - YOU ARE ON YOUR OWN! *****\n"); #endif -- 2.43.0