diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-04-03 17:40:11 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-04-03 17:40:11 (GMT) |
commit | 523a4f7658cc3af131a4a10f8030fc7387745702 (patch) | |
tree | 4758f745b1942d4ef8fc653c79ac0255196ca7ca /tools/h5dump | |
parent | db447ec89ab9968af637941a146129f437ba8b98 (diff) | |
download | hdf5-523a4f7658cc3af131a4a10f8030fc7387745702.zip hdf5-523a4f7658cc3af131a4a10f8030fc7387745702.tar.gz hdf5-523a4f7658cc3af131a4a10f8030fc7387745702.tar.bz2 |
[svn-r26717] Merge revisions 26387, 26649, 26650, 26678, and 26691 from trunk to squish warnings.
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/binread.c | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/tools/h5dump/binread.c b/tools/h5dump/binread.c index 5abb9af..74db92c 100644 --- a/tools/h5dump/binread.c +++ b/tools/h5dump/binread.c @@ -49,8 +49,7 @@ static void usage (void) { - fprintf(stderr, "\ - usage: binread FILE_NAME\n"); + fprintf(stderr, "usage: binread FILE_NAME\n"); } /*------------------------------------------------------------------------- @@ -64,38 +63,35 @@ usage (void) int main (int argc, const char *argv[]) { - FILE *stream; - int numread; - TYPE buf[NELMTS]; - size_t i, nelmts = NELMTS; - char *fname=NULL; - - if (argc != 2) - { - usage(); - exit(1); - } - - fname = strdup(argv[1]); - - if( (stream = fopen(fname, "rb" )) != NULL ) - { - numread = fread( buf, sizeof( TYPE ), nelmts, stream ); - printf( "Number of items read = %d\n", numread ); - - for (i = 0; i < nelmts; i++) - { - printf(FORMAT,buf[i]); - } - printf("\n"); - - fclose( stream ); - } - else - printf( "File %s could not be opened\n",fname ); - - free(fname); - - return 0; + FILE *stream; + size_t numread; + TYPE buf[NELMTS]; + size_t i, nelmts = NELMTS; + char *fname=NULL; + + if (argc != 2) { + usage(); + exit(1); + } + + fname = strdup(argv[1]); + + if((stream = fopen(fname, "rb")) != NULL) { + numread = fread(buf, sizeof( TYPE ), nelmts, stream); + printf("Number of items read = %llu\n", (unsigned long long)numread); + + for (i = 0; i < nelmts; i++) { + printf(FORMAT,buf[i]); + } + printf("\n"); + + fclose(stream); + } + else + printf("File %s could not be opened\n", fname); + + free(fname); + + return 0; } |