summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-09-24 21:34:51 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-09-24 21:34:51 (GMT)
commit6486892de56485f8ec7cf9070363a7b13da4e408 (patch)
tree08508b53153b54eb9aa4224c05a86b7b736677d6 /testpar
parentcd1d772f353b70415b150ae2e85e9d184191f7f0 (diff)
downloadhdf5-6486892de56485f8ec7cf9070363a7b13da4e408.zip
hdf5-6486892de56485f8ec7cf9070363a7b13da4e408.tar.gz
hdf5-6486892de56485f8ec7cf9070363a7b13da4e408.tar.bz2
Fix some HDfprintf compilation errors: use the right format strings
("zu", PRIuHSIZE), avoid casting some printf arguments, pass the right number of arguments.
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_2Gio.c7
-rw-r--r--testpar/t_bigio.c35
-rw-r--r--testpar/t_cache_image.c12
3 files changed, 34 insertions, 20 deletions
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index 54ea546..d44c7c7 100644
--- a/testpar/t_2Gio.c
+++ b/testpar/t_2Gio.c
@@ -585,7 +585,8 @@ static int MpioTest2G( MPI_Comm comm )
MPI_Comm_rank(comm, &mpi_rank);
if(mpi_rank == 0) {
- HDprintf("Using %d process on dataset shape [%llu, %llu, %llu]\n",
+ HDprintf("Using %d process on dataset shape "
+ "[%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "]\n",
mpi_size, shape[0], shape[1], shape[2]);
}
@@ -613,7 +614,7 @@ static int MpioTest2G( MPI_Comm comm )
tot_size_bytes *= shape[i];
}
if(mpi_rank == 0) {
- HDprintf("Dataset of %llu bytes\n", tot_size_bytes);
+ HDprintf("Dataset of %zu bytes\n", tot_size_bytes);
}
filespace = H5Screate_simple(3, shape, NULL);
VRFY((filespace >= 0), "H5Screate_simple succeeded");
@@ -691,7 +692,7 @@ static int MpioTest2G( MPI_Comm comm )
H5Fclose(file_id);
free(data);
- HDprintf("Proc %d - MpioTest2G test succeeded\n", mpi_rank, data_size_bytes);
+ HDprintf("Proc %d - MpioTest2G test succeeded\n", mpi_rank);
if (mpi_rank == 0)
HDremove(FILENAME[1]);
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index f86852a..22a924d 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -143,10 +143,14 @@ void point_set(hsize_t start[],
}
if(VERBOSE_MED) {
- HDprintf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
- (unsigned long)(block[0] * block[1] * count[0] * count[1]));
+ HDprintf("start[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "count[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "stride[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "block[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "total datapoints=%" PRIuHSIZE "\n",
+ start[0], start[1], count[0], count[1],
+ stride[0], stride[1], block[0], block[1],
+ block[0] * block[1] * count[0] * count[1]);
k = 0;
for(i = 0; i < num_points ; i++) {
HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
@@ -167,15 +171,15 @@ dataset_print(hsize_t start[], hsize_t block[], B_DATATYPE * dataset)
/* print the column heading */
HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- HDprintf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3" PRIuHSIZE " ", start[1] + j);
}
HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
+ HDprintf("Row %2" PRIuHSIZE ": ", i + start[0]);
for (j=0; j < block[1]; j++){
- HDprintf("%llu ", *dataptr++);
+ HDprintf("%" PRIuHSIZE " ", *dataptr++);
}
HDprintf("\n");
}
@@ -194,9 +198,12 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[],
/* print it if VERBOSE_MED */
if(VERBOSE_MED) {
HDprintf("verify_data dumping:::\n");
- HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
+ HDprintf("start(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "count(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "stride(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "block(%" PRIuHSIZE ", %" PRIuHSIZE ")\n",
+ start[0], start[1], count[0], count[1],
+ stride[0], stride[1], block[0], block[1]);
HDprintf("original values:\n");
dataset_print(start, block, original);
HDprintf("compared values:\n");
@@ -208,9 +215,11 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[],
for (j=0; j < block[1]; j++){
if(*dataset != *original){
if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n",
- (unsigned long)i, (unsigned long)j,
- (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
+ HDprintf("Dataset Verify failed at [%" PRIuHSIZE "][%" PRIuHSIZE "]"
+ "(row %" PRIuHSIZE ", col %" PRIuHSIZE "): "
+ "expect %" PRIuHSIZE ", got %" PRIuHSIZE "\n",
+ i, j,
+ i + start[0], j + start[1],
*(original), *(dataset));
}
dataset++;
diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c
index 14e3d10..6877d63 100644
--- a/testpar/t_cache_image.c
+++ b/testpar/t_cache_image.c
@@ -3340,8 +3340,10 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
H5_FAILED();
- if ( show_progress )
- HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg);
+ if ( show_progress ) {
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", fcn_name,
+ failure_mssg);
+ }
}
}
@@ -3638,8 +3640,10 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
H5_FAILED();
- if ( show_progress )
- HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg);
+ if ( show_progress ) {
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", fcn_name,
+ failure_mssg);
+ }
}
}