summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2019-09-28 21:05:51 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2019-09-28 21:05:51 (GMT)
commit59aa3afade89e18b7a3d3631cea46e2022a49e7e (patch)
treef1c8f69e5ac0666d999ff4d9c8294f7e3468c287
parent4de1fa88c258223fdb031e1bb1179785ecfcc166 (diff)
downloadhdf5-59aa3afade89e18b7a3d3631cea46e2022a49e7e.zip
hdf5-59aa3afade89e18b7a3d3631cea46e2022a49e7e.tar.gz
hdf5-59aa3afade89e18b7a3d3631cea46e2022a49e7e.tar.bz2
fix declaring variable in for statement
-rw-r--r--test/external.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/external.c b/test/external.c
index e2565de..4dc314a 100644
--- a/test/external.c
+++ b/test/external.c
@@ -447,13 +447,14 @@ test_unlimited(hid_t file)
static int
test_multiple_files(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* dataspace */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1] = {100}; /* data space current size */
- hsize_t max_size[1] = {100}; /* data space maximum size */
- hsize_t max_ext_size; /* maximum size of external files */
- unsigned n_external_files = 4;
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* dataspace */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ hsize_t max_ext_size; /* maximum size of external files */
+ unsigned int n_external_files = 4;
+ unsigned int i = 0;
TESTING("multiple external files");
@@ -462,7 +463,7 @@ test_multiple_files(hid_t file)
max_ext_size = (hsize_t)(sizeof(int) * max_size[0] / n_external_files);
- for (unsigned i = 0; i < n_external_files; i++) {
+ for (i = 0; i < n_external_files; i++) {
char exname[9] = "";
HDsnprintf(exname, 9, "ext%d.data", i+1);
if (H5Pset_external(dcpl, exname, (off_t)0, max_ext_size) < 0) {
@@ -490,7 +491,7 @@ test_multiple_files(hid_t file)
max_ext_size -= 1;
- for (unsigned i = 0; i < n_external_files; i++) {
+ for (i = 0; i < n_external_files; i++) {
char exname[9] = "";
HDsnprintf(exname, 9, "ext%d.data", i+1);
if (H5Pset_external(dcpl, exname, (off_t)0, max_ext_size) < 0) {