summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2019-12-04 02:52:55 (GMT)
committerkmu <kmu@hdfgroup.org>2019-12-04 02:52:55 (GMT)
commit132fa33dad6badacec90e80768d8dc8e8aa33172 (patch)
treeb296c329b62c9152fce3ca228c121a8cdf55d0c8 /test
parentea0759d047dc6421da90375a9c27f7cde0a8e117 (diff)
downloadhdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.zip
hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.tar.gz
hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.tar.bz2
fix intel compile warnings
Diffstat (limited to 'test')
-rw-r--r--test/dsets.c8
-rw-r--r--test/dtypes.c5
-rw-r--r--test/h5test.c3
-rw-r--r--test/ntypes.c2
-rw-r--r--test/th5s.c6
-rw-r--r--test/tsohm.c8
6 files changed, 16 insertions, 16 deletions
diff --git a/test/dsets.c b/test/dsets.c
index aa84833..6cc38db 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -5293,7 +5293,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
(dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ for(i=0; i<sizeof buf; i++) H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
@@ -5307,7 +5307,7 @@ test_types(hid_t file)
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
(dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ for(i=0; i<sizeof buf; i++) H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
if(H5Sclose(space) < 0) goto error;
@@ -5322,7 +5322,7 @@ test_types(hid_t file)
(dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
@@ -5336,7 +5336,7 @@ test_types(hid_t file)
(dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
diff --git a/test/dtypes.c b/test/dtypes.c
index 689336f..93f56b8 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -21,6 +21,7 @@
#include "testhdf5.h"
#include "H5srcdir.h"
#include "H5Iprivate.h" /* For checking that datatype id's don't leak */
+#include "H5private.h"
/* Number of elements in each test */
#define NTESTELEM 100000
@@ -1216,8 +1217,8 @@ test_compound_6(void)
orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st));
for (i=0; i<(int)nelmts; i++) {
s_ptr = ((struct st*)((void *)orig)) + i;
- s_ptr->b = (i*8+1) & 0x7fff;
- s_ptr->d = (i*8+6) & 0x7fff;
+ H5_CHECKED_ASSIGN(s_ptr->b, int16_t, (i*8+1) & 0x7fff, int);
+ H5_CHECKED_ASSIGN(s_ptr->d, int16_t, (i*8+6) & 0x7fff, int);
}
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
diff --git a/test/h5test.c b/test/h5test.c
index c8f4132..fb1c408 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1321,8 +1321,7 @@ h5_dump_info_object(MPI_Info info)
int flag;
int i, nkeys;
- HDprintf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
- MPI_MAX_INFO_VAL);
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
if (info==MPI_INFO_NULL){
HDprintf("object is MPI_INFO_NULL\n");
}
diff --git a/test/ntypes.c b/test/ntypes.c
index 34558f5..82da8ce 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -2484,7 +2484,7 @@ test_opaque_dtype(hid_t file)
TEST_ERROR;
for(i = 0; i < sizeof(wbuf); i++)
- wbuf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ H5_CHECKED_ASSIGN(wbuf[i], uint8_t, 0xff ^ i, size_t);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
if(H5Sclose(space) < 0) TEST_ERROR;
diff --git a/test/th5s.c b/test/th5s.c
index 1a4456a..ed02c16 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -1583,7 +1583,7 @@ test_h5s_encode1(void)
****************************************************************/
static herr_t
test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid,
- uint32_t expected_version, uint8_t expected_enc_size, hbool_t expected_to_fail)
+ uint32_t expected_version, uint32_t expected_enc_size, hbool_t expected_to_fail)
{
char *buf = NULL; /* Pointer to the encoded buffer */
size_t buf_size; /* Size of the encoded buffer */
@@ -1697,7 +1697,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high)
unsigned unlim; /* H5S_UNLIMITED setting or not */
herr_t ret; /* Generic return value */
uint32_t expected_version = 0; /* Expected version for selection info */
- uint8_t expected_enc_size = 0; /* Expected encoded size for selection info */
+ uint32_t expected_enc_size = 0; /* Expected encoded size for selection info */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace encoding of regular hyperslabs\n"));
@@ -1912,7 +1912,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high)
for(config = CONFIG_8; config <= CONFIG_32; config++) {
hbool_t expected_to_fail = FALSE; /* Whether H5Sencode2 is expected to fail */
uint32_t expected_version = 0; /* Expected version for selection info */
- uint8_t expected_enc_size = 0; /* Expected encoded size for selection info */
+ uint32_t expected_enc_size = 0; /* Expected encoded size for selection info */
start = 0;
count = 2;
diff --git a/test/tsohm.c b/test/tsohm.c
index a064940..c126608 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -3342,11 +3342,11 @@ test_sohm_extlink(void)
static int
verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
{
- hid_t file_id = -1;
- hid_t orig_space_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t orig_space_id = H5I_INVALID_HID;
hid_t space1_id, space2_id, space3_id;
- hid_t dcpl_id = -1;
- hid_t dset1_id, dset2_id, dset3_id;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t dset1_id, dset2_id = H5I_INVALID_HID, dset3_id = H5I_INVALID_HID;
hsize_t dims1[] = {1, 2};
hsize_t max_dims[] = {H5S_UNLIMITED, 2};
hsize_t dims2[] = {5, 2};