diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-07-03 16:12:32 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-07-03 16:12:32 (GMT) |
commit | dfcb3cebf17c20b6dfc0a1dd5178c2e2d01c4422 (patch) | |
tree | 6dd345c9832ff210c96dc7d642ba2e2f4d394bf6 /perform/pio_engine.c | |
parent | 6da129cef05328a6935bb6ce65319944cdce5a95 (diff) | |
download | hdf5-dfcb3cebf17c20b6dfc0a1dd5178c2e2d01c4422.zip hdf5-dfcb3cebf17c20b6dfc0a1dd5178c2e2d01c4422.tar.gz hdf5-dfcb3cebf17c20b6dfc0a1dd5178c2e2d01c4422.tar.bz2 |
[svn-r23862] Change printfs in perform output and h5dump to prevent overflow.
This fixes: https://jira.hdfgroup.uiuc.edu/browse/HDFFV-8450
Tested on Jam.
Diffstat (limited to 'perform/pio_engine.c')
-rw-r--r-- | perform/pio_engine.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 0e3190c..87fa82c 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -245,52 +245,52 @@ do_pio(parameters param) /* Validate transfer buffer size & block size*/ if(blk_size<=0) { HDfprintf(stderr, - "Transfer block size (%Hd) must be > 0\n", (long long)blk_size); + "Transfer block size (%zu) must be > 0\n", blk_size); GOTOERROR(FAIL); } if(buf_size<=0) { HDfprintf(stderr, - "Transfer buffer size (%Hd) must be > 0\n", (long long)buf_size); + "Transfer buffer size (%zu) must be > 0\n", buf_size); GOTOERROR(FAIL); } if ((buf_size % blk_size) != 0){ HDfprintf(stderr, - "Transfer buffer size (%Hd) must be a multiple of the " - "interleaved I/O block size (%Hd)\n", - (long long)buf_size, (long long)blk_size); + "Transfer buffer size (%zu) must be a multiple of the " + "interleaved I/O block size (%zu)\n", + buf_size, blk_size); GOTOERROR(FAIL); } if((snbytes%pio_mpi_nprocs_g)!=0) { HDfprintf(stderr, - "Dataset size (%Hd) must be a multiple of the " - "number of processes (%d)\n", - (long long)snbytes, pio_mpi_nprocs_g); + "Dataset size (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the " + "number of processes (%d)\n", + (long long)snbytes, pio_mpi_nprocs_g); GOTOERROR(FAIL); } if (!param.dim2d){ if(((snbytes/pio_mpi_nprocs_g)%buf_size)!=0) { HDfprintf(stderr, - "Dataset size/process (%Hd) must be a multiple of the " - "trasfer buffer size (%Hd)\n", - (long long)(snbytes/pio_mpi_nprocs_g), (long long)buf_size); + "Dataset size/process (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the " + "trasfer buffer size (%zu)\n", + (long long)(snbytes/pio_mpi_nprocs_g), buf_size); GOTOERROR(FAIL); } } else { if((snbytes%buf_size)!=0) { HDfprintf(stderr, - "Dataset side size (%Hd) must be a multiple of the " - "trasfer buffer size (%Hd)\n", - (long long)snbytes, (long long)buf_size); + "Dataset side size (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the " + "trasfer buffer size (%zu)\n", + (long long)snbytes, buf_size); GOTOERROR(FAIL); } } /* Allocate transfer buffer */ if ((buffer = malloc(bsize)) == NULL){ - HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", - (long long)(bsize)); + HDfprintf(stderr, "malloc for transfer buffer size (%zu) failed\n", + bsize); GOTOERROR(FAIL); } @@ -651,13 +651,13 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " - "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", - (long long)buf_size, (long long)bytes_begin[0], + "buf_size=%zu, bytes_begin=%" H5_PRINTF_LL_WIDTH "d, bytes_count=%" H5_PRINTF_LL_WIDTH "d\n", + buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { HDfprintf(output, "Debug(do_write): " - "linear buf_size=%Hd, bytes_begin=(%Hd,%Hd), bytes_count=%Hd\n", - (long long)buf_size*blk_size, (long long)bytes_begin[0], + "linear buf_size=%zu, bytes_begin=(%" H5_PRINTF_LL_WIDTH "d,%" H5_PRINTF_LL_WIDTH "d), bytes_count=%" H5_PRINTF_LL_WIDTH "d\n", + buf_size*blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], (long long)bytes_count); } } @@ -1625,13 +1625,13 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " - "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", - (long long)buf_size, (long long)bytes_begin[0], + "buf_size=%zu, bytes_begin=%" H5_PRINTF_LL_WIDTH "d, bytes_count=%" H5_PRINTF_LL_WIDTH "d\n", + buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { HDfprintf(output, "Debug(do_write): " - "linear buf_size=%Hd, bytes_begin=(%Hd,%Hd), bytes_count=%Hd\n", - (long long)buf_size*blk_size, (long long)bytes_begin[0], + "linear buf_size=%zu, bytes_begin=(%" H5_PRINTF_LL_WIDTH "d,%" H5_PRINTF_LL_WIDTH "d), bytes_count=%" H5_PRINTF_LL_WIDTH "d\n", + buf_size*blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], (long long)bytes_count); } } @@ -2336,10 +2336,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, if (++nerror < 20){ /* report at most 20 errors */ HDprint_rank(output); - HDfprintf(output, "read data error, expected (%Hd), " - "got (%Hd)\n", - (long long)pio_mpi_rank_g+1, - (long long)*(ucharptr-1)); + HDfprintf(output, "read data error, expected (%d), " + "got (%d)\n", + pio_mpi_rank_g+1, + (int)*(ucharptr-1)); } /* end if */ } /* end if */ } /* end for */ |