X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=examples%2Fstream_test.c;h=f8d024eebbdecf77bea30a012d77e4339249c026;hb=ededbc1c93768073f8073bed759327590503c06d;hp=b404c0948b5ef0d50e41bdb9e4963a1138690df9;hpb=604ec22bb3844196da13a3dca71d930c3623d8e7;p=libftdi diff --git a/examples/stream_test.c b/examples/stream_test.c index b404c09..f8d024e 100644 --- a/examples/stream_test.c +++ b/examples/stream_test.c @@ -46,10 +46,10 @@ static void usage(const char *argv0) { fprintf(stderr, - "Usage: %s [tions...] \n" + "Usage: %s [options...] \n" "Test streaming read from FT2232H\n" - "[-P string] only look for product with given string" - "[-n] don't check for special block structure" + "[-P string] only look for product with given string\n" + "[-n] don't check for special block structure\n" "\n" "If some filename is given, write data read to that file\n" "Progess information is printed each second\n" @@ -57,7 +57,7 @@ usage(const char *argv0) "\n" "Options:\n" "\n" - "Copyright (C) 2009 Micah Dowty \n", + "Copyright (C) 2009 Micah Dowty \n" "Adapted for use with libftdi (C) 2010 Uwe Bonnes \n", argv0); exit(1); @@ -83,8 +83,8 @@ readCallback(uint8_t *buffer, int length, FTDIProgressInfo *progress, void *user if (start && (num != start +0x4000)) { uint32_t delta = ((num-start)/0x4000)-1; - fprintf(stderr, "Skip %7d blocks from 0x%08x to 0x%08x at blocks %10lld \n", - delta, start -0x4000, num, blocks); + fprintf(stderr, "Skip %7d blocks from 0x%08x to 0x%08x at blocks %10llu\n", + delta, start -0x4000, num, (unsigned long long)blocks); n_err++; skips += delta; } @@ -98,8 +98,8 @@ readCallback(uint8_t *buffer, int length, FTDIProgressInfo *progress, void *user if (start && (num != start +0x4000)) { uint32_t delta = ((num-start)/0x4000)-1; - fprintf(stderr, "Skip %7d blocks from 0x%08x to 0x%08x at blocks %10lld \n", - delta, start -0x4000, num, blocks); + fprintf(stderr, "Skip %7d blocks from 0x%08x to 0x%08x at blocks %10llu\n", + delta, start -0x4000, num, (unsigned long long) blocks); n_err++; skips += delta; } @@ -239,8 +239,8 @@ int main(int argc, char **argv) fclose(outputFile); } else if (check) - fprintf(stderr,"%d errors of %lld blocks (%Le), %d (%Le) blocks skipped\n", - n_err, blocks, (long double)n_err/(long double) blocks, + fprintf(stderr,"%d errors of %llu blocks (%Le), %d (%Le) blocks skipped\n", + n_err, (unsigned long long) blocks, (long double)n_err/(long double) blocks, skips, (long double)skips/(long double) blocks); exit (0); } @@ -328,8 +328,8 @@ void check_outfile(char *descstring) { if(n_shown < 30) { - fprintf(stderr, "Skip %7d blocks from 0x%08x to 0x%08x at blocks %10lld \n", - (nread-start)/0x4000, start -0x4000, nread, blocks); + fprintf(stderr, "Skip %7d blocks from 0x%08x to 0x%08x at blocks %10llu \n", + (nread-start)/0x4000, start -0x4000, nread, (unsigned long long) blocks); n_shown ++; } n_errors++; @@ -342,9 +342,9 @@ void check_outfile(char *descstring) pc = pa; } if(n_errors) - fprintf(stderr, "%d blocks wrong from %lld blocks read\n", - n_errors, blocks); + fprintf(stderr, "%d blocks wrong from %llu blocks read\n", + n_errors, (unsigned long long) blocks); else - fprintf(stderr, "%lld blocks all fine\n",blocks); + fprintf(stderr, "%llu blocks all fine\n", (unsigned long long) blocks); } }