summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Joe Lee <hyoklee@hdfgroup.org>2021-11-13 23:08:48 (GMT)
committerGitHub <noreply@github.com>2021-11-13 23:08:48 (GMT)
commit899636e4042ec7603516523a13995967a53d9543 (patch)
tree4fa29024c0bb4b78b76f86c45c58d0a4eeda7244
parent70910573e0cdc7f6647f54046f23a0885176a4a7 (diff)
downloadhdf5-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>
-rw-r--r--src/H5FDcore.c6
-rw-r--r--src/H5Zscaleoffset.c66
-rw-r--r--src/H5private.h4
-rw-r--r--src/uthash.h30
-rw-r--r--test/cork.c109
-rw-r--r--test/swmr.c4
-rw-r--r--test/testmeta.c2
-rw-r--r--test/tvlstr.c6
8 files changed, 119 insertions, 108 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 3bb95f7..0b96891 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -388,7 +388,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size)
"write to backing store failed: time = %s, filename = '%s', file descriptor = %d, "
"errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this "
"sub-write = %llu, bytes actually written = %llu, offset = %llu",
- HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr,
+ HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), (void *)ptr,
(unsigned long long)size, (unsigned long long)bytes_in,
(unsigned long long)bytes_wrote, (unsigned long long)offset);
} /* end if */
@@ -916,8 +916,8 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
"file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, "
"error message = '%s', file->mem = %p, total read size = %llu, bytes this "
"sub-read = %llu, bytes actually read = %llu, offset = %llu",
- HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem,
- (unsigned long long)size, (unsigned long long)bytes_in,
+ HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno),
+ (void *)file->mem, (unsigned long long)size, (unsigned long long)bytes_in,
(unsigned long long)bytes_read, (unsigned long long)offset);
} /* end if */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 97678b0..44f3ae7 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
{ \
i = 0; \
- while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
+ while (i < d_nelmts && HDfabs((double)(buf[i] - filval)) < HDpow(10.0, -D_val)) \
i++; \
if (i < d_nelmts) \
min = max = buf[i]; \
for (; i < d_nelmts; i++) { \
- if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
+ if (HDfabs((double)(buf[i] - filval)) < HDpow(10.0, -D_val)) \
continue; /* ignore fill value */ \
if (buf[i] > max) \
max = buf[i]; \
@@ -425,22 +425,22 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) \
{ \
if (sizeof(type) == sizeof(int)) { \
- if (round_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) > \
- pow_fun(2.0f, (type)(sizeof(int) * 8 - 1))) { \
+ if (round_fun(max * pow_fun((type)10, (type)D_val) - min * pow_fun((type)10, (type)D_val)) > \
+ pow_fun((type)2, (type)(sizeof(int) * 8 - 1))) { \
*minbits = sizeof(int) * 8; \
goto done; \
} \
} \
else if (sizeof(type) == sizeof(long)) { \
- if (round_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) > \
- pow_fun(2.0f, (type)(sizeof(long) * 8 - 1))) { \
+ if (round_fun(max * pow_fun((type)10, (type)D_val) - min * pow_fun((type)10, (type)D_val)) > \
+ pow_fun((type)2, (type)(sizeof(long) * 8 - 1))) { \
*minbits = sizeof(long) * 8; \
goto done; \
} \
} \
else if (sizeof(type) == sizeof(long long)) { \
- if (round_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) > \
- pow_fun(2.0f, (type)(sizeof(long long) * 8 - 1))) { \
+ if (round_fun(max * pow_fun((type)10, (type)D_val) - min * pow_fun((type)10, (type)D_val)) > \
+ pow_fun((type)2, (type)(sizeof(long long) * 8 - 1))) { \
*minbits = sizeof(long long) * 8; \
goto done; \
} \
@@ -530,27 +530,27 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ \
if (sizeof(type) == sizeof(int)) \
for (i = 0; i < d_nelmts; i++) { \
- if (abs_fun(buf[i] - filval) < pow_fun(10.0f, (type)-D_val)) \
+ if (abs_fun(buf[i] - filval) < pow_fun((type)10, (type)-D_val)) \
*(int *)((void *)&buf[i]) = (int)(((unsigned int)1 << *minbits) - 1); \
else \
- *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)); \
} \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) { \
- if (abs_fun(buf[i] - filval) < pow_fun(10.0f, (type)-D_val)) \
+ if (abs_fun(buf[i] - filval) < pow_fun((type)10, (type)-D_val)) \
*(long *)((void *)&buf[i]) = (long)(((unsigned long)1 << *minbits) - 1); \
else \
- *(long *)((void *)&buf[i]) = lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(long *)((void *)&buf[i]) = lround_fun(buf[i] * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)); \
} \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) { \
- if (abs_fun(buf[i] - filval) < pow_fun(10.0f, (type)-D_val)) \
+ if (abs_fun(buf[i] - filval) < pow_fun((type)10, (type)-D_val)) \
*(long long *)((void *)&buf[i]) = (long long)(((unsigned long long)1 << *minbits) - 1); \
else \
- *(long long *)((void *)&buf[i]) = llround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(long long *)((void *)&buf[i]) = llround_fun(buf[i] * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)); \
} \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
@@ -561,16 +561,16 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ \
if (sizeof(type) == sizeof(int)) \
for (i = 0; i < d_nelmts; i++) \
- *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)); \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) \
- *(long *)((void *)&buf[i]) = \
- lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)); \
+ *(long *)((void *)&buf[i]) = lround_fun(buf[i] * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)); \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) \
- *(long long *)((void *)&buf[i]) = \
- llround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)); \
+ *(long long *)((void *)&buf[i]) = llround_fun(buf[i] * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)); \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
}
@@ -606,8 +606,8 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z_scaleoffset_get_filval_2(type, cd_values, filval) \
H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) span = \
- (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)) + \
+ (unsigned long long)(llround_fun(max * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)) + \
1); \
*minbits = H5Z__scaleoffset_log2(span + 1); \
if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \
@@ -617,8 +617,8 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
else { /* fill value undefined */ \
H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \
H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) span = \
- (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)) + \
+ (unsigned long long)(llround_fun(max * pow_fun((type)10, (type)D_val) - \
+ min * pow_fun((type)10, (type)D_val)) + \
1); \
*minbits = H5Z__scaleoffset_log2(span); \
if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \
@@ -685,19 +685,19 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
buf[i] = \
(type)((*(int *)((void *)&buf[i]) == (int)(((unsigned int)1 << minbits) - 1)) \
? filval \
- : (type)(*(int *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ : (type)(*(int *)((void *)&buf[i])) / pow_fun((type)10, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) \
buf[i] = \
(type)((*(long *)((void *)&buf[i]) == (long)(((unsigned long)1 << minbits) - 1)) \
? filval \
- : (type)(*(long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ : (type)(*(long *)((void *)&buf[i])) / pow_fun((type)10, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) \
buf[i] = (type)( \
(*(long long *)((void *)&buf[i]) == (long long)(((unsigned long long)1 << minbits) - 1)) \
? filval \
- : (type)(*(long long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ : (type)(*(long long *)((void *)&buf[i])) / pow_fun((type)10, (type)D_val) + min); \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
}
@@ -707,13 +707,13 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ \
if (sizeof(type) == sizeof(int)) \
for (i = 0; i < d_nelmts; i++) \
- buf[i] = ((type)(*(int *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ buf[i] = ((type)(*(int *)((void *)&buf[i])) / pow_fun((type)10, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) \
- buf[i] = ((type)(*(long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ buf[i] = ((type)(*(long *)((void *)&buf[i])) / pow_fun((type)10, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) \
- buf[i] = ((type)(*(long long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ buf[i] = ((type)(*(long long *)((void *)&buf[i])) / pow_fun((type)10, (type)D_val) + min); \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
}
diff --git a/src/H5private.h b/src/H5private.h
index c9b4ab3..8bbeab4 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -321,10 +321,10 @@
#define H5_ATTR_NORETURN __attribute__((noreturn))
#define H5_ATTR_CONST __attribute__((const))
#define H5_ATTR_PURE __attribute__((pure))
-#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__INTEL_COMPILER)
+#if defined(__clang__) || defined(__GNUC__) && __GNUC__ >= 7 && !defined(__INTEL_COMPILER)
#define H5_ATTR_FALLTHROUGH __attribute__((fallthrough));
#else
-#define H5_ATTR_FALLTHROUGH /*void*/
+#define H5_ATTR_FALLTHROUGH /* FALLTHROUGH */
#endif
#else
#define H5_ATTR_FORMAT(X, Y, Z) /*void*/
diff --git a/src/uthash.h b/src/uthash.h
index 8bdca55..ea99839 100644
--- a/src/uthash.h
+++ b/src/uthash.h
@@ -714,25 +714,35 @@ typedef unsigned char uint8_t;
hashv += (unsigned)(keylen); \
switch (_hj_k) { \
case 11: \
- hashv += ((unsigned)_hj_key[10] << 24); /* FALLTHROUGH */ \
+ hashv += ((unsigned)_hj_key[10] << 24); \
+ H5_ATTR_FALLTHROUGH \
case 10: \
- hashv += ((unsigned)_hj_key[9] << 16); /* FALLTHROUGH */ \
+ hashv += ((unsigned)_hj_key[9] << 16); \
+ H5_ATTR_FALLTHROUGH \
case 9: \
- hashv += ((unsigned)_hj_key[8] << 8); /* FALLTHROUGH */ \
+ hashv += ((unsigned)_hj_key[8] << 8); \
+ H5_ATTR_FALLTHROUGH \
case 8: \
- _hj_j += ((unsigned)_hj_key[7] << 24); /* FALLTHROUGH */ \
+ _hj_j += ((unsigned)_hj_key[7] << 24); \
+ H5_ATTR_FALLTHROUGH \
case 7: \
- _hj_j += ((unsigned)_hj_key[6] << 16); /* FALLTHROUGH */ \
+ _hj_j += ((unsigned)_hj_key[6] << 16); \
+ H5_ATTR_FALLTHROUGH \
case 6: \
- _hj_j += ((unsigned)_hj_key[5] << 8); /* FALLTHROUGH */ \
+ _hj_j += ((unsigned)_hj_key[5] << 8); \
+ H5_ATTR_FALLTHROUGH \
case 5: \
- _hj_j += _hj_key[4]; /* FALLTHROUGH */ \
+ _hj_j += _hj_key[4]; \
+ H5_ATTR_FALLTHROUGH \
case 4: \
- _hj_i += ((unsigned)_hj_key[3] << 24); /* FALLTHROUGH */ \
+ _hj_i += ((unsigned)_hj_key[3] << 24); \
+ H5_ATTR_FALLTHROUGH \
case 3: \
- _hj_i += ((unsigned)_hj_key[2] << 16); /* FALLTHROUGH */ \
+ _hj_i += ((unsigned)_hj_key[2] << 16); \
+ H5_ATTR_FALLTHROUGH \
case 2: \
- _hj_i += ((unsigned)_hj_key[1] << 8); /* FALLTHROUGH */ \
+ _hj_i += ((unsigned)_hj_key[1] << 8); \
+ H5_ATTR_FALLTHROUGH \
case 1: \
_hj_i += _hj_key[0]; \
} \
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);