summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-07-07 18:54:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-07-07 18:54:11 (GMT)
commitec2fbe0883f9e76df60bcfbebbd4b6f62d5a09e6 (patch)
treebd27f9b92053818b5d83de373dfcadbbbc892ee2
parent3e5a61c9ff7a22589dbb2fc71f95f32f919c8b54 (diff)
downloadhdf5-ec2fbe0883f9e76df60bcfbebbd4b6f62d5a09e6.zip
hdf5-ec2fbe0883f9e76df60bcfbebbd4b6f62d5a09e6.tar.gz
hdf5-ec2fbe0883f9e76df60bcfbebbd4b6f62d5a09e6.tar.bz2
[svn-r30158] Description:
More warning cleanups. This brings us down to ~1300 warnings in 167 files Tested on: MacOSX/64 10.11.5 (amazon) w/serial & parallel (h5committest forthcoming)
-rw-r--r--hl/test/test_packet_vlen.c282
-rw-r--r--src/H5FSstat.c2
-rw-r--r--src/H5Oattr.c18
-rw-r--r--test/H5srcdir.h42
-rw-r--r--test/tsohm.c83
5 files changed, 222 insertions, 205 deletions
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 82c8d1c..f1e4e00 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -60,7 +60,7 @@ static int test_VLof_atomic(void)
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -69,15 +69,15 @@ static int test_VLof_atomic(void)
TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(unsigned int));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++)
- ((unsigned int *)writeBuf[ii].p)[jj] = ii * 10 + jj;
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++)
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
@@ -119,12 +119,12 @@ static int test_VLof_atomic(void)
if (ret < 0)
goto error;
- for (ii = 0; ii < NRECORDS; ii++)
- for (jj=0; jj<(ii+1); jj++)
+ for (uu = 0; uu < NRECORDS; uu++)
+ for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[ii].p)[jj] != ((unsigned int *)writeBuf[ii].p)[jj]) {
- printf("Packet %d's value should be %d\n", ii, ((unsigned int *)writeBuf[ii].p)[jj]);
- printf("Packet %d's value in readBuf is %d\n", ii, ((unsigned int *)readBuf[ii].p)[jj]);
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -168,7 +168,7 @@ static int test_VLof_comptype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
} VLcomp_t;
hid_t fid=H5I_INVALID_HID; /* Test file identifier */
@@ -178,23 +178,23 @@ static int test_VLof_comptype(void)
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret;
TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(VLcomp_t));
- if(writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ if(writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++) {
- ((VLcomp_t *)writeBuf[ii].p)[jj].i = ii+jj;
- ((VLcomp_t *)writeBuf[ii].p)[jj].f = (float)((ii+jj)/3.0F);
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++) {
+ ((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
+ ((VLcomp_t *)writeBuf[uu].p)[vv].f = (float)(uu + vv) / 3.0F;
} /* end for */
} /* end for */
@@ -209,7 +209,7 @@ static int test_VLof_comptype(void)
goto error;
/* Insert fields */
- ret = H5Tinsert(cmptype, "i", HOFFSET(VLcomp_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
@@ -251,15 +251,15 @@ static int test_VLof_comptype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].len != readBuf[ii].len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].len=%d, readBuf[%d].len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].len,(int)ii,(int)readBuf[ii].len);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].len != readBuf[uu].len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
continue;
} /* write len != read len */
- for (jj=0; jj<(ii+1); jj++) {
- if (((unsigned int *)writeBuf[ii].p)[jj] != ((unsigned int *)readBuf[ii].p)[jj] ) {
- fprintf(stderr, "VL data values don't match!, writeBuf[ii].p[%d]=%d, readBuf[ii].p[%d]=%d\n",(int)jj, (int)((unsigned int *)writeBuf[ii].p)[jj], (int)jj, (int)((unsigned int *)readBuf[ii].p)[jj]);
+ for (vv = 0; vv < (uu + 1); vv++) {
+ if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
+ fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
continue;
} /* write value != read value */
}
@@ -306,7 +306,7 @@ static int test_compound_VL_VLtype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
hvl_t v;
} compVLVL_t;
@@ -322,32 +322,32 @@ static int test_compound_VL_VLtype(void)
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret; /* Returned status from a callee */
TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].i = ii*10;
- writeBuf[ii].f = (float)((ii*20)/3.0F);
- writeBuf[ii].v.p = HDmalloc((ii+L1_INCM)*sizeof(hvl_t));
- if (writeBuf[ii].v.p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].u = uu * 10;
+ writeBuf[uu].f = (float)(uu * 20) / 3.0F;
+ writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ if (writeBuf[uu].v.p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].v.len=ii+L1_INCM;
- for (t1=(hvl_t *)((writeBuf[ii].v).p), jj=0; jj<(ii+L1_INCM); jj++, t1++)
+ writeBuf[uu].v.len = uu + L1_INCM;
+ for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
{
- t1->p = HDmalloc((jj+L2_INCM)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+L2_INCM;
- for (kk=0; kk<jj+L2_INCM; kk++)
- ((unsigned int*)t1->p)[kk] = ii*100 + jj*10 + kk;
+ t1->len = vv + L2_INCM;
+ for (ww = 0; ww < vv + L2_INCM; ww++)
+ ((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
}
} /* end for */
@@ -377,7 +377,7 @@ static int test_compound_VL_VLtype(void)
goto error;
/* Insert fields: atomic, atomic, vlen */
- ret = H5Tinsert(comp_vlvl, "i", HOFFSET(compVLVL_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
@@ -417,29 +417,29 @@ static int test_compound_VL_VLtype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].i != readBuf[ii].i) {
- fprintf(stderr, "Integer components don't match!, writeBuf[%d].i=%d, readBuf[%d].i=%d\n",(int)ii,(int)writeBuf[ii].i,(int)ii,(int)readBuf[ii].i);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].u != readBuf[uu].u) {
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
- if (!H5_FLT_ABS_EQUAL(writeBuf[ii].f,readBuf[ii].f)) {
- fprintf(stderr, "Float components don't match!, writeBuf[%d].f=%f, readBuf[%d].f=%f\n",(int)ii,(double)writeBuf[ii].f,(int)ii,(double)readBuf[ii].f);
+ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f,readBuf[uu].f)) {
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
- if (writeBuf[ii].v.len != readBuf[ii].v.len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%d, readBuf[%d].v.len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].v.len,(int)ii,(int)readBuf[ii].v.len);
+ if (writeBuf[uu].v.len != readBuf[uu].v.len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
- for (t1=(hvl_t *)(writeBuf[ii].v.p), t2=(hvl_t *)(readBuf[ii].v.p), jj=0; (size_t)jj<readBuf[ii].v.len; jj++, t1++, t2++) {
+ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- fprintf(stderr, "%d: VL data length don't match!, ii=%d, jj=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)ii,(int)jj,(int)t1->len,(int)t2->len);
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
- for (kk=0; (size_t)kk<t2->len; kk++) {
- if (((unsigned int *)t1->p)[kk] != ((unsigned int *)t2->p)[kk] ) {
- fprintf(stderr, "VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)kk, (int)((unsigned int *)t1->p)[kk], (int)kk, (int)((unsigned int *)t2->p)[kk]);
+ for (ww = 0; (size_t)ww < t2->len; ww++) {
+ if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -497,7 +497,7 @@ static int test_VLof_VLtype(void)
hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
hsize_t count; /* Number of records in the table */
hvl_t *t1; /* pointer to advance */
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -506,23 +506,23 @@ static int test_VLof_VLtype(void)
TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii< NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(hvl_t));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
- writeBuf[ii].len = ii+1;
- for (t1=(hvl_t *)(writeBuf[ii].p), jj=0; jj<(ii+1); jj++, t1++)
+ writeBuf[uu].len = uu + 1;
+ for (t1=(hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
{
- t1->p = HDmalloc((jj+1)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+1;
- for (kk=0; kk<(jj+1); kk++)
- ((unsigned int *)t1->p)[kk] = ii*100+jj*10+kk;
+ t1->len = vv * 1;
+ for (ww = 0; ww < (vv * 1); ww++)
+ ((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
} /* end for */
} /* end for */
@@ -958,6 +958,8 @@ static herr_t verify_accessors(const char *table_name, herr_t expected_value)
/* Check if the packet table's name matches its associated dataset's. */
*buf = '\0';
name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE);
+ if (name_size < 0)
+ goto error;
VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match");
/* Get the packet table's datatype ID */
@@ -1059,7 +1061,7 @@ static int testfl_VLof_atomic(void)
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -1068,15 +1070,15 @@ static int testfl_VLof_atomic(void)
TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(unsigned int));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++)
- ((unsigned int *)writeBuf[ii].p)[jj] = ii * 10 + jj;
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++)
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
@@ -1118,12 +1120,12 @@ static int testfl_VLof_atomic(void)
if (ret < 0)
goto error;
- for (ii = 0; ii < NRECORDS; ii++)
- for (jj=0; jj<(ii+1); jj++)
+ for (uu = 0; uu < NRECORDS; uu++)
+ for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[ii].p)[jj] != ((unsigned int *)writeBuf[ii].p)[jj]) {
- printf("Packet %d's value should be %d\n", ii, ((unsigned int *)writeBuf[ii].p)[jj]);
- printf("Packet %d's value in readBuf is %d\n", ii, ((unsigned int *)readBuf[ii].p)[jj]);
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -1167,7 +1169,7 @@ static int testfl_VLof_comptype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
} VLcomp_t;
hid_t fid=H5I_INVALID_HID; /* Test file identifier */
@@ -1177,23 +1179,23 @@ static int testfl_VLof_comptype(void)
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret;
TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(VLcomp_t));
- if(writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ if(writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++) {
- ((VLcomp_t *)writeBuf[ii].p)[jj].i = ii+jj;
- ((VLcomp_t *)writeBuf[ii].p)[jj].f = (float)((ii+jj)/3.0F);
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++) {
+ ((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
+ ((VLcomp_t *)writeBuf[uu].p)[vv].f = (float)(uu + vv) / 3.0F;
} /* end for */
} /* end for */
@@ -1208,7 +1210,7 @@ static int testfl_VLof_comptype(void)
goto error;
/* Insert fields */
- ret = H5Tinsert(cmptype, "i", HOFFSET(VLcomp_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
@@ -1250,15 +1252,15 @@ static int testfl_VLof_comptype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].len != readBuf[ii].len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].len=%d, readBuf[%d].len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].len,(int)ii,(int)readBuf[ii].len);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].len != readBuf[uu].len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
continue;
} /* write len != read len */
- for (jj=0; jj<(ii+1); jj++) {
- if (((unsigned int *)writeBuf[ii].p)[jj] != ((unsigned int *)readBuf[ii].p)[jj] ) {
- fprintf(stderr, "VL data values don't match!, writeBuf[ii].p[%d]=%d, readBuf[ii].p[%d]=%d\n",(int)jj, (int)((unsigned int *)writeBuf[ii].p)[jj], (int)jj, (int)((unsigned int *)readBuf[ii].p)[jj]);
+ for (vv = 0; vv < (uu + 1); vv++) {
+ if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
+ fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
continue;
} /* write value != read value */
}
@@ -1305,7 +1307,7 @@ static int testfl_compound_VL_VLtype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
hvl_t v;
} compVLVL_t;
@@ -1321,32 +1323,32 @@ static int testfl_compound_VL_VLtype(void)
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret; /* Returned status from a callee */
TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].i = ii*10;
- writeBuf[ii].f = (float)((ii*20)/3.0F);
- writeBuf[ii].v.p = HDmalloc((ii+L1_INCM)*sizeof(hvl_t));
- if (writeBuf[ii].v.p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].u = uu * 10;
+ writeBuf[uu].f = (float)(uu * 20) / 3.0F;
+ writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ if (writeBuf[uu].v.p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].v.len=ii+L1_INCM;
- for (t1=(hvl_t *)((writeBuf[ii].v).p), jj=0; jj<(ii+L1_INCM); jj++, t1++)
+ writeBuf[uu].v.len = uu + L1_INCM;
+ for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
{
- t1->p = HDmalloc((jj+L2_INCM)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+L2_INCM;
- for (kk=0; kk<jj+L2_INCM; kk++)
- ((unsigned int*)t1->p)[kk] = ii*100 + jj*10 + kk;
+ t1->len = vv + L2_INCM;
+ for (ww = 0; ww < vv + L2_INCM; ww++)
+ ((unsigned int*)t1->p)[ww] = uu * 100 + vv * 10 + ww;
}
} /* end for */
@@ -1376,7 +1378,7 @@ static int testfl_compound_VL_VLtype(void)
goto error;
/* Insert fields: atomic, atomic, vlen */
- ret = H5Tinsert(comp_vlvl, "i", HOFFSET(compVLVL_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
@@ -1416,29 +1418,29 @@ static int testfl_compound_VL_VLtype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].i != readBuf[ii].i) {
- fprintf(stderr, "Integer components don't match!, writeBuf[%d].i=%d, readBuf[%d].i=%d\n",(int)ii,(int)writeBuf[ii].i,(int)ii,(int)readBuf[ii].i);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].u != readBuf[uu].u) {
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
- if (!H5_FLT_ABS_EQUAL(writeBuf[ii].f,readBuf[ii].f)) {
- fprintf(stderr, "Float components don't match!, writeBuf[%d].f=%f, readBuf[%d].f=%f\n",(int)ii,(double)writeBuf[ii].f,(int)ii,(double)readBuf[ii].f);
+ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
- if (writeBuf[ii].v.len != readBuf[ii].v.len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%d, readBuf[%d].v.len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].v.len,(int)ii,(int)readBuf[ii].v.len);
+ if (writeBuf[uu].v.len != readBuf[uu].v.len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
- for (t1=(hvl_t *)(writeBuf[ii].v.p), t2=(hvl_t *)(readBuf[ii].v.p), jj=0; (size_t)jj<readBuf[ii].v.len; jj++, t1++, t2++) {
+ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- fprintf(stderr, "%d: VL data length don't match!, ii=%d, jj=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)ii,(int)jj,(int)t1->len,(int)t2->len);
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
- for (kk=0; (size_t)kk<t2->len; kk++) {
- if (((unsigned int *)t1->p)[kk] != ((unsigned int *)t2->p)[kk] ) {
- fprintf(stderr, "VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)kk, (int)((unsigned int *)t1->p)[kk], (int)kk, (int)((unsigned int *)t2->p)[kk]);
+ for (ww = 0; (size_t)ww < t2->len; ww++) {
+ if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -1496,7 +1498,7 @@ static int testfl_VLof_VLtype(void)
hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
hsize_t count; /* Number of records in the table */
hvl_t *t1; /* pointer to advance */
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -1505,23 +1507,23 @@ static int testfl_VLof_VLtype(void)
TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii< NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(hvl_t));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
- writeBuf[ii].len = ii+1;
- for (t1=(hvl_t *)(writeBuf[ii].p), jj=0; jj<(ii+1); jj++, t1++)
+ writeBuf[uu].len = uu + 1;
+ for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
{
- t1->p = HDmalloc((jj+1)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+1;
- for (kk=0; kk<(jj+1); kk++)
- ((unsigned int *)t1->p)[kk] = ii*100+jj*10+kk;
+ t1->len = vv + 1;
+ for (ww = 0; ww < (vv + 1); ww++)
+ ((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
} /* end for */
} /* end for */
diff --git a/src/H5FSstat.c b/src/H5FSstat.c
index d2c0177..3200849 100644
--- a/src/H5FSstat.c
+++ b/src/H5FSstat.c
@@ -96,7 +96,7 @@ H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *stats)
stats->serial_sect_count = frsp->serial_sect_count;
stats->ghost_sect_count = frsp->ghost_sect_count;
stats->addr = frsp->addr;
- stats->hdr_size = (size_t)H5FS_HEADER_SIZE(f);
+ stats->hdr_size = (hsize_t)H5FS_HEADER_SIZE(f);
stats->sect_addr = frsp->sect_addr;
stats->alloc_sect_size = frsp->alloc_sect_size;
stats->sect_size = frsp->sect_size;
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 9cbcdc4..064c4cb 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -128,6 +128,9 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED
H5A_t *attr = NULL;
H5S_extent_t *extent; /*extent dimensionality information */
size_t name_len; /*attribute name length */
+ size_t dt_size; /* Datatype size */
+ hssize_t sds_size; /* Signed Dataspace size */
+ hsize_t ds_size; /* Dataspace size */
unsigned flags = 0; /* Attribute flags */
H5A_t *ret_value = NULL; /* Return value */
@@ -199,7 +202,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED
/* Decode attribute's dataspace extent */
if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh,
- ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL)
+ ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace")
/* Copy the extent information to the dataspace */
@@ -217,8 +220,19 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED
else
p += attr->shared->ds_size;
+ /* Get the datatype's size */
+ if(0 == (dt_size = H5T_get_size(attr->shared->dt)))
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "unable to get datatype size")
+
+ /* Get the datatype & dataspace sizes */
+ if(0 == (dt_size = H5T_get_size(attr->shared->dt)))
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "unable to get datatype size")
+ if((sds_size = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "unable to get dataspace size")
+ ds_size = (hsize_t)sds_size;
+
/* Compute the size of the data */
- H5_CHECKED_ASSIGN(attr->shared->data_size, size_t, H5S_GET_EXTENT_NPOINTS(attr->shared->ds) * H5T_get_size(attr->shared->dt), hsize_t);
+ H5_CHECKED_ASSIGN(attr->shared->data_size, size_t, ds_size * (hsize_t)dt_size, hsize_t);
/* Go get the data */
if(attr->shared->data_size) {
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
index 81624d8..2f04295 100644
--- a/test/H5srcdir.h
+++ b/test/H5srcdir.h
@@ -31,26 +31,9 @@ static char srcdir_path[1024] = "";
/* Buffer to construct file in and return pointer to */
static char srcdir_testpath[1024] = "";
-/* Append the test file name to the srcdir path and return the whole string */
-static const char *H5_get_srcdir_filename(const char *filename)
-{
- const char *srcdir = HDgetenv("srcdir");
-
- /* Check for using the srcdir from configure time */
- if(NULL == srcdir)
- srcdir = config_srcdir;
-
- /* Build path to test file */
- if((HDstrlen(srcdir) + HDstrlen(filename) + 2) < sizeof(srcdir_testpath)) {
- HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s/%s", srcdir, filename);
- return(srcdir_testpath);
- } /* end if */
- else
- return(NULL);
-}
-
/* Just return the srcdir path */
-static const char *H5_get_srcdir(void)
+static const char *
+H5_get_srcdir(void)
{
const char *srcdir = HDgetenv("srcdir");
@@ -65,6 +48,25 @@ static const char *H5_get_srcdir(void)
} /* end if */
else
return(NULL);
-}
+} /* end H5_get_srcdir() */
+
+/* Append the test file name to the srcdir path and return the whole string */
+static const char *H5_get_srcdir_filename(const char *filename)
+{
+ const char *srcdir = H5_get_srcdir();
+
+ /* Check for error */
+ if(NULL == srcdir)
+ return(NULL);
+ else {
+ /* Build path to test file */
+ if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
+ HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
+ return(srcdir_testpath);
+ } /* end if */
+ else
+ return(NULL);
+ } /* end else */
+} /* end H5_get_srcdir_filename() */
#endif /* _H5SRCDIR_H */
diff --git a/test/tsohm.c b/test/tsohm.c
index b3ffac7..9d56fcc 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -1681,8 +1681,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
for(x = 0; x < NUM_ATTRIBUTES; ++x) {
/* Create a unique name and value for each attribute */
- attr_string1[0] = attr_name[0] = (x / 10) + '0';
- attr_string1[1] = attr_name[1] = (x % 10) + '0';
+ attr_string1[0] = attr_name[0] = (char)((x / 10) + '0');
+ attr_string1[1] = attr_name[1] = (char)((x % 10) + '0');
/* Create an attribute on the group */
attr_id = H5Acreate2(group_id, attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT);
@@ -1721,8 +1721,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
for(x=0; x<NUM_ATTRIBUTES; ++x)
{
/* Create the same name and value for each attribute as before */
- attr_string1[0] = attr_name[0] = (x / 10) + '0';
- attr_string1[1] = attr_name[1] = (x % 10) + '0';
+ attr_string1[0] = attr_name[0] = (char)((x / 10) + '0');
+ attr_string1[1] = attr_name[1] = (char)((x % 10) + '0');
/* Create an attribute on the group */
attr_id = H5Acreate2(group_id, attr_name, attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT);
@@ -1940,8 +1940,8 @@ static void size2_verify(void)
for(x = 0; x < NUM_ATTRIBUTES; ++x) {
/* Create the name and correct value for each attribute */
- attr_correct_string[0] = attr_name[0] = (x / 10) + '0';
- attr_correct_string[1] = attr_name[1] = (x % 10) + '0';
+ attr_correct_string[0] = attr_name[0] = (char)((x / 10) + '0');
+ attr_correct_string[1] = attr_name[1] = (char)((x % 10) + '0');
attr1_id = H5Aopen(group1_id, attr_name, H5P_DEFAULT);
CHECK_I(attr1_id, "H5Aopen");
@@ -2197,7 +2197,7 @@ static void test_sohm_size2(int close_reopen)
/* The files with indexes shouldn't be that much bigger than an
* empty file.
*/
- if(list_index_med.empty_size > norm_sizes.empty_size * OVERHEAD_ALLOWED)
+ if(list_index_med.empty_size > (h5_stat_size_t)((float)norm_sizes.empty_size * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
@@ -2258,7 +2258,7 @@ static void test_sohm_size2(int close_reopen)
*/
if(list_index_med.dsets2 >= btree_index.dsets2)
VERIFY(list_index_med.dsets2, 1, "h5_get_file_size");
- if(btree_index.dsets2 > list_index_small.dsets2 * OVERHEAD_ALLOWED)
+ if(btree_index.dsets2 > (h5_stat_size_t)((float)list_index_small.dsets2 * OVERHEAD_ALLOWED))
VERIFY(btree_index.dsets2, list_index_small.dsets2, "h5_get_file_size");
if(list_index_small.dsets2 >= norm_sizes.dsets2)
VERIFY(btree_index.dsets2, 1, "h5_get_file_size");
@@ -2267,7 +2267,7 @@ static void test_sohm_size2(int close_reopen)
* It seems that the small lists tends to be pretty big anyway. Allow
* for it to have twice as much overhead.
*/
- if(list_index_small.dsets2 > btree_index.dsets2 * OVERHEAD_ALLOWED * OVERHEAD_ALLOWED)
+ if(list_index_small.dsets2 > (h5_stat_size_t)((float)btree_index.dsets2 * OVERHEAD_ALLOWED * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
/* The lists should have grown the least since they share messages and
* have no extra overhead. The normal file should have grown more than
@@ -2291,7 +2291,7 @@ static void test_sohm_size2(int close_reopen)
*/
if(list_index_med.interleaved >= btree_index.interleaved)
VERIFY(0, 1, "h5_get_file_size");
- if(btree_index.interleaved > list_index_small.interleaved * OVERHEAD_ALLOWED)
+ if(btree_index.interleaved > (h5_stat_size_t)((float)list_index_small.interleaved * OVERHEAD_ALLOWED))
VERIFY(btree_index.interleaved, list_index_small.interleaved, "h5_get_file_size");
if(list_index_small.interleaved >= norm_sizes.interleaved)
VERIFY(0, 1, "h5_get_file_size");
@@ -2318,22 +2318,21 @@ static void test_sohm_size2(int close_reopen)
* that started as a B-tree.
* Add in OVERHEAD_ALLOWED as a fudge factor here, since the allocation
* of file space can be hard to predict.
-
*/
- if(btree_index.attrs1 > list_index_small.attrs1 * OVERHEAD_ALLOWED)
+ if(btree_index.attrs1 > (h5_stat_size_t)((float)list_index_small.attrs1 * OVERHEAD_ALLOWED))
VERIFY(btree_index.attrs1, list_index_small.attrs1, "h5_get_file_size");
- if(btree_index.attrs1 > list_index_med.attrs1 * OVERHEAD_ALLOWED)
+ if(btree_index.attrs1 > (h5_stat_size_t)((float)list_index_med.attrs1 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
- if(list_index_med.attrs1 > btree_index.attrs1 * OVERHEAD_ALLOWED)
+ if(list_index_med.attrs1 > (h5_stat_size_t)((float)btree_index.attrs1 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
- if(list_index_small.attrs1 > btree_index.attrs1 * OVERHEAD_ALLOWED)
+ if(list_index_small.attrs1 > (h5_stat_size_t)((float)btree_index.attrs1 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
/* Neither of the converted lists should be too much bigger than
* the index that was originally a B-tree.
*/
- if(list_index_small.attrs1 > btree_index.attrs1 * OVERHEAD_ALLOWED)
+ if(list_index_small.attrs1 > (h5_stat_size_t)((float)btree_index.attrs1 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
- if(list_index_med.attrs1 > btree_index.attrs1 * OVERHEAD_ALLOWED)
+ if(list_index_med.attrs1 > (h5_stat_size_t)((float)btree_index.attrs1 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
/* The "normal" file should have had less overhead, so should gain less
* size than any of the other indexes since none of these attribute
@@ -2349,7 +2348,7 @@ static void test_sohm_size2(int close_reopen)
/* Give it some overhead (for checkin to move messages into continuation message) */
if((list_index_small.attrs1 - list_index_small.interleaved) >
- ((btree_index.attrs1 - btree_index.interleaved) * OVERHEAD_ALLOWED))
+ (h5_stat_size_t)((float)(btree_index.attrs1 - btree_index.interleaved) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
@@ -2357,13 +2356,13 @@ static void test_sohm_size2(int close_reopen)
* of sizes. The big list index is still too big to be smaller than a
* normal file. The B-tree indexes should all be about the same size.
*/
- if(btree_index.attrs2 > list_index_small.attrs2 * OVERHEAD_ALLOWED)
+ if(btree_index.attrs2 > (h5_stat_size_t)((float)list_index_small.attrs2 * OVERHEAD_ALLOWED))
VERIFY(btree_index.attrs2, list_index_small.attrs2, "h5_get_file_size");
- if(list_index_small.attrs2 > btree_index.attrs2 * OVERHEAD_ALLOWED)
+ if(list_index_small.attrs2 > (h5_stat_size_t)((float)btree_index.attrs2 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
- if(btree_index.attrs2 > list_index_med.attrs2 * OVERHEAD_ALLOWED)
+ if(btree_index.attrs2 > (h5_stat_size_t)((float)list_index_med.attrs2 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
- if(list_index_med.attrs2 > btree_index.attrs2 * OVERHEAD_ALLOWED)
+ if(list_index_med.attrs2 > (h5_stat_size_t)((float)btree_index.attrs2 * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
if(list_index_med.attrs2 >= norm_sizes.attrs2)
VERIFY(0, 1, "h5_get_file_size");
@@ -2451,17 +2450,17 @@ static void test_sohm_size2(int close_reopen)
VERIFY((mult_index_btree.dsets1 - mult_index_btree.second_dset), (btree_index.dsets1 - btree_index.second_dset), "h5_get_file_size");
if((mult_index_med.dsets2 - mult_index_med.dsets1) >
- (list_index_med.dsets2 - list_index_med.dsets1) * OVERHEAD_ALLOWED)
+ (h5_stat_size_t)((float)(list_index_med.dsets2 - list_index_med.dsets1) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
if((mult_index_btree.dsets2 - mult_index_btree.dsets1) >
- (btree_index.dsets2 - btree_index.dsets1) * OVERHEAD_ALLOWED)
+ (h5_stat_size_t)((float)(btree_index.dsets2 - btree_index.dsets1) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
if((mult_index_med.interleaved - mult_index_med.dsets2) >
- (list_index_med.interleaved - list_index_med.dsets2) * OVERHEAD_ALLOWED)
+ (h5_stat_size_t)((float)(list_index_med.interleaved - list_index_med.dsets2) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
if((mult_index_btree.interleaved - mult_index_btree.dsets2) >
- (btree_index.interleaved - btree_index.dsets2) * OVERHEAD_ALLOWED)
+ (h5_stat_size_t)((float)(btree_index.interleaved - btree_index.dsets2) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
/* When all the attributes are added, only the index holding attributes
@@ -2470,10 +2469,10 @@ static void test_sohm_size2(int close_reopen)
* will take.
*/
if((mult_index_med.attrs2 - mult_index_med.attrs1) >
- (list_index_med.attrs2 - list_index_med.attrs1) * OVERHEAD_ALLOWED)
+ (h5_stat_size_t)((float)(list_index_med.attrs2 - list_index_med.attrs1) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
if((mult_index_btree.attrs2 - mult_index_btree.attrs1) >
- (btree_index.attrs2 - btree_index.attrs1) * OVERHEAD_ALLOWED)
+ (h5_stat_size_t)((float)(btree_index.attrs2 - btree_index.attrs1) * OVERHEAD_ALLOWED))
VERIFY(0, 1, "h5_get_file_size");
/* The final file size for both of the multiple index files should be
@@ -2483,9 +2482,9 @@ static void test_sohm_size2(int close_reopen)
VERIFY(0, 1, "h5_get_file_size");
if(mult_index_btree.attrs2 >= norm_sizes.attrs2)
VERIFY(0, 1, "h5_get_file_size");
- if(mult_index_med.attrs2 * OVERHEAD_ALLOWED < btree_index.attrs2)
+ if((h5_stat_size_t)((float)mult_index_med.attrs2 * OVERHEAD_ALLOWED) < btree_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
- if(mult_index_btree.attrs2 * OVERHEAD_ALLOWED < btree_index.attrs2)
+ if((h5_stat_size_t)((float)mult_index_btree.attrs2 * OVERHEAD_ALLOWED) < btree_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
@@ -2554,39 +2553,39 @@ static void test_sohm_size2(int close_reopen)
if(share_tiny_index.empty_size != type_space_index.empty_size)
VERIFY(share_tiny_index.empty_size, type_space_index.empty_size, "h5_get_file_size");
- if(share_tiny_index.first_dset >= type_space_index.first_dset * OVERHEAD_ALLOWED)
+ if(share_tiny_index.first_dset >= (h5_stat_size_t)((float)type_space_index.first_dset * OVERHEAD_ALLOWED))
VERIFY(share_tiny_index.first_dset, type_space_index.first_dset, "h5_get_file_size");
if(share_tiny_index.first_dset < type_space_index.first_dset)
VERIFY(0, 1, "h5_get_file_size");
if(share_tiny_index.second_dset >= type_space_index.second_dset)
VERIFY(share_tiny_index.second_dset, type_space_index.second_dset, "h5_get_file_size");
- if(share_tiny_index.second_dset * OVERHEAD_ALLOWED < type_space_index.second_dset)
+ if((h5_stat_size_t)((float)share_tiny_index.second_dset * OVERHEAD_ALLOWED) < type_space_index.second_dset)
VERIFY(0, 1, "h5_get_file_size");
if(share_tiny_index.dsets1 >= type_space_index.dsets1)
VERIFY(0, 1, "h5_get_file_size");
- if(share_tiny_index.dsets1 * OVERHEAD_ALLOWED < type_space_index.dsets1)
+ if((h5_stat_size_t)((float)share_tiny_index.dsets1 * OVERHEAD_ALLOWED) < type_space_index.dsets1)
VERIFY(0, 1, "h5_get_file_size");
if(share_tiny_index.dsets2 >= type_space_index.dsets2)
VERIFY(0, 1, "h5_get_file_size");
- if(share_tiny_index.dsets2 * OVERHEAD_ALLOWED < type_space_index.dsets2)
+ if((h5_stat_size_t)((float)share_tiny_index.dsets2 * OVERHEAD_ALLOWED) < type_space_index.dsets2)
VERIFY(0, 1, "h5_get_file_size");
if(share_tiny_index.interleaved >= type_space_index.interleaved)
VERIFY(0, 1, "h5_get_file_size");
- if(share_tiny_index.interleaved * OVERHEAD_ALLOWED < type_space_index.interleaved)
+ if((h5_stat_size_t)((float)share_tiny_index.interleaved * OVERHEAD_ALLOWED) < type_space_index.interleaved)
VERIFY(0, 1, "h5_get_file_size");
if(share_tiny_index.attrs1 >= type_space_index.attrs1)
VERIFY(0, 1, "h5_get_file_size");
- if(share_tiny_index.attrs1 * OVERHEAD_ALLOWED < type_space_index.attrs1)
+ if((h5_stat_size_t)((float)share_tiny_index.attrs1 * OVERHEAD_ALLOWED) < type_space_index.attrs1)
VERIFY(0, 1, "h5_get_file_size");
if(share_tiny_index.attrs2 >= type_space_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
- if(share_tiny_index.attrs2 * OVERHEAD_ALLOWED < type_space_index.attrs2)
+ if((h5_stat_size_t)((float)share_tiny_index.attrs2 * OVERHEAD_ALLOWED) < type_space_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
} /* end test_sohm_size2() */
@@ -2616,7 +2615,7 @@ static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id,
CHECK_I(dset_id, "H5Dcreate2");
/* Write data to dataset */
- wdata = x + 'a';
+ wdata = (char)(x + 'a');
ret = H5Dwrite(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &wdata);
CHECK_I(ret, "H5Dwrite");
@@ -2764,9 +2763,9 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id)
deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* The two filesizes should be almost the same */
- if(norm_filesize > deleted_filesize * OVERHEAD_ALLOWED)
+ if(norm_filesize > (h5_stat_size_t)((float)deleted_filesize * OVERHEAD_ALLOWED))
VERIFY(norm_filesize, deleted_filesize, "h5_get_file_size");
- if(deleted_filesize > norm_filesize * OVERHEAD_ALLOWED)
+ if(deleted_filesize > (h5_stat_size_t)((float)norm_filesize * OVERHEAD_ALLOWED))
VERIFY(deleted_filesize, norm_filesize, "h5_get_file_size");
}
@@ -3887,8 +3886,8 @@ test_sohm_external_dtype(void)
orig = (s1_t*)HDmalloc(NX * NY * sizeof(s1_t));
for(i=0; i<NX*NY; i++) {
s_ptr = (s1_t*)orig + i;
- s_ptr->a = i*3 + 1;
- s_ptr->b = i*3 + 2;
+ s_ptr->a = (int)(i * 3 + 1);
+ s_ptr->b = (int)(i * 3 + 2);
}
/* Write the data to the dataset1 */