From 580008d5bb39e3a9a4a92aefe06dce6941cd485b Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 4 Mar 2021 16:06:30 -0500 Subject: [PATCH] More warning fixes (#400) * Fixed -Wunused-local-typedef warning * Fixed -Wformat warnings In one case also removed a `z` character. There was a `z%d` that I think was supposed to be `%zd` * Fixed -Wshorten-64-to-32 warnings * Fixed -Wself-assign warnings * Fixed -Wreserved-id-macro warnings * Commit format changes from clang-format, clang version 10.0.1. * Fixed -Wself-assign warnings * Fixed -Wunused-local-typedef warning * Fixed -Wformat warnings In two cases also removed a `z` character. There was a `z%d` that was supposed to be `%zd`. * Fixed -Wshorten-64-to-32 warnings * Fixed -Wreserved-id-macro warnings * Fixed -Wself-assign warnings * Format source. * Remove blank lines to pass format check. Co-authored-by: Larry Knox --- c++/src/H5AbstractDs.h | 6 ++-- c++/src/H5CommonFG.h | 6 ++-- c++/src/H5Group.h | 6 ++-- c++/src/H5IdComponent.h | 6 ++-- c++/test/tarray.cpp | 27 +++++++++------- c++/test/tattr.cpp | 54 +++++++++++++++---------------- examples/h5_attribute.c | 2 +- examples/h5_group.c | 10 +++--- hl/c++/test/ptableTest.cpp | 4 +-- hl/src/H5IM.c | 5 +++ hl/src/H5LT.c | 8 +++++ hl/test/test_ds.c | 24 +++++++------- test/cache.c | 8 ++--- test/dtypes.c | 2 +- test/filter_plugin2_dsets.c | 2 +- test/filter_plugin4_groups.c | 2 +- test/tarray.c | 43 ++++++++++++------------ tools/test/h5copy/dynlib_copy.c | 2 +- tools/test/h5diff/dynlib_diff.c | 2 +- tools/test/h5dump/dynlib_dump.c | 2 +- tools/test/h5dump/h5dumpgentest.c | 2 +- tools/test/h5ls/dynlib_ls.c | 2 +- 22 files changed, 122 insertions(+), 103 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index cb43c73a39f..b84867b2cb9 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef AbstractDs_H -#define AbstractDs_H +#ifndef H5AbstractDs_H +#define H5AbstractDs_H namespace H5 { @@ -81,4 +81,4 @@ class H5_DLLCPP AbstractDs { }; // end of AbstractDs } // namespace H5 -#endif // AbstractDs_H +#endif // H5AbstractDs_H diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 368883bc9be..d87f9ca1348 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef CommonFG_H -#define CommonFG_H +#ifndef H5CommonFG_H +#define H5CommonFG_H namespace H5 { @@ -83,7 +83,7 @@ class H5_DLLCPP CommonFG { }; // end of CommonFG } // namespace H5 -#endif // CommonFG_H +#endif // H5CommonFG_H /*************************************************************************** Design Note diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 2a0f18e98a4..6e82e21473a 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef Group_H -#define Group_H +#ifndef H5Group_H +#define H5Group_H namespace H5 { @@ -83,4 +83,4 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { }; // end of Group } // namespace H5 -#endif // Group_H +#endif // H5Group_H diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 4f7584915a8..383d42d333f 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef IdComponent_H -#define IdComponent_H +#ifndef H5IdComponent_H +#define H5IdComponent_H namespace H5 { @@ -113,4 +113,4 @@ class H5_DLLCPP IdComponent { }; // end class IdComponent } // namespace H5 -#endif // IdComponent_H +#endif // H5IdComponent_H diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index ba71da83919..ab66174df18 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -85,7 +85,7 @@ test_array_compound_array() // Initialize array data to write for (idxi = 0; idxi < SPACE1_DIM1; idxi++) for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { - wdata[idxi][idxj].i = idxi * 10 + idxj; + wdata[idxi][idxj].i = static_cast(idxi * 10 + idxj); for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; @@ -182,8 +182,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=z%d\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -200,8 +201,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=%zd\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -250,8 +252,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=%zd\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -266,9 +269,9 @@ test_array_compound_array() for (idxi = 0; idxi < SPACE1_DIM1; idxi++) { for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { if (wdata[idxi][idxj].i != rdata[idxi][idxj].i) { - TestErrPrintf( - "Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n", - idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i); + TestErrPrintf("Array data information doesn't match!, wdata[%lld][%lld].i=%d, " + "rdata[%lld][%lld].i=%d\n", + idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i); continue; } // end if } // end for @@ -387,7 +390,7 @@ test_array_info() // Initialize array data to write for (idxi = 0; idxi < SPACE1_DIM1; idxi++) for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { - wdata[idxi][idxj].i = idxi * 10 + idxj; + wdata[idxi][idxj].i = static_cast(idxi * 10 + idxj); for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; @@ -459,7 +462,7 @@ test_array_info() for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { TestErrPrintf( - "Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=z%d\n", ii, + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=z%llu\n", ii, rdims1[ii], ii, tdims1[ii]); continue; } // end if diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index e308a3a696f..047d360f09a 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -173,8 +173,8 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__, - i, attr_data1[i], i, read_data1[i]); + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", + __LINE__, i, attr_data1[i], i, read_data1[i]); // Create two more attributes for this dataset, but only write to one. Attribute ds_attr2 = dataset.createAttribute(ATTR2_NAME, PredType::NATIVE_INT, att_space); @@ -189,7 +189,7 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close both attributes @@ -452,8 +452,8 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__, - i, attr_data1[i], i, read_data1[i]); + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu%d\n", + __LINE__, i, attr_data1[i], i, read_data1[i]); // Close attribute attr1.close(); @@ -476,7 +476,7 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close attribute @@ -541,7 +541,7 @@ test_attr_basic_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d, read_data1[%d]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d, read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); /* @@ -572,9 +572,9 @@ test_attr_basic_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) { - TestErrPrintf( - "%d: attribute data different: attr_data2[%d][%d]=%d, read_data2[%d][%d]=%d\n", - __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", + __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); } PASSED(); } // end try block @@ -776,15 +776,15 @@ test_attr_compound_read() for (ii = 0; ii < ATTR4_DIM1; ii++) for (jj = 0; jj < ATTR4_DIM2; jj++) if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct))) { - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", - __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", - __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", - __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, " + "read_data4[%llu][%llu].i=%d\n", + __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].d=%f, " + "read_data4[%llu][%llu].d=%f\n", + __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].c=%c, " + "read_data4[%llu][%llu].c=%c\n", + __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); } /* end if */ // Verify name @@ -1048,7 +1048,7 @@ test_attr_mult_read() hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions int ndims = space.getSimpleExtentDims(dims); if ((long)dims[0] != (long)ATTR1_DIM1) - TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n", __LINE__, + TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %llu\n", __LINE__, (int)dims[0], ATTR1_DIM1); /* Verify Datatype */ @@ -1076,8 +1076,8 @@ test_attr_mult_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__, - i, attr_data1[i], i, read_data1[i]); + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", + __LINE__, i, attr_data1[i], i, read_data1[i]); // Verify Name H5std_string attr_name = attr.getName(); @@ -1131,9 +1131,9 @@ test_attr_mult_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) - TestErrPrintf( - "%d: attribute data different: attr_data2[%d][%d]=%d, read_data2[%d][%d]=%d\n", - __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", + __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); // Verify Name attr_name = attr.getName(); @@ -1186,8 +1186,8 @@ test_attr_mult_read() for (j = 0; j < ATTR3_DIM2; j++) for (k = 0; k < ATTR3_DIM3; k++) if (attr_data3[i][j][k] != read_data3[i][j][k]) - TestErrPrintf("%d: attribute data different: attr_data3[%d][%d][%d]=%f, " - "read_data3[%d][%d][%d]=%f\n", + TestErrPrintf("%d: attribute data different: attr_data3[%llu][%llu][%llu]=%f, " + "read_data3[%llu][%llu][%llu]=%f\n", __LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]); // Verify Name diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 340015102d5..97be7f5bece 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -235,7 +235,7 @@ attr_info(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *opdata) float * float_array; /* Pointer to the array attribute. */ /* avoid warnings */ - opdata = opdata; + (void)opdata; /* * Open the attribute using its name. diff --git a/examples/h5_group.c b/examples/h5_group.c index 4b489f046cd..40acafece7d 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -171,9 +171,9 @@ static herr_t file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata) { /* avoid compiler warnings */ - loc_id = loc_id; - opdata = opdata; - linfo = linfo; + (void)loc_id; + (void)opdata; + (void)linfo; /* * Display group name. The name is passed to the function by @@ -198,8 +198,8 @@ group_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdat int rank_chunk; /* avoid warnings */ - opdata = opdata; - linfo = linfo; + (void)opdata; + (void)linfo; /* * Open the datasets using their names. diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index bf6040288b8..900f8a9bbf5 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -616,11 +616,11 @@ TestHDFFV_9758() s1_t s1[NUM_PACKETS]; for (hsize_t i = 0; i < NUM_PACKETS; i++) { - s1[i].a = i; + s1[i].a = static_cast(i); s1[i].b = 1.f * static_cast(i * i); s1[i].c = 1. / (i + 1); HDsprintf(s1[i].d, "string%d", (int)i); - s1[i].e = 100 + i; + s1[i].e = static_cast(100 + i); } printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)"); diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 310d665ed64..ff10d573c7c 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -169,6 +169,11 @@ find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const if (name == NULL) return -1; + /* Shut compiler up */ + (void)loc_id; + (void)ainfo; + (void)op_data; + /* Define a positive value for return value if the attribute was found. This will * cause the iterator to immediately return that positive value, * indicating short-circuit success diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 6478a96f4cf..d1d364823af 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1309,6 +1309,10 @@ find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const if (name == NULL) return ret; + /* Shut the compiler up */ + (void)loc_id; + (void)linfo; + /* Define a positive value for return value if the dataset was found. This will * cause the iterator to immediately return that positive value, * indicating short-circuit success @@ -1847,6 +1851,10 @@ find_attr(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5 if (name == NULL) return H5_ITER_CONT; + /* Shut compiler up */ + (void)loc_id; + (void)ainfo; + /* Define a positive value for return value if the attribute was found. This will * cause the iterator to immediately return that positive value, * indicating short-circuit success diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 90110a4449a..20e3e826bd4 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -3554,9 +3554,9 @@ verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) int ret = 0; /* unused */ - dset = dset; - dim = dim; - visitor_data = visitor_data; + (void)dset; + (void)dim; + (void)visitor_data; /* define a positive value for return value. This will cause the iterator to immediately return that positive value, indicating short-circuit success @@ -3602,8 +3602,8 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) char * data = (char *)visitor_data; /* unused */ - dset = dset; - dim = dim; + (void)dset; + (void)dim; /* get space */ if ((sid = H5Dget_space(scale_id)) < 0) @@ -3691,7 +3691,7 @@ match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data) hsize_t storage_size; /* Stop compiler from whining about "unused parameters" */ - visitor_data = visitor_data; + (void)visitor_data; /*------------------------------------------------------------------------- * get DID (dataset) space info @@ -3766,9 +3766,9 @@ static herr_t op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ - dset = dset; - dim = dim; - scale_id = scale_id; + (void)dset; + (void)dim; + (void)scale_id; if (visitor_data != NULL) { (*(int *)visitor_data)++; @@ -3799,9 +3799,9 @@ static herr_t op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ - dset = dset; - dim = dim; - scale_id = scale_id; + (void)dset; + (void)dim; + (void)scale_id; if (visitor_data != NULL) { (*(int *)visitor_data)++; diff --git a/test/cache.c b/test/cache.c index 767bae00f6f..b88b30e34e4 100644 --- a/test/cache.c +++ b/test/cache.c @@ -27297,7 +27297,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) /* Fill out the rest of the cache with entries */ /* Verify expected status of entries after each insertion */ - for (entry_idx = entry_idx; entry_idx < 50; entry_idx++) { + for (; entry_idx < 50; entry_idx++) { if (fill_via_insertion) { insert_entry(file_ptr, /* H5F_t * file_ptr */ @@ -27431,7 +27431,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) * After each insertion, verify the expected status of the * entries in the cache. */ - for (entry_idx = entry_idx; entry_idx < 100; entry_idx++) { + for (; entry_idx < 100; entry_idx++) { if (fill_via_insertion) { insert_entry(file_ptr, /* H5F_t * file_ptr */ @@ -33243,7 +33243,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) /* Fill out the rest of the cache with entries */ /* Verify expected status of entries after each insertion */ - for (entry_idx = entry_idx; entry_idx < 50; entry_idx++) { + for (; entry_idx < 50; entry_idx++) { if (fill_via_insertion) { insert_entry(file_ptr, /* H5F_t * file_ptr */ @@ -33304,7 +33304,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) if (pass) { /* Insert 50 more entries (indices 50-99) into the cache. */ - for (entry_idx = entry_idx; entry_idx < 100; entry_idx++) { + for (; entry_idx < 100; entry_idx++) { if (fill_via_insertion) { insert_entry(file_ptr, /* H5F_t * file_ptr */ diff --git a/test/dtypes.c b/test/dtypes.c index 27d31d48dfc..c0fe764728d 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1434,7 +1434,7 @@ test_compound_8(void) int b; } s1; - typedef struct s2 { + struct s2 { char c; s1 d; } s2; diff --git a/test/filter_plugin2_dsets.c b/test/filter_plugin2_dsets.c index 08be78cee39..4a881aa8f9d 100644 --- a/test/filter_plugin2_dsets.c +++ b/test/filter_plugin2_dsets.c @@ -73,7 +73,7 @@ mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_valu return 0; /* Assignment to eliminate unused parameter warning */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /* READ - Divide the original value by MULTIPLIER */ diff --git a/test/filter_plugin4_groups.c b/test/filter_plugin4_groups.c index 237642d2009..c948491d80c 100644 --- a/test/filter_plugin4_groups.c +++ b/test/filter_plugin4_groups.c @@ -74,7 +74,7 @@ append_to_group_name(unsigned int flags, size_t cd_nelmts, const unsigned int *c return 0; /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /* READ - Remove the suffix from the group name */ diff --git a/test/tarray.c b/test/tarray.c index a63ebd7d40d..089360df4b5 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -157,8 +157,8 @@ test_array_atomic_1d(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -484,8 +484,8 @@ test_array_array_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims1; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -662,8 +662,8 @@ test_array_compound_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -883,8 +883,8 @@ test_array_compound_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -945,8 +945,9 @@ test_array_compound_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf( + "Nested array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1204,8 +1205,8 @@ test_array_vlen_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1434,8 +1435,8 @@ test_array_vlen_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1466,8 +1467,8 @@ test_array_vlen_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2075,8 +2076,9 @@ test_compat(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2122,8 +2124,9 @@ test_compat(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ diff --git a/tools/test/h5copy/dynlib_copy.c b/tools/test/h5copy/dynlib_copy.c index 57de3bc15a8..56be5a62947 100644 --- a/tools/test/h5copy/dynlib_copy.c +++ b/tools/test/h5copy/dynlib_copy.c @@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd return (0); /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /*read*/ /* Subtract the original value with MULTIPLIER */ diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c index 4568ca17981..cebe53c0f9d 100644 --- a/tools/test/h5diff/dynlib_diff.c +++ b/tools/test/h5diff/dynlib_diff.c @@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd return (0); /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /*read*/ /* Subtract the original value with MULTIPLIER */ diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c index 4568ca17981..cebe53c0f9d 100644 --- a/tools/test/h5dump/dynlib_dump.c +++ b/tools/test/h5dump/dynlib_dump.c @@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd return (0); /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /*read*/ /* Subtract the original value with MULTIPLIER */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 5507ede1b7e..162dabeed3a 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -10921,7 +10921,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd return (0); /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /*read*/ /* Subtract the original value with MULTIPLIER */ diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c index 4568ca17981..cebe53c0f9d 100644 --- a/tools/test/h5ls/dynlib_ls.c +++ b/tools/test/h5ls/dynlib_ls.c @@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd return (0); /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /*read*/ /* Subtract the original value with MULTIPLIER */