summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-12 14:04:44 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-12 14:04:44 (GMT)
commitc7a1245a19ef45cee0f2dbcc16fa10cca630bb62 (patch)
treebef6987476e2b170dcb3bfded2dd52be39a9393d
parentbaf67cd13f107e0728a57c1cb3005e9252c530a6 (diff)
downloadhdf5-c7a1245a19ef45cee0f2dbcc16fa10cca630bb62.zip
hdf5-c7a1245a19ef45cee0f2dbcc16fa10cca630bb62.tar.gz
hdf5-c7a1245a19ef45cee0f2dbcc16fa10cca630bb62.tar.bz2
Fix VS2012,2008 declaration statements
-rw-r--r--tools/h5dump/h5dumpgentest.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index f55b3fd..a2f4036 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -9811,9 +9811,16 @@ static void gent_compound_complex2(void)
compound buf[F82_DIM32]; /* compound */
- hid_t file, grp=-1, type=-1, space=-1, dset=-1;
- hid_t dset_array_a, dset_array_b, dset_array_c;
- hid_t cmpd_tid1, cmpd_tid2, cmpd_tid3;
+ hid_t file = -1,
+ type = -1,
+ space = -1,
+ dset = -1;
+ hid_t dset_array_a,
+ dset_array_b,
+ dset_array_c;
+ hid_t cmpd_tid1 = -1,
+ cmpd_tid2 = -1,
+ cmpd_tid3 = -1;
size_t i;
size_t j, k;
unsigned dset_array_ndims;
@@ -9825,6 +9832,10 @@ static void gent_compound_complex2(void)
if ((space = H5Screate_simple(F82_RANK, &nelmts, NULL)) >= 0) {
/* CompoundComplex1D */
if ((type = H5Tcreate(H5T_COMPOUND, sizeof(compound))) >= 0) {
+ hid_t str_type, array;
+ hsize_t dims[1];
+ hid_t nest1, nest2;
+
/* Insert top-level array members */
dset_array_ndims = 1; dset_array_a_dims[0] = 4;
dset_array_a = H5Tarray_create2(H5T_STD_U32LE, dset_array_ndims, dset_array_a_dims);
@@ -9842,8 +9853,6 @@ static void gent_compound_complex2(void)
H5Tclose(dset_array_c);
/* Insert first nested compound */
- hid_t str_type, array;
- hsize_t dims[1];
cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(nested_compound));
H5Tinsert(cmpd_tid1, "nested_double", HOFFSET(nested_compound, nested_a), H5T_IEEE_F64LE);
@@ -9865,7 +9874,6 @@ static void gent_compound_complex2(void)
H5Tinsert(type, "nested_compound", HOFFSET(compound, d), cmpd_tid1);
/* Insert second nested compound */
- hid_t nest1, nest2;
cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(multiple_nested_compound));
H5Tinsert(cmpd_tid2, "nested_float", HOFFSET(multiple_nested_compound, a), H5T_IEEE_F32LE);
@@ -9955,10 +9963,10 @@ static void gent_compound_complex2(void)
/* Set up first nested compound */
buf[i].d.nested_a = (double) i;
- strcpy(buf[i].d.nested_string, "This is a test string.");
+ HDstrcpy(buf[i].d.nested_string, "This is a test string.");
for (j = 0; j < 4; j++)
- strcpy(buf[i].d.nested_string_array[j], "String test");
+ HDstrcpy(buf[i].d.nested_string_array[j], "String test");
/* Set up multiple nested compound */
buf[i].e.a = (float) i;
@@ -9970,9 +9978,9 @@ static void gent_compound_complex2(void)
buf[i].e.b.multiple_nested_d[j] = (long)(j - i*10);
}
- strcpy(buf[i].e.c.further_nested_string, "1234567890");
+ HDstrcpy(buf[i].e.c.further_nested_string, "1234567890");
for (j = 0; j < 4; j++)
- strcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY");
+ HDstrcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY");
for (j = 0; j < 10; j++) {
buf[i].e.c.deep_nest.deep_nested_short[j] = (short)(j + i*10);
@@ -9984,7 +9992,7 @@ static void gent_compound_complex2(void)
}
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- fprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n");
+ HDfprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n");
H5Dclose(dset);
}