diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dsets.c | 8 | ||||
-rw-r--r-- | test/dtypes.c | 4 | ||||
-rw-r--r-- | test/h5test.c | 3 | ||||
-rw-r--r-- | test/ntypes.c | 2 | ||||
-rw-r--r-- | test/th5s.c | 13 | ||||
-rw-r--r-- | test/tsohm.c | 8 |
6 files changed, 19 insertions, 19 deletions
diff --git a/test/dsets.c b/test/dsets.c index b866dfe..a394210 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++) buf[i] = (unsigned char)(0xff ^ i); 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++) buf[i] = (unsigned char)(0xff ^ i); 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; + buf[i] = (unsigned char)(0xff ^ i); 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; + buf[i] = (unsigned char)(0xff ^ i); 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 791e8e8..c4c3946 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1216,8 +1216,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; + s_ptr->b = (int16_t)((i*8+1) & 0x7fff); + s_ptr->d = (int16_t)((i*8+6) & 0x7fff); } HDmemcpy(buf, orig, nelmts*sizeof(struct st)); diff --git a/test/h5test.c b/test/h5test.c index 67c73f1..6a3a5cb 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..f1d2449 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; + wbuf[i] = (unsigned char)(0xff ^ i); 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 747e741..7e1e547 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1739,12 +1739,12 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) case CONFIG_16: stride = POWER16 - 1; block = 4; - expected_enc_size = expected_version == 3 ? 2 : 4; + expected_enc_size = (uint8_t)(expected_version == 3 ? 2 : 4); break; case CONFIG_32: stride = POWER32 - 1; block = 4; - expected_enc_size = expected_version == 3 ? 4 : 8; + expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8); break; default: @@ -1765,12 +1765,12 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) case CONFIG_16: stride = POWER16 - 1; block = POWER16 - 2; - expected_enc_size = expected_version == 3 ? 2 : 4; + expected_enc_size = (uint8_t)(expected_version == 3 ? 2 : 4); break; case CONFIG_32: stride = POWER32 - 1; block = POWER32 - 2; - expected_enc_size = expected_version == 3 ? 4 : 8; + expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8); break; default: HDassert(0); @@ -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; @@ -1984,7 +1984,8 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab"); /* Verify the version and encoded size expected for the configuration */ - ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail); + HDassert(expected_enc_size <= 255); + ret = test_h5s_check_encoding(fapl, sid, expected_version, (uint8_t)expected_enc_size, expected_to_fail); CHECK(ret, FAIL, "test_h5s_check_encoding"); } /* for config */ 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}; |