diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2023-09-08 23:06:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 23:06:23 (GMT) |
commit | 117d579c326f64d09d71e28cb0135bbd16a5232e (patch) | |
tree | 384ac7e1e3b9881e6d6ab783ee0391ab7adc1f29 /test/external_env.c | |
parent | 2345f901b26277f643dd91a528e4da975f4e75c1 (diff) | |
download | hdf5-117d579c326f64d09d71e28cb0135bbd16a5232e.zip hdf5-117d579c326f64d09d71e28cb0135bbd16a5232e.tar.gz hdf5-117d579c326f64d09d71e28cb0135bbd16a5232e.tar.bz2 |
Consistent initialization of hid_t in the tests (#3521)
Diffstat (limited to 'test/external_env.c')
-rw-r--r-- | test/external_env.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/test/external_env.c b/test/external_env.c index a7484a8..6067326 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -38,17 +38,17 @@ static const char *EXT_ENV_FNAME[] = {"extern_env_dir/env_file_1", NULL}; static int test_path_env(hid_t fapl) { - hid_t file = -1; /* file to write to */ - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - hid_t dapl = -1; /* dataset access property list */ - hid_t dset = -1; /* dataset */ - size_t i; /* miscellaneous counters */ - char filename[1024]; /* file name */ - int part[PART_SIZE]; /* raw data buffer (partial) */ - int whole[TOTAL_SIZE]; /* raw data buffer (total) */ - hsize_t cur_size; /* current data space size */ - char buffer[1024]; /* buffer to read efile_prefix */ + hid_t file = H5I_INVALID_HID; /* file to write to */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* data space */ + hid_t dapl = H5I_INVALID_HID; /* dataset access property list */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + size_t i; /* miscellaneous counters */ + char filename[1024]; /* file name */ + int part[PART_SIZE]; /* raw data buffer (partial) */ + int whole[TOTAL_SIZE]; /* raw data buffer (total) */ + hsize_t cur_size; /* current data space size */ + char buffer[1024]; /* buffer to read efile_prefix */ TESTING("prefix in HDF5_EXTFILE_PREFIX"); @@ -137,12 +137,12 @@ error: int main(void) { - hid_t fapl_id_old = -1; /* file access properties (old format) */ - hid_t fapl_id_new = -1; /* file access properties (new format) */ - hid_t fid = -1; /* file for test_1* functions */ - hid_t gid = -1; /* group to emit diagnostics */ - unsigned latest_format; /* default or latest file format */ - int nerrors = 0; /* number of errors */ + hid_t fapl_id_old = H5I_INVALID_HID; /* file access properties (old format) */ + hid_t fapl_id_new = H5I_INVALID_HID; /* file access properties (new format) */ + hid_t fid = H5I_INVALID_HID; /* file for test_1* functions */ + hid_t gid = H5I_INVALID_HID; /* group to emit diagnostics */ + unsigned latest_format; /* default or latest file format */ + int nerrors = 0; /* number of errors */ h5_reset(); @@ -157,7 +157,7 @@ main(void) /* Test with old & new format groups */ for (latest_format = false; latest_format <= true; latest_format++) { - hid_t current_fapl_id = -1; + hid_t current_fapl_id = H5I_INVALID_HID; /* Set the fapl for different file formats */ if (latest_format) { |