summaryrefslogtreecommitdiffstats
path: root/test/tmisc.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:39:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:39:09 (GMT)
commit02ce7e7386298576c49d240669314910c3d0c6d1 (patch)
treefb6635a7203cb63626d283c72fd387c874111b23 /test/tmisc.c
parent050dd023870ac6858eaf55c20c7ffd46e97b1454 (diff)
downloadhdf5-02ce7e7386298576c49d240669314910c3d0c6d1.zip
hdf5-02ce7e7386298576c49d240669314910c3d0c6d1.tar.gz
hdf5-02ce7e7386298576c49d240669314910c3d0c6d1.tar.bz2
[svn-r27772] Description:
Clean up warnings, address HDFFV-9524 Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest)
Diffstat (limited to 'test/tmisc.c')
-rw-r--r--test/tmisc.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/test/tmisc.c b/test/tmisc.c
index 2980ec2..88a2a44 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -1254,7 +1254,7 @@ test_misc8(void)
tdata=wdata;
for(u=0; u<MISC8_DIM0; u++)
for(v=0; v<MISC8_DIM1; v++)
- *tdata++=((u*MISC8_DIM1)+v)%13;
+ *tdata++ = (int)(((u * MISC8_DIM1) + v) % 13);
/* Create a file acccess property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
@@ -1310,7 +1310,7 @@ test_misc8(void)
/* Check the storage size */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1336,7 +1336,7 @@ test_misc8(void)
/* Check the storage size after data is written */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1361,7 +1361,7 @@ test_misc8(void)
/* Check the storage size after data is written */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1405,7 +1405,7 @@ test_misc8(void)
/* Check the storage size */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1432,7 +1432,7 @@ test_misc8(void)
/* Check the storage size after data is written */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1462,7 +1462,7 @@ test_misc8(void)
/* Check the storage size after data is written */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1486,7 +1486,7 @@ test_misc8(void)
/* Check the storage size after only four chunks are written */
storage_size = H5Dget_storage_size(did);
- VERIFY(storage_size, 4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Write entire dataset */
ret = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -1509,7 +1509,7 @@ test_misc8(void)
/* Check the storage size after data is written */
storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, (hsize_t)(MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -2701,8 +2701,7 @@ test_misc16(void)
{
hid_t file; /* File ID */
herr_t ret; /* Generic return value */
- const char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE] =
- {"1234567", "1234567\0", "12345678", {NULL}};
+ char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE];
char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */
hid_t dataset; /* Dataset ID */
hid_t sid; /* Dataspace ID */
@@ -2710,6 +2709,13 @@ test_misc16(void)
hsize_t dims[] = {MISC16_SPACE_DIM};
int i;
+ /* Initialize the data */
+ /* (Note that these are supposed to stress the code, so are a little weird) */
+ HDmemcpy(wdata[0], "1234567", MISC16_STR_SIZE);
+ HDmemcpy(wdata[1], "1234567\0", MISC16_STR_SIZE);
+ HDmemcpy(wdata[1], "12345678", MISC16_STR_SIZE);
+ HDmemcpy(wdata[1], "\0\0\0\0\0\0\0\0", MISC16_STR_SIZE);
+
/* Create the file */
file = H5Fcreate(MISC16_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
@@ -2780,8 +2786,7 @@ test_misc17(void)
{
hid_t file; /* File ID */
herr_t ret; /* Generic return value */
- const char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2] =
- {"1234567", "1234567\0", "12345678", {NULL}};
+ char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2];
char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */
hid_t dataset; /* Dataset ID */
hid_t sid; /* Dataspace ID */
@@ -2789,6 +2794,13 @@ test_misc17(void)
hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2};
int i;
+ /* Initialize the data */
+ /* (Note that these are supposed to stress the code, so are a little weird) */
+ HDmemcpy(wdata[0], "1234567", MISC17_SPACE_DIM2);
+ HDmemcpy(wdata[1], "1234567\0", MISC17_SPACE_DIM2);
+ HDmemcpy(wdata[1], "12345678", MISC17_SPACE_DIM2);
+ HDmemcpy(wdata[1], "\0\0\0\0\0\0\0\0", MISC17_SPACE_DIM2);
+
/* Create the file */
file = H5Fcreate(MISC17_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
@@ -3782,6 +3794,7 @@ test_misc23(void)
char objname[MISC23_NAME_BUF_SIZE]; /* Name of object */
H5O_info_t oinfo;
htri_t tri_status;
+ ssize_t namelen;
herr_t status;
/* Output message about test being performed */
@@ -3851,8 +3864,8 @@ test_misc23(void)
CHECK(tmp_id, FAIL, "H5Gcreate2");
/* Query that the name of the new group is correct */
- status = H5Iget_name(tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE);
- CHECK(status, FAIL, "H5Iget_name");
+ namelen = H5Iget_name(tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE);
+ CHECK(namelen, FAIL, "H5Iget_name");
VERIFY_STR(objname, "/A/B01/grp", "H5Iget_name");
status = H5Gclose(tmp_id);
@@ -4991,7 +5004,7 @@ test_misc28(void)
/* Initialize write buffer */
for(i=0; i<MISC28_SIZE; i++)
- buf[i] = i;
+ buf[i] = (char)i;
/* Create memory dataspace and selection in file dataspace */
sidm = H5Screate_simple(1, mdims, NULL);
@@ -5012,7 +5025,7 @@ test_misc28(void)
/* Initialize write buffer */
for(i=0; i<MISC28_SIZE; i++)
- buf[i] = MISC28_SIZE - 1 - i;
+ buf[i] = (char)(MISC28_SIZE - 1 - i);
/* Select new hyperslab */
start[1] = 1;