diff options
author | H. Joe Lee <hyoklee@hdfgroup.org> | 2021-11-13 23:08:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 23:08:48 (GMT) |
commit | 899636e4042ec7603516523a13995967a53d9543 (patch) | |
tree | 4fa29024c0bb4b78b76f86c45c58d0a4eeda7244 /test | |
parent | 70910573e0cdc7f6647f54046f23a0885176a4a7 (diff) | |
download | hdf5-899636e4042ec7603516523a13995967a53d9543.zip hdf5-899636e4042ec7603516523a13995967a53d9543.tar.gz hdf5-899636e4042ec7603516523a13995967a53d9543.tar.bz2 |
1.12 TRILAB-266: Remove clang warnings. (#1193)
* TRILAB-266: Remove clang warnings in src/H5Zscaleoffset.c. (PR #1105)
* Committing clang-format changes
* TRILAB-266: Remove clang warnings in H5private.h and uthash.h. (PR #1124)
* TRILAB-266: Remove clang warnings in H5FDcore.c. (PR #1127)
* Committing clang-format changes
* TRILAB-266: Remove clang warnings in test/testmeta.c. (PR #1135)
* TRILAB-266: Remove clang warnings in test/swmr.c. (PR #1136)
* TRILAB-266: Remove clang warnings in test/cork.c. (PR #1137)
* Committing clang-format changes
* TRILAB-266: Remove clang warnings in test/cork.c. (PR #1146)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/cork.c | 109 | ||||
-rw-r--r-- | test/swmr.c | 4 | ||||
-rw-r--r-- | test/testmeta.c | 2 | ||||
-rw-r--r-- | test/tvlstr.c | 6 |
4 files changed, 61 insertions, 60 deletions
diff --git a/test/cork.c b/test/cork.c index 80934ad..1b99384 100644 --- a/test/cork.c +++ b/test/cork.c @@ -89,10 +89,11 @@ static unsigned verify_old_dset_cork(void) { /* Variable Declarations */ - hid_t fid = -1; /* File ID */ - hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */ - hid_t dcpl = -1, dcpl2 = -1, dcpl3 = -1; /* Dataset creation property lists */ - hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID, + dcpl3 = H5I_INVALID_HID; /* Dataset creation property lists */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID, sid3 = H5I_INVALID_HID; /* Dataspace IDs */ hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */ hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */ hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */ @@ -295,19 +296,19 @@ static unsigned verify_obj_dset_cork(hbool_t swmr) { /* Variable Declarations */ - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t oid = -1; /* Object ID */ - hid_t dcpl2; /* Dataset creation property list */ - int i = 0; /* Local index variable */ - hsize_t dim[1] = {100}; /* Dataset dimension size */ - hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */ - H5O_info2_t oinfo, oinfo2; /* Object metadata information */ - char attrname[500]; /* Name of attribute */ - unsigned flags; /* File access flags */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t oid = H5I_INVALID_HID; /* Object ID */ + hid_t dcpl2 = H5I_INVALID_HID; /* Dataset creation property list */ + int i = 0; /* Local index variable */ + hsize_t dim[1] = {100}; /* Dataset dimension size */ + hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */ + H5O_info2_t oinfo, oinfo2; /* Object metadata information */ + char attrname[500]; /* Name of attribute */ + unsigned flags; /* File access flags */ if (swmr) { TESTING("cork status for dataset objects with attributes (SWMR)"); @@ -500,11 +501,11 @@ static unsigned verify_dset_cork(hbool_t swmr, hbool_t new_format) { /* Variable Declarations */ - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t did = -1, did2 = -1, did3 = -1; /* Dataset IDs */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t sid = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID, sid3 = H5I_INVALID_HID; /* Dataspace IDs */ hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */ hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */ hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */ @@ -758,15 +759,15 @@ static unsigned verify_group_cork(hbool_t swmr) { /* Variable Declarations */ - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t gid = -1, gid2 = -1, gid3 = -1; /* Group IDs */ - H5O_info2_t oinfo, oinfo2, oinfo3; /* Object metadata information */ - hid_t aid; /* Attribute ID */ - hid_t sid; /* Dataspace ID */ - char attrname[500]; /* Name of attribute */ - unsigned flags; /* File access flags */ - int i = 0; /* Local index variable */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid3 = H5I_INVALID_HID; /* Group IDs */ + H5O_info2_t oinfo, oinfo2, oinfo3; /* Object metadata information */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + char attrname[500]; /* Name of attribute */ + unsigned flags; /* File access flags */ + int i = 0; /* Local index variable */ /* Testing Macro */ if (swmr) { @@ -927,17 +928,17 @@ static unsigned verify_named_cork(hbool_t swmr) { /* Variable Declarations */ - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t tid = -1, tid2 = -1, tid3 = -1; /* Datatype IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5O_info2_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */ - hid_t aid = -1; /* Attribute ID */ - hid_t sid; /* Dataspace ID */ - hid_t did; /* Dataset ID */ - char attrname[500]; /* Name of attribute */ - unsigned flags; /* File access flags */ - int i = 0; /* Local index variable */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID, tid3 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5O_info2_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + char attrname[500]; /* Name of attribute */ + unsigned flags; /* File access flags */ + int i = 0; /* Local index variable */ /* Testing Macro */ if (swmr) { @@ -1880,18 +1881,18 @@ error: static unsigned test_dset_cork(hbool_t swmr, hbool_t new_format) { - hid_t fid; /* File ID */ - hid_t fapl; /* File access property list */ - hid_t gid; /* Groupd ID */ - hid_t did1, did2; /* Dataset IDs */ - hid_t tid1, tid2; /* Datatype IDs */ - hid_t sid; /* Dataspace ID */ - hid_t dcpl; /* Dataset creation property list */ - hsize_t dims[RANK]; /* Dataset dimensions */ - hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dataset dimensions */ - hsize_t cdims[RANK] = {2, 2}; /* Chunk dimensions */ - int fillval = 0; /* Fill value */ - int i, j, k = 0; /* Local index variables */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t gid = H5I_INVALID_HID; /* Groupd ID */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hsize_t dims[RANK]; /* Dataset dimensions */ + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dataset dimensions */ + hsize_t cdims[RANK] = {2, 2}; /* Chunk dimensions */ + int fillval = 0; /* Fill value */ + int i, j, k = 0; /* Local index variables */ int ** wbuf = NULL; /* Data buffer for writes (pointers to fake 2D array) */ int * wbuf_data = NULL; /* Data buffer for writes (real data) */ int * rbuf_data = NULL; /* Data buffer for reads (real data) */ diff --git a/test/swmr.c b/test/swmr.c index 24a0b7c..9091fe2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -5220,7 +5220,7 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl) static int test_file_lock_swmr_concur(hid_t in_fapl) { - hid_t fid; /* File ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ hid_t fapl; /* File access property list */ char filename[NAME_BUF_SIZE]; /* file name */ pid_t childpid = 0; /* Child process ID */ @@ -6721,7 +6721,7 @@ test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format) static int test_refresh_concur(hid_t in_fapl, hbool_t new_format) { - hid_t fid; /* File ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ hid_t fapl; /* File access property list */ pid_t childpid = 0; /* Child process ID */ pid_t tmppid; /* Child process ID returned by waitpid */ diff --git a/test/testmeta.c b/test/testmeta.c index c59c6cb..7cb3000 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -195,7 +195,7 @@ main(void) start[0] = 0; status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, start, stride, count, NULL); - start[0] = (hssize_t)j; + start[0] = (hsize_t)j; status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, stride, count, NULL); status = H5Dwrite(dataset_id, type_id, memspace_id, dataspace_id, H5P_DEFAULT, &floatval); if (status < 0) { diff --git a/test/tvlstr.c b/test/tvlstr.c index 7e47c7b..68f6124 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -293,7 +293,7 @@ test_vlstrings_special(void) /* Check data read in */ for (i = 0; i < SPACE1_DIM1; i++) if (rdata[i] != NULL) - TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)i, rdata[i]); + TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); @@ -352,7 +352,7 @@ test_vlstrings_special(void) /* Check data read in */ for (i = 0; i < SPACE1_DIM1; i++) if (rdata[i] != NULL) - TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)i, rdata[i]); + TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]); /* Try to write nil strings to disk. */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2); @@ -365,7 +365,7 @@ test_vlstrings_special(void) /* Check data read in */ for (i = 0; i < SPACE1_DIM1; i++) if (rdata[i] != NULL) - TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)i, rdata[i]); + TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]); /* Close Dataset */ ret = H5Dclose(dataset); |