From 7edb4e04b5c06789067d3e93452e7323f1339197 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 8 Sep 2023 18:06:23 -0500 Subject: [PATCH] Consistent initialization of hid_t in the tests (#3521) --- test/accum.c | 10 +- test/big.c | 17 +- test/btree2.c | 938 +++++++++++++-------------- test/cache.c | 8 +- test/cache_api.c | 39 +- test/cache_image.c | 58 +- test/cache_logging.c | 6 +- test/cache_tagging.c | 408 ++++++------ test/cmpd_dset.c | 8 +- test/cross_read.c | 22 +- test/del_many_dense_attrs.c | 22 +- test/direct_chunk.c | 73 ++- test/dsets.c | 487 +++++++------- test/dt_arith.c | 8 +- test/dtransform.c | 32 +- test/dtypes.c | 178 ++--- test/earray.c | 116 ++-- test/enc_dec_plist.c | 44 +- test/error_test.c | 38 +- test/evict_on_close.c | 68 +- test/external.c | 226 +++---- test/external_env.c | 36 +- test/farray.c | 90 +-- test/fheap.c | 212 +++--- test/file_image.c | 26 +- test/filenotclosed.c | 10 +- test/fillval.c | 55 +- test/filter_fail.c | 16 +- test/filter_plugin.c | 54 +- test/flush1.c | 38 +- test/flush2.c | 36 +- test/flushrefresh.c | 2 +- test/freespace.c | 22 +- test/gen_bad_offset.c | 8 +- test/gen_bad_ohdr.c | 12 +- test/gen_bogus.c | 12 +- test/gen_bounds.c | 58 +- test/gen_cross.c | 52 +- test/gen_deflate.c | 2 +- test/gen_file_image.c | 2 +- test/gen_filespace.c | 18 +- test/gen_filters.c | 24 +- test/gen_new_fill.c | 3 +- test/gen_new_group.c | 12 +- test/gen_old_group.c | 4 +- test/gen_udlinks.c | 6 +- test/genall5.c | 96 +-- test/getname.c | 2 +- test/h5test.c | 4 +- test/hdfs.c | 24 +- test/istore.c | 2 +- test/lheap.c | 4 +- test/links.c | 1218 ++++++++++++++++++----------------- test/links_env.c | 6 +- test/mdset.c | 2 +- test/mf.c | 208 +++--- test/mount.c | 213 +++--- test/ntypes.c | 121 ++-- test/objcopy.c | 1123 ++++++++++++++++---------------- test/objcopy_ref.c | 95 +-- test/ohdr.c | 134 ++-- test/onion.c | 2 +- test/page_buffer.c | 72 +-- test/reserved.c | 13 +- test/ros3.c | 26 +- test/set_extent.c | 72 +-- test/stab.c | 92 +-- test/swmr.c | 243 +++---- test/swmr_reader.c | 2 +- test/swmr_remove_reader.c | 2 +- test/swmr_sparse_reader.c | 2 +- test/tattr.c | 52 +- test/tfile.c | 132 ++-- test/th5o.c | 22 +- test/th5s.c | 47 +- test/tid.c | 4 +- test/titerate.c | 10 +- test/tmisc.c | 82 +-- test/trefer.c | 22 +- test/trefer_deprec.c | 92 +-- test/tselect.c | 10 +- test/tsohm.c | 96 +-- test/tunicode.c | 2 +- test/tvltypes.c | 50 +- test/unlink.c | 97 +-- test/use_append_chunk.c | 4 +- test/use_append_mchunks.c | 4 +- test/vds.c | 280 ++++---- test/vds_env.c | 30 +- test/vds_swmr_gen.c | 14 +- test/vds_swmr_reader.c | 10 +- test/vds_swmr_writer.c | 10 +- test/vfd.c | 233 +++---- testpar/t_2Gio.c | 38 +- testpar/t_bigio.c | 10 +- testpar/t_cache.c | 16 +- testpar/t_cache_image.c | 50 +- testpar/t_dset.c | 36 +- testpar/t_file.c | 2 +- testpar/t_file_image.c | 8 +- testpar/t_mdset.c | 12 +- testpar/t_pmulti_dset.c | 6 +- testpar/t_pread.c | 30 +- testpar/t_shapesame.c | 74 +-- testpar/t_vfd.c | 80 +-- testpar/testphdf5.c | 2 +- 106 files changed, 4571 insertions(+), 4490 deletions(-) diff --git a/test/accum.c b/test/accum.c index 70b99c611c0..8b8e2796791 100644 --- a/test/accum.c +++ b/test/accum.c @@ -82,8 +82,8 @@ main(void) { unsigned nerrors = 0; /* track errors */ bool api_ctx_pushed = false; /* Whether API context pushed */ - hid_t fid = -1; - hid_t fapl = -1; /* File access property list */ + hid_t fid = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; /* File access property list */ char filename[1024]; H5F_t *f = NULL; /* File for all tests */ @@ -2050,9 +2050,9 @@ unsigned test_swmr_write_big(bool newest_format) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - H5F_t *rf = NULL; /* File pointer */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + H5F_t *rf = NULL; /* File pointer */ char filename[1024]; uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */ uint8_t wbuf[1024]; /* Buffer for reading & writing */ diff --git a/test/big.c b/test/big.c index 4c4d31cf5c7..748521ef420 100644 --- a/test/big.c +++ b/test/big.c @@ -306,11 +306,12 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) hsize_t size2[1] = {8LL * 1024LL * 1024LL * 1024LL}; hsize_t hs_start[1]; hsize_t hs_size[1]; - hid_t file = -1, space1 = -1, space2 = -1, mem_space = -1, d1 = -1, d2 = -1; - int *buf = (int *)malloc(sizeof(int) * WRT_SIZE); - int i, j; - FILE *out = fopen(DNAME, "w"); - hid_t dcpl; + hid_t file = H5I_INVALID_HID, space1 = H5I_INVALID_HID, space2 = H5I_INVALID_HID, + mem_space = H5I_INVALID_HID, d1 = H5I_INVALID_HID, d2 = H5I_INVALID_HID; + int *buf = (int *)malloc(sizeof(int) * WRT_SIZE); + int i, j; + FILE *out = fopen(DNAME, "w"); + hid_t dcpl; switch (testsize) { case LFILE: @@ -449,7 +450,7 @@ static int reader(char *filename, hid_t fapl) { FILE *script = NULL; - hid_t file = -1, mspace = -1, fspace = -1, d2 = -1; + hid_t file = H5I_INVALID_HID, mspace = H5I_INVALID_HID, fspace = H5I_INVALID_HID, d2 = H5I_INVALID_HID; char ln[128], *s; hsize_t hs_offset[1]; hsize_t hs_size[1] = {WRT_SIZE}; @@ -705,8 +706,8 @@ int main(int ac, char **av) { unsigned long seed = 0; /* Random # seed */ - hid_t fapl = -1; - hid_t driver = -1; + hid_t fapl = H5I_INVALID_HID; + hid_t driver = H5I_INVALID_HID; /* parameters setup */ diff --git a/test/btree2.c b/test/btree2.c index d8e97c46b7e..a167c2dafbe 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -561,14 +561,14 @@ remove_cb(const void *_record, void *_op_data) static unsigned test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t idx; /* Index within B-tree, for iterator */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t idx; /* Index within B-tree, for iterator */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* * Test v2 B-tree creation @@ -799,16 +799,16 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ static unsigned test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t idx; /* Index within B-tree, for iterator */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t idx; /* Index within B-tree, for iterator */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* * Test inserting enough records into v2 B-tree to split the root node @@ -982,13 +982,13 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p static unsigned test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -1132,13 +1132,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons static unsigned test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -1290,14 +1290,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2 static unsigned test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -1429,14 +1429,14 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons static unsigned test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -1544,16 +1544,16 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const b static unsigned test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* * Test inserting many records into v2 B-tree @@ -1736,14 +1736,14 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_ static unsigned test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -1961,14 +1961,14 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const static unsigned test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -2192,14 +2192,14 @@ static unsigned test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -2360,14 +2360,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, static unsigned test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -2536,14 +2536,14 @@ static unsigned test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -2710,14 +2710,14 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, static unsigned test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -2885,22 +2885,22 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, cons static unsigned test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[1024]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t idx; /* Index within B-tree, for iterator */ - time_t curr_time; /* Current time, for seeding random number generator */ - hsize_t *records; /* Record #'s for random insertion */ - unsigned u; /* Local index variable */ - unsigned swap_idx; /* Location to swap with when shuffling */ - hsize_t temp_rec; /* Temporary record */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t nrec; /* Number of records in B-tree */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t idx; /* Index within B-tree, for iterator */ + time_t curr_time; /* Current time, for seeding random number generator */ + hsize_t *records; /* Record #'s for random insertion */ + unsigned u; /* Local index variable */ + unsigned swap_idx; /* Location to swap with when shuffling */ + hsize_t temp_rec; /* Temporary record */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t nrec; /* Number of records in B-tree */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* Initialize random number seed */ curr_time = HDtime(NULL); @@ -3125,15 +3125,15 @@ fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); static unsigned test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_test_rec_t modify; /* Modified value */ - H5B2_test_rec_t find; /* Record to find */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_test_rec_t modify; /* Modified value */ + H5B2_test_rec_t find; /* Record to find */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* Create the file for the test */ if (create_file(&file, &f, fapl) < 0) @@ -3532,18 +3532,18 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ static unsigned test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_test_rec_t modify; /* Modified value */ - H5B2_test_rec_t find; /* Record to find */ - H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_test_rec_t modify; /* Modified value */ + H5B2_test_rec_t find; /* Record to find */ + H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* * Test inserting enough records into v2 B-tree to split the root node @@ -3791,13 +3791,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_p static unsigned test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -3945,13 +3945,13 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons static unsigned test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -4107,14 +4107,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, const bt2 static unsigned test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -4250,14 +4250,14 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, cons static unsigned test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ + unsigned u; /* Local index variable */ /* * Test inserting many records into v2 B-tree @@ -4368,17 +4368,17 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, const b static unsigned test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_test_rec_t find; /* Record to find */ - H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_test_rec_t find; /* Record to find */ + H5B2_test_rec_t idx; /* Index within B-tree, for iterator */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* * Test inserting many records into v2 B-tree @@ -4956,21 +4956,21 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_ static unsigned test_update_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - time_t curr_time; /* Current time, for seeding random number generator */ - H5B2_test_rec_t *records; /* Record #'s for random insertion */ - H5B2_test_rec_t record; /* Record to insert into tree */ - H5B2_test_rec_t modify; /* Modified value */ - H5B2_test_rec_t find; /* Record to find */ - H5B2_test_rec_t iter; /* Index within B-tree, for iterator */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - hsize_t nrec; /* Number of records in B-tree */ - unsigned u; /* Local index variable */ - bool found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + time_t curr_time; /* Current time, for seeding random number generator */ + H5B2_test_rec_t *records; /* Record #'s for random insertion */ + H5B2_test_rec_t record; /* Record to insert into tree */ + H5B2_test_rec_t modify; /* Modified value */ + H5B2_test_rec_t find; /* Record to find */ + H5B2_test_rec_t iter; /* Index within B-tree, for iterator */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hsize_t nrec; /* Number of records in B-tree */ + unsigned u; /* Local index variable */ + bool found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* Initialize random number seed */ curr_time = HDtime(NULL); @@ -5205,15 +5205,15 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); static unsigned test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + herr_t ret; /* Generic error return value */ /* Record removal tests */ TESTING("B-tree remove: record from empty B-tree"); @@ -5515,16 +5515,16 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_ static unsigned test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic error return value */ /* B-tree record removal tests */ TESTING("B-tree remove: non-existent record from level-1 B-tree"); @@ -5736,15 +5736,15 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt static unsigned test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + unsigned u; /* Local index variable */ /* More complex record removals */ TESTING("B-tree remove: redistribute 2 leaves in level-1 B-tree (r->l)"); @@ -5929,16 +5929,16 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_ static unsigned test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (r->l)"); @@ -6104,16 +6104,16 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt static unsigned test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: merge 3 leaves to 2 in level-1 B-tree"); @@ -6226,16 +6226,16 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt static unsigned test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from right leaf of level-1 B-tree"); @@ -6450,16 +6450,16 @@ static unsigned test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2 node redistrib"); @@ -6595,16 +6595,16 @@ static unsigned test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3 node redistrib"); @@ -6740,16 +6740,16 @@ static unsigned test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2->1 merge"); @@ -6882,16 +6882,16 @@ static unsigned test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3->2 merge"); @@ -7023,16 +7023,16 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, static unsigned test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: collapse level-1 B-tree back to level-0"); @@ -7158,16 +7158,16 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, const bt2_t static unsigned test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from right internal of level-2 B-tree"); @@ -7441,16 +7441,16 @@ static unsigned test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib"); @@ -7589,16 +7589,16 @@ static unsigned test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from left internal of level-2 B-tree w/redistrib"); @@ -7737,16 +7737,16 @@ static unsigned test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from right internal of level-2 B-tree w/merge"); @@ -7886,16 +7886,16 @@ static unsigned test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: promote from middle internal of level-2 B-tree w/merge"); @@ -8035,16 +8035,16 @@ static unsigned test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (l->r)"); @@ -8158,16 +8158,16 @@ static unsigned test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (r->l)"); @@ -8280,16 +8280,16 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam static unsigned test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: merge 3 internal nodes to 2 in level-2 B-tree"); @@ -8403,17 +8403,17 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, cons static unsigned test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - hsize_t nrec; /* Number of records in B-tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + hsize_t nrec; /* Number of records in B-tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ TESTING("B-tree remove: collapse level-2 B-tree back to level-1 (r->l)"); @@ -8526,12 +8526,12 @@ static unsigned gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, haddr_t *bt2_addr, const hsize_t *records) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - hsize_t record; /* Record to insert into tree */ - unsigned u; /* Local index variable */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + hsize_t record; /* Record to insert into tree */ + unsigned u; /* Local index variable */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ /* Create the file to work on */ if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) @@ -8600,23 +8600,23 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, had static unsigned test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cparam) { - hid_t file = -1; /* File ID */ - char filename[1024]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - int fd = -1; /* File descriptor */ - h5_stat_t sb; /* Stat buffer for file */ - void *file_data = NULL; /* Copy of file data */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t rrecord; /* Record to remove from tree */ - haddr_t root_addr; /* Address of root of B-tree created */ - time_t curr_time; /* Current time, for seeding random number generator */ - hsize_t *records; /* Record #'s for random insertion */ - unsigned u; /* Local index variable */ - unsigned rem_idx; /* Location to remove */ - hsize_t nrec; /* Number of records in B-tree */ - bool single_file_vfd; /* Whether VFD used stores data in a single file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + int fd = -1; /* File descriptor */ + h5_stat_t sb; /* Stat buffer for file */ + void *file_data = NULL; /* Copy of file data */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t rrecord; /* Record to remove from tree */ + haddr_t root_addr; /* Address of root of B-tree created */ + time_t curr_time; /* Current time, for seeding random number generator */ + hsize_t *records; /* Record #'s for random insertion */ + unsigned u; /* Local index variable */ + unsigned rem_idx; /* Location to remove */ + hsize_t nrec; /* Number of records in B-tree */ + bool single_file_vfd; /* Whether VFD used stores data in a single file */ /* Initialize random number seed */ curr_time = HDtime(NULL); @@ -9039,16 +9039,16 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); static unsigned test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t search; /* Search value */ - hsize_t *records; /* Record #'s for random insertion */ - unsigned u; /* Local index variable */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t search; /* Search value */ + hsize_t *records; /* Record #'s for random insertion */ + unsigned u; /* Local index variable */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + herr_t ret; /* Generic error return value */ /* Allocate space for the records */ if (NULL == (records = (hsize_t *)malloc(sizeof(hsize_t) * FIND_NEIGHBOR))) @@ -9261,16 +9261,16 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param static unsigned test_delete(hid_t fapl, const H5B2_create_t *cparam) { - hid_t file = -1; /* File ID */ - char filename[1024]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t empty_size; /* Size of an empty file */ - h5_stat_size_t file_size; /* Size of each file created */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - unsigned u; /* Local index variable */ + hid_t file = H5I_INVALID_HID; /* File ID */ + char filename[1024]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t empty_size; /* Size of an empty file */ + h5_stat_size_t file_size; /* Size of each file created */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + unsigned u; /* Local index variable */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -9530,18 +9530,18 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) static unsigned test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ - hsize_t record; /* Record to insert into tree */ - hsize_t modify; /* Modified value */ - hsize_t found; /* Found value */ - H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ - H5B2_node_info_test_t ninfo; /* B-tree node info */ - unsigned u; /* Local index variable */ - bool rec_found; /* Whether record was found */ - herr_t ret; /* Generic error return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ + hsize_t record; /* Record to insert into tree */ + hsize_t modify; /* Modified value */ + hsize_t found; /* Found value */ + H5B2_stat_t bt2_stat; /* Statistics about B-tree created */ + H5B2_node_info_test_t ninfo; /* B-tree node info */ + unsigned u; /* Local index variable */ + bool rec_found; /* Whether record was found */ + herr_t ret; /* Generic error return value */ /* * Test modifying records @@ -9773,17 +9773,17 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa static unsigned test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) { - char filename[1024]; /* Filename to use */ - char filename_tmp[1024]; /* Temporary file name */ - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - hid_t file0 = -1; /* File ID */ - hid_t file00 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ - H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ - H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */ - haddr_t bt2_addr; /* Address of B-tree created */ + char filename[1024]; /* Filename to use */ + char filename_tmp[1024]; /* Temporary file name */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t file2 = H5I_INVALID_HID; /* File ID */ + hid_t file0 = H5I_INVALID_HID; /* File ID */ + hid_t file00 = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ + H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ + H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */ + haddr_t bt2_addr; /* Address of B-tree created */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -9909,11 +9909,11 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) int main(void) { - H5B2_create_t cparam, cparam2; /* Creation parameters for v2 B-tree */ - bt2_test_param_t tparam; /* Test parameters for v2 B-tree */ - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ - unsigned reopen; /* Whether to reopen B-tree during tests */ + H5B2_create_t cparam, cparam2; /* Creation parameters for v2 B-tree */ + bt2_test_param_t tparam; /* Test parameters for v2 B-tree */ + hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ + unsigned reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; bool api_ctx_pushed = false; /* Whether API context pushed */ diff --git a/test/cache.c b/test/cache.c index a9d91a6eab7..c4642f7a02b 100644 --- a/test/cache.c +++ b/test/cache.c @@ -41,9 +41,9 @@ hid_t saved_fcpl_id = H5P_DEFAULT; /* store the fcpl id here between * close. */ -hid_t saved_fid = -1; /* store the file id here between cache setup - * and takedown. - */ +hid_t saved_fid = H5I_INVALID_HID; /* store the file id here between cache setup + * and takedown. + */ bool write_permitted = true; bool try_core_file_driver = false; bool core_file_driver_failed = false; @@ -33513,7 +33513,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) bool show_progress = false; bool verbose = true; int mile_stone = 1; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; H5F_t *ret_val = NULL; diff --git a/test/cache_api.c b/test/cache_api.c index e5a4af9eb1f..b2fa63ba77d 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -60,9 +60,9 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) { char filename[512]; herr_t result; - hid_t fapl_id = -1; - hid_t test_fapl_id = -1; - hid_t file_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t test_fapl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t default_config = H5AC__DEFAULT_CACHE_CONFIG; @@ -499,7 +499,7 @@ static bool check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) { char filename[512]; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; size_t max_size; size_t min_clean_size; size_t cur_size; @@ -827,12 +827,12 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) int64_t min_accesses = 1000; double min_hit_rate = 0.90; bool dump_cache_size = false; - hid_t file_id = -1; - hid_t dataspace_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dataspace_id = H5I_INVALID_HID; hid_t filespace_ids[NUM_DSETS]; - hid_t memspace_id = -1; + hid_t memspace_id = H5I_INVALID_HID; hid_t dataset_ids[NUM_DSETS]; - hid_t properties = -1; + hid_t properties = H5I_INVALID_HID; char dset_name[64]; int i, j, k, l, m, n; herr_t status; @@ -1622,7 +1622,7 @@ check_fapl_mdc_api_errs(void) static char msg[128]; int i; herr_t result; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; H5AC_cache_config_t default_config = H5AC__DEFAULT_CACHE_CONFIG; H5AC_cache_config_t scratch; @@ -1638,7 +1638,7 @@ check_fapl_mdc_api_errs(void) H5E_BEGIN_TRY { - result = H5Pget_mdc_config((hid_t)-1, &scratch); + result = H5Pget_mdc_config((hid_t)H5I_INVALID_HID, &scratch); } H5E_END_TRY @@ -1713,7 +1713,7 @@ check_fapl_mdc_api_errs(void) H5E_BEGIN_TRY { - result = H5Pset_mdc_config((hid_t)-1, &default_config); + result = H5Pset_mdc_config((hid_t)H5I_INVALID_HID, &default_config); } H5E_END_TRY @@ -1803,7 +1803,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) bool show_progress = false; int i; herr_t result; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; size_t max_size; size_t min_clean_size; size_t cur_size; @@ -1868,7 +1868,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) H5E_BEGIN_TRY { - result = H5Fget_mdc_config((hid_t)-1, &scratch); + result = H5Fget_mdc_config((hid_t)H5I_INVALID_HID, &scratch); } H5E_END_TRY @@ -1932,7 +1932,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) H5E_BEGIN_TRY { - result = H5Fset_mdc_config((hid_t)-1, &default_config); + result = H5Fset_mdc_config((hid_t)H5I_INVALID_HID, &default_config); } H5E_END_TRY @@ -2000,7 +2000,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) H5E_BEGIN_TRY { - result = H5Fget_mdc_hit_rate((hid_t)-1, &hit_rate); + result = H5Fget_mdc_hit_rate((hid_t)H5I_INVALID_HID, &hit_rate); } H5E_END_TRY @@ -2041,7 +2041,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) H5E_BEGIN_TRY { - result = H5Freset_mdc_hit_rate_stats((hid_t)-1); + result = H5Freset_mdc_hit_rate_stats((hid_t)H5I_INVALID_HID); } H5E_END_TRY @@ -2062,7 +2062,8 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) H5E_BEGIN_TRY { - result = H5Fget_mdc_size((hid_t)-1, &max_size, &min_clean_size, &cur_size, &cur_num_entries); + result = H5Fget_mdc_size((hid_t)H5I_INVALID_HID, &max_size, &min_clean_size, &cur_size, + &cur_num_entries); } H5E_END_TRY @@ -2143,8 +2144,8 @@ main(void) { unsigned nerrs = 0; int express_test; - hid_t fcpl_id = -1; - hid_t fcpl2_id = -1; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t fcpl2_id = H5I_INVALID_HID; unsigned paged; H5open(); diff --git a/test/cache_image.c b/test/cache_image.c index 57a083494f7..89b074c65f9 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -93,11 +93,11 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) int i, j, k, l, m; int data_chunk[CHUNK_SIZE][CHUNK_SIZE]; herr_t status; - hid_t dataspace_id = -1; + hid_t dataspace_id = H5I_INVALID_HID; hid_t filespace_ids[MAX_NUM_DSETS]; - hid_t memspace_id = -1; + hid_t memspace_id = H5I_INVALID_HID; hid_t dataset_ids[MAX_NUM_DSETS]; - hid_t properties = -1; + hid_t properties = H5I_INVALID_HID; hsize_t dims[2]; hsize_t a_size[2]; hsize_t offset[2]; @@ -498,9 +498,9 @@ open_hdf5_file(bool create_file, bool mdci_sbem_expected, bool read_only, bool s bool show_progress = false; bool verbose = false; int cp = 0; - hid_t fapl_id = -1; - hid_t fcpl_id = -1; - hid_t file_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; herr_t result; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; @@ -857,8 +857,8 @@ attempt_swmr_open_hdf5_file(const bool create_file, const bool set_mdci_fapl, co const char *fcn_name = "attempt_swmr_open_hdf5_file()"; bool show_progress = false; int cp = 0; - hid_t fapl_id = -1; - hid_t file_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; herr_t result; H5AC_cache_image_config_t cache_image_config = {H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, true, false, H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE}; @@ -977,7 +977,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) int data_chunk[CHUNK_SIZE][CHUNK_SIZE]; herr_t status; hid_t filespace_ids[MAX_NUM_DSETS]; - hid_t memspace_id = -1; + hid_t memspace_id = H5I_INVALID_HID; hid_t dataset_ids[MAX_NUM_DSETS]; hsize_t dims[2]; hsize_t a_size[2]; @@ -1251,7 +1251,7 @@ check_cache_image_ctl_flow_1(bool single_file_vfd) const char *fcn_name = "check_cache_image_ctl_flow_1()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -1525,7 +1525,7 @@ check_cache_image_ctl_flow_2(bool single_file_vfd) const char *fcn_name = "check_cache_image_ctl_flow_2()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -1786,7 +1786,7 @@ check_cache_image_ctl_flow_3(bool single_file_vfd) const char *fcn_name = "check_cache_image_ctl_flow_3()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -2149,7 +2149,7 @@ check_cache_image_ctl_flow_4(bool single_file_vfd) const char *fcn_name = "check_cache_image_ctl_flow_4()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -2475,7 +2475,7 @@ check_cache_image_ctl_flow_5(bool single_file_vfd) const char *fcn_name = "check_cache_image_ctl_flow_5()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -2753,7 +2753,7 @@ check_cache_image_ctl_flow_6(bool single_file_vfd) const char *fcn_name = "check_cache_image_ctl_flow_6()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -3036,7 +3036,7 @@ cache_image_smoke_check_1(bool single_file_vfd) const char *fcn_name = "cache_image_smoke_check_1()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -3444,7 +3444,7 @@ cache_image_smoke_check_2(bool single_file_vfd) const char *fcn_name = "cache_image_smoke_check_2()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -3739,7 +3739,7 @@ cache_image_smoke_check_3(bool single_file_vfd) const char *fcn_name = "cache_image_smoke_check_3()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -4113,7 +4113,7 @@ cache_image_smoke_check_4(bool single_file_vfd) const char *fcn_name = "cache_image_smoke_check_4()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -4504,8 +4504,8 @@ cache_image_smoke_check_5(bool single_file_vfd) char filename[512]; char process_group_name[512]; bool show_progress = false; - hid_t file_id = -1; - hid_t proc_gid = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t proc_gid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -4998,7 +4998,7 @@ cache_image_smoke_check_6(bool single_file_vfd) const char *fcn_name = "cache_image_smoke_check_6()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; h5_stat_size_t file_size; @@ -5390,7 +5390,7 @@ cache_image_api_error_check_1(bool single_file_vfd) const char *fcn_name = "cache_image_api_error_check_1()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -5755,7 +5755,7 @@ cache_image_api_error_check_2(bool single_file_vfd) const char *fcn_name = "cache_image_api_error_check_2()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -6153,7 +6153,7 @@ cache_image_api_error_check_3(bool single_file_vfd) const char *fcn_name = "cache_image_api_error_check_3()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -6431,8 +6431,8 @@ cache_image_api_error_check_4(bool single_file_vfd) const char *fcn_name = "cache_image_api_error_check_4()"; char filename[512]; bool show_progress = false; - hid_t fapl_id = -1; - hid_t file_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -7000,7 +7000,7 @@ get_free_sections_test(bool single_file_vfd) const char *fcn_name = "get_free_sections_test()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; h5_stat_size_t file_size; @@ -7440,7 +7440,7 @@ evict_on_close_test(bool H5_ATTR_PARALLEL_UNUSED single_file_vfd) char filename[512]; bool show_progress = false; bool verbose = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; diff --git a/test/cache_logging.c b/test/cache_logging.c index e551e1fe5e9..7113108e150 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -32,7 +32,7 @@ static const char *FILENAME[] = {"cache_logging", NULL}; static herr_t test_logging_api(void) { - hid_t fapl = -1; + hid_t fapl = H5I_INVALID_HID; bool is_enabled; bool is_enabled_out; bool start_on_access; @@ -40,8 +40,8 @@ test_logging_api(void) char *location = NULL; size_t size; - hid_t fid = -1; - hid_t gid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; bool is_currently_logging; char group_name[12]; char filename[1024]; diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 6d4a6de1eb8..33cac8c99fe 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -416,11 +416,11 @@ static unsigned check_file_creation_tags(hid_t fcpl_id, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose test output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose test output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t sbe_tag = 0; @@ -517,13 +517,13 @@ static unsigned check_file_open_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ - haddr_t root_tag; /* Root Group Tag */ - haddr_t sbe_tag = HADDR_UNDEF; /* Sblock Extension Tag */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ + haddr_t root_tag; /* Root Group Tag */ + haddr_t sbe_tag = HADDR_UNDEF; /* Sblock Extension Tag */ /* Testing Macro */ TESTING("tag application during file open"); @@ -643,14 +643,14 @@ static unsigned check_group_creation_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ - haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */ - haddr_t g_tag; /* Group Tag */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ + haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */ + haddr_t g_tag; /* Group Tag */ /* Testing Macro */ TESTING("tag application during group creation"); @@ -763,16 +763,16 @@ static unsigned check_multi_group_creation_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - char gname[16]; /* group name buffer */ - int i = 0; /* iterator */ - hid_t fapl = -1; /* File access prop list */ - haddr_t g_tag = 0; /* Group tag value */ - haddr_t root_tag = 0; /* Root group tag value */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + char gname[16]; /* group name buffer */ + int i = 0; /* iterator */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ + haddr_t g_tag = 0; /* Group tag value */ + haddr_t root_tag = 0; /* Root group tag value */ /* Testing Macro */ TESTING("tag application during multiple group creation"); @@ -911,18 +911,18 @@ static unsigned check_link_iteration_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t sid = -1; /* Group Identifier */ - hid_t did = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t sid = H5I_INVALID_HID; /* Group Identifier */ + hid_t did = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - int i = 0; /* iterator */ - haddr_t root_tag = 0; /* Root Group Tag Value */ - char dsetname[500]; /* Name of dataset */ - H5G_info_t ginfo; /* Group Info Struct */ - hid_t fapl = -1; /* File access prop list */ - hid_t root_group = -1; /* Root Group Identifier */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + int i = 0; /* iterator */ + haddr_t root_tag = 0; /* Root Group Tag Value */ + char dsetname[500]; /* Name of dataset */ + H5G_info_t ginfo; /* Group Info Struct */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ + hid_t root_group = H5I_INVALID_HID; /* Root Group Identifier */ /* Testing Macro */ TESTING("tag application during iteration over links in a group"); @@ -1048,19 +1048,19 @@ static unsigned check_dense_attribute_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t aid = -1; /* File Identifier */ - hid_t sid = -1; /* Group Identifier */ - hid_t did = -1; /* Group Identifier */ - hid_t dcpl = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t aid = H5I_INVALID_HID; /* File Identifier */ + hid_t sid = H5I_INVALID_HID; /* Group Identifier */ + hid_t did = H5I_INVALID_HID; /* Group Identifier */ + hid_t dcpl = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - int i = 0; /* iterator */ - hid_t fapl = -1; /* File access property list */ - haddr_t d_tag = 0; /* Dataset tag value */ - haddr_t root_tag = 0; /* Root group tag value */ - char attrname[500]; /* Name of attribute */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + int i = 0; /* iterator */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + haddr_t d_tag = 0; /* Dataset tag value */ + haddr_t root_tag = 0; /* Root group tag value */ + char attrname[500]; /* Name of attribute */ /* Testing Macro */ TESTING("tag application during dense attribute manipulation"); @@ -1278,12 +1278,12 @@ static unsigned check_group_open_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -1404,15 +1404,15 @@ static unsigned check_attribute_creation_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t aid = -1; /* Attribute Identifier */ - hid_t gid = -1; /* Group Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t aid = H5I_INVALID_HID; /* Attribute Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ - haddr_t root_tag = 0; /* Root group tag */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ + haddr_t root_tag = 0; /* Root group tag */ haddr_t g_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* dimensions */ @@ -1566,14 +1566,14 @@ static unsigned check_attribute_open_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t aid = -1; /* Attribute Identifier */ - hid_t gid = -1; /* Group Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t aid = H5I_INVALID_HID; /* Attribute Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t g_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -1730,16 +1730,16 @@ static unsigned check_attribute_rename_tags(hid_t fcpl, int type) { /* Variable declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ - hid_t aid = -1; /* Attribute Identifier */ - hid_t sid = -1; /* Dataset Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ + hid_t aid = H5I_INVALID_HID; /* Attribute Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataset Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - int *data = NULL; /* data buffer */ - int i, j, k = 0; /* iterators */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + int *data = NULL; /* data buffer */ + int i, j, k = 0; /* iterators */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t g_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -1940,16 +1940,16 @@ static unsigned check_attribute_delete_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ - hid_t aid = -1; /* Attribute Identifier */ - hid_t sid = -1; /* Dataset Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ + hid_t aid = H5I_INVALID_HID; /* Attribute Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataset Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - int *data = NULL; /* data buffer */ - int i, j, k = 0; /* iterators */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + int *data = NULL; /* data buffer */ + int i, j, k = 0; /* iterators */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t g_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -2129,16 +2129,16 @@ static unsigned check_dataset_creation_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -2286,16 +2286,16 @@ static unsigned check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -2449,16 +2449,16 @@ static unsigned check_dataset_open_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -2598,16 +2598,16 @@ static unsigned check_dataset_write_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -2761,16 +2761,16 @@ static unsigned check_attribute_write_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ - hid_t aid = -1; /* Attribute Identifier */ - hid_t sid = -1; /* Dataset Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ + hid_t aid = H5I_INVALID_HID; /* Attribute Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataset Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - int *data = NULL; /* data buffer */ - int i, j, k = 0; /* iterators */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + int *data = NULL; /* data buffer */ + int i, j, k = 0; /* iterators */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t g_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -2945,16 +2945,16 @@ static unsigned check_dataset_read_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -3104,16 +3104,16 @@ static unsigned check_dataset_size_retrieval(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -3265,16 +3265,16 @@ check_dataset_extend_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */ @@ -3425,12 +3425,12 @@ static unsigned check_object_info_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; H5O_native_info_t ninfo; /* Native object info struct */ @@ -3557,12 +3557,12 @@ static unsigned check_object_copy_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t gid = -1; /* Group Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Group Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; haddr_t copy_tag; @@ -3702,17 +3702,17 @@ static unsigned check_link_removal_tags(hid_t fcpl, int type) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ - hid_t gid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ + hid_t gid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; haddr_t g_tag = 0; @@ -3888,17 +3888,17 @@ check_link_getname_tags(void) { /* Variable Declarations */ char name[500]; - hid_t fid = -1; /* File Identifier */ - hid_t did = -1; /* Dataset Identifier */ - hid_t sid = -1; /* Dataspace Identifier */ - hid_t gid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t did = H5I_INVALID_HID; /* Dataset Identifier */ + hid_t sid = H5I_INVALID_HID; /* Dataspace Identifier */ + hid_t gid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t dcpl = -1; /* dataset creation pl */ - hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation pl */ + hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; - hid_t fapl = -1; /* File access prop list */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t d_tag = 0; haddr_t g_tag = 0; @@ -4063,13 +4063,13 @@ static unsigned check_external_link_creation_tags(void) { /* Variable Declarations */ - hid_t fid = -1; /* File Identifier */ - hid_t fid2 = -1; /* File Identifier */ - hid_t gid = -1; /* Dataspace Identifier */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t fid2 = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; /* Testing Macro */ @@ -4185,16 +4185,16 @@ static unsigned check_external_link_open_tags(void) { /* Variable Declarations */ - haddr_t link_tag = 0; /* link tag */ - hid_t fid = -1; /* File Identifier */ - hid_t fid2 = -1; /* File Identifier */ - hid_t gid = -1; /* Dataspace Identifier */ - hid_t xid = -1; /* Dataspace Identifier */ + haddr_t link_tag = 0; /* link tag */ + hid_t fid = H5I_INVALID_HID; /* File Identifier */ + hid_t fid2 = H5I_INVALID_HID; /* File Identifier */ + hid_t gid = H5I_INVALID_HID; /* Dataspace Identifier */ + hid_t xid = H5I_INVALID_HID; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = false; /* verbose file output */ -#endif /* NDEBUG */ - H5O_native_info_t ninfo; /* Native object info struct */ - hid_t fapl = -1; /* File access prop list */ + int verbose = false; /* verbose file output */ +#endif /* NDEBUG */ + H5O_native_info_t ninfo; /* Native object info struct */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ haddr_t root_tag = 0; haddr_t root2_tag = 0; @@ -4357,12 +4357,12 @@ check_invalid_tag_application(void) #ifdef H5C_DO_TAGGING_SANITY_CHECKS /* Variables */ H5F_t *f = NULL; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; haddr_t addr; H5HL_t *lheap = NULL; - hid_t fapl = -1; /* File access prop list */ - bool api_ctx_pushed = false; /* Whether API context pushed */ -#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ + hid_t fapl = H5I_INVALID_HID; /* File access prop list */ + bool api_ctx_pushed = false; /* Whether API context pushed */ +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); @@ -4460,11 +4460,11 @@ int main(void) { /* Variable Declarations */ - hid_t fcpl_default = -1; /* file creation prop list */ - hid_t fcpl_shmesg_all = -1; /* file creation prop list */ - hid_t fcpl = -1; /* file creation prop list */ - unsigned nerrs = 0; /* Error Encountered */ - int test_type = 0; /* test type iterator */ + hid_t fcpl_default = H5I_INVALID_HID; /* file creation prop list */ + hid_t fcpl_shmesg_all = H5I_INVALID_HID; /* file creation prop list */ + hid_t fcpl = H5I_INVALID_HID; /* file creation prop list */ + unsigned nerrs = 0; /* Error Encountered */ + int test_type = 0; /* test type iterator */ /* Open the HDF5 Library */ H5open(); diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 997393f79d1..018fa30917f 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -1920,10 +1920,10 @@ test_pack_ooo(void) static unsigned test_ooo_order(char *filename, hid_t fapl_id) { - hid_t file = -1; /* File ID */ - hid_t dtype = -1; /* Datatype IDs */ - hid_t dtype_tmp = -1; /* Temp Datatype ID */ - H5T_t *dt = NULL; /* Datatype pointer */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t dtype = H5I_INVALID_HID; /* Datatype IDs */ + hid_t dtype_tmp = H5I_INVALID_HID; /* Temp Datatype ID */ + H5T_t *dt = NULL; /* Datatype pointer */ TESTING("that compound member insertion order is preserved"); diff --git a/test/cross_read.c b/test/cross_read.c index 8bcf25d5a14..474452f6e15 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -66,11 +66,11 @@ static const char *FILENAME[] = {"vms_data", "le_data", "be_data", NULL}; static int check_data_i(const char *dsetname, hid_t fid) { - hid_t did = -1; /* dataset ID */ - long long data_in[NX + 1][NY]; /* input buffer */ - long long data_out[NX + 1][NY]; /* output buffer */ - int i, j; /* iterators */ - int nerrors = 0; /* # errors in dataset values */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + long long data_in[NX + 1][NY]; /* input buffer */ + long long data_out[NX + 1][NY]; /* output buffer */ + int i, j; /* iterators */ + int nerrors = 0; /* # errors in dataset values */ /* Open the dataset. */ if ((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) @@ -137,11 +137,11 @@ check_data_i(const char *dsetname, hid_t fid) static int check_data_f(const char *dsetname, hid_t fid) { - hid_t did = -1; /* dataset ID */ - double data_in[NX + 1][NY]; /* input buffer */ - double data_out[NX + 1][NY]; /* output buffer */ - int i, j; /* iterators */ - int nerrors = 0; /* # of errors in dataset values */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + double data_in[NX + 1][NY]; /* input buffer */ + double data_out[NX + 1][NY]; /* output buffer */ + int i, j; /* iterators */ + int nerrors = 0; /* # of errors in dataset values */ /* Open the dataset. */ if ((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) @@ -209,7 +209,7 @@ static int check_file(char *filename) { const char *pathname = H5_get_srcdir_filename(filename); /* Corrected test file name */ - hid_t fid = -1; /* file ID */ + hid_t fid = H5I_INVALID_HID; /* file ID */ int nerrors = 0; /* # of datasets with errors */ #if !defined(H5_HAVE_FILTER_DEFLATE) || !defined(H5_HAVE_FILTER_SZIP) const char *not_supported = " filter is not enabled."; /* no filter message */ diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index 58ecb61b488..478e63ce16e 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -53,17 +53,17 @@ catch_signal(int H5_ATTR_UNUSED signo) int main(void) { - hid_t fid = -1; /* HDF5 File ID */ - hid_t gid = -1; /* Group ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t fapl = -1; /* File access property lists */ - hid_t gcpl = -1; /* Group creation property list */ - char aname[50]; /* Name of attribute */ - const char *basename = "attr"; /* Name prefix for attribute */ - char filename[100]; /* File name */ - int i; /* Local index variable */ + hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property lists */ + hid_t gcpl = H5I_INVALID_HID; /* Group creation property list */ + char aname[50]; /* Name of attribute */ + const char *basename = "attr"; /* Name prefix for attribute */ + char filename[100]; /* File name */ + int i; /* Local index variable */ /* Testing setup */ h5_reset(); diff --git a/test/direct_chunk.c b/test/direct_chunk.c index b526d6e8360..605eb2cd382 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -120,9 +120,9 @@ static const H5Z_class2_t H5Z_BOGUS2[1] = {{ static int test_direct_chunk_write(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; @@ -389,9 +389,9 @@ test_direct_chunk_overwrite_data(hid_t fid) int16_t overwrite_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; uint32_t filter_mask = 0; hid_t tid = H5T_NATIVE_UINT16; - hid_t dcpl_id = -1; - hid_t sid = -1; - hid_t did = -1; + hid_t dcpl_id = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; uint16_t fill_value = 0; hsize_t dset_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; hsize_t dset_max_dims[] = {H5S_UNLIMITED, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; @@ -490,9 +490,9 @@ test_direct_chunk_overwrite_data(hid_t fid) static int test_skip_compress_write1(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; @@ -738,9 +738,9 @@ filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, static int test_skip_compress_write2(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; @@ -944,16 +944,16 @@ test_data_conv(hid_t file) int a, c[4], e; } dst_type_t; - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; herr_t status; int i, j, n; const hsize_t four = 4; - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; hid_t array_dt; unsigned filter_mask = 0; @@ -1170,9 +1170,9 @@ test_data_conv(hid_t file) static int test_invalid_parameters(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; herr_t status; @@ -1267,14 +1267,15 @@ test_invalid_parameters(hid_t file) /* Check invalid dataset ID for H5Dwrite_chunk and H5Dread_chunk */ H5E_BEGIN_TRY { - if ((status = H5Dwrite_chunk((hid_t)-1, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) + if ((status = H5Dwrite_chunk((hid_t)H5I_INVALID_HID, dxpl, filter_mask, offset, buf_size, + direct_buf)) != FAIL) goto error; } H5E_END_TRY H5E_BEGIN_TRY { - if ((status = H5Dread_chunk((hid_t)-1, dxpl, offset, &filter_mask, direct_buf)) != FAIL) + if ((status = H5Dread_chunk((hid_t)H5I_INVALID_HID, dxpl, offset, &filter_mask, direct_buf)) != FAIL) goto error; } H5E_END_TRY @@ -1282,14 +1283,16 @@ test_invalid_parameters(hid_t file) /* Check invalid DXPL ID for H5Dwrite_chunk and H5Dread_chunk */ H5E_BEGIN_TRY { - if ((status = H5Dwrite_chunk(dataset, (hid_t)-1, filter_mask, offset, buf_size, direct_buf)) != FAIL) + if ((status = H5Dwrite_chunk(dataset, (hid_t)H5I_INVALID_HID, filter_mask, offset, buf_size, + direct_buf)) != FAIL) goto error; } H5E_END_TRY H5E_BEGIN_TRY { - if ((status = H5Dread_chunk(dataset, (hid_t)-1, offset, &filter_mask, direct_buf)) != FAIL) + if ((status = H5Dread_chunk(dataset, (hid_t)H5I_INVALID_HID, offset, &filter_mask, direct_buf)) != + FAIL) goto error; } H5E_END_TRY @@ -1414,9 +1417,9 @@ test_invalid_parameters(hid_t file) static int test_direct_chunk_read_no_cache(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1, dapl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID, dapl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; @@ -1592,9 +1595,9 @@ test_direct_chunk_read_no_cache(hid_t file) static int test_direct_chunk_read_cache(hid_t file, bool flush) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; @@ -1791,9 +1794,9 @@ test_direct_chunk_read_cache(hid_t file, bool flush) static int test_read_unfiltered_dset(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; @@ -1944,9 +1947,9 @@ test_read_unfiltered_dset(hid_t file) static int test_read_unallocated_chunk(hid_t file) { - hid_t dataspace = -1, dataset = -1; - hid_t mem_space = -1; - hid_t cparms = -1, dxpl = -1; + hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID, dxpl = H5I_INVALID_HID; hsize_t dims[2] = {NX, NY}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; diff --git a/test/dsets.c b/test/dsets.c index 3c30717b2ae..6d33845d7a4 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -531,9 +531,9 @@ test_create(hid_t file) static herr_t test_simple_io(const char *env_h5_drvr, hid_t fapl) { - char filename[FILENAME_BUF_SIZE]; - hid_t file = -1, dataset = -1, space = -1, xfer = -1; - int i, j, n; + char filename[FILENAME_BUF_SIZE]; + hid_t file = H5I_INVALID_HID, dataset = H5I_INVALID_HID, space = H5I_INVALID_HID, xfer = H5I_INVALID_HID; + int i, j, n; hsize_t dims[2]; void *tconv_buf = NULL; int f = -1; @@ -693,9 +693,9 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) static herr_t test_userblock_offset(const char *env_h5_drvr, hid_t fapl, bool new_format) { - char filename[FILENAME_BUF_SIZE]; - hid_t file = -1, fcpl = -1, dataset = -1, space = -1; - int i, j; + char filename[FILENAME_BUF_SIZE]; + hid_t file = H5I_INVALID_HID, fcpl = H5I_INVALID_HID, dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + int i, j; hsize_t dims[2]; int f = -1; haddr_t offset; @@ -836,7 +836,7 @@ test_compact_io(hid_t fapl) hid_t space = H5I_INVALID_HID; hid_t plist = H5I_INVALID_HID; - hid_t verfile = -1, new_fapl = -1; + hid_t verfile = H5I_INVALID_HID, new_fapl = H5I_INVALID_HID; hsize_t dims[2]; int wbuf[16][8], rbuf[16][8]; char filename[FILENAME_BUF_SIZE]; @@ -1053,10 +1053,10 @@ test_compact_io(hid_t fapl) static herr_t test_max_compact(hid_t fapl) { - hid_t file = -1; - hid_t dataset = -1; - hid_t space = -1; - hid_t plist = -1; + hid_t file = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t plist = H5I_INVALID_HID; hsize_t dims[1]; size_t compact_size; int *wbuf = NULL; @@ -1215,12 +1215,13 @@ test_max_compact(hid_t fapl) static herr_t test_layout_extend(hid_t fapl) { - char filename[FILENAME_BUF_SIZE]; /* File name */ - hid_t fid = -1; /* File id */ - hid_t sid_fix = -1, sid_unlim = -1; /* Dataspace id */ - hid_t dcpl_compact = -1, dcpl_contig = -1, dcpl_chunked = -1; /* Dataset creation property list id */ - hid_t did_fixed = -1, did_unlim = -1; /* Dataset id */ - hsize_t cur_size[1] = {10}; /* Current size of dataspace */ + char filename[FILENAME_BUF_SIZE]; /* File name */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t sid_fix = H5I_INVALID_HID, sid_unlim = H5I_INVALID_HID; /* Dataspace id */ + hid_t dcpl_compact = H5I_INVALID_HID, dcpl_contig = H5I_INVALID_HID, + dcpl_chunked = H5I_INVALID_HID; /* Dataset creation property list id */ + hid_t did_fixed = H5I_INVALID_HID, did_unlim = H5I_INVALID_HID; /* Dataset id */ + hsize_t cur_size[1] = {10}; /* Current size of dataspace */ hsize_t max_unlim[1] = {H5S_UNLIMITED}; /* Maximum size of dataspace (unlimited) */ hsize_t max_fix[1] = {100}; /* Maximum size of dataspace (fixed) */ hsize_t chunk_dim[1] = {10}; /* Chunk size */ @@ -1543,7 +1544,7 @@ test_tconv(hid_t file) { char *out = NULL, *in = NULL; hsize_t dims[1]; - hid_t space = -1, dataset = -1; + hid_t space = H5I_INVALID_HID, dataset = H5I_INVALID_HID; int i; if ((out = (char *)malloc((size_t)(4 * 1000 * 1000))) == NULL) @@ -2286,11 +2287,11 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, static herr_t test_filter_noencoder(const char *dset_name) { - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t test_dset_id = -1; - hid_t dcpl_id = -1; - hid_t space_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t test_dset_id = H5I_INVALID_HID; + hid_t dcpl_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; hsize_t dims = 10; herr_t err; int test_ints[10] = {12}; @@ -4265,7 +4266,7 @@ test_nbit_compound_3(hid_t file) } atomic; hid_t i_tid, str_tid, vl_str_tid, v_tid, o_tid; hid_t cmpd_tid; /* atomic compound datatype */ - hid_t dataset, space, dc, obj_ref_dataset = -1; + hid_t dataset, space, dc, obj_ref_dataset = H5I_INVALID_HID; const hsize_t size[1] = {5}; const hsize_t chunk_size[1] = {5}; atomic orig_data[5]; @@ -5622,9 +5623,9 @@ test_scaleoffset_double_2(hid_t file) static herr_t test_multiopen(hid_t file) { - hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1; - hsize_t cur_size[1] = {10}; - hsize_t tmp_size[1]; + hid_t dcpl = H5I_INVALID_HID, space = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID; + hsize_t cur_size[1] = {10}; + hsize_t tmp_size[1]; static hsize_t max_size[1] = {H5S_UNLIMITED}; TESTING("multi-open with extending"); @@ -5697,9 +5698,9 @@ test_multiopen(hid_t file) static herr_t test_types(hid_t file) { - hid_t grp = -1, type = -1, space = -1, dset = -1; - size_t i; - hsize_t nelmts; + hid_t grp = H5I_INVALID_HID, type = H5I_INVALID_HID, space = H5I_INVALID_HID, dset = H5I_INVALID_HID; + size_t i; + hsize_t nelmts; unsigned char buf[32]; TESTING("various datatypes"); @@ -6714,12 +6715,13 @@ test_set_local(hid_t fapl) static herr_t test_compare_dcpl(hid_t file) { - hid_t dsid = (-1); /* Dataset ID */ - hid_t sid = (-1); /* Dataspace ID */ - hid_t dcpl = (-1); /* Dataspace creation property list ID */ - hid_t dcpl1 = (-1), dcpl2 = (-1); /* Dataspace creation property list IDs from datasets */ - const hsize_t dims[2] = {500, 4096}; /* Dataspace dimensions */ - const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */ + hid_t dsid = (H5I_INVALID_HID); /* Dataset ID */ + hid_t sid = (H5I_INVALID_HID); /* Dataspace ID */ + hid_t dcpl = (H5I_INVALID_HID); /* Dataspace creation property list ID */ + hid_t dcpl1 = (H5I_INVALID_HID), + dcpl2 = (H5I_INVALID_HID); /* Dataspace creation property list IDs from datasets */ + const hsize_t dims[2] = {500, 4096}; /* Dataspace dimensions */ + const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */ TESTING("comparing dataset creation property lists"); @@ -6814,16 +6816,17 @@ test_compare_dcpl(hid_t file) static herr_t test_copy_dcpl(hid_t file, hid_t fapl) { - hid_t dsid1 = (-1), dsid2 = (-1); /* Dataset ID */ - hid_t new_dsid1 = (-1), new_dsid2 = (-1); /* Dataset ID */ - hid_t sid = (-1); /* Dataspace ID */ - hid_t dcpl = (-1); /* Dataset creation property list ID */ - hid_t dcpl1 = (-1), dcpl2 = (-1); /* Copies of creation property list IDs */ - hid_t dcpl1_copy = (-1), dcpl2_copy = (-1); /* Copies of creation property list IDs */ - const hsize_t dims[2] = {500, 4096}; /* Dataspace dimensions */ - const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */ + hid_t dsid1 = (H5I_INVALID_HID), dsid2 = (H5I_INVALID_HID); /* Dataset ID */ + hid_t new_dsid1 = (H5I_INVALID_HID), new_dsid2 = (H5I_INVALID_HID); /* Dataset ID */ + hid_t sid = (H5I_INVALID_HID); /* Dataspace ID */ + hid_t dcpl = (H5I_INVALID_HID); /* Dataset creation property list ID */ + hid_t dcpl1 = (H5I_INVALID_HID), dcpl2 = (H5I_INVALID_HID); /* Copies of creation property list IDs */ + hid_t dcpl1_copy = (H5I_INVALID_HID), + dcpl2_copy = (H5I_INVALID_HID); /* Copies of creation property list IDs */ + const hsize_t dims[2] = {500, 4096}; /* Dataspace dimensions */ + const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */ char filename[FILENAME_BUF_SIZE]; - hid_t new_file = (-1); + hid_t new_file = (H5I_INVALID_HID); TESTING("copying dataset creation property lists"); @@ -6972,16 +6975,16 @@ static herr_t test_filter_delete(hid_t file) { #ifdef H5_HAVE_FILTER_DEFLATE - H5Z_filter_t filtn; /* filter identification number */ - hid_t dsid = -1; /* dataset ID */ - hid_t sid = -1; /* dataspace ID */ - hid_t dcpl = -1; /* dataset creation property list ID */ - hid_t dcpl1 = -1; /* dataset creation property list ID */ - hsize_t dims[2] = {20, 20}; /* dataspace dimensions */ - hsize_t chunk_dims[2] = {10, 10}; /* chunk dimensions */ - int nfilters; /* number of filters in DCPL */ - unsigned flags; /* flags for filter */ - herr_t ret; /* generic return value */ + H5Z_filter_t filtn; /* filter identification number */ + hid_t dsid = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list ID */ + hid_t dcpl1 = H5I_INVALID_HID; /* dataset creation property list ID */ + hsize_t dims[2] = {20, 20}; /* dataspace dimensions */ + hsize_t chunk_dims[2] = {10, 10}; /* chunk dimensions */ + int nfilters; /* number of filters in DCPL */ + unsigned flags; /* flags for filter */ + herr_t ret; /* generic return value */ int i; #endif @@ -7121,16 +7124,16 @@ test_filter_delete(hid_t file) static herr_t auxread_fdata(hid_t fid, const char *name) { - hid_t dset_id = -1; /* dataset ID */ - hid_t dcpl_id = -1; /* dataset creation property list ID */ - hid_t space_id = -1; /* space ID */ - hid_t ftype_id = -1; /* file data type ID */ - hid_t mtype_id = -1; /* memory data type ID */ - size_t msize; /* memory size of memory type */ - void *buf = NULL; /* data buffer */ - hsize_t nelmts; /* number of elements in dataset */ - int rank; /* rank of dataset */ - hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */ + hid_t dset_id = H5I_INVALID_HID; /* dataset ID */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation property list ID */ + hid_t space_id = H5I_INVALID_HID; /* space ID */ + hid_t ftype_id = H5I_INVALID_HID; /* file data type ID */ + hid_t mtype_id = H5I_INVALID_HID; /* memory data type ID */ + size_t msize; /* memory size of memory type */ + void *buf = NULL; /* data buffer */ + hsize_t nelmts; /* number of elements in dataset */ + int rank; /* rank of dataset */ + hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */ int i; if ((dset_id = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) @@ -7203,10 +7206,10 @@ auxread_fdata(hid_t fid, const char *name) static herr_t test_filters_endianess(void) { - hid_t fid = -1; /* file ID */ - hid_t dsid = -1; /* dataset ID */ - hid_t sid = -1; /* dataspace ID */ - hid_t dcpl = -1; /* dataset creation property list ID */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t dsid = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list ID */ const char *data_file = H5_get_srcdir_filename("test_filters_le.h5"); /* Corrected test file name */ TESTING("filters with big-endian/little-endian data"); @@ -7277,8 +7280,8 @@ test_filters_endianess(void) static herr_t test_zero_dims(hid_t file) { - hid_t s = -1, d = -1, dcpl = -1; - hid_t s2 = -1, d2 = -1, dcpl2 = -1; + hid_t s = H5I_INVALID_HID, d = H5I_INVALID_HID, dcpl = H5I_INVALID_HID; + hid_t s2 = H5I_INVALID_HID, d2 = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID; hsize_t dzero = 0, dmax = H5S_UNLIMITED, csize = 5; hsize_t dzero2[2] = {0, 0}; hsize_t dmax2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; @@ -7485,9 +7488,9 @@ test_zero_dims(hid_t file) static herr_t test_missing_chunk(hid_t file) { - hid_t d = -1, did2 = -1; /* Dataset IDs */ - hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property IDs */ - hid_t s = -1, sid2 = -1; /* Dataspace ID */ + hid_t d = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID; /* Dataset creation property IDs */ + hid_t s = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace ID */ hsize_t hs_start[1], hs_stride[1], hs_count[1], hs_block[1]; /* Hyperslab setting */ hsize_t hs_start2[2], hs_stride2[2], hs_count2[2], hs_block2[2]; /* Hyperslab setting */ @@ -7807,8 +7810,9 @@ make_random_offset_and_increment(long nelts, long *offsetp, long *incp) static herr_t test_random_chunks_real(const char *testname, bool early_alloc, hid_t fapl) { - char filename[FILENAME_BUF_SIZE]; - hid_t s = -1, m = -1, d = -1, dcpl = -1, file = -1; + char filename[FILENAME_BUF_SIZE]; + hid_t s = H5I_INVALID_HID, m = H5I_INVALID_HID, d = H5I_INVALID_HID, dcpl = H5I_INVALID_HID, + file = H5I_INVALID_HID; int wbuf[NPOINTS], rbuf[NPOINTS], check2[20][20]; hsize_t coord[NPOINTS][2]; const hsize_t dsize[2] = {100, 100}, dmax[2] = {H5S_UNLIMITED, H5S_UNLIMITED}, csize[2] = {10, 10}, @@ -8543,10 +8547,10 @@ static herr_t test_huge_chunks(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ hsize_t dim2[3], chunk_dim2[3]; /* Dataset and chunk dimensions */ herr_t ret; /* Generic return value */ @@ -8671,14 +8675,14 @@ static herr_t test_chunk_cache(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t fapl_local = -1; /* Local fapl */ - hid_t fapl_def = -1; /* Default fapl */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t dapl1 = -1; /* Dataset access property list ID */ - hid_t dapl2 = -1; /* Dataset access property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl_local = H5I_INVALID_HID; /* Local fapl */ + hid_t fapl_def = H5I_INVALID_HID; /* Default fapl */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t dapl1 = H5I_INVALID_HID; /* Dataset access property list ID */ + hid_t dapl2 = H5I_INVALID_HID; /* Dataset access property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ size_t nslots_1, nslots_2, nslots_3, nslots_4; /* rdcc number of elements */ size_t nbytes_1, nbytes_2, nbytes_3, nbytes_4; /* rdcc number of bytes */ @@ -8940,12 +8944,12 @@ static herr_t test_big_chunks_bypass_cache(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t fapl_local = -1; /* File access property list ID */ - hid_t dcpl = -1, t_dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1, t_sid = -1; /* Dataspace ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl_local = H5I_INVALID_HID; /* File access property list ID */ + hid_t dcpl = H5I_INVALID_HID, t_dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID, t_sid = H5I_INVALID_HID; /* Dataspace ID */ hid_t mid; /* Memory space ID */ - hid_t dsid = -1, t_dsid = -1; /* Dataset ID */ + hid_t dsid = H5I_INVALID_HID, t_dsid = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ hsize_t t_dim[2], t_max[2], t_chunk_dim[2]; /* Dataset and chunk dimensions */ size_t rdcc_nelmts, rdcc_nbytes; /* Chunk cache parameters */ @@ -9309,17 +9313,17 @@ static herr_t test_chunk_fast(const char *env_h5_driver, hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t my_fapl = -1; /* File access property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t scalar_sid = -1; /* Scalar dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ - hsize_t fill; /* Temporary value, for filling arrays */ - hsize_t hs_size[EARRAY_MAX_RANK]; /* Hyperslab size */ - hsize_t chunk_dim[EARRAY_MAX_RANK]; /* Chunk dimensions */ - H5F_libver_t low; /* File format low bound */ - unsigned swmr; /* Whether file should be written with SWMR access enabled */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t my_fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t scalar_sid = H5I_INVALID_HID; /* Scalar dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hsize_t fill; /* Temporary value, for filling arrays */ + hsize_t hs_size[EARRAY_MAX_RANK]; /* Hyperslab size */ + hsize_t chunk_dim[EARRAY_MAX_RANK]; /* Chunk dimensions */ + H5F_libver_t low; /* File format low bound */ + unsigned swmr; /* Whether file should be written with SWMR access enabled */ TESTING("datasets w/extensible array as chunk index"); @@ -9726,17 +9730,17 @@ static herr_t test_reopen_chunk_fast(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t scalar_sid = -1; /* Scalar dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ - hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ - hsize_t hs_offset; /* Hyperslab offset */ - hsize_t hs_size; /* Hyperslab size */ - H5D_alloc_time_t alloc_time; /* Storage allocation time */ - unsigned write_elem, read_elem; /* Element written/read */ - unsigned u; /* Local index variable */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t scalar_sid = H5I_INVALID_HID; /* Scalar dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ + hsize_t hs_offset; /* Hyperslab offset */ + hsize_t hs_size; /* Hyperslab size */ + H5D_alloc_time_t alloc_time; /* Storage allocation time */ + unsigned write_elem, read_elem; /* Element written/read */ + unsigned u; /* Local index variable */ TESTING("datasets w/extensible array open/reopen with read/write"); @@ -9860,10 +9864,10 @@ static herr_t test_chunk_fast_bug1(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim[2], max_dim[2], chunk_dim[2]; /* Dataset and chunk dimensions */ H5D_alloc_time_t alloc_time; /* Storage allocation time */ @@ -10064,22 +10068,22 @@ static herr_t test_chunk_expand(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list ID */ - hid_t sid = -1, sid2 = -1; /* Dataspace ID */ - hid_t scalar_sid = -1; /* Scalar dataspace ID */ - hid_t dsid = -1, dsid2 = -1; /* Dataset ID */ - hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ - hsize_t dim2[2], max_dim2[2], chunk_dim2[2]; /* Dataset and chunk dimensions */ - H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index type */ - H5F_libver_t low, high; /* File format bounds */ - hsize_t hs_offset, hs_offset2[2]; /* Hyperslab offset */ - hsize_t hs_size, hs_size2[2]; /* Hyperslab size */ - H5D_alloc_time_t alloc_time; /* Storage allocation time */ - unsigned write_elem, read_elem; /* Element written/read */ - unsigned write_elem2, read_elem2; /* Element written/read */ - unsigned u; /* Local index variable */ - herr_t status; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace ID */ + hid_t scalar_sid = H5I_INVALID_HID; /* Scalar dataspace ID */ + hid_t dsid = H5I_INVALID_HID, dsid2 = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ + hsize_t dim2[2], max_dim2[2], chunk_dim2[2]; /* Dataset and chunk dimensions */ + H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index type */ + H5F_libver_t low, high; /* File format bounds */ + hsize_t hs_offset, hs_offset2[2]; /* Hyperslab offset */ + hsize_t hs_size, hs_size2[2]; /* Hyperslab size */ + H5D_alloc_time_t alloc_time; /* Storage allocation time */ + unsigned write_elem, read_elem; /* Element written/read */ + unsigned write_elem2, read_elem2; /* Element written/read */ + unsigned u; /* Local index variable */ + herr_t status; /* Generic return value */ TESTING("filter expanding chunks too much"); @@ -10606,16 +10610,16 @@ static herr_t test_fixed_array(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; /* File name */ - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID for dataset with fixed dimensions */ - hid_t sid_big = -1; /* Dataspate ID for big dataset */ - hid_t sid_max = -1; /* Dataspace ID for dataset with maximum dimensions set */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID for dataset with fixed dimensions */ + hid_t sid_big = H5I_INVALID_HID; /* Dataspate ID for big dataset */ + hid_t sid_max = H5I_INVALID_HID; /* Dataspace ID for dataset with maximum dimensions set */ - hid_t dsid = -1; /* Dataset ID for dataset with fixed dimensions */ - hid_t dsid_big = -1; /* Dataset ID for big dataset with fixed dimensions */ - hid_t dsid_max = -1; /* Dataset ID for dataset with maximum dimensions set */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID for dataset with fixed dimensions */ + hid_t dsid_big = H5I_INVALID_HID; /* Dataset ID for big dataset with fixed dimensions */ + hid_t dsid_max = H5I_INVALID_HID; /* Dataset ID for dataset with maximum dimensions set */ hsize_t dim2[2] = {48, 18}; /* Dataset dimensions */ const hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */ @@ -11143,18 +11147,19 @@ static herr_t test_single_chunk(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; /* File name */ - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t t_dcpl = -1; /* Dataset creation property list ID */ - - hid_t sid = -1, sid_max = -1; /* Dataspace ID for dataset with fixed dimensions */ - hid_t did = -1, did_max = -1; /* Dataset ID for dataset with fixed dimensions */ - hsize_t dim2[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ - hsize_t t_dim2[2] = {DSET_TMP_DIM1, DSET_TMP_DIM2}; /* Dataset dimensions */ - int *wbuf = NULL; /* write buffer */ - int *t_wbuf = NULL; /* write buffer */ - int *rbuf = NULL; /* read buffer */ - int *t_rbuf = NULL; /* read buffer */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t t_dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + + hid_t sid = H5I_INVALID_HID, + sid_max = H5I_INVALID_HID; /* Dataspace ID for dataset with fixed dimensions */ + hid_t did = H5I_INVALID_HID, did_max = H5I_INVALID_HID; /* Dataset ID for dataset with fixed dimensions */ + hsize_t dim2[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ + hsize_t t_dim2[2] = {DSET_TMP_DIM1, DSET_TMP_DIM2}; /* Dataset dimensions */ + int *wbuf = NULL; /* write buffer */ + int *t_wbuf = NULL; /* write buffer */ + int *rbuf = NULL; /* read buffer */ + int *t_rbuf = NULL; /* read buffer */ H5D_chunk_index_t idx_type; /* Dataset chunk index type */ H5F_libver_t low, high; /* File format bounds */ @@ -11420,11 +11425,11 @@ test_single_chunk(hid_t fapl) static herr_t test_idx_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ - const char *filename = NULL; /* old test file name */ - unsigned j; /* Local index variable */ - H5D_chunk_index_t idx_type; /* Chunked dataset index type */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t did = H5I_INVALID_HID; /* Dataset id */ + const char *filename = NULL; /* old test file name */ + unsigned j; /* Local index variable */ + H5D_chunk_index_t idx_type; /* Chunked dataset index type */ /* Output message about test being performed */ TESTING("compatibility for 1.6/1.8 datasets that use B-tree indexing"); @@ -11497,10 +11502,10 @@ test_idx_compatible(void) static herr_t test_unfiltered_edge_chunks(hid_t fapl) { - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ - hid_t sid = -1; /* Dataspace id */ - hid_t dcpl = -1; /* DCPL id */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t did = H5I_INVALID_HID; /* Dataset id */ + hid_t sid = H5I_INVALID_HID; /* Dataspace id */ + hid_t dcpl = H5I_INVALID_HID; /* DCPL id */ hsize_t dim[2] = {4, 3}; /* Dataset dimensions */ hsize_t cdim[2] = {2, 2}; /* Chunk dimension */ char wbuf[4][3]; /* Write buffer */ @@ -11640,15 +11645,15 @@ static herr_t test_large_chunk_shrink(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t scalar_sid = -1; /* Scalar dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ - hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ - hsize_t hs_offset; /* Hyperslab offset */ - hsize_t hs_size; /* Hyperslab size */ - unsigned write_elem, read_elem; /* Element written/read */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t scalar_sid = H5I_INVALID_HID; /* Scalar dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ + hsize_t hs_offset; /* Hyperslab offset */ + hsize_t hs_size; /* Hyperslab size */ + unsigned write_elem, read_elem; /* Element written/read */ TESTING("shrinking large chunk"); @@ -11773,11 +11778,11 @@ static herr_t test_zero_dim_dset(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ - hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ int data[1]; H5F_libver_t low, high; /* File format bounds */ herr_t ret; /* Generic return value */ @@ -11878,11 +11883,11 @@ static herr_t test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim[1], dims2[2]; /* Size of dataset */ hsize_t max_dim[1], max_dims2[2]; /* Maximum size of dataset */ hsize_t chunk_dim[1], chunk_dims2[2]; /* Chunk dimensions */ @@ -12148,12 +12153,12 @@ static herr_t test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; - hid_t sid = -1; - hid_t did = -1; - hid_t tid = -1; - hid_t dcpl = -1; - hid_t msid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t msid = H5I_INVALID_HID; H5D_chunk_index_t idx_type; const hsize_t shape[1] = {8}; const hsize_t maxshape[1] = {H5S_UNLIMITED}; @@ -12269,12 +12274,12 @@ static herr_t test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; - hid_t sid = -1; - hid_t did = -1; - hid_t tid = -1; - hid_t dcpl = -1; - hid_t msid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t msid = H5I_INVALID_HID; H5D_chunk_index_t idx_type; const hsize_t shape[1] = {8}; const hsize_t maxshape[1] = {64}; @@ -12390,12 +12395,12 @@ static herr_t test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; - hid_t sid = -1; - hid_t did = -1; - hid_t tid = -1; - hid_t dcpl = -1; - hid_t msid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t msid = H5I_INVALID_HID; H5D_chunk_index_t idx_type; const hsize_t shape[2] = {8, 8}; const hsize_t maxshape[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; @@ -12516,13 +12521,13 @@ static herr_t test_storage_size(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t dsid = -1; /* Dataset ID */ - hsize_t dims[2], max_dims[2]; /* Dataset dimensions */ - hsize_t new_dims[2]; /* New dataset dimensions */ - hsize_t chunk_dims[2]; /* Chunk dimensions */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID; /* Dataset creation property list IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dims[2], max_dims[2]; /* Dataset dimensions */ + hsize_t new_dims[2]; /* New dataset dimensions */ + hsize_t chunk_dims[2]; /* Chunk dimensions */ int wdata[STORAGE_SIZE_DIM1][STORAGE_SIZE_DIM2]; hsize_t ssize; /* Dataset storage size */ @@ -13005,15 +13010,15 @@ static herr_t test_power2up(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hsize_t dims[2]; /* Dataset dimension sizes */ - hsize_t max_dims[2]; /* Maximum dimension sizes */ - hsize_t chunk_dims[2]; /* Chunk dimensions */ - hsize_t ext_dims[2]; /* Extended dimension sizes */ - herr_t status; /* Error status */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hsize_t dims[2]; /* Dataset dimension sizes */ + hsize_t max_dims[2]; /* Maximum dimension sizes */ + hsize_t chunk_dims[2]; /* Chunk dimensions */ + hsize_t ext_dims[2]; /* Extended dimension sizes */ + herr_t status; /* Error status */ TESTING("the next power of 2"); @@ -13134,8 +13139,8 @@ scatter_cb(void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/, void *_sc static herr_t test_scatter(void) { - hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[3] = {8, 5, 8}; /* Dataspace dimensions */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dim[3] = {8, 5, 8}; /* Dataspace dimensions */ hsize_t start[3] = {0, 0, 0}; hsize_t stride[3] = {0, 0, 0}; hsize_t count[3] = {0, 0, 0}; @@ -13449,8 +13454,8 @@ gather_cb(const void *dst_buf, size_t dst_buf_bytes_used, void *_gather_info) static herr_t test_gather(void) { - hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[3] = {8, 5, 8}; /* Dataspace dimensions */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dim[3] = {8, 5, 8}; /* Dataspace dimensions */ hsize_t start[3] = {0, 0, 0}; hsize_t stride[3] = {0, 0, 0}; hsize_t count[3] = {0, 0, 0}; @@ -13813,8 +13818,8 @@ scatter_error_cb_unalign(void **src_buf /*out*/, size_t *src_buf_bytes_used /*ou static herr_t test_scatter_error(void) { - hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[1] = {10}; /* Dataspace dimensions */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dim[1] = {10}; /* Dataspace dimensions */ hsize_t start[3] = {2}; hsize_t count[3] = {6}; int src_buf[7]; /* Source data buffer */ @@ -14005,8 +14010,8 @@ gather_error_cb_fail(const void H5_ATTR_UNUSED *dst_buf, size_t H5_ATTR_UNUSED d static herr_t test_gather_error(void) { - hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[1] = {10}; /* Dataspace dimensions */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dim[1] = {10}; /* Dataspace dimensions */ hsize_t start[1] = {2}; hsize_t count[1] = {6}; int src_buf[10]; /* Source data buffer */ @@ -14453,10 +14458,10 @@ dls_01_main(void) static herr_t test_compact_open_close_dirty(hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t dcpl = -1; /* Dataset creation property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ hsize_t dims[1] = {10}; /* Dimension */ int wbuf[10]; /* Data buffer */ char filename[FILENAME_BUF_SIZE]; /* Filename */ @@ -14579,15 +14584,15 @@ test_compact_open_close_dirty(hid_t fapl) static herr_t test_versionbounds(void) { - hid_t fapl = -1; - hid_t srcfile = -1; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t srcspace = -1; /* Source dataspaces */ - hid_t vspace = -1; /* Virtual dset dataspaces */ - hid_t srcdset = -1; /* Source dataset */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[1] = {3}; /* Data space current size */ + hid_t fapl = H5I_INVALID_HID; + hid_t srcfile = H5I_INVALID_HID; /* Files with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t srcspace = H5I_INVALID_HID; /* Source dataspaces */ + hid_t vspace = H5I_INVALID_HID; /* Virtual dset dataspaces */ + hid_t srcdset = H5I_INVALID_HID; /* Source dataset */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[1] = {3}; /* Data space current size */ char srcfilename[FILENAME_BUF_SIZE]; char vfilename1[FILENAME_BUF_SIZE]; char vfilename2[FILENAME_BUF_SIZE]; @@ -14732,8 +14737,8 @@ test_versionbounds(void) static herr_t test_object_header_minimization_dcpl(void) { - hid_t dcpl_id = -1; - hid_t file_id = -1; + hid_t dcpl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; char filename[FILENAME_BUF_SIZE] = ""; bool minimize = false; herr_t ret; @@ -15407,7 +15412,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, grp, fapl, fapl2; - hid_t fcpl = -1, fcpl2 = -1; + hid_t fcpl = H5I_INVALID_HID, fcpl2 = H5I_INVALID_HID; unsigned new_format; unsigned paged; unsigned minimized_ohdr; diff --git a/test/dt_arith.c b/test/dt_arith.c index ce261ac96fb..dd25b9dd388 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -777,8 +777,8 @@ test_particular_fp_integer(void) static int test_derived_flt(void) { - hid_t file = -1, tid1 = -1, tid2 = -1; - hid_t dxpl_id = -1; + hid_t file = H5I_INVALID_HID, tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; char filename[1024]; size_t spos, epos, esize, mpos, msize, size; size_t src_size, dst_size; @@ -1223,8 +1223,8 @@ test_derived_flt(void) static int test_derived_integer(void) { - hid_t file = -1, tid1 = -1, tid2 = -1; - hid_t dxpl_id = -1; + hid_t file = H5I_INVALID_HID, tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; char filename[1024]; size_t src_size, dst_size; unsigned char *buf = NULL, *saved_buf = NULL; diff --git a/test/dtransform.c b/test/dtransform.c index 6892a7ccfe5..c0d92ddd19c 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -25,10 +25,10 @@ static int test_set(void); static int test_getset(hid_t dxpl_id_simple); /* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */ -hid_t dset_id_int = -1; -hid_t dset_id_float = -1; -hid_t dset_id_int_chunk = -1; -hid_t dset_id_float_chunk = -1; +hid_t dset_id_int = H5I_INVALID_HID; +hid_t dset_id_float = H5I_INVALID_HID; +hid_t dset_id_int_chunk = H5I_INVALID_HID; +hid_t dset_id_float_chunk = H5I_INVALID_HID; const float windchillFfloat[ROWS][COLS] = { {36.0F, 31.0F, 25.0F, 19.0F, 13.0F, 7.0F, 1.0F, -5.0F, -11.0F, -16.0F, -22.0F, -28.0F, -34.0F, -40.0F, @@ -315,13 +315,13 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, int main(void) { - hid_t dxpl_id_c_to_f = -1; + hid_t dxpl_id_c_to_f = H5I_INVALID_HID; hid_t dxpl_id_c_to_f_copy = 1; - hid_t dxpl_id_simple = -1; - hid_t dxpl_id_polynomial = -1; - hid_t dxpl_id_polynomial_copy = -1; - hid_t dxpl_id_utrans_inv = -1; - hid_t file_id = -1; + hid_t dxpl_id_simple = H5I_INVALID_HID; + hid_t dxpl_id_polynomial = H5I_INVALID_HID; + hid_t dxpl_id_polynomial_copy = H5I_INVALID_HID; + hid_t dxpl_id_utrans_inv = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; const char *c_to_f = "(9/5.0)*x + 32"; const char *simple = "(4/2) * ( (2 + 4)/(5 - 2.5))"; /* this equals 4.8 */ @@ -452,11 +452,11 @@ init_test(hid_t file_id) /* utrans is a transform for char types: numbers are restricted from -128 to 127, fits into char */ const char *utrans = "(x/4+25)*3"; - hid_t dataspace = -1; - hid_t dxpl_id_f_to_c = -1; - hid_t dxpl_id_utrans = -1; - hid_t cparms = -1; - hid_t filespace = -1; + hid_t dataspace = H5I_INVALID_HID; + hid_t dxpl_id_f_to_c = H5I_INVALID_HID; + hid_t dxpl_id_utrans = H5I_INVALID_HID; + hid_t cparms = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; hsize_t dim[2] = {ROWS, COLS}; hsize_t offset[2] = {0, 0}; @@ -912,7 +912,7 @@ test_getset(const hid_t dxpl_id_c_to_f) static int test_set(void) { - hid_t dxpl_id = -1; + hid_t dxpl_id = H5I_INVALID_HID; H5E_auto2_t func; const char *str = "(9/5.0)*x + 32"; char *ptrgetTest = NULL; diff --git a/test/dtypes.c b/test/dtypes.c index 143db769ee2..37be1cad4a6 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -750,7 +750,7 @@ test_compound_2(void) const size_t nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; hid_t array_dt; int64_t nmembs; int i; @@ -875,7 +875,7 @@ test_compound_3(void) const size_t nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; hid_t array_dt; int64_t nmembs; int i; @@ -1000,7 +1000,7 @@ test_compound_4(void) const size_t nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; hid_t array_dt; int64_t nmembs; int i; @@ -1225,7 +1225,7 @@ test_compound_6(void) const size_t nelmts = NTESTELEM; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; int64_t nmembs; int i; @@ -3688,12 +3688,12 @@ test_compound_17(void) static int test_compound_18(void) { - hid_t file = -1; - hid_t gid = -1; - hid_t did = -1; - hid_t aid = -1; - hid_t tid = -1; - hid_t sid = -1; + hid_t file = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t aid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dim = 1; const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ char filename[1024]; @@ -3842,7 +3842,7 @@ test_query(void) long c; double d; }; - hid_t file = -1, tid1 = -1, tid2 = -1; + hid_t file = H5I_INVALID_HID, tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; char filename[1024]; char compnd_type[] = "Compound_type", enum_type[] = "Enum_type"; short enum_val; @@ -4081,10 +4081,11 @@ static int test_transient(hid_t fapl) { static hsize_t ds_size[2] = {10, 20}; - hid_t file = -1, type = -1, space = -1, dset = -1, t2 = -1; - char filename[1024]; - hid_t ret_id; /* Generic hid_t return value */ - herr_t status; + hid_t file = H5I_INVALID_HID, type = H5I_INVALID_HID, space = H5I_INVALID_HID, dset = H5I_INVALID_HID, + t2 = H5I_INVALID_HID; + char filename[1024]; + hid_t ret_id; /* Generic hid_t return value */ + herr_t status; TESTING("transient datatypes"); @@ -4232,7 +4233,8 @@ test_transient(hid_t fapl) static int test_named(hid_t fapl) { - hid_t file = -1, type = -1, space = -1, dset = -1, t2 = -1, t3 = -1, attr1 = -1; + hid_t file = H5I_INVALID_HID, type = H5I_INVALID_HID, space = H5I_INVALID_HID, dset = H5I_INVALID_HID, + t2 = H5I_INVALID_HID, t3 = H5I_INVALID_HID, attr1 = H5I_INVALID_HID; herr_t status; static hsize_t ds_size[2] = {10, 20}; size_t i, j; @@ -4631,8 +4633,8 @@ static int test_conv_str_1(void) { char *buf = NULL; - hid_t src_type = -1; - hid_t dst_type = -1; + hid_t src_type = H5I_INVALID_HID; + hid_t dst_type = H5I_INVALID_HID; TESTING("string conversions"); @@ -4962,8 +4964,8 @@ static int test_conv_str_2(void) { char *buf = NULL, s[80]; - hid_t c_type = -1; - hid_t f_type = -1; + hid_t c_type = H5I_INVALID_HID; + hid_t f_type = H5I_INVALID_HID; const size_t nelmts = NTESTELEM; size_t i, j, nchars; int ret_value = 1; @@ -5031,8 +5033,8 @@ static int test_conv_str_3(void) { char *buf = NULL; - hid_t type = -1; - hid_t super = -1; + hid_t type = H5I_INVALID_HID; + hid_t super = H5I_INVALID_HID; const size_t nelmts = NTESTELEM; size_t i, j, nchars; int ret_value = 1; @@ -5168,8 +5170,8 @@ test_conv_enum_1(void) { const size_t nelmts = NTESTELEM; int i, val, *buf = NULL; - hid_t t1 = -1; - hid_t t2 = -1; + hid_t t1 = H5I_INVALID_HID; + hid_t t2 = H5I_INVALID_HID; char s[80]; int ret_value = 1; size_t u; @@ -5243,7 +5245,7 @@ test_conv_enum_1(void) static int test_conv_enum_2(void) { - hid_t srctype = -1, dsttype = -1, oddsize = -1; + hid_t srctype = H5I_INVALID_HID, dsttype = H5I_INVALID_HID, oddsize = H5I_INVALID_HID; int *data = NULL, i, nerrors = 0; const char *mname[] = {"RED", "GREEN", "BLUE", "YELLOW", "PINK", "PURPLE", "ORANGE", "WHITE"}; @@ -5317,7 +5319,7 @@ static int test_conv_bitfield(void) { unsigned char buf[4]; - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; TESTING("bitfield conversions"); @@ -5411,7 +5413,7 @@ test_conv_bitfield(void) static int test_bitfield_funcs(void) { - hid_t type = -1, ntype = -1, super = -1; + hid_t type = H5I_INVALID_HID, ntype = H5I_INVALID_HID, super = H5I_INVALID_HID; size_t size; char *tag = 0; H5T_pad_t inpad; @@ -5613,7 +5615,7 @@ static int opaque_check(int tag_it) { #define OPAQUE_NELMTS 1000 - hid_t st = -1, dt = -1; + hid_t st = H5I_INVALID_HID, dt = H5I_INVALID_HID; herr_t status; char buf[1]; /*not really used*/ int saved; @@ -5689,7 +5691,7 @@ static int opaque_long(void) { char *long_tag = NULL; - hid_t dt = -1; + hid_t dt = H5I_INVALID_HID; herr_t ret; /* Build opaque type */ @@ -5743,7 +5745,7 @@ opaque_long(void) static int opaque_funcs(void) { - hid_t type = -1, super = -1; + hid_t type = H5I_INVALID_HID, super = H5I_INVALID_HID; size_t size; H5T_pad_t inpad; H5T_cset_t cset; @@ -6455,9 +6457,9 @@ test_latest(void) long c; double d; }; - hid_t file = (-1); /* File ID */ - hid_t tid1 = (-1), tid2 = (-1); /* Datatype ID */ - hid_t fapl = (-1); /* File access property list */ + hid_t file = (H5I_INVALID_HID); /* File ID */ + hid_t tid1 = (H5I_INVALID_HID), tid2 = (H5I_INVALID_HID); /* Datatype ID */ + hid_t fapl = (H5I_INVALID_HID); /* File access property list */ H5O_native_info_t oi; /* Stat buffer for committed datatype */ hsize_t old_dtype_oh_size; /* Size of object header with "old" format */ hsize_t new_dtype_oh_size; /* Size of object header with "new" format */ @@ -7073,9 +7075,10 @@ test_set_order_compound(hid_t fapl) atomic_cmpd d[3][4]; } complex_cmpd; - hid_t file = -1; - hid_t cmpd = -1, memb_cmpd = -1, memb_array1 = -1, memb_array2 = -1, cmpd_array = -1; - hid_t vl_id = -1; + hid_t file = H5I_INVALID_HID; + hid_t cmpd = H5I_INVALID_HID, memb_cmpd = H5I_INVALID_HID, memb_array1 = H5I_INVALID_HID, + memb_array2 = H5I_INVALID_HID, cmpd_array = H5I_INVALID_HID; + hid_t vl_id = H5I_INVALID_HID; hsize_t dims[2] = {3, 4}; /* Array dimensions */ char filename[1024]; herr_t ret; /* Generic return value */ @@ -7224,7 +7227,8 @@ test_set_order_compound(hid_t fapl) static int test_named_indirect_reopen(hid_t fapl) { - hid_t file = -1, type = -1, reopened_type = -1, strtype = -1, dset = -1, space = -1; + hid_t file = H5I_INVALID_HID, type = H5I_INVALID_HID, reopened_type = H5I_INVALID_HID, + strtype = H5I_INVALID_HID, dset = H5I_INVALID_HID, space = H5I_INVALID_HID; static hsize_t dims[1] = {3}; size_t dt_size; int enum_value; @@ -7592,11 +7596,11 @@ create_del_obj_named_test_file(const char *filename, hid_t fapl, H5F_libver_t lo static int test_delete_obj_named(hid_t fapl) { - hid_t filea1 = -1, filea2 = -1, fileb = -1; /* File IDs */ - hid_t attr = -1; /* Attribute ID */ - hid_t dset = -1; /* Dataset ID */ - hid_t fapl2 = -1; /* File access property list ID */ - H5F_libver_t low, high; /* File format bounds */ + hid_t filea1 = H5I_INVALID_HID, filea2 = H5I_INVALID_HID, fileb = H5I_INVALID_HID; /* File IDs */ + hid_t attr = H5I_INVALID_HID; /* Attribute ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list ID */ + H5F_libver_t low, high; /* File format bounds */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -7709,15 +7713,15 @@ test_delete_obj_named(hid_t fapl) static int test_delete_obj_named_fileid(hid_t fapl) { - hid_t filea1 = -1, filea2 = -1, fileb = -1; /* File IDs */ - hid_t dset_fid = -1; /* File ID from dataset */ - hid_t type_fid = -1; /* File ID from datatype */ - hid_t attr_fid = -1; /* File ID from attribute */ - hid_t type = -1; /* Datatype ID */ - hid_t attr = -1; /* Attribute ID */ - hid_t dset = -1; /* Dataset ID */ - hid_t fapl2 = -1; /* File access property list ID */ - H5F_libver_t low, high; /* File format bounds */ + hid_t filea1 = H5I_INVALID_HID, filea2 = H5I_INVALID_HID, fileb = H5I_INVALID_HID; /* File IDs */ + hid_t dset_fid = H5I_INVALID_HID; /* File ID from dataset */ + hid_t type_fid = H5I_INVALID_HID; /* File ID from datatype */ + hid_t attr_fid = H5I_INVALID_HID; /* File ID from attribute */ + hid_t type = H5I_INVALID_HID; /* Datatype ID */ + hid_t attr = H5I_INVALID_HID; /* Attribute ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list ID */ + H5F_libver_t low, high; /* File format bounds */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -7908,14 +7912,14 @@ test_delete_obj_named_fileid(hid_t fapl) static int test_deprec(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t type = -1; /* Datatype ID */ - unsigned rank = 2; /* Rank for array datatype */ - hsize_t dims[2] = {3, 3}; /* Dimensions for array datatype */ - int perm[2] = {0, 1}; /* Dimensions permutations for array datatype */ - hsize_t rdims[2] = {0, 0}; /* Dimensions for querying array datatype */ - int rperm[2] = {-2, -2}; /* Dimensions permutations for array datatype */ - bool dim_mismatch; /* Whether any dimensions didn't match */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t type = H5I_INVALID_HID; /* Datatype ID */ + unsigned rank = 2; /* Rank for array datatype */ + hsize_t dims[2] = {3, 3}; /* Dimensions for array datatype */ + int perm[2] = {0, 1}; /* Dimensions permutations for array datatype */ + hsize_t rdims[2] = {0, 0}; /* Dimensions for querying array datatype */ + int rperm[2] = {-2, -2}; /* Dimensions permutations for array datatype */ + bool dim_mismatch; /* Whether any dimensions didn't match */ char filename[1024]; unsigned u; /* Local index variable */ herr_t status; /* Generic routine value */ @@ -8076,13 +8080,13 @@ test_deprec(hid_t fapl) static int test_utf_ascii_conv(void) { - hid_t fid = -1; - hid_t did = -1; - hid_t utf8_vtid = -1; - hid_t ascii_vtid = -1; - hid_t utf8_tid = -1; - hid_t ascii_tid = -1; - hid_t sid = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t utf8_vtid = H5I_INVALID_HID; + hid_t ascii_vtid = H5I_INVALID_HID; + hid_t utf8_tid = H5I_INVALID_HID; + hid_t ascii_tid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; const char *utf8_w = "foo!"; char *ascii_r = NULL; const char *ascii_w = "bar!"; @@ -8340,8 +8344,8 @@ test_utf_ascii_conv(void) static herr_t verify_version(hid_t dtype, H5F_libver_t low, unsigned *highest_version) { - hid_t base_dtype = -1; - hid_t mem_dtype = -1; + hid_t base_dtype = H5I_INVALID_HID; + hid_t mem_dtype = H5I_INVALID_HID; H5T_t *dtypep = NULL; /* Internal structure of a datatype */ H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */ int nmembers = 0; @@ -8509,25 +8513,25 @@ test_versionbounds(void) color_t enum_color; } outer_cmp_t; - hid_t file = -1; /* File ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t fapl = -1; /* Copy of file access property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t dset_dtype = -1; /* Dataset's datatype */ - hid_t arr_chartype = -1; /* Array of characters datatype */ - hid_t vlen_floattype = -1; /* Vlen of float datatype */ - hid_t enum_type = -1; /* Enumeration datatype */ - hid_t outer_cmp_type = -1; /* Outer compound datatype */ - hid_t inner_cmp_type = -1; /* Inner compound datatype */ - hid_t simple_cmp_type = -1; /* Simple cmpd dtype, contains no other cmpd */ - hid_t outer_arr_type = -1; /* Outermost array datatype */ - hid_t inner_arr_type = -1; /* Inner array datatype */ - H5F_t *filep = NULL; /* Pointer to internal structure of a file */ - H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */ - hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */ - int low, high; /* Indices for iterating over versions */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t fapl = H5I_INVALID_HID; /* Copy of file access property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t dset_dtype = H5I_INVALID_HID; /* Dataset's datatype */ + hid_t arr_chartype = H5I_INVALID_HID; /* Array of characters datatype */ + hid_t vlen_floattype = H5I_INVALID_HID; /* Vlen of float datatype */ + hid_t enum_type = H5I_INVALID_HID; /* Enumeration datatype */ + hid_t outer_cmp_type = H5I_INVALID_HID; /* Outer compound datatype */ + hid_t inner_cmp_type = H5I_INVALID_HID; /* Inner compound datatype */ + hid_t simple_cmp_type = H5I_INVALID_HID; /* Simple cmpd dtype, contains no other cmpd */ + hid_t outer_arr_type = H5I_INVALID_HID; /* Outermost array datatype */ + hid_t inner_arr_type = H5I_INVALID_HID; /* Inner array datatype */ + H5F_t *filep = NULL; /* Pointer to internal structure of a file */ + H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */ + hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */ + int low, high; /* Indices for iterating over versions */ H5F_libver_t versions[] = {H5F_LIBVER_EARLIEST, H5F_LIBVER_V18, H5F_LIBVER_V110, H5F_LIBVER_V112, H5F_LIBVER_V114, H5F_LIBVER_V114}; int versions_count = 6; /* Number of version bounds in the array */ diff --git a/test/earray.c b/test/earray.c index 3fa0cb5895c..5af1fa998c7 100644 --- a/test/earray.c +++ b/test/earray.c @@ -566,10 +566,10 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) static unsigned test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5EA_t *ea = NULL; /* Extensible array wrapper */ - haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5EA_t *ea = NULL; /* Extensible array wrapper */ + haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ /* Create file & retrieve pointer to internal file object */ if (create_file(H5F_ACC_TRUNC, fapl, &file, &f) < 0) @@ -808,10 +808,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE static unsigned test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5EA_t *ea = NULL; /* Extensible array wrapper */ - haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5EA_t *ea = NULL; /* Extensible array wrapper */ + haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ /* Create file & retrieve pointer to internal file object */ if (create_file(H5F_ACC_TRUNC, fapl, &file, &f) < 0) @@ -876,13 +876,13 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) static unsigned test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ - H5EA_t *ea = NULL; /* Extensible array wrapper */ - H5EA_t *ea2 = NULL; /* Extensible array wrapper */ - haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t file2 = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ + H5EA_t *ea = NULL; /* Extensible array wrapper */ + H5EA_t *ea2 = NULL; /* Extensible array wrapper */ + haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ /* Create file & retrieve pointer to internal file object */ if (create_file(H5F_ACC_TRUNC, fapl, &file, &f) < 0) @@ -984,10 +984,10 @@ static unsigned test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { char filename_tmp[EARRAY_FILENAME_LEN]; /* Temporary file name */ - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - hid_t file0 = -1; /* File ID */ - hid_t file00 = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t file2 = H5I_INVALID_HID; /* File ID */ + hid_t file0 = H5I_INVALID_HID; /* File ID */ + hid_t file00 = H5I_INVALID_HID; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ H5F_t *f2 = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ @@ -1120,12 +1120,12 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa static unsigned test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5EA_t *ea = NULL; /* Extensible array wrapper */ - H5EA_t *ea2 = NULL; /* Extensible array wrapper */ - haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ - h5_stat_size_t file_size; /* File size, after deleting array */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5EA_t *ea = NULL; /* Extensible array wrapper */ + H5EA_t *ea2 = NULL; /* Extensible array wrapper */ + haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ + h5_stat_size_t file_size; /* File size, after deleting array */ /* Create file & retrieve pointer to internal file object */ if (create_file(H5F_ACC_TRUNC, fapl, &file, &f) < 0) @@ -1961,20 +1961,20 @@ static unsigned test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, hsize_t nelmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5EA_t *ea = NULL; /* Extensible array wrapper */ - void *eiter_info; /* Extensible array iterator info */ - earray_state_t state; /* State of extensible array */ - uint64_t welmt; /* Element to write */ - uint64_t relmt; /* Element to read */ - hsize_t nelmts_written; /* Highest element written in array */ - hsize_t cnt; /* Count of array indices */ - hssize_t smax; /* Index value of max. element set */ - hsize_t max; /* Index value of max. element set */ - hssize_t sidx; /* Index value of first element of first data block */ - hsize_t idx; /* Index value of first element of first data block */ - haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5EA_t *ea = NULL; /* Extensible array wrapper */ + void *eiter_info; /* Extensible array iterator info */ + earray_state_t state; /* State of extensible array */ + uint64_t welmt; /* Element to write */ + uint64_t relmt; /* Element to read */ + hsize_t nelmts_written; /* Highest element written in array */ + hsize_t cnt; /* Count of array indices */ + hssize_t smax; /* Index value of max. element set */ + hsize_t max; /* Index value of max. element set */ + hssize_t sidx; /* Index value of first element of first data block */ + hsize_t idx; /* Index value of first element of first data block */ + haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ /* * Display testing message @@ -2136,16 +2136,16 @@ static unsigned test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, hsize_t skip_elmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5EA_t *ea = NULL; /* Extensible array wrapper */ - earray_state_t state; /* State of extensible array */ - uint64_t welmt; /* Element to write */ - uint64_t relmt; /* Element to read */ - hsize_t nelmts_written; /* Highest element written in array */ - hsize_t idx; /* Index value of element to get */ - hsize_t cnt; /* Count of array indices */ - haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5EA_t *ea = NULL; /* Extensible array wrapper */ + earray_state_t state; /* State of extensible array */ + uint64_t welmt; /* Element to write */ + uint64_t relmt; /* Element to read */ + hsize_t nelmts_written; /* Highest element written in array */ + hsize_t idx; /* Index value of element to get */ + hsize_t cnt; /* Count of array indices */ + haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ /* * Display testing message @@ -2291,15 +2291,15 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, int main(void) { - H5EA_create_t cparam; /* Creation parameters for extensible array */ - earray_test_param_t tparam; /* Testing parameters */ - earray_test_type_t curr_test; /* Current test being worked on */ - earray_iter_type_t curr_iter; /* Current iteration type being worked on */ - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ - time_t curr_time; /* Current time, for seeding random number generator */ - int ExpressMode; /* Test express value */ - bool api_ctx_pushed = false; /* Whether API context pushed */ + H5EA_create_t cparam; /* Creation parameters for extensible array */ + earray_test_param_t tparam; /* Testing parameters */ + earray_test_type_t curr_test; /* Current test being worked on */ + earray_iter_type_t curr_iter; /* Current iteration type being worked on */ + hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ + time_t curr_time; /* Current time, for seeding random number generator */ + int ExpressMode; /* Test express value */ + bool api_ctx_pushed = false; /* Whether API context pushed */ /* Reset library */ h5_reset(); diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 46956fce28b..14cb78eeb85 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -24,10 +24,10 @@ static int test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) { - hid_t pl = (-1); /* Decoded property list */ - hid_t fapl = -1; /* File access property list */ - void *temp_buf = NULL; /* Pointer to encoding buffer */ - size_t temp_size = 0; /* Size of encoding buffer */ + hid_t pl = (H5I_INVALID_HID); /* Decoded property list */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + void *temp_buf = NULL; /* Pointer to encoding buffer */ + size_t temp_size = 0; /* Size of encoding buffer */ /* Create file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -113,24 +113,24 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) int main(void) { - hid_t dcpl; /* dataset create prop. list */ - hid_t dapl; /* dataset access prop. list */ - hid_t dxpl; /* dataset xfer prop. list */ - hid_t gcpl; /* group create prop. list */ - hid_t ocpypl; /* object copy prop. list */ - hid_t ocpl; /* object create prop. list */ - hid_t lcpl; /* link create prop. list */ - hid_t lapl; /* link access prop. list */ - hid_t fapl; /* file access prop. list */ - hid_t fcpl; /* file create prop. list */ - hid_t strcpl; /* string create prop. list */ - hid_t acpl; /* attribute create prop. list */ - hid_t srcspace = -1; /* Source dataspaces */ - hid_t vspace = -1; /* Virtual dset dataspaces */ - hsize_t dims[1] = {3}; /* Data space current size */ - hsize_t chunk_size[2] = {16384, 4}; /* chunk size */ - double fill = 2.7; /* Fill value */ - hsize_t max_size[1]; /* data space maximum size */ + hid_t dcpl; /* dataset create prop. list */ + hid_t dapl; /* dataset access prop. list */ + hid_t dxpl; /* dataset xfer prop. list */ + hid_t gcpl; /* group create prop. list */ + hid_t ocpypl; /* object copy prop. list */ + hid_t ocpl; /* object create prop. list */ + hid_t lcpl; /* link create prop. list */ + hid_t lapl; /* link access prop. list */ + hid_t fapl; /* file access prop. list */ + hid_t fcpl; /* file create prop. list */ + hid_t strcpl; /* string create prop. list */ + hid_t acpl; /* attribute create prop. list */ + hid_t srcspace = H5I_INVALID_HID; /* Source dataspaces */ + hid_t vspace = H5I_INVALID_HID; /* Virtual dset dataspaces */ + hsize_t dims[1] = {3}; /* Data space current size */ + hsize_t chunk_size[2] = {16384, 4}; /* chunk size */ + double fill = 2.7; /* Fill value */ + hsize_t max_size[1]; /* data space maximum size */ size_t nslots = 521 * 2; size_t nbytes = 1048576 * 10; double w0 = 0.5; diff --git a/test/error_test.c b/test/error_test.c index ce5e4d73938..b1c45efb752 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -89,9 +89,9 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void *cl static herr_t test_error(hid_t file) { - hid_t dataset = -1; - hid_t space = -1; - hid_t estack_id = -1; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t estack_id = H5I_INVALID_HID; hsize_t dims[2]; const char *FUNC_test_error = "test_error"; H5E_auto2_t old_func; @@ -456,10 +456,10 @@ custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) static herr_t test_create(void) { - const char *err_func = "test_create"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id = -1; /* Error stack ID */ + const char *err_func = "test_create"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = H5I_INVALID_HID; /* Error stack ID */ /* Create an empty error stack */ if ((estack_id = H5Ecreate_stack()) < 0) @@ -512,11 +512,11 @@ test_create(void) static herr_t test_copy(void) { - const char *err_func = "test_copy"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id = -1; /* Error stack ID */ - herr_t ret; /* Generic return value */ + const char *err_func = "test_copy"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = H5I_INVALID_HID; /* Error stack ID */ + herr_t ret; /* Generic return value */ /* Push an error with a long description */ if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", @@ -585,8 +585,8 @@ test_append(void) const char *err_msg1 = "Error message #1"; /* Error message #1 for pushing error */ const char *err_msg2 = "Error message #2"; /* Error message #2 for pushing error */ ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id1 = -1; /* Error stack ID */ - hid_t estack_id2 = -1; /* Error stack ID */ + hid_t estack_id1 = H5I_INVALID_HID; /* Error stack ID */ + hid_t estack_id2 = H5I_INVALID_HID; /* Error stack ID */ herr_t ret; /* Generic return value */ /* Push an error */ @@ -737,8 +737,8 @@ static herr_t test_filter_error(const char *fname, hid_t fapl) { const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ - hid_t file = -1; - hid_t dataset = -1; + hid_t file = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; int buf[20]; fprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n"); @@ -777,9 +777,9 @@ test_filter_error(const char *fname, hid_t fapl) int main(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t estack_id = -1; + hid_t file = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; + hid_t estack_id = H5I_INVALID_HID; char filename[1024]; const char *env_h5_drvr; /* File driver value from environment */ const char *FUNC_main = "main"; diff --git a/test/evict_on_close.c b/test/evict_on_close.c index a5e83898846..4a386e0ba81 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -122,22 +122,22 @@ verify_tag_not_in_cache(const H5F_t *f, haddr_t tag) static hid_t generate_eoc_test_file(hid_t fapl_id) { - char filename[FILENAME_BUF_SIZE]; /* decorated file name */ - hid_t fid = -1; /* file ID (returned) */ - hid_t fapl_copy_id = -1; /* ID of copied fapl */ - hid_t gid1 = -1, gid2 = -1; /* group IDs */ - hid_t sid = -1; /* dataspace ID */ - hid_t dcpl_id = -1; /* dataset creation plist */ - hid_t did = -1; /* dataset ID */ - int rank; /* # of array dimensions */ - hsize_t current_dims[2]; /* current dataset size */ - hsize_t maximum_dims[2]; /* maximum dataset size */ - hsize_t chunk_dims[2]; /* chunk dimensions */ - H5D_chunk_index_t idx_type; /* dataset chunk index type */ - H5D_layout_t layout_type; /* dataset layout type */ - int *data = NULL; /* buffer for fake data */ - int n; /* # of data elements */ - int i; /* iterator (# subgroups) */ + char filename[FILENAME_BUF_SIZE]; /* decorated file name */ + hid_t fid = H5I_INVALID_HID; /* file ID (returned) */ + hid_t fapl_copy_id = H5I_INVALID_HID; /* ID of copied fapl */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* group IDs */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation plist */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + int rank; /* # of array dimensions */ + hsize_t current_dims[2]; /* current dataset size */ + hsize_t maximum_dims[2]; /* maximum dataset size */ + hsize_t chunk_dims[2]; /* chunk dimensions */ + H5D_chunk_index_t idx_type; /* dataset chunk index type */ + H5D_layout_t layout_type; /* dataset layout type */ + int *data = NULL; /* buffer for fake data */ + int n; /* # of data elements */ + int i; /* iterator (# subgroups) */ TESTING("generating evict-on-close test file"); @@ -584,12 +584,12 @@ generate_eoc_test_file(hid_t fapl_id) static herr_t check_group_layout(hid_t fid, const char *group_name) { - H5F_t *file_ptr = NULL; /* ptr to internal file struct */ - hid_t gid1 = -1, gid2 = -1; /* group IDs */ - H5G_t *grp_ptr = NULL; /* ptr to internal group struct */ - haddr_t tag1, tag2; /* MD cache tags for groups */ - uint32_t before, during, after; /* cache sizes */ - int i; /* iterator */ + H5F_t *file_ptr = NULL; /* ptr to internal file struct */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* group IDs */ + H5G_t *grp_ptr = NULL; /* ptr to internal group struct */ + haddr_t tag1, tag2; /* MD cache tags for groups */ + uint32_t before, during, after; /* cache sizes */ + int i; /* iterator */ /* NOTE: The TESTING() macro is called in main() */ @@ -698,12 +698,12 @@ check_group_layout(hid_t fid, const char *group_name) static herr_t check_dset_scheme(hid_t fid, const char *dset_name) { - H5F_t *file_ptr = NULL; /* ptr to internal file struct */ - hid_t did = -1; /* dataset ID */ - H5D_t *dset_ptr = NULL; /* ptr to internal dset struct */ - haddr_t tag; /* MD cache tag for dataset */ - int *data = NULL; /* buffer for fake data */ - uint32_t before, during, after; /* cache sizes */ + H5F_t *file_ptr = NULL; /* ptr to internal file struct */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + H5D_t *dset_ptr = NULL; /* ptr to internal dset struct */ + haddr_t tag; /* MD cache tag for dataset */ + int *data = NULL; /* buffer for fake data */ + uint32_t before, during, after; /* cache sizes */ /* NOTE: The TESTING() macro is called in main() */ @@ -801,8 +801,8 @@ check_dset_scheme(hid_t fid, const char *dset_name) static herr_t check_evict_on_close_api(void) { - hid_t fapl_id = -1; - hid_t dapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dapl_id = H5I_INVALID_HID; bool evict_on_close; herr_t status; @@ -883,9 +883,9 @@ check_evict_on_close_api(void) int main(void) { - hid_t fapl_id = -1; /* VFD-specific fapl */ - hid_t fid = -1; /* file ID */ - unsigned nerrors = 0; /* number of test errors */ + hid_t fapl_id = H5I_INVALID_HID; /* VFD-specific fapl */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + unsigned nerrors = 0; /* number of test errors */ printf("Testing evict-on-close cache behavior\n"); @@ -990,7 +990,7 @@ main(void) static herr_t check_evict_on_close_parallel_fail(void) { - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; bool evict_on_close; herr_t status; diff --git a/test/external.c b/test/external.c index 28d2e125b2d..3d1d3083e38 100644 --- a/test/external.c +++ b/test/external.c @@ -91,15 +91,15 @@ files_have_same_contents(const char *name1, const char *name2) static int test_non_extendible(hid_t file) { - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - 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 */ - int n = 0; /* number of external files */ - off_t file_offset = 0; /* external file offset */ - hsize_t file_size = 0; /* sizeof external file segment */ - haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* data space */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + hsize_t cur_size[1] = {100}; /* data space current size */ + hsize_t max_size[1] = {100}; /* data space maximum size */ + int n = 0; /* number of external files */ + off_t file_offset = 0; /* external file offset */ + hsize_t file_size = 0; /* sizeof external file segment */ + haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */ TESTING("fixed-size data space, exact storage"); @@ -193,11 +193,11 @@ test_non_extendible(hid_t file) static int test_too_small(hid_t file) { - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - hid_t dset = -1; /* dataset */ - hsize_t cur_size[1] = {100}; /* current data space size */ - hsize_t max_size[1] = {100}; /* maximum data space size */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* data space */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + hsize_t cur_size[1] = {100}; /* current data space size */ + hsize_t max_size[1] = {100}; /* maximum data space size */ TESTING("external storage is too small"); @@ -250,11 +250,11 @@ test_too_small(hid_t file) static int test_large_enough_current_eventual(hid_t file) { - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - hid_t dset = -1; /* dataset */ - hsize_t cur_size[1] = {100}; /* current data space size */ - hsize_t max_size[1] = {200}; /* maximum data space size */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* data space */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + hsize_t cur_size[1] = {100}; /* current data space size */ + hsize_t max_size[1] = {200}; /* maximum data space size */ TESTING("extendible dataspace, exact external size"); @@ -302,11 +302,11 @@ test_large_enough_current_eventual(hid_t file) static int test_large_enough_current_not_eventual(hid_t file) { - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - hid_t dset = -1; /* dataset */ - hsize_t cur_size[1] = {100}; /* current data space size */ - hsize_t max_size[1] = {200}; /* maximum data space size */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* data space */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + hsize_t cur_size[1] = {100}; /* current data space size */ + hsize_t max_size[1] = {200}; /* maximum data space size */ TESTING("extendible dataspace, external storage is too small"); @@ -359,9 +359,9 @@ test_large_enough_current_not_eventual(hid_t file) static int test_unlimited(hid_t file) { - hid_t dcpl = -1; /* dataset creation properties */ - hid_t space = -1; /* data space */ - hid_t dset = -1; /* dataset */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* data space */ + hid_t dset = H5I_INVALID_HID; /* dataset */ hsize_t cur_size[1] = {100}; /* data space current size */ hsize_t max_size[1] = {H5S_UNLIMITED}; /* data space maximum size */ int n; /* number of external files */ @@ -484,12 +484,12 @@ add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, h 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 */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t space = H5I_INVALID_HID; /* dataspace */ + hid_t dset = H5I_INVALID_HID; /* 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; TESTING("multiple external files"); @@ -568,9 +568,9 @@ test_multiple_files(hid_t file) static int test_add_to_unlimited(void) { - hid_t dcpl = -1; /* dataset creation properties */ - herr_t status = FAIL; /* function return status */ - int n = 0; /* number of external files */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + herr_t status = FAIL; /* function return status */ + int n = 0; /* number of external files */ TESTING("external file following unlimited file"); @@ -620,8 +620,8 @@ test_add_to_unlimited(void) static int test_overflow(void) { - hid_t dcpl = -1; /* dataset creation properties */ - herr_t status = FAIL; /* return status */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + herr_t status = FAIL; /* return status */ TESTING("address overflow in external files"); @@ -666,19 +666,19 @@ test_overflow(void) static int test_read_file_set(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 dset = -1; /* dataset */ - hid_t grp = -1; /* group to emit diagnostics */ - size_t i = 0; /* miscellaneous counter */ - char filename[1024]; /* file names */ - int part[PART_SIZE]; /* raw data buffer (partial) */ - int whole[TOTAL_SIZE]; /* raw data buffer (total) */ - hsize_t cur_size; /* current data space size */ - hid_t hs_space = -1; /* hyperslab data space */ - hsize_t hs_start = 30; /* hyperslab starting offset */ - hsize_t hs_count = 25; /* hyperslab size */ + 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 dset = H5I_INVALID_HID; /* dataset */ + hid_t grp = H5I_INVALID_HID; /* group to emit diagnostics */ + size_t i = 0; /* miscellaneous counter */ + char filename[1024]; /* file names */ + int part[PART_SIZE]; /* raw data buffer (partial) */ + int whole[TOTAL_SIZE]; /* raw data buffer (total) */ + hsize_t cur_size; /* current data space size */ + hid_t hs_space = H5I_INVALID_HID; /* hyperslab data space */ + hsize_t hs_start = 30; /* hyperslab starting offset */ + hsize_t hs_count = 25; /* hyperslab size */ TESTING("read external dataset"); @@ -788,19 +788,19 @@ test_read_file_set(hid_t fapl) static int test_write_file_set(hid_t fapl) { - hid_t file = -1; /* file to which to write */ - hid_t dcpl = -1; /* dataset creation properties */ - hid_t mem_space = -1; /* memory data space */ - hid_t file_space = -1; /* file data space */ - hid_t dset = -1; /* dataset */ - unsigned i = 0; /* miscellaneous counter */ - int part[PART_SIZE]; /* raw data buffer (partial) */ - int whole[TOTAL_SIZE]; /* raw data buffer (total) */ - hsize_t cur_size = 100; /* current data space size */ - hsize_t max_size = 200; /* maximum data space size */ - hsize_t hs_start = 100; /* hyperslab starting offset */ - hsize_t hs_count = 100; /* hyperslab size */ - char filename[1024]; /* file name */ + hid_t file = H5I_INVALID_HID; /* file to which to write */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation properties */ + hid_t mem_space = H5I_INVALID_HID; /* memory data space */ + hid_t file_space = H5I_INVALID_HID; /* file data space */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + unsigned i = 0; /* miscellaneous counter */ + int part[PART_SIZE]; /* raw data buffer (partial) */ + int whole[TOTAL_SIZE]; /* raw data buffer (total) */ + hsize_t cur_size = 100; /* current data space size */ + hsize_t max_size = 200; /* maximum data space size */ + hsize_t hs_start = 100; /* hyperslab starting offset */ + hsize_t hs_count = 100; /* hyperslab size */ + char filename[1024]; /* file name */ TESTING("write external dataset"); @@ -915,16 +915,16 @@ test_write_file_set(hid_t fapl) static int test_path_absolute(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 dset = -1; /* dataset */ - size_t i = 0; /* miscellaneous counter */ - char cwdpath[1024]; /* working directory */ - char filename[1088]; /* 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 */ + 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 dset = H5I_INVALID_HID; /* dataset */ + size_t i = 0; /* miscellaneous counter */ + char cwdpath[1024]; /* working directory */ + char filename[1088]; /* 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 */ TESTING("absolute filenames for external file"); @@ -1007,15 +1007,15 @@ test_path_absolute(hid_t fapl) static int test_path_relative(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 dset = -1; /* dataset */ - size_t i = 0; /* 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 */ + 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 dset = H5I_INVALID_HID; /* dataset */ + size_t i = 0; /* 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 */ TESTING("filenames relative to current directory for external file"); @@ -1096,20 +1096,20 @@ test_path_relative(hid_t fapl) static int test_path_relative_cwd(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 dapl2 = -1; /* copy of dapl */ - hid_t dset = -1; /* dataset */ - hid_t dset2 = -1; /* dataset, opened a second time */ - hid_t dset3 = -1; /* dataset, opened with different prefix */ - size_t i = 0; /* 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 dapl2 = H5I_INVALID_HID; /* copy of dapl */ + hid_t dset = H5I_INVALID_HID; /* dataset */ + hid_t dset2 = H5I_INVALID_HID; /* dataset, opened a second time */ + hid_t dset3 = H5I_INVALID_HID; /* dataset, opened with different prefix */ + size_t i = 0; /* 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("filenames relative to HDF5 file for external file"); @@ -1260,14 +1260,14 @@ test_path_relative_cwd(hid_t fapl) static int test_h5d_get_access_plist(hid_t fapl_id) { - hid_t fid = -1; /* file to write to */ - hid_t dcpl_id = -1; /* dataset creation properties */ - hid_t dapl_id = -1; /* dataset access properties */ - hid_t sid = -1; /* data space */ - hid_t did = -1; /* dataset */ - hsize_t dims = 0; /* dataset size */ - char *buffer = NULL; /* saved prefix name from dapl */ - char filename[1024]; /* file names */ + hid_t fid = H5I_INVALID_HID; /* file to write to */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation properties */ + hid_t dapl_id = H5I_INVALID_HID; /* dataset access properties */ + hid_t sid = H5I_INVALID_HID; /* data space */ + hid_t did = H5I_INVALID_HID; /* dataset */ + hsize_t dims = 0; /* dataset size */ + char *buffer = NULL; /* saved prefix name from dapl */ + char filename[1024]; /* file names */ TESTING("H5Dget_access_plist() returns correct prefix"); @@ -1361,13 +1361,13 @@ test_h5d_get_access_plist(hid_t fapl_id) 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 */ - char filename[1024]; /* file name for test_1* funcs */ - 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 */ + char filename[1024]; /* file name for test_1* funcs */ + unsigned latest_format; /* default or latest file format */ + int nerrors = 0; /* number of errors */ h5_reset(); @@ -1387,7 +1387,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) { diff --git a/test/external_env.c b/test/external_env.c index a7484a82f15..60673261e27 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 @@ test_path_env(hid_t fapl) 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) { diff --git a/test/farray.c b/test/farray.c index 78bf16e332a..d9c2d03916a 100644 --- a/test/farray.c +++ b/test/farray.c @@ -418,10 +418,10 @@ finish(hid_t fid, hid_t fapl_id, H5F_t *f, H5FA_t *fa, haddr_t fa_addr) static unsigned test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSED *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FA_t *fa = NULL; /* Fixed array wrapper */ - haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FA_t *fa = NULL; /* Fixed array wrapper */ + haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ /* Create file & retrieve pointer to internal file object */ if (create_file(fapl, &file, &f) < 0) @@ -546,10 +546,10 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE static unsigned test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FA_t *fa = NULL; /* Fixed array wrapper */ - haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FA_t *fa = NULL; /* Fixed array wrapper */ + haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ /* Create file & retrieve pointer to internal file object */ if (create_file(fapl, &file, &f) < 0) @@ -850,12 +850,12 @@ test_open_twice_diff(hid_t fapl_id, H5FA_create_t *cparam, farray_test_param_t * static unsigned test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FA_t *fa = NULL; /* Fixed array wrapper */ - H5FA_t *fa2 = NULL; /* Fixed array wrapper */ - haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ - h5_stat_size_t file_size; /* File size, after deleting array */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FA_t *fa = NULL; /* Fixed array wrapper */ + H5FA_t *fa2 = NULL; /* Fixed array wrapper */ + haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ + h5_stat_size_t file_size; /* File size, after deleting array */ /* Create file & retrieve pointer to internal file object */ if (create_file(fapl, &file, &f) < 0) @@ -1338,18 +1338,18 @@ static unsigned test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, hsize_t nelmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FA_t *fa = NULL; /* Fixed array wrapper */ - void *fiter_info; /* Fixed array iterator info */ - farray_state_t state; /* State of fixed array */ - uint64_t welmt; /* Element to write */ - uint64_t relmt; /* Element to read */ - hsize_t cnt; /* Count of array indices */ - hssize_t sidx; /* Index value of next element in the fixed array */ - hsize_t idx; /* Index value of next element in the fixed array */ - hsize_t fa_nelmts; /* # of elements in fixed array */ - haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FA_t *fa = NULL; /* Fixed array wrapper */ + void *fiter_info; /* Fixed array iterator info */ + farray_state_t state; /* State of fixed array */ + uint64_t welmt; /* Element to write */ + uint64_t relmt; /* Element to read */ + hsize_t cnt; /* Count of array indices */ + hssize_t sidx; /* Index value of next element in the fixed array */ + hsize_t idx; /* Index value of next element in the fixed array */ + hsize_t fa_nelmts; /* # of elements in fixed array */ + haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ assert(nelmts); /* @@ -1496,16 +1496,16 @@ static unsigned test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, hsize_t skip_elmts, bool check_rest, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FA_t *fa = NULL; /* Extensible array wrapper */ - farray_state_t state; /* State of extensible array */ - uint64_t welmt; /* Element to write */ - uint64_t relmt; /* Element to read */ - hsize_t idx; /* Index value of element to get */ - hsize_t cnt; /* Count of array indices */ - hsize_t fa_nelmts; /* # of elements in fixed array */ - haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ + hid_t file = H5I_INVALID_HID; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FA_t *fa = NULL; /* Extensible array wrapper */ + farray_state_t state; /* State of extensible array */ + uint64_t welmt; /* Element to write */ + uint64_t relmt; /* Element to read */ + hsize_t idx; /* Index value of element to get */ + hsize_t cnt; /* Count of array indices */ + hsize_t fa_nelmts; /* # of elements in fixed array */ + haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ /* * Display testing message @@ -1622,15 +1622,15 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, int main(void) { - H5FA_create_t cparam; /* Creation parameters for fixed array */ - farray_test_param_t tparam; /* Testing parameters */ - farray_test_type_t curr_test; /* Current test being worked on */ - farray_iter_type_t curr_iter; /* Current iteration type being worked on */ - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ - time_t curr_time; /* Current time, for seeding random number generator */ - int ExpressMode; /* Test express value */ - bool api_ctx_pushed = false; /* Whether API context pushed */ + H5FA_create_t cparam; /* Creation parameters for fixed array */ + farray_test_param_t tparam; /* Testing parameters */ + farray_test_type_t curr_test; /* Current test being worked on */ + farray_iter_type_t curr_iter; /* Current iteration type being worked on */ + hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ + time_t curr_time; /* Current time, for seeding random number generator */ + int ExpressMode; /* Test express value */ + bool api_ctx_pushed = false; /* Whether API context pushed */ /* Reset library */ h5_reset(); diff --git a/test/fheap.c b/test/fheap.c index 345a71b75c2..7042e799962 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1719,7 +1719,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *stat static unsigned test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ @@ -1835,7 +1835,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) static unsigned test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ @@ -1985,8 +1985,8 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) static unsigned test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t file2 = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5F_t *f2 = NULL; /* Internal file object pointer */ @@ -2160,7 +2160,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) static unsigned test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ @@ -2335,7 +2335,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) static unsigned test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2670,7 +2670,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) static unsigned test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2789,7 +2789,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) static unsigned test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2928,7 +2928,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) static unsigned test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file1 = -1; /* File ID */ + hid_t file1 = H5I_INVALID_HID; /* File ID */ hid_t file2 = -2; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ @@ -3057,7 +3057,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) static unsigned test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3169,7 +3169,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa static unsigned test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3267,7 +3267,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa static unsigned test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3360,7 +3360,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp static unsigned test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3456,7 +3456,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3559,7 +3559,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par static unsigned test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3663,7 +3663,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ static unsigned test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3771,7 +3771,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param static unsigned test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3864,7 +3864,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t static unsigned test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3964,7 +3964,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4062,7 +4062,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * static unsigned test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4169,7 +4169,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * static unsigned test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4264,7 +4264,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * static unsigned test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4357,7 +4357,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para static unsigned test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4456,7 +4456,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ static unsigned test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4563,7 +4563,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe static unsigned test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4663,7 +4663,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ static unsigned test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4771,7 +4771,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test static unsigned test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4876,7 +4876,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap static unsigned test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4971,7 +4971,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te static unsigned test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5077,7 +5077,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t static unsigned test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5177,7 +5177,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te static unsigned test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5284,7 +5284,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t static unsigned test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5392,7 +5392,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh static unsigned test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5497,7 +5497,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea static unsigned test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5603,7 +5603,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea static unsigned test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5715,7 +5715,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t static unsigned test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5833,7 +5833,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh static unsigned test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5942,7 +5942,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea static unsigned test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6053,7 +6053,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea static unsigned test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6177,7 +6177,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t static unsigned test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6334,7 +6334,7 @@ fprintf(stderr, "Random # seed was: %lu\n", seed); static unsigned test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6495,7 +6495,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara static unsigned test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6686,7 +6686,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara static unsigned test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6852,7 +6852,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7089,7 +7089,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7384,7 +7384,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param static unsigned test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7511,7 +7511,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ static unsigned test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7581,7 +7581,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ static unsigned test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7666,7 +7666,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7733,7 +7733,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7802,7 +7802,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par static unsigned test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7875,7 +7875,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa static unsigned test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7942,7 +7942,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa static unsigned test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8013,7 +8013,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param static unsigned test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8091,7 +8091,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param static unsigned test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8166,7 +8166,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t static unsigned test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8262,7 +8262,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test static unsigned test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8369,7 +8369,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t static unsigned test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8463,7 +8463,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t static unsigned test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8606,7 +8606,7 @@ static unsigned test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8769,7 +8769,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * static unsigned test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8894,7 +8894,7 @@ static unsigned test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9019,7 +9019,7 @@ static unsigned test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9141,7 +9141,7 @@ static unsigned test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9270,7 +9270,7 @@ static unsigned test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9413,7 +9413,7 @@ static unsigned test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9573,7 +9573,7 @@ static unsigned test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9726,7 +9726,7 @@ static unsigned test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9907,7 +9907,7 @@ static unsigned test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10035,7 +10035,7 @@ static unsigned test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10174,7 +10174,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10324,7 +10324,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10478,7 +10478,7 @@ static unsigned test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10639,7 +10639,7 @@ static unsigned test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped( hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10804,7 +10804,7 @@ static unsigned test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10964,7 +10964,7 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped( hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11144,7 +11144,7 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped( hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11361,7 +11361,7 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped( hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11558,7 +11558,7 @@ static unsigned test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped( hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11784,7 +11784,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ static unsigned test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11912,7 +11912,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12080,7 +12080,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12189,7 +12189,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * static unsigned test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12300,7 +12300,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * static unsigned test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12447,7 +12447,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12674,7 +12674,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12976,7 +12976,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp static unsigned test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13396,7 +13396,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13606,7 +13606,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam static unsigned test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13753,7 +13753,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13981,7 +13981,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -14582,7 +14582,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar static unsigned test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -14752,7 +14752,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para static unsigned test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15079,7 +15079,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa static unsigned test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15280,7 +15280,7 @@ fprintf(stderr, "Random # seed was: %lu\n", seed); static unsigned test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15502,7 +15502,7 @@ test_write_filter(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_ne static unsigned test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15779,7 +15779,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) static unsigned test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15947,15 +15947,15 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) int main(void) { - fheap_test_param_t tparam; /* Testing parameters */ - H5HF_create_t small_cparam; /* Creation parameters for "small" heap */ - H5HF_create_t large_cparam; /* Creation parameters for "large" heap */ - hid_t fapl = -1, def_fapl = -1; /* File access property list for data files */ - hid_t pb_fapl = -1; /* File access property list for data files */ - hid_t fcpl = -1, def_fcpl = -1; /* File creation property list for data files */ - fheap_test_type_t curr_test; /* Current test being worked on */ - unsigned u, v; /* Local index variable */ - unsigned nerrors = 0; /* Cumulative error count */ + fheap_test_param_t tparam; /* Testing parameters */ + H5HF_create_t small_cparam; /* Creation parameters for "small" heap */ + H5HF_create_t large_cparam; /* Creation parameters for "large" heap */ + hid_t fapl = H5I_INVALID_HID, def_fapl = H5I_INVALID_HID; /* File access property list for data files */ + hid_t pb_fapl = H5I_INVALID_HID; /* File access property list for data files */ + hid_t fcpl = H5I_INVALID_HID, def_fcpl = H5I_INVALID_HID; /* File creation property list for data files */ + fheap_test_type_t curr_test; /* Current test being worked on */ + unsigned u, v; /* Local index variable */ + unsigned nerrors = 0; /* Cumulative error count */ unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */ int ExpressMode; /* Express testing level */ const char *envval; /* Environment variable */ diff --git a/test/file_image.c b/test/file_image.c index 669afa90dfd..b80eef0db1d 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -79,8 +79,8 @@ typedef struct { static int test_properties(void) { - hid_t fapl_1 = -1; - hid_t fapl_2 = -1; + hid_t fapl_1 = H5I_INVALID_HID; + hid_t fapl_2 = H5I_INVALID_HID; char *buffer = 0; int count = 10; void *temp = 0; @@ -688,19 +688,19 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl int i; int fd = -1; int result; - hid_t driver = -1; - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t space_id = -1; - hid_t core_fapl_id = -1; - hid_t core_file_id = -1; + hid_t driver = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t core_fapl_id = H5I_INVALID_HID; + hid_t core_file_id = H5I_INVALID_HID; herr_t err; hsize_t dims[2]; ssize_t bytes_read; ssize_t image_size; ssize_t file_size; h5_stat_t stat_buf; - hid_t fcpl = -1; + hid_t fcpl = H5I_INVALID_HID; herr_t ret; TESTING(test_banner); @@ -958,10 +958,10 @@ test_get_file_image_error_rejection(void) void *image_ptr = NULL; int data[100]; int i; - hid_t fapl_id = -1; - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t space_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; herr_t err; hsize_t dims[2]; ssize_t bytes_read; diff --git a/test/filenotclosed.c b/test/filenotclosed.c index 699b9efca6d..48758af3166 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -49,11 +49,11 @@ catch_signal(int H5_ATTR_UNUSED signo) int main(void) { - hid_t fapl = -1; /* File access property lists */ - hid_t fid = -1; /* File ID */ - hid_t did = -1; /* Dataset ID */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t sid = -1; /* Dataspace ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property lists */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ hsize_t cur_dim[1] = {5}; /* Current dimension sizes */ hsize_t max_dim[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ hsize_t chunk_dim[1] = {10}; /* Chunk dimension sizes */ diff --git a/test/fillval.c b/test/fillval.c index 88f811460ca..555a4ed3ef6 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -61,7 +61,7 @@ typedef struct { static hid_t create_compound_type(void) { - hid_t ret_value = -1; + hid_t ret_value = H5I_INVALID_HID; if ((ret_value = H5Tcreate(H5T_COMPOUND, sizeof(comp_datatype))) < 0) goto error; @@ -99,8 +99,8 @@ create_compound_type(void) static hid_t create_compound_vl_type(void) { - hid_t str_id = -1; /* Datatype for VL-string fields */ - hid_t ret_value = -1; + hid_t str_id = H5I_INVALID_HID; /* Datatype for VL-string fields */ + hid_t ret_value = H5I_INVALID_HID; /* Create a string datatype */ if ((str_id = H5Tcopy(H5T_C_S1)) < 0) @@ -150,9 +150,9 @@ create_compound_vl_type(void) static int test_getset(void) { - hid_t dcpl = -1; + hid_t dcpl = H5I_INVALID_HID; int fill_i; - hid_t type_ss = -1, type_si = -1; + hid_t type_ss = H5I_INVALID_HID, type_si = H5I_INVALID_HID; struct fill_si { int v1, v2; } fill_si; @@ -275,12 +275,13 @@ static int test_getset_vl(hid_t fapl) { hsize_t dims[1] = {2}; - hid_t fileid = (-1), spaceid = (-1), dtypeid = (-1), datasetid = (-1), plistid = (-1); - char fill_value[] = "aaaa"; - char orig_fill_value[] = "aaaa"; - char *f1 = fill_value; - char *f2; - char filename[1024]; + hid_t fileid = (H5I_INVALID_HID), spaceid = (H5I_INVALID_HID), dtypeid = (H5I_INVALID_HID), + datasetid = (H5I_INVALID_HID), plistid = (H5I_INVALID_HID); + char fill_value[] = "aaaa"; + char orig_fill_value[] = "aaaa"; + char *f1 = fill_value; + char *f2; + char filename[1024]; TESTING("property lists, with variable-length datatype"); @@ -872,7 +873,8 @@ static int test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_fill_time_t fill_time, H5D_layout_t layout, H5T_class_t datatype, hid_t ctype_id) { - hid_t fspace = -1, mspace = -1, dset1 = -1, dset2 = -1; + hid_t fspace = H5I_INVALID_HID, mspace = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, + dset2 = H5I_INVALID_HID; hsize_t cur_size[5] = {2, 8, 8, 4, 2}; hsize_t one[5] = {1, 1, 1, 1, 1}; hsize_t hs_size[5], hs_stride[5]; @@ -1205,7 +1207,7 @@ static int test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) { char filename[1024]; - hid_t file = -1, dcpl = -1, ctype_id = -1; + hid_t file = H5I_INVALID_HID, dcpl = H5I_INVALID_HID, ctype_id = H5I_INVALID_HID; hsize_t ch_size[5] = {2, 8, 8, 4, 2}; int nerrors = 0; int fillval = 0x4c70f1cd; @@ -1563,10 +1565,10 @@ static int test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t *ch_size, hsize_t *start_size, hsize_t *max_size, hid_t dtype, void *fillval) { - hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */ - hid_t dset = -1; /* Dataset ID */ - hid_t dcpl = -1; /* Dataset creation property list */ - hsize_t extend_size[5]; /* Dimensions to extend to */ + hid_t fspace = H5I_INVALID_HID, mspace = H5I_INVALID_HID; /* File & memory dataspaces */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hsize_t extend_size[5]; /* Dimensions to extend to */ hsize_t one[5] = {1, 1, 1, 1, 1}; /* Dimensions of single element dataspace */ hsize_t hs_size[5], hs_stride[5], hs_offset[5]; size_t nelmts; @@ -2029,9 +2031,9 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t static int test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) { - hid_t file = -1; /* File ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t cmpd_vl_tid = -1; /* Compound+vl datatype ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t cmpd_vl_tid = H5I_INVALID_HID; /* Compound+vl datatype ID */ hsize_t start_size[5] = {8, 8, 8, 4, 2}; hsize_t max_size[5] = {32, 32, 32, 16, 8}; hsize_t ch_size[5] = {1, 8, 8, 4, 2}; @@ -2188,8 +2190,9 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) static int test_compatible(void) { - hid_t file = -1, dset1 = -1, dset2 = -1; - hid_t dcpl1 = -1, dcpl2 = -1, fspace = -1, mspace = -1; + hid_t file = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID; + hid_t dcpl1 = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID, fspace = H5I_INVALID_HID, + mspace = H5I_INVALID_HID; int rd_fill = 0, fill_val = 4444, val_rd = 0; hsize_t dims[2], one[2] = {1, 1}; hsize_t hs_offset[2] = {3, 4}; @@ -2339,7 +2342,7 @@ test_compatible(void) static int test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time) { - hid_t fspace = -1, dset1 = -1, rspace = -1; + hid_t fspace = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, rspace = H5I_INVALID_HID; herr_t ret; hsize_t ds_size[2] = {4, 4}; hsize_t max_size[2] = {H5S_UNLIMITED, 4}; @@ -2461,7 +2464,7 @@ static int test_partalloc(hid_t fapl, const char *base_name) { char filename[1024]; - hid_t file = -1, dcpl = -1; + hid_t file = H5I_INVALID_HID, dcpl = H5I_INVALID_HID; hsize_t ch_size[2] = {1, 4}; int nerrors = 0; @@ -2603,8 +2606,8 @@ int main(int argc, char *argv[]) { int nerrors = 0, argno, test_contig = 1, test_chunk = 1, test_compact = 1; - hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - unsigned new_format; /* Whether to use the new format or not */ + hid_t fapl = (H5I_INVALID_HID), fapl2 = (H5I_INVALID_HID); /* File access property lists */ + unsigned new_format; /* Whether to use the new format or not */ bool driver_is_default_compatible; if (argc >= 2) { diff --git a/test/filter_fail.c b/test/filter_fail.c index 7a8051a6065..feecf484123 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -93,10 +93,10 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned static herr_t test_filter_write(char *file_name, hid_t my_fapl, bool cache_enabled) { - hid_t file = -1; - hid_t dataset = -1; /* dataset ID */ - hid_t sid = -1; /* dataspace ID */ - hid_t dcpl = -1; /* dataset creation property list ID */ + hid_t file = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list ID */ hsize_t dims[1] = {DIM}; /* dataspace dimension - 10*/ hsize_t chunk_dims[1] = {FILTER_CHUNK_DIM}; /* chunk dimension - 2*/ int points[DIM]; /* Data */ @@ -225,10 +225,10 @@ test_filter_write(char *file_name, hid_t my_fapl, bool cache_enabled) static herr_t test_filter_read(char *file_name, hid_t my_fapl) { - hid_t file = -1; - hid_t dataset = -1; /* dataset ID */ - hid_t sid = -1; - hid_t mspace = -1; + hid_t file = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; + hid_t mspace = H5I_INVALID_HID; hsize_t dims[1] = {DIM}; /* dataspace dimension - 10*/ int rbuf[DIM]; /* Data */ hsize_t dset_size = 0; /* Dataset storage size */ diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 8c53b9fa69b..779db78d24a 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -176,19 +176,19 @@ compare_2D_arrays(int **dset1, int **dset2, const hsize_t *sizes, /*OUT*/ bool * static herr_t ensure_filter_works(hid_t fid, const char *name, hid_t dcpl_id) { - hid_t did = -1; /* Dataset ID */ - hid_t dxpl_id = -1; /* Dataset xfer property list ID */ - hid_t write_dxpl_id = -1; /* Dataset xfer property list ID for writing */ - hid_t sid = -1; /* Dataspace ID */ - void *tconv_buf = NULL; /* Temporary conversion buffer */ - int **orig = NULL; /* Data written to the dataset */ - int **read = NULL; /* Data read from the dataset */ - size_t r, c; /* Data rows and columns */ - size_t hs_r, hs_c, hs_offr, hs_offc; /* Hypserslab sizes and offsets */ - size_t i, j; /* Local index variables */ - int n = 0; /* Value written to point array */ - bool are_same; /* Output from dataset compare function */ - int ***save_array = NULL; /* (Global) array where the final data go */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset xfer property list ID */ + hid_t write_dxpl_id = H5I_INVALID_HID; /* Dataset xfer property list ID for writing */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + int **orig = NULL; /* Data written to the dataset */ + int **read = NULL; /* Data read from the dataset */ + size_t r, c; /* Data rows and columns */ + size_t hs_r, hs_c, hs_offr, hs_offc; /* Hypserslab sizes and offsets */ + size_t i, j; /* Local index variables */ + int n = 0; /* Value written to point array */ + bool are_same; /* Output from dataset compare function */ + int ***save_array = NULL; /* (Global) array where the final data go */ /* initialize */ r = (size_t)sizes_g[0]; @@ -437,9 +437,9 @@ ensure_filter_works(hid_t fid, const char *name, hid_t dcpl_id) static herr_t test_dataset_write_with_filters(hid_t fid) { - hid_t dcpl_id = -1; /* Dataset creation property list ID */ - unsigned int filter1_data; /* Data used by filter 1 */ - unsigned int libver_values[4]; /* Used w/ the filter that makes HDF5 calls */ + hid_t dcpl_id = H5I_INVALID_HID; /* Dataset creation property list ID */ + unsigned int filter1_data; /* Data used by filter 1 */ + unsigned int libver_values[4]; /* Used w/ the filter that makes HDF5 calls */ #ifdef H5_HAVE_FILTER_DEFLATE unsigned int compress_level; /* Deflate compression level */ #endif @@ -633,7 +633,7 @@ test_read_data(hid_t did, int *origin_data) static herr_t test_dataset_read_with_filters(hid_t fid) { - hid_t did = -1; /* Dataset ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ /*---------------------------------------------------------- * STEP 1: Test deflation by itself. @@ -768,8 +768,8 @@ ensure_data_read_fails(hid_t did) static herr_t test_no_read_when_plugins_disabled(hid_t fid) { - hid_t did = -1; /* Dataset ID */ - unsigned plugin_flags; /* Plugin access flags */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + unsigned plugin_flags; /* Plugin access flags */ TESTING("filter plugin 1 with filter plugins disabled"); @@ -826,9 +826,9 @@ test_no_read_when_plugins_disabled(hid_t fid) static herr_t test_creating_groups_using_plugins(hid_t fid) { - hid_t gcpl_id = -1; - hid_t gid = -1; - hid_t sub_gid = -1; + hid_t gcpl_id = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; + hid_t sub_gid = H5I_INVALID_HID; int i; char subgroup_name[256]; @@ -893,8 +893,8 @@ test_creating_groups_using_plugins(hid_t fid) static herr_t test_opening_groups_using_plugins(hid_t fid) { - hid_t gid = -1; - hid_t sub_gid = -1; + hid_t gid = H5I_INVALID_HID; + hid_t sub_gid = H5I_INVALID_HID; int i; char subgroup_name[256]; @@ -1433,9 +1433,9 @@ int main(void) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; - hid_t old_ff_fapl_id = -1; - hid_t new_ff_fapl_id = -1; + hid_t fid = H5I_INVALID_HID; + hid_t old_ff_fapl_id = H5I_INVALID_HID; + hid_t new_ff_fapl_id = H5I_INVALID_HID; unsigned new_format; int nerrors = 0; diff --git a/test/flush1.c b/test/flush1.c index 288b269235b..c1ae6763e10 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -54,12 +54,12 @@ static herr_t add_dset_to_file(hid_t fid, const char *dset_name); static hid_t create_file(const char *filename, hid_t fapl_id, bool swmr) { - hid_t fid = -1; /* file ID */ - hid_t top_gid = -1; /* containing group ID */ - hid_t gid = -1; /* subgroup ID */ - char group_name[32]; /* group name */ - unsigned flags; /* file open flags */ - int i; /* iterator */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t top_gid = H5I_INVALID_HID; /* containing group ID */ + hid_t gid = H5I_INVALID_HID; /* subgroup ID */ + char group_name[32]; /* group name */ + unsigned flags; /* file open flags */ + int i; /* iterator */ flags = H5F_ACC_TRUNC | (swmr ? H5F_ACC_SWMR_WRITE : 0); @@ -110,13 +110,13 @@ create_file(const char *filename, hid_t fapl_id, bool swmr) static herr_t add_dset_to_file(hid_t fid, const char *dset_name) { - hid_t dcpl_id = -1; /* dataset creation plist ID */ - hid_t sid = -1; /* dataspace ID */ - hid_t did = -1; /* dataset ID */ - int *data = NULL; /* data buffer */ - hsize_t dims[1] = {NELEMENTS}; /* size of dataset */ - hsize_t chunk_dims[1] = {CHUNK_SIZE}; /* chunk size */ - int i; /* iterator */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation plist ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + int *data = NULL; /* data buffer */ + hsize_t dims[1] = {NELEMENTS}; /* size of dataset */ + hsize_t chunk_dims[1] = {CHUNK_SIZE}; /* chunk size */ + int i; /* iterator */ /* Create a chunked dataset */ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -176,12 +176,12 @@ add_dset_to_file(hid_t fid, const char *dset_name) int main(void) { - char *driver = NULL; /* name of current VFD (from env var) */ - bool vfd_supports_swmr; /* whether the current VFD supports SWMR */ - hid_t fid = -1; /* file ID */ - hid_t fapl_id = -1; /* file access proplist ID */ - char filename[1024]; /* filename */ - bool use_swmr; /* whether or not to use SWMR I/O */ + char *driver = NULL; /* name of current VFD (from env var) */ + bool vfd_supports_swmr; /* whether the current VFD supports SWMR */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access proplist ID */ + char filename[1024]; /* filename */ + bool use_swmr; /* whether or not to use SWMR I/O */ h5_reset(); if ((fapl_id = h5_fileaccess()) < 0) diff --git a/test/flush2.c b/test/flush2.c index e0f4224bb24..21534fec605 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -54,11 +54,11 @@ static bool file_ok(const char *filename, hid_t fapl_id, bool check_second_dset) static bool dset_ok(hid_t fid, const char *dset_name) { - hid_t sid = -1; /* dataspace ID */ - hid_t did = -1; /* dataset ID */ - int *data = NULL; /* data buffer */ - hsize_t dims[1] = {0}; /* size of dataset */ - int i; /* iterator */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + int *data = NULL; /* data buffer */ + hsize_t dims[1] = {0}; /* size of dataset */ + int i; /* iterator */ /* Open the dataset and check size */ if ((did = H5Dopen2(fid, dset_name, H5P_DEFAULT)) < 0) @@ -113,11 +113,11 @@ dset_ok(hid_t fid, const char *dset_name) static bool file_ok(const char *filename, hid_t fapl_id, bool check_second_dset) { - hid_t fid = -1; /* file ID */ - hid_t top_gid = -1; /* containing group ID */ - hid_t gid = -1; /* subgroup ID */ - char group_name[32]; /* group name */ - int i; /* iterator */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t top_gid = H5I_INVALID_HID; /* containing group ID */ + hid_t gid = H5I_INVALID_HID; /* subgroup ID */ + char group_name[32]; /* group name */ + int i; /* iterator */ /* open file */ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id)) < 0) @@ -173,8 +173,8 @@ file_ok(const char *filename, hid_t fapl_id, bool check_second_dset) static herr_t clear_status_flags(const char *filename, hid_t fapl_id) { - hid_t new_fapl_id = -1; /* copy of the file access plist ID */ - hid_t fid = -1; /* file ID */ + hid_t new_fapl_id = H5I_INVALID_HID; /* copy of the file access plist ID */ + hid_t fid = H5I_INVALID_HID; /* file ID */ bool clear = true; /* Get a copy of fapl */ @@ -223,12 +223,12 @@ clear_status_flags(const char *filename, hid_t fapl_id) int main(void) { - char *driver = NULL; /* name of current VFD (from env var) */ - bool vfd_supports_swmr; /* whether the current VFD supports SWMR */ - hid_t fapl_id = -1; /* file access proplist ID */ - char filename[1024]; /* filename */ - bool check_second_dset; /* whether or not to check the second dset */ - H5E_auto2_t func; /* for shutting off error reporting */ + char *driver = NULL; /* name of current VFD (from env var) */ + bool vfd_supports_swmr; /* whether the current VFD supports SWMR */ + hid_t fapl_id = H5I_INVALID_HID; /* file access proplist ID */ + char filename[1024]; /* filename */ + bool check_second_dset; /* whether or not to check the second dset */ + H5E_auto2_t func; /* for shutting off error reporting */ bool driver_is_default_vfd_compatible; h5_reset(); diff --git a/test/flushrefresh.c b/test/flushrefresh.c index f42f65c4431..bec2cd1069c 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -1054,7 +1054,7 @@ herr_t flush_verification(const char *obj_pathname, const char *expected) { /* Variables */ - hid_t oid = -1, fid = -1; + hid_t oid = H5I_INVALID_HID, fid = H5I_INVALID_HID; herr_t status = 0; H5O_info2_t oinfo; diff --git a/test/freespace.c b/test/freespace.c index a118a72d297..67b4ffc4693 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -440,7 +440,7 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state) static unsigned test_fs_create(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -581,7 +581,7 @@ test_fs_create(hid_t fapl) static unsigned test_fs_sect_add(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -925,7 +925,7 @@ test_fs_sect_add(hid_t fapl) static unsigned test_fs_sect_find(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -1309,7 +1309,7 @@ test_fs_sect_find(hid_t fapl) static unsigned test_fs_sect_merge(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -1787,7 +1787,7 @@ test_fs_sect_merge(hid_t fapl) static unsigned test_fs_sect_shrink(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2134,7 +2134,7 @@ test_fs_sect_shrink(hid_t fapl) static unsigned test_fs_sect_change_class(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2422,7 +2422,7 @@ test_fs_sect_change_class(hid_t fapl) static unsigned test_fs_sect_extend(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2778,7 +2778,7 @@ test_fs_sect_extend(hid_t fapl) static unsigned test_fs_sect_iterate(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2874,9 +2874,9 @@ test_fs_sect_iterate(hid_t fapl) int main(void) { - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ - bool api_ctx_pushed = false; /* Whether API context pushed */ + hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ + bool api_ctx_pushed = false; /* Whether API context pushed */ h5_reset(); diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c index e9e3393f240..4f7b95997d8 100644 --- a/test/gen_bad_offset.c +++ b/test/gen_bad_offset.c @@ -50,10 +50,10 @@ int main(void) { - hid_t fid = -1, gid1 = -1, gid2 = -1; /* File and group IDs */ - hid_t did = -1, sid = -1; /* Dataset and dataspace IDs */ - int fd = -1; /* File descriptor */ - int64_t val = 999; /* Bad offset value */ + hid_t fid = H5I_INVALID_HID, gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* File and group IDs */ + hid_t did = H5I_INVALID_HID, sid = H5I_INVALID_HID; /* Dataset and dataspace IDs */ + int fd = -1; /* File descriptor */ + int64_t val = 999; /* Bad offset value */ /* Create the test file */ if ((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index 452c6223bb2..d81ba8b161d 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -40,12 +40,12 @@ int main(void) { #ifdef H5O_ENABLE_BAD_MESG_COUNT - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t gcpl = -1; /* Group creation property list ID */ - bool store_bad_mesg_count; /* Flag for storing a bad message count */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t gcpl = H5I_INVALID_HID; /* Group creation property list ID */ + bool store_bad_mesg_count; /* Flag for storing a bad message count */ /* Create test file */ if ((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 5ace0c96cb3..c8f335d953f 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -40,10 +40,10 @@ static int generate_datasets(hid_t loc_id, unsigned bogus_id) { - hid_t sid = -1; /* Dataspace ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t did = -1; /* Dataset ID */ - uint8_t bogus_flags = 0; /* Flags for bogus message */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + uint8_t bogus_flags = 0; /* Flags for bogus message */ /* Create dataspace for datasets */ if ((sid = H5Screate(H5S_SCALAR)) < 0) @@ -140,8 +140,8 @@ int main(void) { #ifdef H5O_ENABLE_BOGUS - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ /* Create file for test datasets */ if ((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 1198694a319..53fa436a6dc 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -109,12 +109,12 @@ static herr_t gen_earliest_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ float *buf = NULL; /* Buffer for writing data */ float *bufp = NULL; /* Pointer to data buffer */ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ @@ -253,12 +253,12 @@ gen_earliest_latest(void) static herr_t gen_earliest_v18(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ float *buf = NULL; /* Buffer for writing data */ float *bufp = NULL; /* Pointer to data buffer */ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ @@ -372,11 +372,11 @@ gen_earliest_v18(void) static herr_t gen_latest_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ float *buf = NULL; /* Buffer for writing data */ float *bufp = NULL; /* Pointer to data buffer */ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ @@ -480,12 +480,12 @@ gen_latest_latest(void) static herr_t gen_v18_latest(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ float *buf = NULL; /* Buffer for writing data */ float *bufp = NULL; /* Pointer to data buffer */ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ @@ -595,12 +595,12 @@ gen_v18_latest(void) static herr_t gen_v18_v18(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ float *buf = NULL; /* Buffer for writing data */ float *bufp = NULL; /* Pointer to data buffer */ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */ diff --git a/test/gen_cross.c b/test/gen_cross.c index 1bcfd64a274..f7a97107cce 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -87,8 +87,8 @@ int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* file and dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* file and dataset handles */ + hid_t dcpl = H5I_INVALID_HID; float data[NX][NY]; /* data to write */ float fillvalue = -2.2f; int i, j; @@ -188,8 +188,8 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) int create_scale_offset_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; float data[NX][NY]; /* data to write */ float fillvalue = -2.2f; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -273,8 +273,8 @@ create_scale_offset_dsets_float(hid_t fid, hid_t fsid, hid_t msid) int create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; double data[NX][NY]; /* data to write */ double fillvalue = -2.2; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -358,8 +358,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) int create_scale_offset_dsets_char(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; char data[NX][NY]; /* data to write */ char fillvalue = -2; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -451,8 +451,8 @@ create_scale_offset_dsets_char(hid_t fid, hid_t fsid, hid_t msid) int create_scale_offset_dsets_short(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; short data[NX][NY]; /* data to write */ short fillvalue = -2; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -544,8 +544,8 @@ create_scale_offset_dsets_short(hid_t fid, hid_t fsid, hid_t msid) int create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; int data[NX][NY]; /* data to write */ int fillvalue = -2; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -638,8 +638,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) int create_scale_offset_dsets_long_long(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; long long data[NX][NY]; /* data to write */ long long fillvalue = -2; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -731,8 +731,8 @@ create_scale_offset_dsets_long_long(hid_t fid, hid_t fsid, hid_t msid) int create_fletcher_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; float data[NX][NY]; /* data to write */ float fillvalue = -2.2f; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -817,8 +817,8 @@ int create_deflate_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { #ifdef H5_HAVE_FILTER_DEFLATE - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; float data[NX][NY]; /* data to write */ float fillvalue = -2.2f; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -998,8 +998,8 @@ create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid) int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t dcpl = H5I_INVALID_HID; float data[NX][NY]; /* data to write */ float fillvalue = -2.2f; hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; @@ -1083,9 +1083,9 @@ create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid) int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { - hid_t dataset = -1; /* dataset handles */ - hid_t datatype = -1; - hid_t dcpl = -1; + hid_t dataset = H5I_INVALID_HID; /* dataset handles */ + hid_t datatype = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; size_t precision, offset; float data[NX][NY]; /* data to write */ float fillvalue = -2.2f; @@ -1188,9 +1188,9 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) int main(void) { - hid_t file = -1; - hid_t filespace = -1; - hid_t memspace = -1; + hid_t file = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; + hid_t memspace = H5I_INVALID_HID; hsize_t dimsf[RANK]; hsize_t start[RANK] = {0, 0}; diff --git a/test/gen_deflate.c b/test/gen_deflate.c index 9c3d20f713a..b19dcbd573d 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -40,7 +40,7 @@ int main(void) { - hid_t fid = -1, sid = -1, did = -1, dcpl_id = -1; + hid_t fid = H5I_INVALID_HID, sid = H5I_INVALID_HID, did = H5I_INVALID_HID, dcpl_id = H5I_INVALID_HID; hsize_t dims[SPACE_RANK] = {SPACE_DIM1, SPACE_DIM2}; hsize_t chunk_dims[SPACE_RANK] = {CHUNK_DIM1, CHUNK_DIM2}; size_t i, j; /* Local index variables */ diff --git a/test/gen_file_image.c b/test/gen_file_image.c index bb86ecc80b9..c5c15106df1 100644 --- a/test/gen_file_image.c +++ b/test/gen_file_image.c @@ -33,7 +33,7 @@ int main(void) { - hid_t fid = -1, sid = -1, did = -1; + hid_t fid = H5I_INVALID_HID, sid = H5I_INVALID_HID, did = H5I_INVALID_HID; hsize_t dims[SPACE_RANK] = {SPACE_DIM1, SPACE_DIM2}; size_t i, j; /* Local index variables */ int *data = NULL; /* Dataset data */ diff --git a/test/gen_filespace.c b/test/gen_filespace.c index 59896b39f43..27f3d2628cb 100644 --- a/test/gen_filespace.c +++ b/test/gen_filespace.c @@ -46,15 +46,15 @@ const char *FILENAMES[] = { int main(void) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ - hsize_t dim[1]; /* Dimension sizes */ - int data[NUM_ELMTS]; /* Buffer for data */ - int i, j; /* Local index variables */ - H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ - unsigned fs_persist; /* Persisting free-space or not */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dim[1]; /* Dimension sizes */ + int data[NUM_ELMTS]; /* Buffer for data */ + int i, j; /* Local index variables */ + H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ + unsigned fs_persist; /* Persisting free-space or not */ j = 0; for (fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_strategy < H5F_FSPACE_STRATEGY_NTYPES; diff --git a/test/gen_filters.c b/test/gen_filters.c index 2bb458c1be9..6b96dec872e 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -41,12 +41,12 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned static herr_t test_filters_endianess(void) { - hid_t fid = -1; /* file ID */ - hid_t dsid = -1; /* dataset ID */ - hid_t sid = -1; /* dataspace ID */ - hid_t dcpl = -1; /* dataset creation property list ID */ - hsize_t dims[1] = {20}; /* dataspace dimensions */ - hsize_t chunk_dims[1] = {10}; /* chunk dimensions */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t dsid = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list ID */ + hsize_t dims[1] = {20}; /* dataspace dimensions */ + hsize_t chunk_dims[1] = {10}; /* chunk dimensions */ int buf[20]; int rank = 1; int i; @@ -146,12 +146,12 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, static herr_t create_file_with_bogus_filter(void) { - hid_t fid = -1; /* file ID */ - hid_t dsid = -1; /* dataset ID */ - hid_t sid = -1; /* dataspace ID */ - hid_t dcpl = -1; /* dataset creation property list ID */ - hsize_t dims[1] = {20}; /* dataspace dimensions */ - hsize_t chunk_dims[1] = {10}; /* chunk dimensions */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t dsid = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list ID */ + hsize_t dims[1] = {20}; /* dataspace dimensions */ + hsize_t chunk_dims[1] = {10}; /* chunk dimensions */ int buf[20]; int rank = 1; int i; diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 955c375015c..b27daee83c0 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -27,7 +27,8 @@ int main(void) { - hid_t file = -1, dcpl = -1, space = -1, dset1 = -1, dset2 = -1; + hid_t file = H5I_INVALID_HID, dcpl = H5I_INVALID_HID, space = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, + dset2 = H5I_INVALID_HID; hsize_t cur_size[2] = {8, 8}; H5D_space_status_t allocation; int fill_val1 = 4444, fill_val2 = 5555; diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 31c44cc4dbf..e9d55cbd172 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -28,12 +28,12 @@ int main(void) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t gid = -1; /* Group creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t gid = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ /* Create file creation property list */ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) diff --git a/test/gen_old_group.c b/test/gen_old_group.c index 3ed8a1f36cb..25e2a3306f6 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -30,8 +30,8 @@ int main(void) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group creation property list ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group creation property list ID */ /* Create file for test groups */ if ((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index 9843fcda0f4..91f938df508 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -30,9 +30,9 @@ int main(void) { - hid_t fid1 = -1; - hid_t fid2 = -1; - hid_t gid = -1; + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; diff --git a/test/genall5.c b/test/genall5.c index 21a7fb9fe6a..03652592c17 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -43,8 +43,8 @@ void ns_grp_0(hid_t fid, const char *group_name) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; herr_t ret; if (pass) { @@ -118,8 +118,8 @@ ns_grp_0(hid_t fid, const char *group_name) void vrfy_ns_grp_0(hid_t fid, const char *group_name) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; H5G_info_t grp_info; unsigned crt_order_flags = 0; herr_t ret; @@ -232,8 +232,8 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) void ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; unsigned max_compact; unsigned u; herr_t ret; @@ -369,8 +369,8 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) void vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; H5G_info_t grp_info; unsigned crt_order_flags = 0; unsigned u; @@ -641,8 +641,8 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) void ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; unsigned max_compact; unsigned u; herr_t ret; @@ -773,8 +773,8 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) void vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; H5G_info_t grp_info; unsigned crt_order_flags = 0; unsigned u; @@ -1042,8 +1042,8 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) void os_grp_0(hid_t fid, const char *group_name) { - hid_t gid = -1; - hid_t fapl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; H5F_libver_t low = H5F_LIBVER_ERROR, high = H5F_LIBVER_ERROR; herr_t ret; @@ -1127,8 +1127,8 @@ os_grp_0(hid_t fid, const char *group_name) void vrfy_os_grp_0(hid_t fid, const char *group_name) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; H5G_info_t grp_info; unsigned crt_order_flags = 0; herr_t ret; @@ -1241,9 +1241,9 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) void os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { - hid_t gid = -1; + hid_t gid = H5I_INVALID_HID; unsigned u; - hid_t fapl = -1; + hid_t fapl = H5I_INVALID_HID; H5F_libver_t low = H5F_LIBVER_ERROR, high = H5F_LIBVER_ERROR; herr_t ret; @@ -1356,8 +1356,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) { - hid_t gid = -1; - hid_t gcpl = -1; + hid_t gid = H5I_INVALID_HID; + hid_t gcpl = H5I_INVALID_HID; H5G_info_t grp_info; unsigned crt_order_flags = 0; unsigned u; @@ -1581,8 +1581,8 @@ ds_ctg_i(hid_t fid, const char *dset_name, bool write_data) { int *wdata = NULL; unsigned u; - hid_t dsid = -1; - hid_t sid = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1] = {DSET_DIMS}; herr_t ret; @@ -1673,10 +1673,10 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, bool write_data) { int *rdata = NULL; unsigned u; - hid_t dsid = -1; - hid_t sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; H5D_space_status_t allocation; H5D_layout_t layout; int ndims; @@ -1889,9 +1889,9 @@ ds_chk_i(hid_t fid, const char *dset_name, bool write_data) { int *wdata = NULL; unsigned u; - hid_t dsid = -1; - hid_t dcpl = -1; - hid_t sid = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1] = {DSET_DIMS}; hsize_t chunk_dims[1] = {DSET_CHUNK_DIMS}; herr_t ret; @@ -2011,10 +2011,10 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, bool write_data) { int *rdata = NULL; unsigned u; - hid_t dsid = -1; - hid_t sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; H5D_space_status_t allocation; H5D_layout_t layout; int ndims; @@ -2242,9 +2242,9 @@ ds_cpt_i(hid_t fid, const char *dset_name, bool write_data) { int *wdata = NULL; unsigned u; - hid_t dsid = -1; - hid_t dcpl = -1; - hid_t sid = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1] = {DSET_COMPACT_DIMS}; herr_t ret; @@ -2365,10 +2365,10 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, bool write_data) { int *rdata = NULL; unsigned u; - hid_t dsid = -1; - hid_t sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; H5D_space_status_t allocation; H5D_layout_t layout; int ndims; @@ -2574,9 +2574,9 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, bool write_data) void ds_ctg_v(hid_t fid, const char *dset_name, bool write_data) { - hid_t dsid = -1; - hid_t sid = -1; - hid_t tid = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; hsize_t dims[1] = {DSET_SMALL_DIMS}; herr_t ret; hvl_t *wdata = NULL; @@ -2718,11 +2718,11 @@ ds_ctg_v(hid_t fid, const char *dset_name, bool write_data) void vrfy_ds_ctg_v(hid_t fid, const char *dset_name, bool write_data) { - hid_t dsid = -1; - hid_t sid = -1; - hid_t tid = -1; - hid_t tmp_tid = -1; - hid_t dcpl = -1; + hid_t dsid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t tmp_tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; H5D_space_status_t allocation; H5D_layout_t layout; int ndims; diff --git a/test/getname.c b/test/getname.c index 869248e9899..644596ade6e 100644 --- a/test/getname.c +++ b/test/getname.c @@ -3750,7 +3750,7 @@ test_elinks(hid_t fapl) int main(void) { - hid_t file_id = (-1); + hid_t file_id = (H5I_INVALID_HID); int nerrors = 0; hid_t fapl; char filename0[1024]; diff --git a/test/h5test.c b/test/h5test.c index d7d53bd0310..50d5de69bcb 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -456,7 +456,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu char *ptr, last = '\0'; const char *suffix = _suffix; size_t i, j; - hid_t driver = -1; + hid_t driver = H5I_INVALID_HID; int isppdriver = 0; /* if the driver is MPI parallel */ if (!base_name || !fullname || size < 1) @@ -1446,7 +1446,7 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name, const H5O_ herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl) { - hid_t file = -1; + hid_t file = H5I_INVALID_HID; char filename[1024]; int i = 0; diff --git a/test/hdfs.c b/test/hdfs.c index 156046d83a8..c308d8c8e50 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -397,7 +397,7 @@ test_fapl_config_validation(void) * test-local variables * ************************/ - hid_t fapl_id = -1; /* file access property list ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ H5FD_hdfs_fapl_t config; H5FD_hdfs_fapl_t fa_fetch; herr_t success = SUCCEED; @@ -588,9 +588,9 @@ test_hdfs_fapl(void) * test-local variables * ************************/ - hid_t fapl_id = -1; /* file access property list ID */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ H5FD_hdfs_fapl_t hdfs_fa_0 = { 1, /* version*/ "", /* node name */ @@ -779,8 +779,8 @@ test_vfd_open(void) unsigned i = 0; unsigned failing_conditions_count = 10; H5FD_t *fd = NULL; - hid_t fapl_hdfs = -1; - hid_t fapl_unconfigured = -1; + hid_t fapl_hdfs = H5I_INVALID_HID; + hid_t fapl_unconfigured = H5I_INVALID_HID; TESTING("HDFS VFD-level open"); @@ -934,7 +934,7 @@ test_eof_eoa(void) ************************/ H5FD_t *fd_shakespeare = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("HDFS eof/eoa gets and sets"); @@ -1034,7 +1034,7 @@ test_H5FDread_without_eoa_set_fails(void) char buffer[HDFS_TEST_MAX_BUF_SIZE]; unsigned int i = 0; H5FD_t *file_shakespeare = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("HDFS VFD read-eoa temporal coupling library limitation"); @@ -1206,7 +1206,7 @@ test_read(void) char buffer[HDFS_TEST_MAX_BUF_SIZE]; unsigned int i = 0; H5FD_t *file_raven = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("HDFS VFD read/range-gets"); @@ -1349,7 +1349,7 @@ test_noops_and_autofails(void) * test-local variables * ************************/ - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; H5FD_t *file = NULL; const char data[36] = "The Force shall be with you, always"; @@ -1485,8 +1485,8 @@ test_H5F_integration(void) * test-local variables * ************************/ - hid_t file = -1; - hid_t fapl_id = -1; + hid_t file = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; TESTING("HDFS file access through HD5F library (H5F API)"); diff --git a/test/istore.c b/test/istore.c index 8dcc2050ef7..323b7d796aa 100644 --- a/test/istore.c +++ b/test/istore.c @@ -543,7 +543,7 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size_t nx, size_t ny, s int main(int argc, char *argv[]) { - hid_t fapl = -1, file = -1, fcpl = -1; + hid_t fapl = H5I_INVALID_HID, file = H5I_INVALID_HID, fcpl = H5I_INVALID_HID; herr_t status; int nerrors = 0; unsigned size_of_test; diff --git a/test/lheap.c b/test/lheap.c index 8ffb4b6ed13..182966bbce4 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -42,7 +42,7 @@ int main(void) { hid_t fapl = H5P_DEFAULT; /* file access properties */ - hid_t file = -1; /* hdf5 file */ + hid_t file = H5I_INVALID_HID; /* hdf5 file */ H5F_t *f = NULL; /* hdf5 file pointer */ char filename[1024]; /* file name */ haddr_t heap_addr; /* local heap address */ @@ -176,7 +176,7 @@ main(void) TESTING("opening pre-created file with non-default sizes"); { const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ - hid_t dset = -1; + hid_t dset = H5I_INVALID_HID; file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); if (file >= 0) { if ((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0) diff --git a/test/links.c b/test/links.c index 96bd7d6c9fe..188711f7721 100644 --- a/test/links.c +++ b/test/links.c @@ -486,10 +486,11 @@ mklinks(hid_t fapl, bool new_format) static int new_links(hid_t fapl, bool new_format) { - hid_t file_a, file_b = (-1); - hid_t grp1_a = (-1), grp1_b = (-1), grp2_a = (-1), grp2_b = (-1); - hid_t scalar = (-1); - hid_t dset1 = (-1), dset2 = (-1); + hid_t file_a, file_b = (H5I_INVALID_HID); + hid_t grp1_a = (H5I_INVALID_HID), grp1_b = (H5I_INVALID_HID), grp2_a = (H5I_INVALID_HID), + grp2_b = (H5I_INVALID_HID); + hid_t scalar = (H5I_INVALID_HID); + hid_t dset1 = (H5I_INVALID_HID), dset2 = (H5I_INVALID_HID); char filename[NAME_BUF_SIZE]; hsize_t size[1] = {1}; @@ -862,11 +863,11 @@ ck_new_links(hid_t fapl, bool new_format) static int long_links(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t gid2 = -1; /* Datatype ID */ - char *objname = NULL; /* Name of object [Long] */ - size_t u; /* Local index variable */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t gid2 = H5I_INVALID_HID; /* Datatype ID */ + char *objname = NULL; /* Name of object [Long] */ + size_t u; /* Local index variable */ char filename[NAME_BUF_SIZE]; if (new_format) @@ -941,9 +942,9 @@ long_links(hid_t fapl, bool new_format) static int toomany(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; if (new_format) @@ -1140,12 +1141,12 @@ toomany(hid_t fapl, bool new_format) static int test_lcpl(hid_t fapl, bool new_format) { - hid_t file_id = -1; - hid_t group_id = -1; - hid_t space_id = -1; - hid_t dset_id = -1; - hid_t type_id = -1; - hid_t lcpl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t type_id = H5I_INVALID_HID; + hid_t lcpl_id = H5I_INVALID_HID; H5L_info2_t linfo; char filename[1024]; hsize_t dims[2]; @@ -1353,9 +1354,10 @@ test_lcpl(hid_t fapl, bool new_format) static int test_move(hid_t fapl, bool new_format) { - hid_t file_a = -1, file_b = -1; - hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1; - char filename[1024]; + hid_t file_a = H5I_INVALID_HID, file_b = H5I_INVALID_HID; + hid_t grp_1 = H5I_INVALID_HID, grp_2 = H5I_INVALID_HID, grp_move = H5I_INVALID_HID, + moved_grp = H5I_INVALID_HID; + char filename[1024]; if (new_format) TESTING("H5Lmove (w/new group format)"); @@ -1520,9 +1522,10 @@ test_move(hid_t fapl, bool new_format) static int test_copy(hid_t fapl, bool new_format) { - hid_t file_a = -1, file_b = -1; - hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1; - char filename[1024]; + hid_t file_a = H5I_INVALID_HID, file_b = H5I_INVALID_HID; + hid_t grp_1 = H5I_INVALID_HID, grp_2 = H5I_INVALID_HID, grp_move = H5I_INVALID_HID, + moved_grp = H5I_INVALID_HID; + char filename[1024]; if (new_format) TESTING("H5Lcopy (w/new group format)"); @@ -1695,11 +1698,11 @@ test_copy(hid_t fapl, bool new_format) static int test_move_preserves(hid_t fapl_id, bool new_format) { - hid_t file_id = -1; - hid_t group_id = -1; - hid_t fcpl_id = -1; /* Group creation property list ID */ - hid_t lcpl_id = -1; - hid_t lcpl2_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t lcpl_id = H5I_INVALID_HID; + hid_t lcpl2_id = H5I_INVALID_HID; H5O_info2_t oinfo; H5L_info2_t linfo; H5T_cset_t old_cset; @@ -1935,9 +1938,9 @@ test_move_preserves(hid_t fapl_id, bool new_format) static int test_deprec(hid_t fapl, bool new_format) { - hid_t file_id = -1; - hid_t group1_id = -1; - hid_t group2_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t group1_id = H5I_INVALID_HID; + hid_t group2_id = H5I_INVALID_HID; H5G_stat_t sb_hard1, sb_hard2, sb_soft1, sb_soft2; H5G_obj_t obj_type; /* Object type */ hsize_t num_objs; /* Number of objects in a group */ @@ -2313,12 +2316,12 @@ cklinks_deprec(hid_t fapl, bool new_format) static int test_lcpl_deprec(hid_t fapl, bool new_format) { - hid_t file_id = -1; - hid_t group_id = -1; - hid_t space_id = -1; - hid_t dset_id = -1; - hid_t type_id = -1; - hid_t lcpl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t type_id = H5I_INVALID_HID; + hid_t lcpl_id = H5I_INVALID_HID; H5L_info1_t linfo; char filename[1024]; hsize_t dims[2]; @@ -2527,11 +2530,11 @@ test_lcpl_deprec(hid_t fapl, bool new_format) static int test_move_preserves_deprec(hid_t fapl_id, bool new_format) { - hid_t file_id = -1; - hid_t group_id = -1; - hid_t fcpl_id = -1; /* Group creation property list ID */ - hid_t lcpl_id = -1; - hid_t lcpl2_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t lcpl_id = H5I_INVALID_HID; + hid_t lcpl2_id = H5I_INVALID_HID; H5O_info1_t oinfo; H5L_info1_t linfo; H5T_cset_t old_cset; @@ -2767,10 +2770,10 @@ test_move_preserves_deprec(hid_t fapl_id, bool new_format) static int external_link_root_deprec(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5L_info1_t linfo; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info1_t linfo; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; const char *file; /* File from external link */ @@ -2986,12 +2989,12 @@ external_link_root_deprec(hid_t fapl, bool new_format) static int external_link_query_deprec(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ - const char *file_name; /* Name of the file the external link points to */ - const char *object_name; /* Name of the object the external link points to */ - H5O_info1_t oi; /* Object information */ - H5L_info1_t li; /* Link information */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ + const char *file_name; /* Name of the file the external link points to */ + const char *object_name; /* Name of the object the external link points to */ + H5O_info1_t oi; /* Object information */ + H5L_info1_t li; /* Link information */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ @@ -3140,9 +3143,11 @@ external_link_query_deprec(hid_t fapl, bool new_format) static int external_link_closing_deprec(hid_t fapl, bool new_format) { - hid_t fid1 = (-1), fid2 = (-1), fid3 = (-1), fid4 = (-1); - hid_t gid = (-1), tid = (-1), tid2 = (-1), sid = (-1), did = (-1); - hid_t lcpl_id = (-1); + hid_t fid1 = (H5I_INVALID_HID), fid2 = (H5I_INVALID_HID), fid3 = (H5I_INVALID_HID), + fid4 = (H5I_INVALID_HID); + hid_t gid = (H5I_INVALID_HID), tid = (H5I_INVALID_HID), tid2 = (H5I_INVALID_HID), sid = (H5I_INVALID_HID), + did = (H5I_INVALID_HID); + hid_t lcpl_id = (H5I_INVALID_HID); hsize_t dims[2]; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], filename4[NAME_BUF_SIZE], /* Names of files to externally link across */ @@ -3449,7 +3454,7 @@ UD_hard_create_deprec(const char H5_ATTR_UNUSED *link_name, hid_t loc_group, con size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id) { haddr_t addr; - hid_t target_obj = -1; + hid_t target_obj = H5I_INVALID_HID; herr_t ret_value = 0; if (udata_size != sizeof(haddr_t)) { @@ -3523,7 +3528,7 @@ UD_hard_traverse_deprec(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, c size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id) { haddr_t addr; - hid_t ret_value = -1; + hid_t ret_value = H5I_INVALID_HID; if (udata_size != sizeof(haddr_t)) return FAIL; @@ -3540,7 +3545,7 @@ static herr_t UD_hard_delete_deprec(const char H5_ATTR_UNUSED *link_name, hid_t file, const void *udata, size_t udata_size) { haddr_t addr; - hid_t target_obj = -1; + hid_t target_obj = H5I_INVALID_HID; herr_t ret_value = 0; if (udata_size != sizeof(haddr_t)) { @@ -3611,11 +3616,11 @@ UD_hard_delete_deprec(const char H5_ATTR_UNUSED *link_name, hid_t file, const vo static int ud_hard_links_deprec(hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5L_info1_t li; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ - h5_stat_size_t empty_size; /* Size of an empty file */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info1_t li; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ + h5_stat_size_t empty_size; /* Size of an empty file */ char filename[NAME_BUF_SIZE]; TESTING("user-defined hard link using deprecated routines (w/new group format)"); @@ -3768,10 +3773,10 @@ ud_hard_links_deprec(hid_t fapl) static int ud_link_reregister_deprec(hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5L_info1_t li; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info1_t li; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ @@ -3952,9 +3957,9 @@ ud_link_reregister_deprec(hid_t fapl) static int ud_callbacks_deprec(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t lcpl = -1; /* Link Creation PL */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t lcpl = H5I_INVALID_HID; /* Link Creation PL */ H5L_info1_t li; /* Link information */ char ud_target_name[] = UD_CB_TARGET; /* Link target name */ char filename[NAME_BUF_SIZE]; @@ -4129,12 +4134,12 @@ ud_callbacks_deprec(hid_t fapl, bool new_format) static int lapl_nlinks_deprec(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t plist = -1; /* lapl ID */ - hid_t tid = -1, sid = -1, did = -1; /* Other IDs */ - hid_t gapl = -1, dapl = -1, tapl = -1; /* Other property lists */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t plist = H5I_INVALID_HID; /* lapl ID */ + hid_t tid = H5I_INVALID_HID, sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Other IDs */ + hid_t gapl = H5I_INVALID_HID, dapl = H5I_INVALID_HID, tapl = H5I_INVALID_HID; /* Other property lists */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; size_t nlinks; /* nlinks for H5Pset_nlinks */ hsize_t dims[2]; @@ -4436,11 +4441,11 @@ lapl_nlinks_deprec(hid_t fapl, bool new_format) static int linkinfo_deprec(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t tid = -1; /* Type ID */ - hid_t sid = -1, did = -1; /* Dataspace and dataset IDs */ - H5L_info1_t li; /* Link information */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t tid = H5I_INVALID_HID; /* Type ID */ + hid_t sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Dataspace and dataset IDs */ + H5L_info1_t li; /* Link information */ char filename[NAME_BUF_SIZE]; if (new_format) @@ -4549,15 +4554,15 @@ linkinfo_deprec(hid_t fapl, bool new_format) static int corder_create_compact_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned nlinks; /* Number of link messages in group's header */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + unsigned u; /* Local index variable */ TESTING("creating compact group with creation order indexing using deprecated routines"); @@ -4691,17 +4696,17 @@ corder_create_compact_deprec(hid_t fapl) static int corder_create_dense_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ - hsize_t name_count; /* # of records in name index */ - hsize_t corder_count; /* # of records in creation order index */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned nlinks; /* Number of link messages in group's header */ + hsize_t name_count; /* # of records in name index */ + hsize_t corder_count; /* # of records in creation order index */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + unsigned u; /* Local index variable */ TESTING("creating dense group with creation order indexing using deprecated routines"); @@ -5060,21 +5065,21 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, b static int link_info_by_idx_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned hard_link; /* Create hard or soft link? */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5L_info1_t linfo; /* Link info struct */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[NAME_BUF_SIZE]; /* Link value name */ - char filename[NAME_BUF_SIZE]; /* File name */ - char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ - unsigned u; /* Local index variable */ - ssize_t name_len; /* Length of name */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned hard_link; /* Create hard or soft link? */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5L_info1_t linfo; /* Link info struct */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[NAME_BUF_SIZE]; /* Link value name */ + char filename[NAME_BUF_SIZE]; /* File name */ + char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ + unsigned u; /* Local index variable */ + ssize_t name_len; /* Length of name */ + herr_t ret; /* Generic return value */ /* Loop over creating hard or soft links */ for (hard_link = false; hard_link <= true; hard_link++) { @@ -5299,19 +5304,19 @@ link_info_by_idx_deprec(hid_t fapl) static int link_info_by_idx_old_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - unsigned hard_link; /* Create hard or soft link? */ - H5L_info1_t linfo; /* Link info struct */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[NAME_BUF_SIZE]; /* Link value name */ - char filename[NAME_BUF_SIZE]; /* File name */ - haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ - char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ - char tmpval[NAME_BUF_SIZE]; /* Temporary link value */ - unsigned u; /* Local index variable */ - ssize_t name_len; /* Length of name */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + unsigned hard_link; /* Create hard or soft link? */ + H5L_info1_t linfo; /* Link info struct */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[NAME_BUF_SIZE]; /* Link value name */ + char filename[NAME_BUF_SIZE]; /* File name */ + haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ + char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ + char tmpval[NAME_BUF_SIZE]; /* Temporary link value */ + unsigned u; /* Local index variable */ + ssize_t name_len; /* Length of name */ + herr_t ret; /* Generic return value */ /* Loop over creating hard or soft links */ for (hard_link = false; hard_link <= true; hard_link++) { @@ -5505,20 +5510,20 @@ link_info_by_idx_old_deprec(hid_t fapl) static int delete_by_idx_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5L_info1_t linfo; /* Link info struct */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5L_info1_t linfo; /* Link info struct */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Loop over operating on different indices on link fields */ for (idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) { @@ -5913,16 +5918,16 @@ delete_by_idx_deprec(hid_t fapl) static int delete_by_idx_old_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - H5L_info1_t linfo; /* Link info struct */ - H5_iter_order_t order; /* Order within in the index */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ - char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info1_t linfo; /* Link info struct */ + H5_iter_order_t order; /* Order within in the index */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ + char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Loop over operating in different orders */ for (order = H5_ITER_INC; order <= H5_ITER_DEC; order++) { @@ -6451,21 +6456,21 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o static int link_iterate_deprec(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - link_iter_info_t iter_info; /* Iterator info */ - bool *visited = NULL; /* Array of flags for visiting links */ - hsize_t skip; /* # of links to skip in group */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = (H5I_INVALID_HID); /* File ID */ + hid_t group_id = (H5I_INVALID_HID); /* Group ID */ + hid_t gcpl_id = (H5I_INVALID_HID); /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + link_iter_info_t iter_info; /* Iterator info */ + bool *visited = NULL; /* Array of flags for visiting links */ + hsize_t skip; /* # of links to skip in group */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Create group creation property list */ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) @@ -6914,7 +6919,8 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma skip = 0; H5E_BEGIN_TRY { - ret = H5Literate1((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, NULL); + ret = H5Literate1((hid_t)(H5I_INVALID_HID), H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, + NULL); } H5E_END_TRY if (ret >= 0) @@ -6922,7 +6928,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma H5E_BEGIN_TRY { - ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_deprec_cb, iter_info); + ret = H5Giterate((hid_t)(H5I_INVALID_HID), ".", &gskip, group_iterate_old_deprec_cb, iter_info); } H5E_END_TRY if (ret >= 0) @@ -6947,16 +6953,16 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma static int link_iterate_old_deprec(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - H5_iter_order_t order; /* Order within in the index */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - link_iter_info_t iter_info; /* Iterator info */ - bool *visited = NULL; /* Array of flags for visiting links */ - hsize_t skip; /* # of links to skip in group */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + H5_iter_order_t order; /* Order within in the index */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + link_iter_info_t iter_info; /* Iterator info */ + bool *visited = NULL; /* Array of flags for visiting links */ + hsize_t skip; /* # of links to skip in group */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Allocate the "visited link" array */ iter_info.max_visit = CORDER_NLINKS; @@ -7083,10 +7089,10 @@ link_iterate_old_deprec(hid_t fapl) static int external_link_root(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5L_info2_t linfo; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info2_t linfo; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; const char *file; /* File from external link */ @@ -7302,9 +7308,9 @@ external_link_root(hid_t fapl, bool new_format) static int external_link_path(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; @@ -7424,9 +7430,9 @@ external_link_path(hid_t fapl, bool new_format) static int external_link_mult(hid_t fapl, bool new_format) { - hid_t fid = -1, fid2 = -1; /* File IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], filename4[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -7622,10 +7628,10 @@ external_link_mult(hid_t fapl, bool new_format) static int external_link_self(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t lcpl_id = -1; /* Link Creation Property List ID */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t lcpl_id = H5I_INVALID_HID; /* Link Creation Property List ID */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; char filename3[NAME_BUF_SIZE]; @@ -7813,8 +7819,8 @@ external_link_self(hid_t fapl, bool new_format) static int external_link_pingpong(hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1), gid2 = (-1); /* Group IDs */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID), gid2 = (H5I_INVALID_HID); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -7965,8 +7971,8 @@ external_link_pingpong(hid_t fapl, bool new_format) static int external_link_toomany(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -8114,10 +8120,10 @@ external_link_toomany(hid_t fapl, bool new_format) static int external_link_dangling(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ - hid_t rid = -1; /* Root Group ID */ - hid_t status = -1; /* Status */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ + hid_t rid = H5I_INVALID_HID; /* Root Group ID */ + hid_t status = H5I_INVALID_HID; /* Status */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if (new_format) @@ -8234,9 +8240,9 @@ external_link_dangling(hid_t fapl, bool new_format) static int external_link_prefix(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ - hid_t gapl_id = -1; + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ + hid_t gapl_id = H5I_INVALID_HID; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; if (new_format) @@ -8331,8 +8337,8 @@ external_link_prefix(hid_t fapl, bool new_format) static int external_link_abs_mainpath(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -8427,8 +8433,8 @@ external_link_abs_mainpath(hid_t fapl, bool new_format) static int external_link_rel_mainpath(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; if (new_format) @@ -8515,8 +8521,8 @@ external_link_rel_mainpath(hid_t fapl, bool new_format) static int external_link_cwd(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; if (new_format) @@ -8609,8 +8615,8 @@ external_link_cwd(hid_t fapl, bool new_format) static int external_link_abstar(hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -8707,8 +8713,8 @@ external_link_abstar(hid_t fapl, bool new_format) static int external_link_abstar_cur(hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -8804,8 +8810,8 @@ external_link_abstar_cur(hid_t fapl, bool new_format) static int external_link_reltar(hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; if (new_format) @@ -8887,8 +8893,8 @@ external_link_reltar(hid_t fapl, bool new_format) static int external_link_chdir(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; if (new_format) @@ -8993,14 +8999,14 @@ external_link_chdir(hid_t fapl, bool new_format) static int external_set_elink_fapl1(hid_t fapl, bool new_format) { - hid_t fid = (-1); - hid_t fidA = (-1), fidB = (-1); - hid_t gidA = (-1), gidB = (-1); - hid_t oidA = (-1), oidB = (-1); + hid_t fid = (H5I_INVALID_HID); + hid_t fidA = (H5I_INVALID_HID), fidB = (H5I_INVALID_HID); + hid_t gidA = (H5I_INVALID_HID), gidB = (H5I_INVALID_HID); + hid_t oidA = (H5I_INVALID_HID), oidB = (H5I_INVALID_HID); char filename1[NAME_BUF_SIZE], filename2A[NAME_BUF_SIZE], filename2B[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; - hid_t fam_fapl = -1, multi_fapl = -1; - hid_t lapl_idA = -1, lapl_idB = -1; + hid_t fam_fapl = H5I_INVALID_HID, multi_fapl = H5I_INVALID_HID; + hid_t lapl_idA = H5I_INVALID_HID, lapl_idB = H5I_INVALID_HID; hid_t memb_fapl[H5FD_MEM_NTYPES]; char sv[H5FD_MEM_NTYPES][64]; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; @@ -9428,8 +9434,8 @@ external_set_elink_fapl2(hid_t fapl, bool new_format) static int external_set_elink_fapl3(bool new_format) { - hid_t core_fapl = -1, stdio_fapl = -1; - hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl; + hid_t core_fapl = H5I_INVALID_HID, stdio_fapl = H5I_INVALID_HID; + hid_t lapl_id = H5I_INVALID_HID, new_lapl_id = H5I_INVALID_HID, l_fapl = H5I_INVALID_HID, out_fapl; if (new_format) TESTING("H5Pset/get_fapl() (w/new group format)"); @@ -9530,7 +9536,8 @@ external_set_elink_fapl3(bool new_format) static int external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, bool new_format) { - hid_t file1 = -1, file2 = -1, group = -1, subgroup = -1, gapl = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, group = H5I_INVALID_HID, + subgroup = H5I_INVALID_HID, gapl = H5I_INVALID_HID; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; herr_t ret; unsigned flags; @@ -9868,8 +9875,9 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, cons static int external_set_elink_cb(hid_t fapl, bool new_format) { - hid_t file1 = -1, file2 = -1, group = -1, gapl = -1, fam_fapl = -1, ret_fapl = -1, base_driver; - set_elink_cb_t op_data, *op_data_p; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, group = H5I_INVALID_HID, gapl = H5I_INVALID_HID, + fam_fapl = H5I_INVALID_HID, ret_fapl = H5I_INVALID_HID, base_driver; + set_elink_cb_t op_data, *op_data_p; H5L_elink_traverse_t cb; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; unsigned flags; @@ -10099,8 +10107,8 @@ external_reset_register(void) static int external_link_win1(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -10193,8 +10201,8 @@ external_link_win1(hid_t fapl, bool new_format) static int external_link_win2(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -10290,8 +10298,8 @@ external_link_win2(hid_t fapl, bool new_format) static int external_link_win3(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ int drive = 0; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE]; @@ -10384,8 +10392,8 @@ external_link_win3(hid_t fapl, bool new_format) static int external_link_win4(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ int drive = 0; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE]; @@ -10475,8 +10483,8 @@ external_link_win4(hid_t fapl, bool new_format) static int external_link_win5(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ int drive = 0; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -10576,8 +10584,8 @@ external_link_win5(hid_t fapl, bool new_format) static int external_link_win6(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ int drive = 0; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE]; @@ -10674,8 +10682,8 @@ external_link_win6(hid_t fapl, bool new_format) static int external_link_win7(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -10770,8 +10778,8 @@ external_link_win7(hid_t fapl, bool new_format) static int external_link_win8(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ int drive = 0; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -10869,8 +10877,8 @@ external_link_win8(hid_t fapl, bool new_format) static int external_link_win9(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE]; @@ -10962,8 +10970,8 @@ external_link_win9(hid_t fapl, bool new_format) static int external_link_recursive(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE]; /* Names of files to externally link across */ if (new_format) @@ -11032,12 +11040,12 @@ external_link_recursive(hid_t fapl, bool new_format) static int external_link_query(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ - const char *file_name; /* Name of the file the external link points to */ - const char *object_name; /* Name of the object the external link points to */ - H5O_info2_t oi; /* Object information */ - H5L_info2_t li; /* Link information */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ + const char *file_name; /* Name of the file the external link points to */ + const char *object_name; /* Name of the object the external link points to */ + H5O_info2_t oi; /* Object information */ + H5L_info2_t li; /* Link information */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ @@ -11185,8 +11193,8 @@ external_link_query(hid_t fapl, bool new_format) static int external_link_unlink_compact(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ if (new_format) @@ -11278,9 +11286,9 @@ external_link_unlink_compact(hid_t fapl, bool new_format) static int external_link_unlink_dense(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gcpl = -1; /* Group creation property list ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gcpl = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ unsigned nmsgs; /* Number of messages in group's header */ @@ -11455,8 +11463,8 @@ external_link_unlink_dense(hid_t fapl, bool new_format) static int external_link_move(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -11690,9 +11698,9 @@ external_link_move(hid_t fapl, bool new_format) static int external_link_ride(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gcpl = -1; /* Group creation property list ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gcpl = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ unsigned nmsgs; /* Number of messages in group's header */ @@ -11922,9 +11930,11 @@ external_link_ride(hid_t fapl, bool new_format) static int external_link_closing(hid_t fapl, bool new_format) { - hid_t fid1 = (-1), fid2 = (-1), fid3 = (-1), fid4 = (-1); - hid_t gid = (-1), tid = (-1), tid2 = (-1), sid = (-1), did = (-1); - hid_t lcpl_id = (-1); + hid_t fid1 = (H5I_INVALID_HID), fid2 = (H5I_INVALID_HID), fid3 = (H5I_INVALID_HID), + fid4 = (H5I_INVALID_HID); + hid_t gid = (H5I_INVALID_HID), tid = (H5I_INVALID_HID), tid2 = (H5I_INVALID_HID), sid = (H5I_INVALID_HID), + did = (H5I_INVALID_HID); + hid_t lcpl_id = (H5I_INVALID_HID); hsize_t dims[2]; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], filename4[NAME_BUF_SIZE], /* Names of files to externally link across */ @@ -12238,10 +12248,10 @@ external_link_closing(hid_t fapl, bool new_format) static int external_link_endian(bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t lapl_id = -1; /* Prop List ID */ - const char *pathbuf = H5_get_srcdir(); /* Path to the files */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t lapl_id = H5I_INVALID_HID; /* Prop List ID */ + const char *pathbuf = H5_get_srcdir(); /* Path to the files */ const char *namebuf; if (new_format) @@ -12323,10 +12333,10 @@ external_link_endian(bool new_format) static int external_link_strong(hid_t fapl, bool new_format) { - hid_t my_fapl = (-1); /* File access property list */ - hid_t fid1 = (-1), fid2 = (-1); /* File ID */ - hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t my_fapl = (H5I_INVALID_HID); /* File access property list */ + hid_t fid1 = (H5I_INVALID_HID), fid2 = (H5I_INVALID_HID); /* File ID */ + hid_t gid1 = (H5I_INVALID_HID), gid2 = (H5I_INVALID_HID); /* Group IDs */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; if (new_format) @@ -12727,9 +12737,9 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, bool new_format) static int external_copy_invalid_object(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t ocpyplid = -1; /* Object copy plist ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t ocpyplid = H5I_INVALID_HID; /* Object copy plist ID */ char filename[NAME_BUF_SIZE]; if (new_format) @@ -12807,9 +12817,9 @@ external_copy_invalid_object(hid_t fapl, bool new_format) static int external_dont_fail_to_source(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t oid = -1; /* Object ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t oid = H5I_INVALID_HID; /* Object ID */ char filename[NAME_BUF_SIZE]; if (new_format) @@ -12876,12 +12886,12 @@ external_dont_fail_to_source(hid_t fapl, bool new_format) static int external_file_cache(hid_t fapl, bool new_format) { - hid_t my_fapl = -1; /* Temporary FAPL */ - hid_t fid1 = -1; /* File ID */ - hid_t fid2 = -1; /* File ID */ - hid_t fid3 = -1; /* File ID */ - hid_t fid4 = -1; /* File ID */ - hid_t oid = -1; /* Object ID */ + hid_t my_fapl = H5I_INVALID_HID; /* Temporary FAPL */ + hid_t fid1 = H5I_INVALID_HID; /* File ID */ + hid_t fid2 = H5I_INVALID_HID; /* File ID */ + hid_t fid3 = H5I_INVALID_HID; /* File ID */ + hid_t fid4 = H5I_INVALID_HID; /* File ID */ + hid_t oid = H5I_INVALID_HID; /* Object ID */ unsigned efc_size; char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; @@ -13234,12 +13244,12 @@ external_file_cache(hid_t fapl, bool new_format) static int external_open_twice(hid_t fapl, bool new_format) { - hid_t fid1 = -1; /* File ID */ - hid_t fid2 = -1; /* File ID */ - hid_t oid1 = -1; /* Object ID */ - hid_t oid2 = -1; /* Object ID */ - hid_t type = -1; /* Datatype ID */ - hid_t space = -1; /* Dataspace ID */ + hid_t fid1 = H5I_INVALID_HID; /* File ID */ + hid_t fid2 = H5I_INVALID_HID; /* File ID */ + hid_t oid1 = H5I_INVALID_HID; /* Object ID */ + hid_t oid2 = H5I_INVALID_HID; /* Object ID */ + hid_t type = H5I_INVALID_HID; /* Datatype ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; @@ -13449,24 +13459,24 @@ external_open_twice(hid_t fapl, bool new_format) static int external_link_with_committed_datatype(hid_t fapl, bool new_format) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gid1 = -1, gid2 = -1; /* Group IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t sid2 = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t atid = -1; /* Attribute's datatype ID */ - hid_t did = -1; /* Dataset ID */ - hid_t dtid = -1; /* Dataset's datatype ID */ - hid_t dcpl = -1; /* Dataset creation property list */ - int wdata = 99; /* Attribute data written */ - int wbuf[60]; /* Data buffer for writing */ - int rbuf[60]; /* Data buffer for reading */ - int i; /* Local index variable */ - char filename1[NAME_BUF_SIZE]; /* File name for main file */ - char filename2[NAME_BUF_SIZE]; /* File name for target file */ - hsize_t dims[2] = {5, 12}; /* Dimension sizes */ - hsize_t chunks[2] = {3, 7}; /* Chunk sizes */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t sid2 = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t atid = H5I_INVALID_HID; /* Attribute's datatype ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t dtid = H5I_INVALID_HID; /* Dataset's datatype ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + int wdata = 99; /* Attribute data written */ + int wbuf[60]; /* Data buffer for writing */ + int rbuf[60]; /* Data buffer for reading */ + int i; /* Local index variable */ + char filename1[NAME_BUF_SIZE]; /* File name for main file */ + char filename2[NAME_BUF_SIZE]; /* File name for target file */ + hsize_t dims[2] = {5, 12}; /* Dimension sizes */ + hsize_t chunks[2] = {3, 7}; /* Chunk sizes */ if (new_format) TESTING("attach committed datatype to external group's attribute/dataset(w/new group format)"); @@ -13716,7 +13726,7 @@ external_link_with_committed_datatype(hid_t fapl, bool new_format) static int external_link_public_macros(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ H5L_info2_t linfo; /* Link information */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename1[NAME_BUF_SIZE]; @@ -13827,7 +13837,7 @@ UD_hard_create(const char H5_ATTR_UNUSED *link_name, hid_t loc_group, const void hid_t H5_ATTR_UNUSED lcpl_id) { H5O_token_t token; - hid_t target_obj = -1; + hid_t target_obj = H5I_INVALID_HID; herr_t ret_value = 0; if (udata_size != sizeof(H5O_token_t)) { @@ -13901,7 +13911,7 @@ UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const vo hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id) { H5O_token_t token; - hid_t ret_value = -1; + hid_t ret_value = H5I_INVALID_HID; if (udata_size != sizeof(H5O_token_t)) return FAIL; @@ -13919,7 +13929,7 @@ static herr_t UD_hard_delete(const char H5_ATTR_UNUSED *link_name, hid_t file, const void *udata, size_t udata_size) { H5O_token_t token; - hid_t target_obj = -1; + hid_t target_obj = H5I_INVALID_HID; herr_t ret_value = 0; if (udata_size != sizeof(H5O_token_t)) { @@ -13990,11 +14000,11 @@ UD_hard_delete(const char H5_ATTR_UNUSED *link_name, hid_t file, const void *uda static int ud_hard_links(hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5L_info2_t li; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ - h5_stat_size_t empty_size; /* Size of an empty file */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info2_t li; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ + h5_stat_size_t empty_size; /* Size of an empty file */ char filename[NAME_BUF_SIZE]; TESTING("user-defined hard link (w/new group format)"); @@ -14175,10 +14185,10 @@ UD_rereg_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const v static int ud_link_reregister(hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5L_info2_t li; /* Link information */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5L_info2_t li; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ @@ -14503,9 +14513,9 @@ UD_cb_query(const char *link_name, const void *udata, size_t udata_size, void *b static int ud_callbacks(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t lcpl = -1; /* Link Creation PL */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t lcpl = H5I_INVALID_HID; /* Link Creation PL */ H5L_info2_t li; /* Link information */ char ud_target_name[] = UD_CB_TARGET; /* Link target name */ char filename[NAME_BUF_SIZE]; @@ -14703,9 +14713,9 @@ UD_plist_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const v static int lapl_udata(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t plist_id = -1; /* Property List ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t plist_id = H5I_INVALID_HID; /* Property List ID */ char group_a_name[NAME_BUF_SIZE]; char group_b_name[NAME_BUF_SIZE]; char filename[NAME_BUF_SIZE]; @@ -15028,8 +15038,8 @@ const H5L_class_t UD_error4_class[1] = {{ static int ud_link_errors(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ char group_name[NAME_BUF_SIZE]; char filename[NAME_BUF_SIZE]; char query_buf[NAME_BUF_SIZE]; @@ -15215,12 +15225,12 @@ ud_link_errors(hid_t fapl, bool new_format) static int lapl_nlinks(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t plist = -1; /* lapl ID */ - hid_t tid = -1, sid = -1, did = -1; /* Other IDs */ - hid_t gapl = -1, dapl = -1, tapl = -1; /* Other property lists */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t plist = H5I_INVALID_HID; /* lapl ID */ + hid_t tid = H5I_INVALID_HID, sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Other IDs */ + hid_t gapl = H5I_INVALID_HID, dapl = H5I_INVALID_HID, tapl = H5I_INVALID_HID; /* Other property lists */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; size_t nlinks; /* nlinks for H5Pset_nlinks */ hsize_t dims[2]; @@ -15522,11 +15532,11 @@ lapl_nlinks(hid_t fapl, bool new_format) static int linkinfo(hid_t fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t tid = -1; /* Type ID */ - hid_t sid = -1, did = -1; /* Dataspace and dataset IDs */ - H5L_info2_t li; /* Link information */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t tid = H5I_INVALID_HID; /* Type ID */ + hid_t sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Dataspace and dataset IDs */ + H5L_info2_t li; /* Link information */ char filename[NAME_BUF_SIZE]; if (new_format) @@ -15639,7 +15649,7 @@ linkinfo(hid_t fapl, bool new_format) static int check_all_closed(hid_t fapl, bool new_format, int stopat) { - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; char filename[NAME_BUF_SIZE]; int x; @@ -15686,11 +15696,11 @@ check_all_closed(hid_t fapl, bool new_format, int stopat) static hid_t build_visit_file(hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t tid = -1; /* Datatype ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ char filename[NAME_BUF_SIZE]; const char *pathname = H5_get_srcdir_filename(LINKED_FILE); /* Corrected test file name */ @@ -15842,8 +15852,8 @@ static int link_visit(hid_t fapl, bool new_format) { lvisit_ud_t udata; /* User-data for visiting */ - hid_t fid = -1; - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; /* Group ID */ if (new_format) TESTING("link visiting (w/new group format)"); @@ -15919,8 +15929,8 @@ static int link_visit_by_name(hid_t fapl, bool new_format) { lvisit_ud_t udata; /* User-data for visiting */ - hid_t fid = -1; - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; /* Group ID */ if (new_format) TESTING("link visiting by name (w/new group format)"); @@ -16033,8 +16043,8 @@ static int obj_visit(hid_t fapl, bool new_format) { ovisit_ud_t udata; /* User-data for visiting */ - hid_t fid = -1; - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; /* Group ID */ if (new_format) TESTING("object visiting (w/new group format)"); @@ -16114,8 +16124,8 @@ static int obj_visit_by_name(hid_t fapl, bool new_format) { ovisit_ud_t udata; /* User-data for visiting */ - hid_t fid = -1; - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID; /* Group ID */ if (new_format) TESTING("object visiting by name (w/new group format)"); @@ -16232,7 +16242,7 @@ static int obj_visit_stop(hid_t fapl, bool new_format) { unsigned nvisited; /* User-data for visiting */ - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; herr_t ret; /* Return value */ if (new_format) @@ -16360,15 +16370,15 @@ link_filter_filter(unsigned int flags, size_t cd_nelmts, const unsigned int cd_v static int link_filters(hid_t fapl, bool new_format) { - hid_t fid = -1, fcpl = -1; - hid_t gid1 = -1, gid2 = -1, gcpl1 = -1, gcpl2 = -1; - hid_t lcpl = -1; - size_t cd_nelmts = 1; - unsigned cd_value = 2112; - unsigned cd_value_out; - unsigned flags_out; - unsigned filter_config_out; - int nfilters = 0; + hid_t fid = H5I_INVALID_HID, fcpl = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gcpl1 = H5I_INVALID_HID, gcpl2 = H5I_INVALID_HID; + hid_t lcpl = H5I_INVALID_HID; + size_t cd_nelmts = 1; + unsigned cd_value = 2112; + unsigned cd_value_out; + unsigned flags_out; + unsigned filter_config_out; + int nfilters = 0; H5Z_class2_t filter_class; char name_out[24]; char filename[NAME_BUF_SIZE]; @@ -16772,8 +16782,8 @@ static int obj_exists(hid_t fapl, bool new_format) { char filename[NAME_BUF_SIZE]; /* Buffer for file name */ - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ herr_t status; /* Generic return value */ if (new_format) @@ -17100,12 +17110,12 @@ obj_exists(hid_t fapl, bool new_format) static int corder_create_empty(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned crt_order_flags; /* Status of creation order info for GCPL */ - herr_t ret; /* Generic return value */ - char filename[NAME_BUF_SIZE]; /* File name */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned crt_order_flags; /* Status of creation order info for GCPL */ + herr_t ret; /* Generic return value */ + char filename[NAME_BUF_SIZE]; /* File name */ TESTING("creating empty group with creation order indexing"); @@ -17230,15 +17240,15 @@ corder_create_empty(hid_t fapl) static int corder_create_compact(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned nlinks; /* Number of link messages in group's header */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + unsigned u; /* Local index variable */ TESTING("creating compact group with creation order indexing"); @@ -17372,17 +17382,17 @@ corder_create_compact(hid_t fapl) static int corder_create_dense(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ - hsize_t name_count; /* # of records in name index */ - hsize_t corder_count; /* # of records in creation order index */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned nlinks; /* Number of link messages in group's header */ + hsize_t name_count; /* # of records in name index */ + hsize_t corder_count; /* # of records in creation order index */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + unsigned u; /* Local index variable */ TESTING("creating dense group with creation order indexing"); @@ -17535,19 +17545,19 @@ corder_create_dense(hid_t fapl) static int corder_transition(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned nlinks; /* Number of link messages in group's header */ - hsize_t name_count; /* # of records in name index */ - hsize_t corder_count; /* # of records in creation order index */ - h5_stat_size_t empty_size; /* Size of empty file */ - h5_stat_size_t file_size; /* Size of file after operating on it */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned nlinks; /* Number of link messages in group's header */ + hsize_t name_count; /* # of records in name index */ + hsize_t corder_count; /* # of records in creation order index */ + h5_stat_size_t empty_size; /* Size of empty file */ + h5_stat_size_t file_size; /* Size of file after operating on it */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + unsigned u; /* Local index variable */ TESTING("transitioning group with creation order indexing between dense & compact forms"); @@ -17832,19 +17842,19 @@ corder_transition(hid_t fapl) static int corder_delete(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - hsize_t name_count; /* # of records in name index */ - hsize_t corder_count; /* # of records in creation order index */ - unsigned reopen_file; /* Whether to re-open the file before deleting group */ - h5_stat_size_t empty_size; /* Size of empty file */ - h5_stat_size_t file_size; /* Size of file after operating on it */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + hsize_t name_count; /* # of records in name index */ + hsize_t corder_count; /* # of records in creation order index */ + unsigned reopen_file; /* Whether to re-open the file before deleting group */ + h5_stat_size_t empty_size; /* Size of empty file */ + h5_stat_size_t file_size; /* Size of file after operating on it */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + unsigned u; /* Local index variable */ TESTING("deleting group with creation order indexing in dense form"); @@ -18188,21 +18198,21 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, bool har static int link_info_by_idx(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - unsigned hard_link; /* Create hard or soft link? */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5L_info2_t linfo; /* Link info struct */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[NAME_BUF_SIZE]; /* Link value name */ - char filename[NAME_BUF_SIZE]; /* File name */ - char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ - unsigned u; /* Local index variable */ - ssize_t name_len; /* Length of name */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + unsigned hard_link; /* Create hard or soft link? */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5L_info2_t linfo; /* Link info struct */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[NAME_BUF_SIZE]; /* Link value name */ + char filename[NAME_BUF_SIZE]; /* File name */ + char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ + unsigned u; /* Local index variable */ + ssize_t name_len; /* Length of name */ + herr_t ret; /* Generic return value */ /* Loop over creating hard or soft links */ for (hard_link = false; hard_link <= true; hard_link++) { @@ -18423,8 +18433,8 @@ link_info_by_idx(hid_t fapl) static int link_info_by_idx_old(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ H5F_t *f = NULL; unsigned hard_link; /* Create hard or soft link? */ H5L_info2_t linfo; /* Link info struct */ @@ -18647,20 +18657,20 @@ link_info_by_idx_old(hid_t fapl) static int delete_by_idx(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5L_info2_t linfo; /* Link info struct */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5L_info2_t linfo; /* Link info struct */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + char tmpname[NAME_BUF_SIZE]; /* Temporary link name */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Loop over operating on different indices on link fields */ for (idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) { @@ -19055,8 +19065,8 @@ delete_by_idx(hid_t fapl) static int delete_by_idx_old(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1, group_id2 = -1; /* Group IDs */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */ H5F_t *f = NULL; H5L_info2_t linfo; /* Link info struct */ H5_iter_order_t order; /* Order within in the index */ @@ -19631,21 +19641,21 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u static int link_iterate(hid_t fapl) { - hid_t file_id = (-1); /* File ID */ - hid_t group_id = (-1); /* Group ID */ - hid_t gcpl_id = (-1); /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - link_iter_info_t iter_info; /* Iterator info */ - bool *visited = NULL; /* Array of flags for visiting links */ - hsize_t skip; /* # of links to skip in group */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = (H5I_INVALID_HID); /* File ID */ + hid_t group_id = (H5I_INVALID_HID); /* Group ID */ + hid_t gcpl_id = (H5I_INVALID_HID); /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + link_iter_info_t iter_info; /* Iterator info */ + bool *visited = NULL; /* Array of flags for visiting links */ + hsize_t skip; /* # of links to skip in group */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Create group creation property list */ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) @@ -20108,7 +20118,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links skip = 0; H5E_BEGIN_TRY { - ret = H5Literate2((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); + ret = H5Literate2((hid_t)(H5I_INVALID_HID), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); } H5E_END_TRY if (ret >= 0) @@ -20117,7 +20127,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links #ifndef H5_NO_DEPRECATED_SYMBOLS H5E_BEGIN_TRY { - ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info); + ret = H5Giterate((hid_t)(H5I_INVALID_HID), ".", &gskip, group_iterate_old_cb, iter_info); } H5E_END_TRY if (ret >= 0) @@ -20143,16 +20153,16 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links static int link_iterate_old(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - H5_iter_order_t order; /* Order within in the index */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char filename[NAME_BUF_SIZE]; /* File name */ - link_iter_info_t iter_info; /* Iterator info */ - bool *visited = NULL; /* Array of flags for visiting links */ - hsize_t skip; /* # of links to skip in group */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + H5_iter_order_t order; /* Order within in the index */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename[NAME_BUF_SIZE]; /* File name */ + link_iter_info_t iter_info; /* Iterator info */ + bool *visited = NULL; /* Array of flags for visiting links */ + hsize_t skip; /* # of links to skip in group */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Allocate the "visited link" array */ iter_info.max_visit = CORDER_NLINKS; @@ -20276,13 +20286,13 @@ static int open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, H5O_token_t *objno) { - char mntname[NAME_BUF_SIZE]; /* Link value */ - hid_t group_id = -1; /* ID of group to test */ - H5O_info2_t oi; /* Buffer for querying object's info */ - H5O_token_t mnt_root_token; /* Token (address) of root group in file to mount */ - hid_t obj_id; /* ID of object opened */ - unsigned mnt_idx; /* Index to mount group on */ - unsigned u, v; /* Local index variables */ + char mntname[NAME_BUF_SIZE]; /* Link value */ + hid_t group_id = H5I_INVALID_HID; /* ID of group to test */ + H5O_info2_t oi; /* Buffer for querying object's info */ + H5O_token_t mnt_root_token; /* Token (address) of root group in file to mount */ + hid_t obj_id; /* ID of object opened */ + unsigned mnt_idx; /* Index to mount group on */ + unsigned u, v; /* Local index variables */ int token_cmp; /* Work through main & soft link groups */ @@ -20388,23 +20398,23 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, static int open_by_idx(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t mount_file_id = -1; /* File ID for file to mount */ - hid_t group_id = -1; /* Group ID */ - hid_t soft_group_id = -1; /* Group ID for soft links */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5O_info2_t oi; /* Buffer for querying object's info */ - char filename[NAME_BUF_SIZE]; /* File name */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[2 * NAME_BUF_SIZE]; /* Link value */ - H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */ - unsigned u; /* Local index variable */ - hid_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t mount_file_id = H5I_INVALID_HID; /* File ID for file to mount */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5O_info2_t oi; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE]; /* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[2 * NAME_BUF_SIZE]; /* Link value */ + H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */ + unsigned u; /* Local index variable */ + hid_t ret; /* Generic return value */ /* Create group creation property list */ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) @@ -20657,14 +20667,14 @@ static int open_by_idx_check_old(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, H5O_token_t *objno) { - char mntname[NAME_BUF_SIZE]; /* Link value */ - hid_t group_id = -1; /* ID of group to test */ - H5O_info2_t oi; /* Buffer for querying object's info */ - H5O_token_t mnt_root_token; /* Token of root group in file to mount */ - hid_t obj_id; /* ID of object opened */ - unsigned mnt_idx; /* Index to mount group on */ - unsigned u, v; /* Local index variables */ - int cmp_value; /* Token comparison value */ + char mntname[NAME_BUF_SIZE]; /* Link value */ + hid_t group_id = H5I_INVALID_HID; /* ID of group to test */ + H5O_info2_t oi; /* Buffer for querying object's info */ + H5O_token_t mnt_root_token; /* Token of root group in file to mount */ + hid_t obj_id; /* ID of object opened */ + unsigned mnt_idx; /* Index to mount group on */ + unsigned u, v; /* Local index variables */ + int cmp_value; /* Token comparison value */ /* Work through main & soft link groups */ for (v = 0; v < 2; v++) { @@ -20769,18 +20779,18 @@ open_by_idx_check_old(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file static int open_by_idx_old(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t mount_file_id = -1; /* File ID for file to mount */ - hid_t group_id = -1; /* Group ID */ - hid_t soft_group_id = -1; /* Group ID for soft links */ - H5_iter_order_t order; /* Order within in the index */ - H5O_info2_t oi; /* Buffer for querying object's info */ - char filename[NAME_BUF_SIZE]; /* File name */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[2 * NAME_BUF_SIZE]; /* Link value */ - H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */ - unsigned u; /* Local index variable */ - hid_t ret; /* Generic return value */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t mount_file_id = H5I_INVALID_HID; /* File ID for file to mount */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */ + H5_iter_order_t order; /* Order within in the index */ + H5O_info2_t oi; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE]; /* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[2 * NAME_BUF_SIZE]; /* Link value */ + H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */ + unsigned u; /* Local index variable */ + hid_t ret; /* Generic return value */ /* Create file to mount */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); @@ -20922,10 +20932,10 @@ static int object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, H5O_token_t *objno) { - char objname[NAME_BUF_SIZE]; /* Object name */ - hid_t group_id = -1; /* ID of group to test */ - H5O_info2_t oinfo; /* Buffer for querying object's info */ - unsigned u, v; /* Local index variables */ + char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t group_id = H5I_INVALID_HID; /* ID of group to test */ + H5O_info2_t oinfo; /* Buffer for querying object's info */ + unsigned u, v; /* Local index variables */ int token_cmp; /* Work through main & soft link groups */ @@ -21005,24 +21015,24 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, static int object_info(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t soft_group_id = -1; /* Group ID for soft links */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - hid_t space_id = -1; /* Dataspace ID (for attributes) */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5O_info2_t oinfo; /* Buffer for querying object's info */ - char filename[NAME_BUF_SIZE]; /* File name */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[2 * NAME_BUF_SIZE]; /* Link value */ - char attrname[NAME_BUF_SIZE]; /* Attribute name */ - H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */ - herr_t ret; /* Generic return value */ - unsigned u, v; /* Local index variables */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t space_id = H5I_INVALID_HID; /* Dataspace ID (for attributes) */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5O_info2_t oinfo; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE]; /* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[2 * NAME_BUF_SIZE]; /* Link value */ + char attrname[NAME_BUF_SIZE]; /* Attribute name */ + H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */ + herr_t ret; /* Generic return value */ + unsigned u, v; /* Local index variables */ /* Create group creation property list */ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) @@ -21310,10 +21320,10 @@ static int object_info_check_old(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, H5_iter_order_t order, unsigned max_links, H5O_token_t *objno) { - char objname[NAME_BUF_SIZE]; /* Object name */ - hid_t group_id = -1; /* ID of group to test */ - H5O_info2_t oinfo; /* Buffer for querying object's info */ - unsigned u, v; /* Local index variables */ + char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t group_id = H5I_INVALID_HID; /* ID of group to test */ + H5O_info2_t oinfo; /* Buffer for querying object's info */ + unsigned u, v; /* Local index variables */ /* Work through main & soft link groups */ for (v = 0; v < 2; v++) { @@ -21393,19 +21403,19 @@ object_info_check_old(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_t static int object_info_old(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t soft_group_id = -1; /* Group ID for soft links */ - hid_t space_id = -1; /* Dataspace ID (for attributes) */ - H5_iter_order_t order; /* Order within in the index */ - H5O_info2_t oinfo; /* Buffer for querying object's info */ - char filename[NAME_BUF_SIZE]; /* File name */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char valname[2 * NAME_BUF_SIZE]; /* Link value */ - char attrname[NAME_BUF_SIZE]; /* Attribute name */ - H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */ - herr_t ret; /* Generic return value */ - unsigned u, v; /* Local index variables */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */ + hid_t space_id = H5I_INVALID_HID; /* Dataspace ID (for attributes) */ + H5_iter_order_t order; /* Order within in the index */ + H5O_info2_t oinfo; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE]; /* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[2 * NAME_BUF_SIZE]; /* Link value */ + char attrname[NAME_BUF_SIZE]; /* Attribute name */ + H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */ + herr_t ret; /* Generic return value */ + unsigned u, v; /* Local index variables */ /* Create dataspace for attributes */ if ((space_id = H5Screate(H5S_SCALAR)) < 0) @@ -21566,22 +21576,22 @@ object_info_old(hid_t fapl) static int group_info(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t soft_group_id = -1; /* Group ID for soft links */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - H5_index_t idx_type; /* Type of index to operate on */ - H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - H5G_info_t grp_info; /* Buffer for querying object's info */ - char filename[NAME_BUF_SIZE]; /* File name */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char objname2[NAME_BUF_SIZE]; /* Object name */ - char valname[2 * NAME_BUF_SIZE]; /* Link value */ - herr_t ret; /* Generic return value */ - unsigned u, v; /* Local index variables */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + H5_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + unsigned use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5G_info_t grp_info; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE]; /* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char objname2[NAME_BUF_SIZE]; /* Object name */ + char valname[2 * NAME_BUF_SIZE]; /* Link value */ + herr_t ret; /* Generic return value */ + unsigned u, v; /* Local index variables */ /* Create group creation property list */ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) @@ -22115,17 +22125,17 @@ group_info(hid_t fapl) static int group_info_old(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t soft_group_id = -1; /* Group ID for soft links */ - H5_iter_order_t order; /* Order within in the index */ - H5G_info_t grp_info; /* Buffer for querying object's info */ - char filename[NAME_BUF_SIZE]; /* File name */ - char objname[NAME_BUF_SIZE]; /* Object name */ - char objname2[NAME_BUF_SIZE]; /* Object name */ - char valname[2 * NAME_BUF_SIZE]; /* Link value */ - herr_t ret; /* Generic return value */ - unsigned u, v; /* Local index variables */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */ + H5_iter_order_t order; /* Order within in the index */ + H5G_info_t grp_info; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE]; /* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char objname2[NAME_BUF_SIZE]; /* Object name */ + char valname[2 * NAME_BUF_SIZE]; /* Link value */ + herr_t ret; /* Generic return value */ + unsigned u, v; /* Local index variables */ /* Loop over operating in different orders */ for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) { @@ -22404,15 +22414,15 @@ group_info_old(hid_t fapl) static int timestamps(hid_t fapl) { - hid_t file_id = -1; /* File ID */ - hid_t group_id = -1; /* Group ID */ - hid_t group_id2 = -1; /* Group ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - hid_t gcpl_id2 = -1; /* Group creation property list ID */ - H5O_info2_t oinfo, oinfo2; /* Object info for groups created */ - H5O_native_info_t ninfo, ninfo2; /* Native info for groups created */ - char filename[NAME_BUF_SIZE]; /* File name */ - bool track_times; /* The object timestamp setting */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t group_id = H5I_INVALID_HID; /* Group ID */ + hid_t group_id2 = H5I_INVALID_HID; /* Group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t gcpl_id2 = H5I_INVALID_HID; /* Group creation property list ID */ + H5O_info2_t oinfo, oinfo2; /* Object info for groups created */ + H5O_native_info_t ninfo, ninfo2; /* Native info for groups created */ + char filename[NAME_BUF_SIZE]; /* File name */ + bool track_times; /* The object timestamp setting */ /* Print test message */ TESTING("timestamps on objects"); @@ -22639,7 +22649,7 @@ timestamps(hid_t fapl) int main(void) { - hid_t fapl = -1, fapl2 = -1; /* File access property lists */ + hid_t fapl = H5I_INVALID_HID, fapl2 = H5I_INVALID_HID; /* File access property lists */ int nerrors = 0; unsigned new_format; /* Whether to use the new format or not */ unsigned minimize_dset_oh; diff --git a/test/links_env.c b/test/links_env.c index 6b61921a110..c043281300c 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -50,9 +50,9 @@ static int external_link_env(hid_t fapl, bool new_format); static int external_link_env(hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group IDs */ - const char *envval = NULL; /* Pointer to environment variable */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group IDs */ + const char *envval = NULL; /* Pointer to environment variable */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; /* Holders for filename */ diff --git a/test/mdset.c b/test/mdset.c index 0d2776d9a94..013eb775553 100644 --- a/test/mdset.c +++ b/test/mdset.c @@ -183,7 +183,7 @@ test_mdset(size_t niter, unsigned flags, hid_t fapl_id) size_t max_dsets; size_t buf_size; size_t ndsets; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; hid_t dcpl_id[MAX_DSETS]; hsize_t dset_dims[MAX_DSETS][3]; hsize_t chunk_dims[2]; diff --git a/test/mf.c b/test/mf.c index 372546f2010..5a7aa6d3b60 100644 --- a/test/mf.c +++ b/test/mf.c @@ -212,11 +212,11 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *state) static unsigned test_mf_eoa(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* file size */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl_new = H5I_INVALID_HID; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* file size */ H5FD_mem_t type; haddr_t addr1, addr2; haddr_t ma_addr = HADDR_UNDEF, new_ma_addr = HADDR_UNDEF; @@ -361,8 +361,8 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl_new = H5I_INVALID_HID; /* copy of fapl */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size = 0, new_file_size; /* file size */ @@ -648,11 +648,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* File size */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl_new = H5I_INVALID_HID; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* File size */ H5FD_mem_t type; haddr_t addr; htri_t was_extended; @@ -863,9 +863,9 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_tmp(const char *env_h5_drvr, hid_t fapl, bool new_format) { - hid_t file = -1; /* File ID */ - hid_t fapl2 = -1; /* File access property list */ - hid_t fcpl = -1; /* File creation property list */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ if (new_format) TESTING("'temporary' file space allocation with new library format"); @@ -1056,11 +1056,11 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, bool new_format) static unsigned test_mf_fs_start(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* file size */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl_new = H5I_INVALID_HID; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* file size */ H5FS_stat_t state; TESTING("H5MF_create_fstype()/H5MF__open_fstype() of free-space manager"); @@ -1167,11 +1167,11 @@ test_mf_fs_start(hid_t fapl) static unsigned test_mf_fs_alloc_free(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* file size */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl_new = H5I_INVALID_HID; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* file size */ H5MF_free_section_t *sect_node = NULL; haddr_t addr; haddr_t tmp; @@ -1496,11 +1496,11 @@ test_mf_fs_alloc_free(hid_t fapl) static unsigned test_mf_fs_extend(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* file size */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl_new = H5I_INVALID_HID; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* file size */ H5MF_free_section_t *sect_node1 = NULL, *sect_node2 = NULL; haddr_t addr; haddr_t tmp; @@ -2004,7 +2004,7 @@ test_mf_fs_extend(hid_t fapl) static unsigned test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t addr, saddr; @@ -2179,7 +2179,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ hid_t fcpl; /* File creation property list */ @@ -2332,7 +2332,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ @@ -2489,7 +2489,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ @@ -2659,7 +2659,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* File size */ @@ -2808,7 +2808,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* File size */ @@ -2945,7 +2945,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ @@ -3119,7 +3119,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size, file_size; @@ -3290,7 +3290,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size = 0, file_size; @@ -3587,7 +3587,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size = 0, file_size; @@ -3837,8 +3837,8 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl1 = -1; + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fapl1 = H5I_INVALID_HID; char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; @@ -4134,7 +4134,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ h5_stat_size_t file_size; H5F_t *f = NULL; /* Internal file object pointer */ @@ -4495,7 +4495,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; /* File size */ @@ -4759,7 +4759,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; /* File size */ @@ -5104,7 +5104,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; @@ -5419,7 +5419,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; @@ -5637,7 +5637,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; @@ -5908,7 +5908,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; @@ -6118,10 +6118,10 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) static unsigned test_mf_bug1(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t copied_fapl = -1; /* FAPL to use for this test */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t copied_fapl = H5I_INVALID_HID; /* FAPL to use for this test */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type; haddr_t addr1, addr2; hsize_t block_size; @@ -6296,9 +6296,9 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) static unsigned test_mf_fs_persist_split(void) { - hid_t file = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t fapl = -1; /* File access property list ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type, stype, btype; /* File allocation type */ @@ -6611,9 +6611,9 @@ test_mf_fs_persist_split(void) static unsigned test_mf_fs_persist_multi(void) { - hid_t file = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t fapl = -1; /* File access property list ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type, stype, btype, gtype; /* File allocation type */ @@ -6933,9 +6933,9 @@ test_mf_fs_persist_multi(void) static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, bool new_format) { - hid_t file = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t fapl2 = -1; /* File access property list ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type; /* File allocation type */ @@ -7108,9 +7108,9 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, bool new_format) static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, bool new_format) { - hid_t file = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ - hid_t fapl2 = -1; /* File access property list */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type; /* File allocation type */ @@ -7298,9 +7298,9 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, bool new_format) static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, bool new_format) { - hid_t file = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list template */ - hid_t fapl2 = -1; /* File access property list template */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list template */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list template */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type; /* File allocation type */ @@ -7467,9 +7467,9 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, bool new_format static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, bool new_format) { - hid_t file = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list template */ - hid_t fapl2 = -1; /* File access property list template */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list template */ + hid_t fapl2 = H5I_INVALID_HID; /* File access property list template */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type; /* File allocation type */ @@ -7672,7 +7672,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, bool new_format) static unsigned test_dichotomy(hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FD_mem_t type, stype; @@ -7804,13 +7804,13 @@ static unsigned test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ - hid_t fapl_new = -1; /* File access property list ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - haddr_t addr2, addr3; /* Addresses for small metadata blocks */ - haddr_t saddr1; /* Addresses for small raw data blocks */ - haddr_t gaddr1; /* Addresses for large data blocks */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ + hid_t fapl_new = H5I_INVALID_HID; /* File access property list ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + haddr_t addr2, addr3; /* Addresses for small metadata blocks */ + haddr_t saddr1; /* Addresses for small raw data blocks */ + haddr_t gaddr1; /* Addresses for large data blocks */ bool split = false, multi = false; char filename[FILENAME_LEN]; /* Filename to use */ haddr_t found_addr; /* Address of the found section */ @@ -8034,8 +8034,8 @@ static unsigned test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t addr1; /* Address for small metadata block */ haddr_t saddr1; /* Address for small raw data block */ @@ -8163,8 +8163,8 @@ static unsigned test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t addr1, addr2, addr3; /* Addresses for small metadata blocks */ haddr_t saddr1; /* Address for small raw data block */ @@ -8341,8 +8341,8 @@ static unsigned test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t gaddr1, gaddr2, gaddr3, gaddr4; /* Addresses for large data blocks */ bool contig_addr_vfd; /* Whether VFD used has a contiguous address space */ @@ -8502,8 +8502,8 @@ static unsigned test_page_large(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t gaddr1, gaddr2, gaddr3, gaddr4; /* Addresses for blocks */ bool contig_addr_vfd; /* Whether VFD used has a contiguous address space */ @@ -8654,8 +8654,8 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) static unsigned test_page_small(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t addr2, addr3, addr4, addr5; /* Addresses for blocks */ haddr_t addr9, addr10, addr11; /* Address for small metadata blocks */ @@ -8825,15 +8825,15 @@ static unsigned test_page_alignment(const char *env_h5_drvr, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list ID */ - hid_t fcpl2 = -1; /* File creation property list ID */ - hid_t fapl_new = -1; /* File access property list ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - haddr_t addr1, addr2; /* Addresses for small metadata blocks */ - haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */ - haddr_t gaddr1, gaddr2; /* Addresses for blocks */ - char filename[FILENAME_LEN]; /* Filename to use */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + hid_t fcpl2 = H5I_INVALID_HID; /* File creation property list ID */ + hid_t fapl_new = H5I_INVALID_HID; /* File access property list ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + haddr_t addr1, addr2; /* Addresses for small metadata blocks */ + haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */ + haddr_t gaddr1, gaddr2; /* Addresses for blocks */ + char filename[FILENAME_LEN]; /* Filename to use */ bool split = false, multi = false; TESTING("Paged aggregation and H5Pset_alignment: verify proper alignment is used"); @@ -9126,12 +9126,12 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) int main(void) { - hid_t fapl = -1; /* File access property list for data files */ - hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ - unsigned nerrors = 0; /* Cumulative error count */ - test_type_t curr_test; /* Current test being worked on */ - const char *env_h5_drvr; /* File Driver value from environment */ - bool api_ctx_pushed = false; /* Whether API context pushed */ + hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */ + hid_t new_fapl = H5I_INVALID_HID; /* File access property list for alignment & aggr setting */ + unsigned nerrors = 0; /* Cumulative error count */ + test_type_t curr_test; /* Current test being worked on */ + const char *env_h5_drvr; /* File Driver value from environment */ + bool api_ctx_pushed = false; /* Whether API context pushed */ /* Get the VFD to use */ env_h5_drvr = HDgetenv(HDF5_DRIVER); diff --git a/test/mount.c b/test/mount.c index 9d87bbdcadd..21ccfbfc8b1 100644 --- a/test/mount.c +++ b/test/mount.c @@ -41,7 +41,7 @@ static int bm[NX][NY]; /* Data buffers */ static int setup(hid_t fapl) { - hid_t file = -1; + hid_t file = H5I_INVALID_HID; char filename[1024]; /* file 1 */ @@ -111,7 +111,7 @@ setup(hid_t fapl) static int test_basic(hid_t fapl) { - hid_t file1 = -1, file2 = -1, grp = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, grp = H5I_INVALID_HID; char filename1[1024], filename2[1024]; TESTING("basic functionality"); @@ -162,7 +162,8 @@ test_basic(hid_t fapl) static int test_illegal(hid_t fapl) { - hid_t file1 = -1, file1b = -1, file2 = -1, file3 = -1, file3b = -1, mnt = -1; + hid_t file1 = H5I_INVALID_HID, file1b = H5I_INVALID_HID, file2 = H5I_INVALID_HID, file3 = H5I_INVALID_HID, + file3b = H5I_INVALID_HID, mnt = H5I_INVALID_HID; char filename1[1024], filename2[1024], filename3[1024]; herr_t status; @@ -301,8 +302,9 @@ test_illegal(hid_t fapl) static int test_samefile(hid_t fapl) { - hid_t file1a = -1, file1b = -1, file2 = -1, file3 = -1; - hid_t mnt1a = -1, mnt1b = -1; + hid_t file1a = H5I_INVALID_HID, file1b = H5I_INVALID_HID, file2 = H5I_INVALID_HID, + file3 = H5I_INVALID_HID; + hid_t mnt1a = H5I_INVALID_HID, mnt1b = H5I_INVALID_HID; char filename1[1024], filename2[1024], filename3[1024]; H5G_info_t grp_info; herr_t status; @@ -443,7 +445,7 @@ test_samefile(hid_t fapl) static int test_hide(hid_t fapl) { - hid_t file1 = -1, file2 = -1, grp = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, grp = H5I_INVALID_HID; H5O_info2_t oi1, oi2; char filename1[1024], filename2[1024]; bool same_obj; @@ -538,7 +540,7 @@ test_hide(hid_t fapl) static int test_assoc(hid_t fapl) { - hid_t file1 = -1, file2 = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID; H5O_info2_t oi1, oi2; char filename1[1024], filename2[1024]; bool same_obj; @@ -622,7 +624,7 @@ test_assoc(hid_t fapl) static int test_mntlnk(hid_t fapl) { - hid_t file1 = -1, file2 = -1, grp = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, grp = H5I_INVALID_HID; char filename1[1024], filename2[1024]; TESTING("multi-linked mount point"); @@ -687,7 +689,7 @@ test_mntlnk(hid_t fapl) static int test_move(hid_t fapl) { - hid_t file1 = -1, file2 = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID; herr_t status; char filename1[1024], filename2[1024]; @@ -752,7 +754,7 @@ test_move(hid_t fapl) static int test_preopen(hid_t fapl) { - hid_t file1 = -1, file2 = -1, grp = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, grp = H5I_INVALID_HID; H5O_info2_t oinfo; char filename1[1024], filename2[1024]; @@ -817,7 +819,7 @@ static int test_postopen(hid_t fapl) { - hid_t file1 = -1, file2 = -1, grp = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, grp = H5I_INVALID_HID; H5O_info2_t oinfo; char filename1[1024], filename2[1024]; @@ -886,7 +888,7 @@ test_postopen(hid_t fapl) static int test_unlink(hid_t fapl) { - hid_t file1 = -1, file2 = -1, mnt = -1, root = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, mnt = H5I_INVALID_HID, root = H5I_INVALID_HID; H5O_info2_t oinfo; char filename1[1024], filename2[1024]; herr_t status; @@ -1035,7 +1037,7 @@ test_unlink(hid_t fapl) static int test_mvmpt(hid_t fapl) { - hid_t file1 = -1, file2 = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID; H5O_info2_t oinfo; char filename1[1024], filename2[1024]; @@ -1093,9 +1095,9 @@ test_mvmpt(hid_t fapl) static int test_interlink(hid_t fapl) { - hid_t file1 = -1, file2 = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID; #ifdef NOT_NOW - hid_t type = -1, space = -1, dset = -1; + hid_t type = H5I_INVALID_HID, space = H5I_INVALID_HID, dset = H5I_INVALID_HID; hsize_t cur_dims[1] = {2}; #endif /* NOT_NOW */ char filename1[1024], filename2[1024]; @@ -1210,7 +1212,7 @@ test_interlink(hid_t fapl) static int test_uniformity(hid_t fapl) { - hid_t file1 = -1, file2 = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID; H5O_info2_t oinfo; char filename1[1024], filename2[1024]; @@ -1284,7 +1286,7 @@ test_uniformity(hid_t fapl) static int test_close(hid_t fapl) { - hid_t file1 = -1, file2 = -1; + hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID; H5O_info2_t oinfo; char filename1[1024], filename2[1024]; @@ -1369,15 +1371,17 @@ test_close(hid_t fapl) static int test_mount_after_close(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gidA = -1, gidAB = -1, gidABM = -1, gidX = -1, gidXY = -1; /* Group identifiers */ - hid_t gidABMX = -1, gidABC = -1, gidABT = -1; /* Group IDs for testing */ - hid_t didABMXYD = -1; /* Dataset ID for testing */ - hid_t did = -1, sid = -1; /* Dataset and dataspace identifiers */ - char filename1[1024], filename2[1024]; /* Name of files to mount */ - char objname[NAME_BUF_SIZE]; /* Name of object opened */ - hsize_t dims[] = {NX, NY}; /* Dataset dimensions */ - int i, j; /* Local index variable */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidAB = H5I_INVALID_HID, gidABM = H5I_INVALID_HID, gidX = H5I_INVALID_HID, + gidXY = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidABMX = H5I_INVALID_HID, gidABC = H5I_INVALID_HID, + gidABT = H5I_INVALID_HID; /* Group IDs for testing */ + hid_t didABMXYD = H5I_INVALID_HID; /* Dataset ID for testing */ + hid_t did = H5I_INVALID_HID, sid = H5I_INVALID_HID; /* Dataset and dataspace identifiers */ + char filename1[1024], filename2[1024]; /* Name of files to mount */ + char objname[NAME_BUF_SIZE]; /* Name of object opened */ + hsize_t dims[] = {NX, NY}; /* Dataset dimensions */ + int i, j; /* Local index variable */ TESTING("mounting on group after file is closed"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); @@ -1599,16 +1603,18 @@ test_mount_after_close(hid_t fapl) static int test_mount_after_unmount(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1, fid4 = -1; /* File IDs */ - hid_t gidA = -1, gidB = -1, gidX = -1, gidY = -1, gidZ = -1; /* Group identifiers */ - hid_t gidBM = -1; /* Group identifiers */ - hid_t gidBMZ = -1; /* Group identifiers */ - hid_t gidAM = -1; /* Group identifiers */ - hid_t gidAMX = -1; /* Group identifiers */ - hid_t gidAMXX = -1; /* Group identifiers */ - hid_t gidAMXMY = -1; /* Group identifiers */ - hid_t gidXM = -1; /* Group identifiers */ - hid_t gidXX = -1; /* Group identifiers */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID, + fid4 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidB = H5I_INVALID_HID, gidX = H5I_INVALID_HID, gidY = H5I_INVALID_HID, + gidZ = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidBM = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidBMZ = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidAM = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidAMX = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidAMXX = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidAMXMY = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidXM = H5I_INVALID_HID; /* Group identifiers */ + hid_t gidXX = H5I_INVALID_HID; /* Group identifiers */ char filename1[1024], filename2[1024], filename3[1024], filename4[1024]; /* Name of files to mount */ char objname[NAME_BUF_SIZE]; /* Name of object opened */ @@ -1863,10 +1869,10 @@ test_mount_after_unmount(hid_t fapl) static int test_missing_unmount(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1; /* File IDs */ - hid_t gidA = -1, gidE = -1, gidM = -1; /* Group IDs */ - hid_t gidAE = -1, gidAEM = -1; /* Group IDs */ - char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidE = H5I_INVALID_HID, gidM = H5I_INVALID_HID; /* Group IDs */ + hid_t gidAE = H5I_INVALID_HID, gidAEM = H5I_INVALID_HID; /* Group IDs */ + char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ TESTING("missing unmount"); @@ -2010,8 +2016,8 @@ test_missing_unmount(hid_t fapl) static int test_hold_open_file(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidM = H5I_INVALID_HID, gidAM = H5I_INVALID_HID; /* Group IDs */ char filename1[1024], filename2[1024]; /* Name of files to mount */ TESTING("hold open w/file"); @@ -2135,9 +2141,10 @@ test_hold_open_file(hid_t fapl) static int test_hold_open_group(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gid = -1, gidA = -1, gidM = -1, gidAM = -1, gidAM2 = -1; /* Group IDs */ - char filename1[1024], filename2[1024]; /* Name of files to mount */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID, gidA = H5I_INVALID_HID, gidM = H5I_INVALID_HID, gidAM = H5I_INVALID_HID, + gidAM2 = H5I_INVALID_HID; /* Group IDs */ + char filename1[1024], filename2[1024]; /* Name of files to mount */ TESTING("hold open w/group"); @@ -2286,10 +2293,10 @@ test_hold_open_group(hid_t fapl) static int test_fcdegree_same(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */ - hid_t fapl_id = -1; /* FAPL IDs */ - herr_t ret; /* Generic return value */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidM = H5I_INVALID_HID, gidAM = H5I_INVALID_HID; /* Group IDs */ + hid_t fapl_id = H5I_INVALID_HID; /* FAPL IDs */ + herr_t ret; /* Generic return value */ char filename1[1024], filename2[1024]; /* Name of files to mount */ TESTING("file close degrees must be same"); @@ -2425,10 +2432,10 @@ test_fcdegree_same(hid_t fapl) static int test_fcdegree_semi(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */ - hid_t fapl_id = -1; /* FAPL IDs */ - herr_t ret; /* Generic return value */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidM = H5I_INVALID_HID, gidAM = H5I_INVALID_HID; /* Group IDs */ + hid_t fapl_id = H5I_INVALID_HID; /* FAPL IDs */ + herr_t ret; /* Generic return value */ char filename1[1024], filename2[1024]; /* Name of files to mount */ TESTING("'semi' file close degree"); @@ -2563,9 +2570,9 @@ test_fcdegree_semi(hid_t fapl) static int test_fcdegree_strong(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */ - hid_t fapl_id = -1; /* FAPL IDs */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidM = H5I_INVALID_HID, gidAM = H5I_INVALID_HID; /* Group IDs */ + hid_t fapl_id = H5I_INVALID_HID; /* FAPL IDs */ H5O_info2_t oinfo; char filename1[1024], filename2[1024]; /* Name of files to mount */ herr_t ret; /* Generic return value */ @@ -2700,9 +2707,10 @@ test_fcdegree_strong(hid_t fapl) static int test_acc_perm(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1; /* File IDs */ - hid_t gidA = -1, gidB = -1, gidC = -1, gidM = -1, gidAM = -1, gidAMZ = -1; /* Group IDs */ - hid_t bad_id = -1; /* Bad ID from object create */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidB = H5I_INVALID_HID, gidC = H5I_INVALID_HID, gidM = H5I_INVALID_HID, + gidAM = H5I_INVALID_HID, gidAMZ = H5I_INVALID_HID; /* Group IDs */ + hid_t bad_id = H5I_INVALID_HID; /* Bad ID from object create */ char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ @@ -2899,12 +2907,14 @@ test_acc_perm(hid_t fapl) static int test_mult_mount(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1, fid3_2 = -1; /* File IDs */ - hid_t gidA = -1, gidB = -1; /* Group IDs in file #1 */ - hid_t gidM = -1, gidN = -1, gidAM = -1; /* Group IDs in file #2 */ - hid_t gidS = -1, gidT = -1, gidU = -1, gidBS = -1, gidAMT = -1; /* Group IDs in file #3 */ - char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ - char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID, + fid3_2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidB = H5I_INVALID_HID; /* Group IDs in file #1 */ + hid_t gidM = H5I_INVALID_HID, gidN = H5I_INVALID_HID, gidAM = H5I_INVALID_HID; /* Group IDs in file #2 */ + hid_t gidS = H5I_INVALID_HID, gidT = H5I_INVALID_HID, gidU = H5I_INVALID_HID, gidBS = H5I_INVALID_HID, + gidAMT = H5I_INVALID_HID; /* Group IDs in file #3 */ + char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ + char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ TESTING("multiple mounts"); @@ -3117,10 +3127,11 @@ test_mult_mount(hid_t fapl) static int test_nested_survive(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1; /* File IDs */ - hid_t gidA = -1; /* Group IDs in file #1 */ - hid_t gidM = -1, gidAM = -1; /* Group IDs in file #2 */ - hid_t gidS = -1, gidMS = -1, gidAMS = -1; /* Group IDs in file #3 */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID; /* Group IDs in file #1 */ + hid_t gidM = H5I_INVALID_HID, gidAM = H5I_INVALID_HID; /* Group IDs in file #2 */ + hid_t gidS = H5I_INVALID_HID, gidMS = H5I_INVALID_HID, + gidAMS = H5I_INVALID_HID; /* Group IDs in file #3 */ char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ ssize_t name_len; /* Filename length */ char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ @@ -3325,12 +3336,12 @@ test_nested_survive(hid_t fapl) static int test_close_parent(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gidA = -1; /* Group IDs in file #1 */ - hid_t gidM = -1; /* Group IDs in file #2 */ - char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ - ssize_t name_len; /* Filename length */ - char filename1[1024], filename2[1024]; /* Name of files to mount */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID; /* Group IDs in file #1 */ + hid_t gidM = H5I_INVALID_HID; /* Group IDs in file #2 */ + char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ + ssize_t name_len; /* Filename length */ + char filename1[1024], filename2[1024]; /* Name of files to mount */ TESTING("close parent"); @@ -3491,17 +3502,18 @@ test_close_parent(hid_t fapl) static int test_cut_graph(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1, fid4 = -1, fid5 = -1, fid6 = -1, fid7 = -1; /* File IDs */ - hid_t gidA = -1, gidB = -1; /* Group IDs in file #1 */ - hid_t gidD = -1, gidE = -1; /* Group IDs in file #2 */ - hid_t gidH = -1, gidI = -1; /* Group IDs in file #3 */ - hid_t gidK = -1; /* Group IDs in file #4 */ - hid_t gidM = -1; /* Group IDs in file #5 */ - hid_t gidO = -1; /* Group IDs in file #6 */ - hid_t gidQ = -1; /* Group IDs in file #7 */ - char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ - ssize_t name_len; /* Filename length */ - ssize_t obj_count; /* Number of objects open */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID, fid4 = H5I_INVALID_HID, + fid5 = H5I_INVALID_HID, fid6 = H5I_INVALID_HID, fid7 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidB = H5I_INVALID_HID; /* Group IDs in file #1 */ + hid_t gidD = H5I_INVALID_HID, gidE = H5I_INVALID_HID; /* Group IDs in file #2 */ + hid_t gidH = H5I_INVALID_HID, gidI = H5I_INVALID_HID; /* Group IDs in file #3 */ + hid_t gidK = H5I_INVALID_HID; /* Group IDs in file #4 */ + hid_t gidM = H5I_INVALID_HID; /* Group IDs in file #5 */ + hid_t gidO = H5I_INVALID_HID; /* Group IDs in file #6 */ + hid_t gidQ = H5I_INVALID_HID; /* Group IDs in file #7 */ + char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ + ssize_t name_len; /* Filename length */ + ssize_t obj_count; /* Number of objects open */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], filename4[NAME_BUF_SIZE], filename5[NAME_BUF_SIZE], filename6[NAME_BUF_SIZE], filename7[NAME_BUF_SIZE]; /* Name of files to mount */ @@ -3878,13 +3890,13 @@ test_cut_graph(hid_t fapl) static int test_symlink(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1; /* File IDs */ - hid_t gidA = -1, gidB = -1; /* Group IDs in file #1 */ - hid_t gidD = -1, gidE = -1; /* Group IDs in file #2 */ - hid_t gidH = -1, gidI = -1; /* Group IDs in file #3 */ - hid_t gidL = -1; /* Group IDs through soft link to file #3 */ - char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ - ssize_t name_len; /* Filename length */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID; /* File IDs */ + hid_t gidA = H5I_INVALID_HID, gidB = H5I_INVALID_HID; /* Group IDs in file #1 */ + hid_t gidD = H5I_INVALID_HID, gidE = H5I_INVALID_HID; /* Group IDs in file #2 */ + hid_t gidH = H5I_INVALID_HID, gidI = H5I_INVALID_HID; /* Group IDs in file #3 */ + hid_t gidL = H5I_INVALID_HID; /* Group IDs through soft link to file #3 */ + char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ + ssize_t name_len; /* Filename length */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; /* Name of files to mount */ @@ -4038,8 +4050,9 @@ test_symlink(hid_t fapl) static int test_sharedacc(hid_t fapl) { - hid_t fid1[2] = {-1, -1}, fid2[2] = {-1, -1}; /* File IDs */ - hid_t gid = -1; + hid_t fid1[2] = {H5I_INVALID_HID, H5I_INVALID_HID}, + fid2[2] = {H5I_INVALID_HID, H5I_INVALID_HID}; /* File IDs */ + hid_t gid = H5I_INVALID_HID; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; /* Name of files to mount */ int i, j, k; /* Counters */ @@ -4139,8 +4152,8 @@ test_sharedacc(hid_t fapl) static int test_sharedclose(hid_t fapl) { - hid_t fid1a = -1, fid1b = -1, fid2 = -1, fid3 = -2; /* File IDs */ - hid_t gid1 = -1, gid2 = -1, gid3 = -1; + hid_t fid1a = H5I_INVALID_HID, fid1b = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = -2; /* File IDs */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid3 = H5I_INVALID_HID; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; /* Name of files to mount */ @@ -4293,8 +4306,8 @@ test_sharedclose(hid_t fapl) static int test_multisharedclose(hid_t fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gid1 = -1, gid2 = -1, gid3 = -1; + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid3 = H5I_INVALID_HID; char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], filename4[NAME_BUF_SIZE]; /* Name of files to mount */ @@ -4443,7 +4456,7 @@ int main(void) { int nerrors = 0; - hid_t fapl = -1; + hid_t fapl = H5I_INVALID_HID; h5_reset(); fapl = h5_fileaccess(); diff --git a/test/ntypes.c b/test/ntypes.c index c38fedaeedb..e234cf4031b 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -62,8 +62,8 @@ static const char *FILENAME[] = {"ntypes", NULL}; static herr_t test_atomic_dtype(hid_t file) { - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID; int i, j, n; hsize_t dims[2]; void *tmp = NULL; @@ -319,8 +319,9 @@ test_compound_dtype2(hid_t file) s2 st; unsigned long long l; } s1; - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, tid = -1, tid2 = -1, tid_m = -1, tid_m2 = -1, mem_id = -1, + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, tid = H5I_INVALID_HID, + tid2 = H5I_INVALID_HID, tid_m = H5I_INVALID_HID, tid_m2 = H5I_INVALID_HID, mem_id = H5I_INVALID_HID, nest_mem_id = -1; int i, j, n; hsize_t dims[2]; @@ -629,8 +630,9 @@ test_compound_dtype(hid_t file) unsigned int i; long long l; } s1; - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, tid = -1, tid2 = -1, mem_id = -1; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, tid = H5I_INVALID_HID, + tid2 = H5I_INVALID_HID, mem_id = H5I_INVALID_HID; int i, j, n; hsize_t dims[2]; s1 *temp_point = NULL; @@ -837,8 +839,9 @@ test_compound_dtype3(hid_t file) int a[5]; long long l; } s1; - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, tid = -1, tid2 = -1, tid_m = -1, tid_m2 = -1, mem_id = -1, + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, tid = H5I_INVALID_HID, + tid2 = H5I_INVALID_HID, tid_m = H5I_INVALID_HID, tid_m2 = H5I_INVALID_HID, mem_id = H5I_INVALID_HID, nest_mem_id = -1; hsize_t array_dims[1] = {5}; int i, j, k, n; @@ -1073,8 +1076,9 @@ test_compound_opaque(hid_t file) unsigned char o[5]; long long l; } s1; - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, tid = -1, tid2 = -1, tid_m = -1, mem_id = -1; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, tid = H5I_INVALID_HID, + tid2 = H5I_INVALID_HID, tid_m = H5I_INVALID_HID, mem_id = H5I_INVALID_HID; int i, j, k, n; hsize_t dims[2]; s1 *temp_point = NULL, *temp_check = NULL; @@ -1290,8 +1294,9 @@ test_compound_opaque(hid_t file) static herr_t test_enum_dtype(hid_t file) { - hid_t dataset = -1, space = -1; - hid_t tid = -1, tid_m = -1, dtype = -1, native_type = -1; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID, tid_m = H5I_INVALID_HID, dtype = H5I_INVALID_HID, + native_type = H5I_INVALID_HID; int i, j, n; hsize_t dims[2]; void *tmp = NULL; @@ -1449,8 +1454,9 @@ test_array_dtype(hid_t file) int i; long long l; } s1; - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, tid = -1, tid2 = -1, tid3 = -1, tid_m = -1; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, tid = H5I_INVALID_HID, + tid2 = H5I_INVALID_HID, tid3 = H5I_INVALID_HID, tid_m = H5I_INVALID_HID; int i, j, k, n; hsize_t space_dims[2], array_dims[1] = {5}; s1 *temp_point = NULL, *temp_check = NULL; @@ -1627,8 +1633,9 @@ test_array_dtype(hid_t file) static herr_t test_array_dtype2(hid_t file) { - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, tid = -1, tid_m = -1; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, tid = H5I_INVALID_HID, + tid_m = H5I_INVALID_HID; int i, j, k, n; hsize_t space_dims[2], array_dims[1] = {5}; void *tmp = NULL; @@ -1778,10 +1785,11 @@ test_vl_dtype(hid_t file) hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ hsize_t dims1[] = {SPACE1_DIM1}; - hid_t dataset = -1, space = -1; - hid_t dtype = -1, native_type = -1, nat_super_type = -1, tid = -1, tid2 = -1, tid_m = -1, tid_m2 = -1; - size_t i, j, k; - void **tmp = NULL; + hid_t dataset = H5I_INVALID_HID, space = H5I_INVALID_HID; + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID, nat_super_type = H5I_INVALID_HID, + tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID, tid_m = H5I_INVALID_HID, tid_m2 = H5I_INVALID_HID; + size_t i, j, k; + void **tmp = NULL; TESTING("variable length datatype"); @@ -1981,11 +1989,11 @@ test_vlstr_dtype(hid_t file) "conceived in liberty and dedicated to the proposition that all men are created equal.", "Now we are engaged in a great civil war,", "testing whether that nation or any nation so conceived and so dedicated can long endure."}; - char *rdata[SPACE1_DIM1]; /* Information read in */ - bool rdata_alloc = false; /* Whether the read data is allocated */ - hid_t dataset = -1; /* Dataset ID */ - hid_t sid1 = -1; /* Dataspace ID */ - hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ + char *rdata[SPACE1_DIM1]; /* Information read in */ + bool rdata_alloc = false; /* Whether the read data is allocated */ + hid_t dataset = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid1 = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid1 = H5I_INVALID_HID, dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ @@ -2112,11 +2120,11 @@ test_str_dtype(hid_t file) { const char wdata[SPACE1_DIM1][4] = {"one", "two", "3rd", "4th"}; /* Information to write */ char rdata[SPACE1_DIM1][4]; /* Information read in */ - hid_t dataset = -1; /* Dataset ID */ - hid_t sid1 = -1; /* Dataspace ID */ - hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}; - unsigned i; /* counting variable */ + hid_t dataset = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid1 = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid1 = H5I_INVALID_HID, dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; + unsigned i; /* counting variable */ /* Output message about test being performed */ TESTING("fixed-length string datatype"); @@ -2234,10 +2242,10 @@ test_refer_dtype(hid_t file) float c; } s1_t; - hid_t dataset = -1; /* Dataset ID */ - hid_t group = -1; /* Group ID */ - hid_t sid1 = -1; /* Dataspace ID */ - hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ + hid_t dataset = H5I_INVALID_HID; /* Dataset ID */ + hid_t group = H5I_INVALID_HID; /* Group ID */ + hid_t sid1 = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid1 = H5I_INVALID_HID, dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID; /* Datatype ID */ hsize_t dims1[] = {1}; H5O_type_t obj_type; /* Object type */ hobj_ref_t *wbuf = NULL, /* buffer to write to disk */ @@ -2395,11 +2403,11 @@ test_refer_dtype(hid_t file) static herr_t test_refer_dtype2(hid_t file) { - hid_t dset1 = -1, /* Dataset ID */ - dset2 = -1; /* Dereferenced dataset ID */ - hid_t sid1 = -1, /* Dataspace ID #1 */ - sid2 = -1; /* Dataspace ID #2 */ - hid_t dtype = -1, native_type = -1; + hid_t dset1 = H5I_INVALID_HID, /* Dataset ID */ + dset2 = -1; /* Dereferenced dataset ID */ + hid_t sid1 = H5I_INVALID_HID, /* Dataspace ID #1 */ + sid2 = -1; /* Dataspace ID #2 */ + hid_t dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID; hsize_t dims1[] = {1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ @@ -2604,8 +2612,8 @@ test_refer_dtype2(hid_t file) static herr_t test_opaque_dtype(hid_t file) { - hid_t type = -1, space = -1, dset = -1; - hid_t dataset = -1, dtype = -1, native_type = -1; + hid_t type = H5I_INVALID_HID, space = H5I_INVALID_HID, dset = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID, dtype = H5I_INVALID_HID, native_type = H5I_INVALID_HID; size_t i; unsigned char wbuf[32], rbuf[32]; hsize_t nelmts; @@ -2698,8 +2706,9 @@ test_opaque_dtype(hid_t file) static herr_t test_bitfield_dtype(hid_t file) { - hid_t type = -1, space = -1, dset1 = -1, dset2 = -1; - hid_t dataset1 = -1, dataset2 = -1, dtype = -1, native_type = -1; + hid_t type = H5I_INVALID_HID, space = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID; + hid_t dataset1 = H5I_INVALID_HID, dataset2 = H5I_INVALID_HID, dtype = H5I_INVALID_HID, + native_type = H5I_INVALID_HID; size_t ntype_size, i; unsigned char wbuf[BITFIELD_ENUMB * sizeof(int)]; unsigned char *p = NULL; @@ -2849,19 +2858,19 @@ test_bitfield_dtype(hid_t file) static herr_t test_ninteger(void) { - hid_t fid1 = -1; /* file ID */ - hid_t fid2 = -1; /* file ID */ - hid_t did1 = -1; /* dataset ID */ - hid_t did2 = -1; /* dataset ID */ - hid_t sid1 = -1; /* dataspace ID */ - hid_t dcpl1 = -1; /* dataset creation property list ID */ - hid_t dcpl2 = -1; /* dataset creation property list ID */ - hid_t tid1 = -1; /* file datatype */ - hid_t tid2 = -1; /* file datatype */ - hid_t nid1 = -1; /* native datatype */ - hid_t nid2 = -1; /* native datatype */ - hsize_t dims[1] = {DIM3}; /* dataspace dimensions */ - int rank = 1; /* rank of dataset */ + hid_t fid1 = H5I_INVALID_HID; /* file ID */ + hid_t fid2 = H5I_INVALID_HID; /* file ID */ + hid_t did1 = H5I_INVALID_HID; /* dataset ID */ + hid_t did2 = H5I_INVALID_HID; /* dataset ID */ + hid_t sid1 = H5I_INVALID_HID; /* dataspace ID */ + hid_t dcpl1 = H5I_INVALID_HID; /* dataset creation property list ID */ + hid_t dcpl2 = H5I_INVALID_HID; /* dataset creation property list ID */ + hid_t tid1 = H5I_INVALID_HID; /* file datatype */ + hid_t tid2 = H5I_INVALID_HID; /* file datatype */ + hid_t nid1 = H5I_INVALID_HID; /* native datatype */ + hid_t nid2 = H5I_INVALID_HID; /* native datatype */ + hsize_t dims[1] = {DIM3}; /* dataspace dimensions */ + int rank = 1; /* rank of dataset */ int buf[DIM3]; int chk[DIM3]; int i; diff --git a/test/objcopy.c b/test/objcopy.c index 13b6783048b..92a595524f6 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -258,9 +258,10 @@ token_reset(void) static herr_t attach_ref_attr(hid_t file_id, hid_t loc_id) { - char dsetname1[] = "dataset1_pointed_by_ref_attr"; - char dsetname2[] = "dataset2_pointed_by_ref_attr"; - hid_t did1 = (-1), did2 = (-1), aid = (-1), sid = (-1), sid_ref = (-1); + char dsetname1[] = "dataset1_pointed_by_ref_attr"; + char dsetname2[] = "dataset2_pointed_by_ref_attr"; + hid_t did1 = (H5I_INVALID_HID), did2 = (H5I_INVALID_HID), aid = (H5I_INVALID_HID), + sid = (H5I_INVALID_HID), sid_ref = (H5I_INVALID_HID); hsize_t dims[2] = {2, 9}; hsize_t dims_ref[1] = {2}; hobj_ref_t ref[2]; @@ -333,10 +334,10 @@ static herr_t attach_reg_ref_attr(hid_t file_id, hid_t loc_id) { const char dsetnamev[] = "dataset_pointed_by_reg_ref_attr"; - hid_t aid = (-1); - hid_t space_id = (-1); /* dataspace identifiers */ - hid_t spacer_id = (-1); /* dataspace identifiers */ - hid_t dsetv_id = (-1); /*dataset identifiers*/ + hid_t aid = (H5I_INVALID_HID); + hid_t space_id = (H5I_INVALID_HID); /* dataspace identifiers */ + hid_t spacer_id = (H5I_INVALID_HID); /* dataspace identifiers */ + hid_t dsetv_id = (H5I_INVALID_HID); /*dataset identifiers*/ hsize_t dims[2] = {2, 9}; hsize_t dimsr[1] = {2}; int rank = 2; @@ -429,10 +430,10 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) const char dsetnamer[] = "dataset_with_reg_ref"; const char dsetnamer1[] = "compact_dataset_with_reg_ref"; const char dsetnamer2[] = "compressed_dataset_with_reg_ref"; - hid_t space_id = (-1); /* dataspace identifiers */ - hid_t spacer_id = (-1); - hid_t dsetv_id = (-1); /*dataset identifiers*/ - hid_t dsetr_id = (-1); + hid_t space_id = (H5I_INVALID_HID); /* dataspace identifiers */ + hid_t spacer_id = (H5I_INVALID_HID); + hid_t dsetv_id = (H5I_INVALID_HID); /*dataset identifiers*/ + hid_t dsetr_id = (H5I_INVALID_HID); hsize_t dims[2] = {2, 9}; hsize_t dimsr[1] = {2}; int rank = 2; @@ -444,7 +445,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) hsize_t count[2]; hsize_t coord[3][2] = {{0, 0}, {1, 6}, {0, 8}}; size_t num_points = 3; - hid_t pid = (-1); + hid_t pid = (H5I_INVALID_HID); if ((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR; @@ -547,7 +548,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) static int test_copy_attach_attribute_vl(hid_t loc_id) { - hid_t aid = -1, sid = -1, tid = -1; + hid_t aid = H5I_INVALID_HID, sid = H5I_INVALID_HID, tid = H5I_INVALID_HID; hvl_t buf[4]; hsize_t dim1 = 4; unsigned int i, j; @@ -602,11 +603,11 @@ test_copy_attach_attribute_vl(hid_t loc_id) static int test_copy_attach_attributes(hid_t loc_id, hid_t type_id) { - hid_t aid = -1, sid = -1; + hid_t aid = H5I_INVALID_HID, sid = H5I_INVALID_HID; char attr_name[ATTR_NAME_LEN]; int attr_data[2]; hsize_t dim1 = 2; - hid_t acpl = -1; + hid_t acpl = H5I_INVALID_HID; unsigned u; int ret_value = -1; @@ -669,10 +670,10 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id) static int test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id) { - hid_t aid = -1, sid = -1; + hid_t aid = H5I_INVALID_HID, sid = H5I_INVALID_HID; char attr_name[ATTR_NAME_LEN]; int attr_data[2]; - hid_t acpl = -1; + hid_t acpl = H5I_INVALID_HID; unsigned u; hsize_t dim1 = 2; @@ -745,16 +746,16 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id) static int compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_owner) { - hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - size_t elmt_size; /* Size of datatype */ - htri_t is_committed; /* If the datatype is committed */ - htri_t is_committed2; /* If the datatype is committed */ - H5A_info_t ainfo; /* Attribute info */ - H5A_info_t ainfo2; /* Attribute info */ - hssize_t nelmts; /* # of elements in dataspace */ - void *rbuf = NULL; /* Buffer for reading raw data */ - void *rbuf2 = NULL; /* Buffer for reading raw data */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + size_t elmt_size; /* Size of datatype */ + htri_t is_committed; /* If the datatype is committed */ + htri_t is_committed2; /* If the datatype is committed */ + H5A_info_t ainfo; /* Attribute info */ + H5A_info_t ainfo2; /* Attribute info */ + hssize_t nelmts; /* # of elements in dataspace */ + void *rbuf = NULL; /* Buffer for reading raw data */ + void *rbuf2 = NULL; /* Buffer for reading raw data */ /* Check the character sets are equal */ if (H5Aget_info(aid, &ainfo) < 0) @@ -905,9 +906,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ static int compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid) { - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - H5O_info2_t oinfo1, oinfo2; /* Object info */ - unsigned cpy_flags; /* Object copy flags */ + hid_t aid = H5I_INVALID_HID, aid2 = H5I_INVALID_HID; /* Attribute IDs */ + H5O_info2_t oinfo1, oinfo2; /* Object info */ + unsigned cpy_flags; /* Object copy flags */ /* Retrieve the object copy flags from the property list, if it's non-DEFAULT */ if (pid != H5P_DEFAULT) { @@ -1307,18 +1308,18 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, static int compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) { - hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list IDs */ - size_t elmt_size; /* Size of datatype */ - htri_t is_committed; /* If the datatype is committed */ - htri_t is_committed2; /* If the datatype is committed */ - int nfilters; /* Number of filters applied to dataset */ - hssize_t nelmts; /* # of elements in dataspace */ - void *rbuf = NULL; /* Buffer for reading raw data */ - void *rbuf2 = NULL; /* Buffer for reading raw data */ - H5D_space_status_t space_status; /* Dataset's raw dataspace status */ - H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID; /* Dataset creation property list IDs */ + size_t elmt_size; /* Size of datatype */ + htri_t is_committed; /* If the datatype is committed */ + htri_t is_committed2; /* If the datatype is committed */ + int nfilters; /* Number of filters applied to dataset */ + hssize_t nelmts; /* # of elements in dataspace */ + void *rbuf = NULL; /* Buffer for reading raw data */ + void *rbuf2 = NULL; /* Buffer for reading raw data */ + H5D_space_status_t space_status; /* Dataset's raw dataspace status */ + H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ /* Check the datatypes are equal */ @@ -1747,8 +1748,8 @@ compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_in static int test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -1854,8 +1855,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d static int test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -1961,8 +1962,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ static int test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -2078,13 +2079,13 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h static int test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - hsize_t dims[2] = {3, 4}; /* Dataspace dimensions */ - H5O_info2_t oinfo, oinfo2; /* Object info */ - H5G_info_t ginfo; /* Group info */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dims[2] = {3, 4}; /* Dataspace dimensions */ + H5O_info2_t oinfo, oinfo2; /* Object info */ + H5G_info_t ginfo; /* Group info */ bool same_type; char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -2256,12 +2257,12 @@ test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap static int test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - hsize_t dim2d[2]; /* Dataset dimensions */ - int i, j; /* local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + int i, j; /* local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -2398,19 +2399,19 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d static int test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) { - hid_t fid_src = -1, fid_dst = -1; /* Source and destination file IDs */ - hid_t fapl_dst = -1; /* File access plist for dest file */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did_src = -1, did_dst = -1; /* Source and destination dataset IDs */ - int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - hsize_t dim2d[2]; /* Dataset dimensions */ - char src_fname[NAME_BUF_SIZE]; /* Name of source file */ - char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */ - H5F_libver_t low, high; /* File format bounds */ - unsigned srcdset_layoutversion; /* Layout version of source dataset */ - int i, j; /* Local index variables */ - H5D_t *dsetp = NULL; /* Pointer to internal dset structure */ - herr_t ret; /* Generic return value */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* Source and destination file IDs */ + hid_t fapl_dst = H5I_INVALID_HID; /* File access plist for dest file */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did_src = H5I_INVALID_HID, did_dst = H5I_INVALID_HID; /* Source and destination dataset IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + char src_fname[NAME_BUF_SIZE]; /* Name of source file */ + char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */ + H5F_libver_t low, high; /* File format bounds */ + unsigned srcdset_layoutversion; /* Layout version of source dataset */ + int i, j; /* Local index variables */ + H5D_t *dsetp = NULL; /* Pointer to internal dset structure */ + herr_t ret; /* Generic return value */ TESTING("H5Ocopy(): simple dataset with version bounds"); @@ -2595,12 +2596,12 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) static int test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - hsize_t dim2d[2]; /* Dataset dimensions */ - int i, j; /* local index variables */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + int i, j; /* local index variables */ char filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): simple dataset within the same file"); @@ -2717,10 +2718,10 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl) static int test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim2d[2]; /* Dataset dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim2d[2]; /* Dataset dimensions */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -2850,11 +2851,11 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h static int test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim1d[1]; /* Dataset dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim1d[1]; /* Dataset dimensions */ typedef struct comp_t { int a; double d; @@ -3002,18 +3003,18 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t static int test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hsize_t max_dim1d[1]; /* Dataset max. dimensions */ - hsize_t dim2d[2]; /* Dataset dimensions */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ - float buf1d[DIM_SIZE_1]; /* Buffer for writing data */ - float buf2d[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int i, j; /* Local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hsize_t max_dim1d[1]; /* Dataset max. dimensions */ + hsize_t dim2d[2]; /* Dataset dimensions */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ + float buf1d[DIM_SIZE_1]; /* Buffer for writing data */ + float buf2d[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int i, j; /* Local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -3526,15 +3527,15 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t static int test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hsize_t max_dim1d[1]; /* Dataset max. dimensions */ - hsize_t dim2d[2]; /* Dataset dimensions */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hsize_t max_dim1d[1]; /* Dataset max. dimensions */ + hsize_t dim2d[2]; /* Dataset dimensions */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -4026,21 +4027,21 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, static int test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hsize_t new_dim1d[1]; /* Dataset dimensions */ - hsize_t max_dim1d[1]; /* Dataset max. dimensions */ - hsize_t dim2d[2]; /* Dataset dimensions */ - hsize_t new_dim2d[2]; /* Dataset dimensions */ - hsize_t max_dim2d[2]; /* Dataset max. dimensions */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ - float buf1d[DIM_SIZE_1]; /* Buffer for writing data */ - float buf2d[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int i, j; /* Local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hsize_t new_dim1d[1]; /* Dataset dimensions */ + hsize_t max_dim1d[1]; /* Dataset max. dimensions */ + hsize_t dim2d[2]; /* Dataset dimensions */ + hsize_t new_dim2d[2]; /* Dataset dimensions */ + hsize_t max_dim2d[2]; /* Dataset max. dimensions */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ + float buf1d[DIM_SIZE_1]; /* Buffer for writing data */ + float buf2d[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int i, j; /* Local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -4404,14 +4405,14 @@ static int test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { #ifdef H5_HAVE_FILTER_DEFLATE - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim2d[2]; /* Dataset dimensions */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ - float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int i, j; /* Local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim2d[2]; /* Dataset dimensions */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ + float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int i, j; /* Local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -4822,14 +4823,14 @@ static int test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { #ifdef H5_HAVE_FILTER_DEFLATE - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim2d[2]; /* Dataset dimensions */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ - float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int i, j; /* Local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim2d[2]; /* Dataset dimensions */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ + float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int i, j; /* Local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -5002,13 +5003,13 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h static int test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim2d[2]; /* Dataset dimensions */ - float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int i, j; /* Local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim2d[2]; /* Dataset dimensions */ + float buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int i, j; /* Local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -5157,10 +5158,10 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t static int test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ int i; hsize_t size; hsize_t dim1d[1]; @@ -5303,10 +5304,10 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t static int test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ int i; hsize_t dim1d[1]; int buf[DIM_SIZE_1]; @@ -5445,11 +5446,11 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi static int test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ int i; hsize_t dim1d[1]; int buf[DIM_SIZE_1]; @@ -5610,11 +5611,11 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap static int test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ int i; hsize_t dim1d[1]; int buf[DIM_SIZE_1]; @@ -5779,10 +5780,10 @@ static int test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ int i; hsize_t dim1d[1]; int buf[DIM_SIZE_1]; @@ -5950,11 +5951,11 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa static int test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ int i; hsize_t dim1d[1]; int buf[DIM_SIZE_1]; @@ -6118,14 +6119,14 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap static int test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -6275,16 +6276,16 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ static int test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -6489,15 +6490,15 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid static int test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -6657,11 +6658,11 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid static int test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hsize_t dim2d[2]; /* Dataset dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t aid = H5I_INVALID_HID, aid2 = H5I_INVALID_HID; /* Attribute IDs */ + hsize_t dim2d[2]; /* Dataset dimensions */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -6793,13 +6794,13 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst static int attach_attribute_compound_vlstr(hid_t loc_id) { - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t vl_str_tid = -1; /* Variable length string datatype ID */ - hid_t cmpd_tid = -1; /* Compound datatype ID */ - hsize_t dim1 = 1; /* Dimension size */ - typedef struct { /* Compound structure for the attribute */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t vl_str_tid = H5I_INVALID_HID; /* Variable length string datatype ID */ + hid_t cmpd_tid = H5I_INVALID_HID; /* Compound datatype ID */ + hsize_t dim1 = 1; /* Dimension size */ + typedef struct { /* Compound structure for the attribute */ int i; char *v; } s1; @@ -6874,10 +6875,10 @@ attach_attribute_compound_vlstr(hid_t loc_id) static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2) { - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ - hid_t dxpl_id = -1; + hid_t aid = H5I_INVALID_HID, aid2 = H5I_INVALID_HID; /* Attribute IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t dxpl_id = H5I_INVALID_HID; typedef struct { /* Compound structure for the attribute */ int i; char *v; @@ -6979,14 +6980,14 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2) static int test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hsize_t dim2d[2]; /* Dataset dimensions */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t aid = H5I_INVALID_HID, aid2 = H5I_INVALID_HID; /* Attribute IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hsize_t dim2d[2]; /* Dataset dimensions */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ TESTING("H5Ocopy(): attribute with compound datatype consisting of variable length string"); @@ -7141,16 +7142,16 @@ static int test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { #ifdef H5_HAVE_FILTER_DEFLATE - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - hsize_t dim2d[2]; /* Dataset dimensions */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ - hvl_t buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int i, j, k; /* Local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + hsize_t dim2d[2]; /* Dataset dimensions */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimensions */ + hvl_t buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int i, j, k; /* Local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -7327,8 +7328,8 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, static int test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -7434,11 +7435,11 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ static int test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t gid_sub = -1; /* Sub-group ID */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID; /* Sub-group ID */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; @@ -7590,11 +7591,11 @@ test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f static int test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t gid_sub = -1; /* Sub-group ID */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID; /* Sub-group ID */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; @@ -7746,11 +7747,11 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) static int test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t gid_sub = -1, gid_sub2; /* Sub-group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID, gid_sub2; /* Sub-group IDs */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j, k; /* Local index variables */ @@ -7912,9 +7913,9 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f static int test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t gid_sub = -1, gid_sub2 = -1; /* Sub-group IDs */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID, gid_sub2 = H5I_INVALID_HID; /* Sub-group IDs */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -8046,11 +8047,11 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f static int test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t gid_sub = -1, gid_sub2 = -1; /* Sub-group IDs */ - unsigned u, v; /* Local index variables */ - char objname[NAME_BUF_SIZE]; /* Object name buffer */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID, gid_sub2 = H5I_INVALID_HID; /* Sub-group IDs */ + unsigned u, v; /* Local index variables */ + char objname[NAME_BUF_SIZE]; /* Object name buffer */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -8191,13 +8192,13 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t static int test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1, fid_ext = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t plid = -1; /* Object copy plist ID */ - hsize_t dim2d[2]; - hsize_t dim1d[1]; + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID, fid_ext = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t plid = H5I_INVALID_HID; /* Object copy plist ID */ + hsize_t dim2d[2]; + hsize_t dim1d[1]; H5L_info2_t linfo; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; @@ -8517,10 +8518,10 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ static int test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t gid = -1; /* Group ID */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; @@ -8672,10 +8673,10 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa static int test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1, fid_ext = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t gid = -1; /* Group ID */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID, fid_ext = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; @@ -8834,13 +8835,13 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap static int test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset IDs */ - int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - hsize_t dim2d[2]; /* Dataset dimensions */ - int i, j; /* local index variables */ - herr_t ret; /* Generic return value */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + int i, j; /* local index variables */ + herr_t ret; /* Generic return value */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -8958,14 +8959,14 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) static int test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t gid = -1; /* Group ID */ - int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - hsize_t dim2d[2]; /* Dataset dimensions */ - int i, j; /* local index variables */ - herr_t ret; /* Generic return value */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + int i, j; /* local index variables */ + herr_t ret; /* Generic return value */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -9120,8 +9121,8 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) static int test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ char filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named datatype in same file"); @@ -9199,9 +9200,9 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) static int test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t src_fapl = -1; /* Source file FAPL ID */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t src_fapl = H5I_INVALID_HID; /* Source file FAPL ID */ const char *src_filename = H5_get_srcdir_filename(FILE_OLD_LAYOUT); /* Corrected test file name */ char dst_filename[NAME_BUF_SIZE]; @@ -9309,15 +9310,15 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, bool test_open) static int test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid_copy = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid_copy = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -9491,14 +9492,14 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap static int test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid_copy = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid_copy = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -9665,16 +9666,16 @@ static int test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid_copy = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid_copy = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -9858,16 +9859,16 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap static int test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid_copy = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid_copy = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -10043,16 +10044,16 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_ static int test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j, k; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ - hvl_t *tvl; /* Temporary pointer to VL information */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j, k; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hvl_t *tvl; /* Temporary pointer to VL information */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -10235,16 +10236,16 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, static int test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j, k; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ - hvl_t *tvl; /* Temporary pointer to VL information */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j, k; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hvl_t *tvl; /* Temporary pointer to VL information */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -10431,15 +10432,15 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h static int test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j, k; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j, k; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ hvl_t *tvl; /* Temporary pointer to VL information */ hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ char src_filename[NAME_BUF_SIZE]; @@ -10667,15 +10668,15 @@ static int test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool test_open) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j, k; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j, k; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hvl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ hvl_t *tvl; /* Temporary pointer to VL information */ hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ char src_filename[NAME_BUF_SIZE]; @@ -10876,16 +10877,16 @@ typedef struct cmpd_vl_t { static int test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t tid2 = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t did2 = -1; /* Dataset ID */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - cmpd_vl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t tid2 = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t did2 = H5I_INVALID_HID; /* Dataset ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + cmpd_vl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -11049,16 +11050,16 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, static int test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ - cmpd_vl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + hsize_t chunk_dim1d[1] = {CHUNK_SIZE_1}; /* Chunk dimensions */ + cmpd_vl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -11232,15 +11233,15 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl static int test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Dataset creation property list ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t dxpl_id = -1; /* Dataset transfer property list ID */ - unsigned int i, j; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - cmpd_vl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dxpl_id = H5I_INVALID_HID; /* Dataset transfer property list ID */ + unsigned int i, j; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + cmpd_vl_t buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -11418,14 +11419,14 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl static int test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Object copy property list ID */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hsize_t dim1d[1] = {2}; /* Dataset dimensions */ - hobj_ref_t obj_buf[2]; /* Buffer for object refs */ - hdset_reg_ref_t reg_buf[2]; /* Buffer for region refs */ - char zeros[MAX(sizeof(obj_buf), sizeof(reg_buf))]; /* Array of zeros, for memcmp */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Object copy property list ID */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hsize_t dim1d[1] = {2}; /* Dataset dimensions */ + hobj_ref_t obj_buf[2]; /* Buffer for object refs */ + hdset_reg_ref_t reg_buf[2]; /* Buffer for region refs */ + char zeros[MAX(sizeof(obj_buf), sizeof(reg_buf))]; /* Array of zeros, for memcmp */ char src_filename[NAME_BUF_SIZE]; char mid_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -11609,18 +11610,18 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap static int test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid1 = -1, fid2 = -1, fid3 = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t pid = -1; /* Object copy property list ID */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hid_t did3 = -1, did4 = -1; /* Dataset IDs */ - hid_t did5 = -1, did6 = -1; /* Dataset IDs */ - hid_t dcpl = -1; /* Dataset creation property list */ - hsize_t chunk_dim1d[1] = {2}; /* Chunk dimensions */ - hsize_t dim1d[1] = {3}; /* Dataset dimensions */ - hobj_ref_t obj_buf[3]; /* Buffer for object refs */ - hdset_reg_ref_t reg_buf[3]; /* Buffer for region refs */ - char zeros[MAX(sizeof(obj_buf), sizeof(reg_buf))]; /* Array of zeros, for memcmp */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, fid3 = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t pid = H5I_INVALID_HID; /* Object copy property list ID */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t did3 = H5I_INVALID_HID, did4 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t did5 = H5I_INVALID_HID, did6 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hsize_t chunk_dim1d[1] = {2}; /* Chunk dimensions */ + hsize_t dim1d[1] = {3}; /* Dataset dimensions */ + hobj_ref_t obj_buf[3]; /* Buffer for object refs */ + hdset_reg_ref_t reg_buf[3]; /* Buffer for region refs */ + char zeros[MAX(sizeof(obj_buf), sizeof(reg_buf))]; /* Array of zeros, for memcmp */ char src_filename[NAME_BUF_SIZE]; char mid_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -11814,9 +11815,9 @@ test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds static int test_copy_attr_crt_order(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gcplid = -1; /* Group creation property list ID */ - hid_t gid1 = -1, gid2 = -1; /* Group IDs */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gcplid = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -11947,16 +11948,16 @@ static int test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src1 = -1, fid_src2 = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid_src1 = H5I_INVALID_HID, fid_src2 = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char src1_filename[NAME_BUF_SIZE]; char src2_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -12263,17 +12264,17 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap static int test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, bool reopen) { - hid_t fid = -1; /* File ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char filename[NAME_BUF_SIZE]; int token_cmp; @@ -12656,16 +12657,16 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, bool reopen static int test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; int token_cmp; @@ -12950,18 +12951,18 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl static int test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t gid = -1; /* Group ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; int token_cmp; @@ -13221,23 +13222,23 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl static int test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group IDs */ - hid_t f_tid = -1; /* Datatype ID for root group */ - hid_t g_tid = -1; /* Datatype ID for group */ - hid_t anon_tid = -1; /* Anonymous datatype */ - hid_t aid = -1; /* Attribute ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - int i; /* Local index variable */ - hsize_t dim1d[1]; /* dimension sizes */ - int buf[DIM_SIZE_1]; /* Buffer for data */ - H5O_token_t exp_token_int, exp_token_short; /* Expected object tokenes */ - H5O_info2_t oinfo; /* Object info */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID; /* Group IDs */ + hid_t f_tid = H5I_INVALID_HID; /* Datatype ID for root group */ + hid_t g_tid = H5I_INVALID_HID; /* Datatype ID for group */ + hid_t anon_tid = H5I_INVALID_HID; /* Anonymous datatype */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + int i; /* Local index variable */ + hsize_t dim1d[1]; /* dimension sizes */ + int buf[DIM_SIZE_1]; /* Buffer for data */ + H5O_token_t exp_token_int, exp_token_short; /* Expected object tokenes */ + H5O_info2_t oinfo; /* Object info */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ int token_cmp; if (reopen) @@ -13691,18 +13692,18 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d static int test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ - hid_t tid3 = -1, tid4 = -1; /* Datatype IDs */ - hid_t tid5 = -1, tid = -1; /* Datatype IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - hsize_t dim1d[1]; /* dimension sizes */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t tid3 = H5I_INVALID_HID, tid4 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t tid5 = H5I_INVALID_HID, tid = H5I_INVALID_HID; /* Datatype IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + hsize_t dim1d[1]; /* dimension sizes */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ int token_cmp; if (reopen) @@ -14004,11 +14005,11 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds static int test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; int token_cmp; @@ -14317,16 +14318,16 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t static int test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; int token_cmp; @@ -14690,17 +14691,17 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h static int test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t gid = -1; /* Group ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t did = -1; /* Dataset ID */ - hid_t exp_did = -1; /* Dataset ID */ - hid_t tid_short = -1; /* Datatype ID */ - hid_t exp_tid = -1; /* Expected datatype ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - hsize_t dim1d[1]; /* Dataset dimensions */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t exp_did = H5I_INVALID_HID; /* Dataset ID */ + hid_t tid_short = H5I_INVALID_HID; /* Datatype ID */ + hid_t exp_tid = H5I_INVALID_HID; /* Expected datatype ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + hsize_t dim1d[1]; /* Dataset dimensions */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; @@ -15333,16 +15334,16 @@ mcdt_search_cb(void *_udata) static int test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ - H5O_info2_t oinfo; /* Object info */ - H5O_token_t exp_token; /* Expected object token */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info2_t oinfo; /* Object info */ + H5O_token_t exp_token; /* Expected object token */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; mcdt_search_cb_ud cb_udata; /* User data for callback */ @@ -15805,14 +15806,14 @@ mcdt_search_cbB(void *_udata) static int test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, bool reopen) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t ocpypl_id = -1; /* Object copy plist ID */ - unsigned int i; /* Local index variables */ - hsize_t dim1d[1]; /* Dataset dimensions */ - int buf[DIM_SIZE_1]; /* Buffer for writing data */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t ocpypl_id = H5I_INVALID_HID; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ @@ -16216,8 +16217,8 @@ test_copy_cdt_v1_header_bug(hid_t fcpl_src, hid_t src_fapl) static int test_copy_iterate(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t gid = -1; /* Group ID */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ int i; char grp_name[16]; char src_filename[NAME_BUF_SIZE]; @@ -16303,14 +16304,14 @@ static int test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, unsigned flag, bool crt_intermediate_grp, const char *test_desciption) { - hid_t fid_src = -1, fid_dst = -1, fid_ext = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1, gid_ref = -1; /* Group IDs */ - hid_t gid_sub = -1, gid_sub_sub = -1; /* Sub-group ID */ - hid_t pid = -1, lcpl_id = -1; /* Property IDs */ - unsigned cpy_flags; /* Object copy flags */ - int depth = -1; /* Copy depth */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID, fid_ext = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid_ref = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID, gid_sub_sub = H5I_INVALID_HID; /* Sub-group ID */ + hid_t pid = H5I_INVALID_HID, lcpl_id = H5I_INVALID_HID; /* Property IDs */ + unsigned cpy_flags; /* Object copy flags */ + int depth = -1; /* Copy depth */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; @@ -16709,18 +16710,18 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, static int test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { - hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t did3 = -1, did4 = -1; /* Dataset IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t pid = -1; /* Dataset creation property list */ - hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimension sizes */ - int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - int newbuf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ - hsize_t dim2d[2]; /* Dataset dimensions */ - int i, j; /* local index variables */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t did3 = H5I_INVALID_HID, did4 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t pid = H5I_INVALID_HID; /* Dataset creation property list */ + hsize_t chunk_dim2d[2] = {CHUNK_SIZE_1, CHUNK_SIZE_2}; /* Chunk dimension sizes */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int newbuf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + int i, j; /* local index variables */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c index 05e006b6d64..40f91e885e4 100644 --- a/test/objcopy_ref.c +++ b/test/objcopy_ref.c @@ -166,9 +166,10 @@ token_reset(void) static herr_t attach_ref_attr(hid_t file_id, hid_t loc_id) { - char dsetname1[] = "dataset1_pointed_by_ref_attr"; - char dsetname2[] = "dataset2_pointed_by_ref_attr"; - hid_t did1 = (-1), did2 = (-1), aid = (-1), sid = (-1), sid_ref = (-1); + char dsetname1[] = "dataset1_pointed_by_ref_attr"; + char dsetname2[] = "dataset2_pointed_by_ref_attr"; + hid_t did1 = (H5I_INVALID_HID), did2 = (H5I_INVALID_HID), aid = (H5I_INVALID_HID), + sid = (H5I_INVALID_HID), sid_ref = (H5I_INVALID_HID); hsize_t dims[2] = {2, 9}; hsize_t dims_ref[1] = {2}; H5R_ref_t ref[2]; @@ -247,10 +248,10 @@ static herr_t attach_reg_ref_attr(hid_t file_id, hid_t loc_id) { const char dsetnamev[] = "dataset_pointed_by_reg_ref_attr"; - hid_t aid = (-1); - hid_t space_id = (-1); /* dataspace identifiers */ - hid_t spacer_id = (-1); /* dataspace identifiers */ - hid_t dsetv_id = (-1); /*dataset identifiers*/ + hid_t aid = (H5I_INVALID_HID); + hid_t space_id = (H5I_INVALID_HID); /* dataspace identifiers */ + hid_t spacer_id = (H5I_INVALID_HID); /* dataspace identifiers */ + hid_t dsetv_id = (H5I_INVALID_HID); /*dataset identifiers*/ hsize_t dims[2] = {2, 9}; hsize_t dimsr[1] = {2}; int rank = 2; @@ -347,10 +348,10 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) const char dsetnamer[] = "dataset_with_reg_ref"; const char dsetnamer1[] = "compact_dataset_with_reg_ref"; const char dsetnamer2[] = "compressed_dataset_with_reg_ref"; - hid_t space_id = (-1); /* dataspace identifiers */ - hid_t spacer_id = (-1); - hid_t dsetv_id = (-1); /*dataset identifiers*/ - hid_t dsetr_id = (-1); + hid_t space_id = (H5I_INVALID_HID); /* dataspace identifiers */ + hid_t spacer_id = (H5I_INVALID_HID); + hid_t dsetv_id = (H5I_INVALID_HID); /*dataset identifiers*/ + hid_t dsetr_id = (H5I_INVALID_HID); hsize_t dims[2] = {2, 9}; hsize_t dimsr[1] = {2}; int rank = 2; @@ -362,7 +363,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) hsize_t count[2]; hsize_t coord[3][2] = {{0, 0}, {1, 6}, {0, 8}}; size_t num_points = 3; - hid_t pid = (-1); + hid_t pid = (H5I_INVALID_HID); if ((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR; @@ -471,11 +472,11 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id) static int test_copy_attach_attributes(hid_t loc_id, hid_t type_id) { - hid_t aid = -1, sid = -1; + hid_t aid = H5I_INVALID_HID, sid = H5I_INVALID_HID; char attr_name[ATTR_NAME_LEN]; int attr_data[2]; hsize_t dim1 = 2; - hid_t acpl = -1; + hid_t acpl = H5I_INVALID_HID; unsigned u; int ret_value = -1; @@ -538,16 +539,16 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id) static int compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_owner) { - hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - size_t elmt_size; /* Size of datatype */ - htri_t is_committed; /* If the datatype is committed */ - htri_t is_committed2; /* If the datatype is committed */ - H5A_info_t ainfo; /* Attribute info */ - H5A_info_t ainfo2; /* Attribute info */ - hssize_t nelmts; /* # of elements in dataspace */ - void *rbuf = NULL; /* Buffer for reading raw data */ - void *rbuf2 = NULL; /* Buffer for reading raw data */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + size_t elmt_size; /* Size of datatype */ + htri_t is_committed; /* If the datatype is committed */ + htri_t is_committed2; /* If the datatype is committed */ + H5A_info_t ainfo; /* Attribute info */ + H5A_info_t ainfo2; /* Attribute info */ + hssize_t nelmts; /* # of elements in dataspace */ + void *rbuf = NULL; /* Buffer for reading raw data */ + void *rbuf2 = NULL; /* Buffer for reading raw data */ /* Check the character sets are equal */ if (H5Aget_info(aid, &ainfo) < 0) @@ -698,9 +699,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ static int compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid) { - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - H5O_info2_t oinfo1, oinfo2; /* Object info */ - unsigned cpy_flags; /* Object copy flags */ + hid_t aid = H5I_INVALID_HID, aid2 = H5I_INVALID_HID; /* Attribute IDs */ + H5O_info2_t oinfo1, oinfo2; /* Object info */ + unsigned cpy_flags; /* Object copy flags */ /* Retrieve the object copy flags from the property list, if it's non-DEFAULT */ if (pid != H5P_DEFAULT) { @@ -1028,18 +1029,18 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, static int compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) { - hid_t sid = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list IDs */ - size_t elmt_size; /* Size of datatype */ - htri_t is_committed; /* If the datatype is committed */ - htri_t is_committed2; /* If the datatype is committed */ - int nfilters; /* Number of filters applied to dataset */ - hssize_t nelmts; /* # of elements in dataspace */ - void *rbuf = NULL; /* Buffer for reading raw data */ - void *rbuf2 = NULL; /* Buffer for reading raw data */ - H5D_space_status_t space_status; /* Dataset's raw dataspace status */ - H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ + hid_t sid = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t tid = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t dcpl = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID; /* Dataset creation property list IDs */ + size_t elmt_size; /* Size of datatype */ + htri_t is_committed; /* If the datatype is committed */ + htri_t is_committed2; /* If the datatype is committed */ + int nfilters; /* Number of filters applied to dataset */ + hssize_t nelmts; /* # of elements in dataspace */ + void *rbuf = NULL; /* Buffer for reading raw data */ + void *rbuf2 = NULL; /* Buffer for reading raw data */ + H5D_space_status_t space_status; /* Dataset's raw dataspace status */ + H5D_space_status_t space_status2; /* Dataset's raw dataspace status */ /* Check the datatypes are equal */ @@ -1430,14 +1431,14 @@ static int test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, unsigned flag, bool crt_intermediate_grp, const char *test_desciption) { - hid_t fid_src = -1, fid_dst = -1, fid_ext = -1; /* File IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1, gid2 = -1, gid_ref = -1; /* Group IDs */ - hid_t gid_sub = -1, gid_sub_sub = -1; /* Sub-group ID */ - hid_t pid = -1, lcpl_id = -1; /* Property IDs */ - unsigned cpy_flags; /* Object copy flags */ - int depth = -1; /* Copy depth */ + hid_t fid_src = H5I_INVALID_HID, fid_dst = H5I_INVALID_HID, fid_ext = H5I_INVALID_HID; /* File IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid_ref = H5I_INVALID_HID; /* Group IDs */ + hid_t gid_sub = H5I_INVALID_HID, gid_sub_sub = H5I_INVALID_HID; /* Sub-group ID */ + hid_t pid = H5I_INVALID_HID, lcpl_id = H5I_INVALID_HID; /* Property IDs */ + unsigned cpy_flags; /* Object copy flags */ + int depth = -1; /* Copy depth */ hsize_t dim2d[2]; int buf[DIM_SIZE_1][DIM_SIZE_2]; int i, j; diff --git a/test/ohdr.c b/test/ohdr.c index 88654c64ffe..db302efb076 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -68,7 +68,7 @@ static const char *FILENAME[] = {"ohdr", "ohdr_min_a", "ohdr_min_b", NULL}; static herr_t test_cont(char *filename, hid_t fapl) { - hid_t file = -1; + hid_t file = H5I_INVALID_HID; H5F_t *f = NULL; H5O_hdr_info_t hdr_info; H5O_loc_t oh_locA, oh_locB; @@ -181,7 +181,7 @@ test_cont(char *filename, hid_t fapl) static herr_t test_ohdr_cache(char *filename, hid_t fapl) { - hid_t file = -1; /* File ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ hid_t my_fapl; /* FAPL ID */ H5AC_cache_config_t mdc_config; /* Metadata cache configuration info */ H5F_t *f = NULL; /* File handle */ @@ -318,17 +318,17 @@ test_ohdr_cache(char *filename, hid_t fapl) static herr_t test_ohdr_swmr(bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t plist = -1; /* Dataset creation property list */ - size_t compact_size = 1024; /* The size of compact dataset */ - int *wbuf = NULL; /* Buffer for writing */ - hsize_t dims[1]; /* Dimension sizes */ - size_t u; /* Iterator */ - int n; /* Data variable */ - H5O_native_info_t ninfo; /* Information for the object */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t plist = H5I_INVALID_HID; /* Dataset creation property list */ + size_t compact_size = 1024; /* The size of compact dataset */ + int *wbuf = NULL; /* Buffer for writing */ + hsize_t dims[1]; /* Dimension sizes */ + size_t u; /* Iterator */ + int n; /* Data variable */ + H5O_native_info_t ninfo; /* Information for the object */ if (new_format) { TESTING("exercise the coding for the re-read of the object header for SWMR access: latest-format"); @@ -528,15 +528,15 @@ test_ohdr_badness(hid_t fapl) static herr_t test_unknown(unsigned bogus_id, char *filename, hid_t fapl) { - hid_t fid = -1; /* file ID */ - hid_t gid = -1; /* group ID */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t loc = -1; /* location: file or group ID */ - hid_t fid_bogus = -1; /* bogus file ID */ - hid_t gid_bogus = -1; /* bogus group ID */ - hid_t loc_bogus = -1; /* location: bogus file or group ID */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t gid = H5I_INVALID_HID; /* group ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t loc = H5I_INVALID_HID; /* location: file or group ID */ + hid_t fid_bogus = H5I_INVALID_HID; /* bogus file ID */ + hid_t gid_bogus = H5I_INVALID_HID; /* bogus group ID */ + hid_t loc_bogus = H5I_INVALID_HID; /* location: bogus file or group ID */ char testfile[TESTFILE_LEN]; /* create a different name for a local copy of the data file to be @@ -1083,23 +1083,23 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id) unsigned compact = 0; /* IDs that are file-agnostic */ - hid_t dspace_id = -1; - hid_t int_type_id = -1; - hid_t dcpl_minimize = -1; - hid_t dcpl_dontmin = -1; - hid_t dcpl_default = -1; + hid_t dspace_id = H5I_INVALID_HID; + hid_t int_type_id = H5I_INVALID_HID; + hid_t dcpl_minimize = H5I_INVALID_HID; + hid_t dcpl_dontmin = H5I_INVALID_HID; + hid_t dcpl_default = H5I_INVALID_HID; /* IDs for non-minimized file open */ - hid_t file_f_id = -1; /* lower 'f' for standard file setting */ - hid_t dset_f_x_id = -1; /* 'x' for default */ - hid_t dset_f_N_id = -1; /* 'N' for explicit non-minimized dset */ - hid_t dset_f_Y_id = -1; /* 'Y' for minimized dset */ + hid_t file_f_id = H5I_INVALID_HID; /* lower 'f' for standard file setting */ + hid_t dset_f_x_id = H5I_INVALID_HID; /* 'x' for default */ + hid_t dset_f_N_id = H5I_INVALID_HID; /* 'N' for explicit non-minimized dset */ + hid_t dset_f_Y_id = H5I_INVALID_HID; /* 'Y' for minimized dset */ /* IDs for minimized file open */ - hid_t file_F_id = -1; /* upper 'F' for minimized file setting */ - hid_t dset_F_x_id = -1; /* 'x' for default */ - hid_t dset_F_N_id = -1; /* 'N' for explicit non-minimized dset */ - hid_t dset_F_Y_id = -1; /* 'Y' for minimized dset */ + hid_t file_F_id = H5I_INVALID_HID; /* upper 'F' for minimized file setting */ + hid_t dset_F_x_id = H5I_INVALID_HID; /* 'x' for default */ + hid_t dset_F_N_id = H5I_INVALID_HID; /* 'N' for explicit non-minimized dset */ + hid_t dset_F_Y_id = H5I_INVALID_HID; /* 'Y' for minimized dset */ char filename_a[512] = ""; char filename_b[512] = ""; @@ -1310,16 +1310,16 @@ test_minimized_dset_ohdr_with_filter(hid_t fapl_id) const unsigned filter_values[] = {0}; /* TBD */ const hsize_t chunk_dim[] = {32}; /* needed for filter */ const int ndims = 1; - hid_t dspace_id = -1; - hid_t dtype_id = -1; - hid_t dcpl_xZ_id = -1; - hid_t dcpl_mx_id = -1; - hid_t dcpl_mZ_id = -1; - hid_t dset_xx_id = -1; - hid_t dset_xZ_id = -1; - hid_t dset_mx_id = -1; - hid_t dset_mZ_id = -1; - hid_t file_id = -1; + hid_t dspace_id = H5I_INVALID_HID; + hid_t dtype_id = H5I_INVALID_HID; + hid_t dcpl_xZ_id = H5I_INVALID_HID; + hid_t dcpl_mx_id = H5I_INVALID_HID; + hid_t dcpl_mZ_id = H5I_INVALID_HID; + hid_t dset_xx_id = H5I_INVALID_HID; + hid_t dset_xZ_id = H5I_INVALID_HID; + hid_t dset_mx_id = H5I_INVALID_HID; + hid_t dset_mZ_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; herr_t ret; /* dcpl suffixes: @@ -1469,19 +1469,19 @@ test_minimized_dset_ohdr_modification_times(hid_t _fapl_id) char filename[512] = ""; const hsize_t extents[1] = {128}; /* extents of dataspace */ - hid_t dspace_id = -1; - hid_t dtype_id = -1; - hid_t dcpl_xT_id = -1; /* Track modtime */ - hid_t dcpl_mx_id = -1; /* minimized */ - hid_t dcpl_mT_id = -1; /* minimized, Track */ - hid_t dcpl_mN_id = -1; /* minimized, do Not track */ - hid_t dset_xx_id = -1; - hid_t dset_xT_id = -1; - hid_t dset_mx_id = -1; - hid_t dset_mT_id = -1; - hid_t dset_mN_id = -1; - hid_t file_id = -1; - hid_t fapl_id = -1; + hid_t dspace_id = H5I_INVALID_HID; + hid_t dtype_id = H5I_INVALID_HID; + hid_t dcpl_xT_id = H5I_INVALID_HID; /* Track modtime */ + hid_t dcpl_mx_id = H5I_INVALID_HID; /* minimized */ + hid_t dcpl_mT_id = H5I_INVALID_HID; /* minimized, Track */ + hid_t dcpl_mN_id = H5I_INVALID_HID; /* minimized, do Not track */ + hid_t dset_xx_id = H5I_INVALID_HID; + hid_t dset_xT_id = H5I_INVALID_HID; + hid_t dset_mx_id = H5I_INVALID_HID; + hid_t dset_mT_id = H5I_INVALID_HID; + hid_t dset_mN_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; herr_t ret; unsigned i = 0; /* for testcase loop */ @@ -1686,13 +1686,13 @@ test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id) char filename[512] = ""; const hsize_t extents[1] = {64}; /* extents of dataspace */ const int fill[1] = {343}; /* fill value of dataset */ - hid_t file_id = -1; - hid_t dtype_id = -1; - hid_t dspace_id = -1; - hid_t dcpl_id = -1; - hid_t fapl_id = -1; - hid_t dset_0_id = -1; - hid_t dset_1_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dtype_id = H5I_INVALID_HID; + hid_t dspace_id = H5I_INVALID_HID; + hid_t dcpl_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dset_0_id = H5I_INVALID_HID; + hid_t dset_1_id = H5I_INVALID_HID; herr_t ret; /********* @@ -1824,8 +1824,8 @@ test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id) int main(void) { - hid_t fapl = -1; - hid_t file = -1; + hid_t fapl = H5I_INVALID_HID; + hid_t file = H5I_INVALID_HID; H5F_t *f = NULL; const char *env_h5_drvr; /* File driver value from environment */ bool single_file_vfd; /* Whether VFD used stores data in a single file */ diff --git a/test/onion.c b/test/onion.c index 576d8ad6101..e3b0ae735b5 100644 --- a/test/onion.c +++ b/test/onion.c @@ -1285,7 +1285,7 @@ test_revision_record_encode_decode(void) 0, 0, 0, 0, /* Bytes 080-083: checksum (populated below) */ /* ENTRY 1 */ 0, 0xF0, 0x2E, 0, 0, 0, 0, 0, /* Bytes 084-091: entry 1: logical offset */ - 0xA7, 0, 0, 0, 0, 0, 0, 0, /* Bytes 092-099: entry 1: physical address */ + 0xA7, 0, 0, 0, 0, 0, 0, 0, /* Bytes 092-099: entry 1: physical address */ 0, 0, 0, 0, /* Bytes 100-103: checksum (populated below) */ /* ENTRY 2 */ 0, 0x50, 0x15, 0, 0, 0x20, 0, 0, /* Bytes 104-111: entry 2: logical offset */ diff --git a/test/page_buffer.c b/test/page_buffer.c index 6fd3528616a..4cc1478398e 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -82,13 +82,13 @@ static const char *FILENAME[] = {"filepaged", NULL}; static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl) { - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t grp_id = -1; - hid_t filespace = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t grp_id = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; hsize_t dimsf[2] = {NX, NY}; /* dataset dimensions */ int *data = NULL; /* pointer to data buffer to write */ - hid_t dcpl = -1; + hid_t dcpl = H5I_INVALID_HID; int i; int num_elements; int j; @@ -219,9 +219,9 @@ create_file(char *filename, hid_t fcpl, hid_t fapl) static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size) { - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t grp_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t grp_id = H5I_INVALID_HID; int *data = NULL; /* pointer to data buffer to write */ int i; int j; @@ -376,10 +376,10 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize) static unsigned test_args(hid_t orig_fapl, const char *env_h5_drvr) { - char filename[FILENAME_LEN]; /* Filename to use */ - hid_t file_id = -1; /* File ID */ - hid_t fcpl = -1; - hid_t fapl = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; herr_t ret; TESTING("Settings for Page Buffering"); @@ -547,10 +547,10 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) static unsigned test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) { - char filename[FILENAME_LEN]; /* Filename to use */ - hid_t file_id = -1; /* File ID */ - hid_t fcpl = -1; - hid_t fapl = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; size_t base_page_cnt; size_t page_count = 0; int i, num_elements = 2000; @@ -810,10 +810,10 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) static unsigned test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) { - char filename[FILENAME_LEN]; /* Filename to use */ - hid_t file_id = -1; /* File ID */ - hid_t fcpl = -1; - hid_t fapl = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; size_t base_page_cnt; size_t page_count = 0; int i; @@ -1049,10 +1049,10 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) static unsigned test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) { - char filename[FILENAME_LEN]; /* Filename to use */ - hid_t file_id = -1; /* File ID */ - hid_t fcpl = -1; - hid_t fapl = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; size_t base_raw_cnt = 0; size_t base_meta_cnt = 0; size_t page_count = 0; @@ -1667,10 +1667,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) static unsigned test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) { - char filename[FILENAME_LEN]; /* Filename to use */ - hid_t file_id = -1; /* File ID */ - hid_t fcpl = -1; - hid_t fapl = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; int i; int num_elements = 1000; size_t base_raw_cnt = 0; @@ -1956,10 +1956,10 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) static unsigned verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) { - char filename[FILENAME_LEN]; /* Filename to use */ - hid_t file_id = -1; /* File ID */ - hid_t fcpl = -1; - hid_t fapl = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ + hid_t fcpl = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; TESTING("Page Buffering Disabled"); h5_fixname(FILENAME[0], orig_fapl, filename, sizeof(filename)); @@ -2064,10 +2064,10 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) int main(void) { - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ - const char *env_h5_drvr = NULL; /* File Driver value from environment */ - bool api_ctx_pushed = false; /* Whether API context pushed */ + hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ + const char *env_h5_drvr = NULL; /* File Driver value from environment */ + bool api_ctx_pushed = false; /* Whether API context pushed */ h5_reset(); diff --git a/test/reserved.c b/test/reserved.c index 1b29f8b8a13..f9d1c7f5f94 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -31,8 +31,8 @@ static const char *FILENAME[] = {"rsrv_heap", "rsrv_ohdr", "rsrv_vlen", NULL}; static herr_t rsrv_heap(void) { - hid_t file_id = (-1), dataset_id = (-1), dataspace_id = (-1); - hid_t fapl = (-1), fcpl = (-1); + hid_t file_id = (H5I_INVALID_HID), dataset_id = (H5I_INVALID_HID), dataspace_id = (H5I_INVALID_HID); + hid_t fapl = (H5I_INVALID_HID), fcpl = (H5I_INVALID_HID); hsize_t dims[1] = {1}; char filename[1024], dset_name[10]; int i; @@ -160,8 +160,8 @@ rsrv_heap(void) static herr_t rsrv_ohdr(void) { - hid_t file_id = (-1), dataset_id = (-1), dataspace_id = (-1); - hid_t fapl = (-1), fcpl = (-1), aid, attr_id; + hid_t file_id = (H5I_INVALID_HID), dataset_id = (H5I_INVALID_HID), dataspace_id = (H5I_INVALID_HID); + hid_t fapl = (H5I_INVALID_HID), fcpl = (H5I_INVALID_HID), aid, attr_id; hsize_t dims[2]; herr_t status; int attrval[4][6]; @@ -298,8 +298,9 @@ rsrv_ohdr(void) static herr_t rsrv_vlen(void) { - hid_t file_id = (-1), dataset_id = (-1), dataspace_id = (-1), type_id = (-1); - hid_t fapl = (-1), fcpl = (-1), mem_space_id = (-1); + hid_t file_id = (H5I_INVALID_HID), dataset_id = (H5I_INVALID_HID), dataspace_id = (H5I_INVALID_HID), + type_id = (H5I_INVALID_HID); + hid_t fapl = (H5I_INVALID_HID), fcpl = (H5I_INVALID_HID), mem_space_id = (H5I_INVALID_HID); hssize_t offset[1]; hsize_t start[1]; hsize_t dims[1], count[1]; diff --git a/test/ros3.c b/test/ros3.c index 52470f2443e..994c5889154 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -412,7 +412,7 @@ test_fapl_config_validation(void) * test-local variables * ************************/ - hid_t fapl_id = -1; /* file access property list ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ H5FD_ros3_fapl_t config; H5FD_ros3_fapl_t fa_fetch; herr_t success = SUCCEED; @@ -620,9 +620,9 @@ test_ros3_fapl(void) * test-local variables * ************************/ - hid_t fapl_id = -1; /* file access property list ID */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ H5FD_ros3_fapl_t ros3_fa_0 = { H5FD_CURR_ROS3_FAPL_T_VERSION, /* version */ false, /* authenticate */ @@ -787,8 +787,8 @@ test_vfd_open(void) }; H5FD_t *fd = NULL; bool curl_ready = false; - hid_t fapl_id = -1; - hid_t fapl_file_access = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t fapl_file_access = H5I_INVALID_HID; unsigned i = 0; unsigned tests_count = 10; @@ -930,7 +930,7 @@ test_eof_eoa(void) H5FD_t *fd_shakespeare = NULL; bool curl_ready = false; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("ROS3 eof/eoa gets and sets"); @@ -1038,7 +1038,7 @@ test_H5FDread_without_eoa_set_fails(void) char buffer[256]; unsigned int i = 0; H5FD_t *file_shakespeare = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("ROS3 VFD read-eoa temporal coupling library limitation "); @@ -1209,7 +1209,7 @@ test_read(void) char buffer[S3_TEST_MAX_URL_SIZE]; unsigned int i = 0; H5FD_t *file_raven = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("ROS3 VFD read/range-gets"); @@ -1348,7 +1348,7 @@ test_noops_and_autofails(void) ************************/ bool curl_ready = false; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; H5FD_t *file = NULL; const char data[36] = "The Force shall be with you, always"; @@ -1467,7 +1467,7 @@ test_cmp(void) H5FD_t *fd_shakes = NULL; H5FD_t *fd_raven_2 = NULL; bool curl_ready = false; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; TESTING("ROS3 cmp (comparison)"); @@ -1587,8 +1587,8 @@ test_H5F_integration(void) * test-local variables * ************************/ - hid_t file = -1; - hid_t fapl_id = -1; + hid_t file = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; TESTING("S3 file access through HD5F library (H5F API)"); diff --git a/test/set_extent.c b/test/set_extent.c index 9407807995b..7b7bcbd3a82 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -230,8 +230,8 @@ do_ranks(hid_t fapl, bool new_format, bool use_select_io) bool do_fillvalue = false; bool disable_edge_filters = false; rank4_index_t index_type; - hid_t dcpl = -1; - hid_t dxpl = -1; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; int fillvalue = FILL_VALUE; unsigned config; bool driver_is_parallel; @@ -437,8 +437,8 @@ do_ranks(hid_t fapl, bool new_format, bool use_select_io) static int do_layouts(hid_t fapl, bool use_select_io) { - hid_t new_fapl = -1; - hid_t dxpl = -1; + hid_t new_fapl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Generic return value */ @@ -514,10 +514,10 @@ test_rank1(hid_t fapl, hid_t dcpl, hid_t dxpl, bool do_fill_value, bool disable_ bool set_istore_k) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; - hid_t my_dcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t my_dcpl = H5I_INVALID_HID; hid_t fcpl; hsize_t dims_o[RANK1] = {DIM0}; /* original dimensions */ hsize_t dims_s[RANK1] = {DIMS0}; /* shrinking dimensions */ @@ -848,10 +848,10 @@ test_rank2(hid_t fapl, hid_t dcpl, hid_t dxpl, bool do_fill_value, bool disable_ bool set_istore_k) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; - hid_t my_dcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t my_dcpl = H5I_INVALID_HID; hid_t fcpl; hsize_t dims_o[RANK2] = {DIM0, DIM1}; /* original dimensions */ hsize_t dims_s[RANK2] = {DIMS0, DIMS1}; /* shrinking dimensions */ @@ -1343,10 +1343,10 @@ test_rank3(hid_t fapl, hid_t dcpl, hid_t dxpl, bool do_fill_value, bool disable_ bool set_istore_k) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; - hid_t my_dcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t my_dcpl = H5I_INVALID_HID; hid_t fcpl; hsize_t dims_o[RANK3] = {DIM0, DIM1, DIM2}; /* original dimensions */ hsize_t dims_s[RANK3] = {DIMS0, DIMS1, DIMS2}; /* shrinking dimensions */ @@ -1777,11 +1777,11 @@ static int test_external(hid_t fapl, bool use_select_io) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; - hid_t dcpl = -1; - hid_t dxpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; hsize_t dims_o[RANK2] = {DIM0, DIM1}; /* original dimensions */ hsize_t dims_s[RANK2] = {DIMS0, DIMS1}; /* shrinking dimensions */ hsize_t dims_e[RANK2] = {DIME0, DIM1}; /* extended dimensions, dimension 1 is the original */ @@ -2080,10 +2080,10 @@ static int test_layouts(H5D_layout_t layout, hid_t fapl, hid_t dxpl) { - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; - hid_t dcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t ret; hsize_t dims_o[RANK2] = {DIM0, DIM1}; /* original dimensions */ hsize_t dims_s[RANK2] = {DIMS0, DIMS1}; /* shrinking dimensions */ @@ -2296,11 +2296,11 @@ static int test_random_rank4(hid_t fapl, hid_t dcpl, hid_t dxpl, bool do_fillvalue, bool disable_edge_filters, bool do_sparse, rank4_index_t index_type) { - hid_t file = -1; - hid_t dset = -1; - hid_t fspace = -1; - hid_t mspace = -1; - hid_t my_dcpl = -1; + hid_t file = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t fspace = H5I_INVALID_HID; + hid_t mspace = H5I_INVALID_HID; + hid_t my_dcpl = H5I_INVALID_HID; hsize_t dims[4] = {10, 10, 10, 10}; /* Dataset's dimensions */ hsize_t max_dims[4] = {10, 10, 10, 10}; /* Maximum dimensions */ hsize_t old_dims[4]; /* Old dataset dimensions */ @@ -2513,12 +2513,12 @@ static int test_random_rank4_vl(hid_t fapl, hid_t dcpl, hid_t dxpl, bool do_fillvalue, bool disable_edge_filters, bool do_sparse, rank4_index_t index_type) { - hid_t file = -1; - hid_t dset = -1; - hid_t type = -1; - hid_t fspace = -1; - hid_t mspace = -1; - hid_t my_dcpl = -1; + hid_t file = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t type = H5I_INVALID_HID; + hid_t fspace = H5I_INVALID_HID; + hid_t mspace = H5I_INVALID_HID; + hid_t my_dcpl = H5I_INVALID_HID; hsize_t dims[4] = {10, 10, 10, 10}; /* Dataset's dimensions */ hsize_t max_dims[4] = {10, 10, 10, 10}; /* Maximum dimensions */ hsize_t old_dims[4]; /* Old dataset dimensions */ diff --git a/test/stab.c b/test/stab.c index 78d13cc6d26..15432eec1b0 100644 --- a/test/stab.c +++ b/test/stab.c @@ -85,8 +85,8 @@ static const char *FILENAME[] = {"stab", NULL}; static int test_misc(hid_t fcpl, hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t g1 = (-1), g2 = (-1), g3 = (-1); + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t g1 = (H5I_INVALID_HID), g2 = (H5I_INVALID_HID), g3 = (H5I_INVALID_HID); char filename[NAME_BUF_SIZE]; char comment[64]; @@ -186,8 +186,8 @@ test_misc(hid_t fcpl, hid_t fapl, bool new_format) static int test_long(hid_t fcpl, hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t g1 = (-1), g2 = (-1); + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t g1 = (H5I_INVALID_HID), g2 = (H5I_INVALID_HID); size_t name2Len; char *name1 = NULL, *name2 = NULL; char filename[NAME_BUF_SIZE]; @@ -270,8 +270,8 @@ test_long(hid_t fcpl, hid_t fapl, bool new_format) static int test_large(hid_t fcpl, hid_t fapl, bool new_format) { - hid_t fid = (-1); /* File ID */ - hid_t cwg = (-1), dir = (-1); /* Group IDs */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t cwg = (H5I_INVALID_HID), dir = (H5I_INVALID_HID); /* Group IDs */ char filename[NAME_BUF_SIZE]; char name[NAME_BUF_SIZE]; int i; @@ -342,18 +342,18 @@ test_large(hid_t fcpl, hid_t fapl, bool new_format) static int lifecycle(hid_t fcpl, hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ - hid_t gcpl = (-1); /* Group creation property list ID */ - size_t lheap_size_hint; /* Local heap size hint */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ - unsigned est_num_entries; /* Estimated # of entries in group */ - unsigned est_name_len; /* Estimated length of entry name */ - unsigned nmsgs; /* Number of messages in group's header */ - H5O_native_info_t ninfo; /* Object info */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group ID */ + hid_t gid2 = (H5I_INVALID_HID); /* Datatype ID */ + hid_t gcpl = (H5I_INVALID_HID); /* Group creation property list ID */ + size_t lheap_size_hint; /* Local heap size hint */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + unsigned est_num_entries; /* Estimated # of entries in group */ + unsigned est_name_len; /* Estimated length of entry name */ + unsigned nmsgs; /* Number of messages in group's header */ + H5O_native_info_t ninfo; /* Object info */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ unsigned u; /* Local index variable */ @@ -625,10 +625,10 @@ lifecycle(hid_t fcpl, hid_t fapl2) static int long_compact(hid_t fcpl, hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Group ID */ - char *objname = NULL; /* Object name */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group ID */ + hid_t gid2 = (H5I_INVALID_HID); /* Group ID */ + char *objname = NULL; /* Object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ @@ -788,11 +788,11 @@ long_compact(hid_t fcpl, hid_t fapl2) static int read_old(void) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Group ID */ - char objname[NAME_BUF_SIZE]; /* Object name */ - unsigned u; /* Local index variable */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group ID */ + hid_t gid2 = (H5I_INVALID_HID); /* Group ID */ + char objname[NAME_BUF_SIZE]; /* Object name */ + unsigned u; /* Local index variable */ TESTING("reading old groups"); @@ -892,11 +892,11 @@ read_old(void) static int no_compact(hid_t fcpl, hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ - hid_t gcpl = (-1); /* Group creation property list ID */ - char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group ID */ + hid_t gid2 = (H5I_INVALID_HID); /* Datatype ID */ + hid_t gcpl = (H5I_INVALID_HID); /* Group creation property list ID */ + char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ @@ -1029,14 +1029,14 @@ no_compact(hid_t fcpl, hid_t fapl2) static int gcpl_on_root(hid_t fapl2) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ - hid_t fcpl = (-1); /* File creation property list ID */ - hid_t gcpl = (-1); /* Group creation property list ID */ - hid_t lcpl = (-1); /* Link creation property list ID */ - unsigned max_compact; /* Maximum # of links to store in group compactly */ - unsigned min_dense; /* Minimum # of links to store in group "densely" */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group ID */ + hid_t gid2 = (H5I_INVALID_HID); /* Datatype ID */ + hid_t fcpl = (H5I_INVALID_HID); /* File creation property list ID */ + hid_t gcpl = (H5I_INVALID_HID); /* Group creation property list ID */ + hid_t lcpl = (H5I_INVALID_HID); /* Link creation property list ID */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ char filename[NAME_BUF_SIZE]; TESTING("setting root group creation properties"); @@ -1179,10 +1179,10 @@ static int old_api(hid_t fapl) { #ifndef H5_NO_DEPRECATED_SYMBOLS - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - h5_stat_size_t small_file_size; /* Size of small group file */ - h5_stat_size_t large_file_size; /* Size of large group file */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t gid = (H5I_INVALID_HID); /* Group ID */ + h5_stat_size_t small_file_size; /* Size of small group file */ + h5_stat_size_t large_file_size; /* Size of large group file */ char filename[NAME_BUF_SIZE]; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -1281,8 +1281,8 @@ old_api(hid_t fapl) static int corrupt_stab_msg(void) { - hid_t fid = (-1); /* File ID */ - hid_t did = (-1); /* Dataset ID */ + hid_t fid = (H5I_INVALID_HID); /* File ID */ + hid_t did = (H5I_INVALID_HID); /* Dataset ID */ TESTING("corrupt symbol table message"); diff --git a/test/swmr.c b/test/swmr.c index 1caf548ac5a..6b9e097e361 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -115,10 +115,10 @@ static int test_multiple_same(hid_t in_fapl, bool new_format); static int test_metadata_read_attempts(hid_t in_fapl) { - hid_t fapl = -1; /* File access property list */ - hid_t file_fapl = -1; /* The file's access property list */ - hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ - hid_t driver_id = -1; /* ID for this VFD */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t file_fapl = H5I_INVALID_HID; /* The file's access property list */ + hid_t fid = H5I_INVALID_HID, fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ unsigned long driver_flags = 0; /* VFD feature flags */ bool compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */ unsigned attempts; /* The # of read attempts */ @@ -1572,26 +1572,26 @@ test_metadata_read_retry_info(hid_t in_fapl) static int test_start_swmr_write(hid_t in_fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property */ - hid_t gid = -1; /* Group ID */ - hid_t dcpl = -1; /* Dataset creation property */ - hid_t file_fapl = -1; /* File access property for the file */ - hid_t did1 = -1, did2 = -1, did3 = -1; /* Dataset IDs */ - hid_t did1_a = -1, did1_b = -1; - hid_t sid1 = -1, sid2 = -1, sid3 = -1; /* Dataspace IDs */ - hsize_t dim[1] = {1}; /* Dimension sizes */ - hsize_t max_dim[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunk_dim[1] = {2}; /* Chunk dimension sizes */ - hsize_t dim2[2] = {5, 10}; /* Dimension sizes */ - hsize_t max_dim2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ - hsize_t chunk_dim2[2] = {2, 7}; /* Chunk dimension sizes */ - H5D_chunk_index_t idx_type; /* Dataset chunk index type */ - int wdata = 99; /* Data to write */ - int rdata; /* Data read */ - unsigned attempts; /* The retrieved # of read attempts */ - char filename[NAME_BUF_SIZE]; /* File name */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property */ + hid_t file_fapl = H5I_INVALID_HID; /* File access property for the file */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t did1_a = H5I_INVALID_HID, did1_b = H5I_INVALID_HID; + hid_t sid1 = H5I_INVALID_HID, sid2 = H5I_INVALID_HID, sid3 = H5I_INVALID_HID; /* Dataspace IDs */ + hsize_t dim[1] = {1}; /* Dimension sizes */ + hsize_t max_dim[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunk_dim[1] = {2}; /* Chunk dimension sizes */ + hsize_t dim2[2] = {5, 10}; /* Dimension sizes */ + hsize_t max_dim2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunk_dim2[2] = {2, 7}; /* Chunk dimension sizes */ + H5D_chunk_index_t idx_type; /* Dataset chunk index type */ + int wdata = 99; /* Data to write */ + int rdata; /* Data read */ + unsigned attempts; /* The retrieved # of read attempts */ + char filename[NAME_BUF_SIZE]; /* File name */ + herr_t ret; /* Return value */ /* Get a copy of the parameter fapl (non-latest-format) */ if ((fapl = H5Pcopy(in_fapl)) < 0) @@ -1940,18 +1940,18 @@ test_start_swmr_write(hid_t in_fapl, bool new_format) static int test_err_start_swmr_write(hid_t in_fapl, bool new_format) { - hid_t fid = -1; /* File ID */ - hid_t fid2 = -1; /* File ID */ - hid_t fapl = -1; /* A copy of file access property */ - hid_t new_fapl = -1; /* A copy of file access property */ - hid_t gid = -1; /* Group ID */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t bad_fid = -1; /* Test fid (should never represent a real ID) */ - herr_t ret; /* Return value */ - char filename[NAME_BUF_SIZE]; /* File name */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fid2 = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* A copy of file access property */ + hid_t new_fapl = H5I_INVALID_HID; /* A copy of file access property */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t bad_fid = H5I_INVALID_HID; /* Test fid (should never represent a real ID) */ + herr_t ret; /* Return value */ + char filename[NAME_BUF_SIZE]; /* File name */ /* Create a copy of the input parameter in_fapl */ if ((fapl = H5Pcopy(in_fapl)) < 0) @@ -2420,18 +2420,18 @@ test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, bool new_format) static int test_start_swmr_write_concur(hid_t in_fapl, bool new_format) { - hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ - hid_t fapl; /* File access property list */ - pid_t childpid = 0; /* Child process ID */ - pid_t tmppid; /* Child process ID returned by waitpid */ - int child_status; /* Status passed to waitpid */ - int child_wait_option = 0; /* Options passed to waitpid */ - int child_exit_val; /* Exit status of the child */ - char filename[NAME_BUF_SIZE]; /* File name */ - - hid_t did = -1, did1 = -1, did2 = -1, did3 = -1; - hid_t sid = -1; - hid_t dcpl = -1; + hid_t fid = H5I_INVALID_HID, fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t fapl; /* File access property list */ + pid_t childpid = 0; /* Child process ID */ + pid_t tmppid; /* Child process ID returned by waitpid */ + int child_status; /* Status passed to waitpid */ + int child_wait_option = 0; /* Options passed to waitpid */ + int child_exit_val; /* Exit status of the child */ + char filename[NAME_BUF_SIZE]; /* File name */ + + hid_t did = H5I_INVALID_HID, did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; hsize_t chunk_dims[1] = {1}; hsize_t maxdims[1] = {H5S_UNLIMITED}; hsize_t dims[1] = {1}; @@ -2583,9 +2583,9 @@ test_start_swmr_write_concur(hid_t in_fapl, bool new_format) if ((childpid = fork()) < 0) FAIL_STACK_ERROR; - if (childpid == 0) { /* Child process */ - hid_t child_fid1 = -1, child_fid2; /* File IDs */ - hid_t child_did1 = -1, child_did2 = -1; /* Dataset IDs */ + if (childpid == 0) { /* Child process */ + hid_t child_fid1 = H5I_INVALID_HID, child_fid2; /* File IDs */ + hid_t child_did1 = H5I_INVALID_HID, child_did2 = H5I_INVALID_HID; /* Dataset IDs */ int child_notify = 0; int rdata = 0; @@ -3029,14 +3029,14 @@ test_start_swmr_write_concur(hid_t in_fapl, bool new_format) static int test_start_swmr_write_stress_ohdr(hid_t in_fapl) { - hid_t fid = -1; /* File IDs */ - hid_t fapl; /* File access property list */ - char filename[NAME_BUF_SIZE]; /* File name */ - hid_t did = -1, did2 = -1; /* Dataset IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t aid = -1; /* Attribute ID */ + hid_t fid = H5I_INVALID_HID; /* File IDs */ + hid_t fapl; /* File access property list */ + char filename[NAME_BUF_SIZE]; /* File name */ + hid_t did = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ hsize_t chunk_dims[2] = {10, 10}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; char fill[256]; /* Fill value for dataset */ @@ -3582,14 +3582,14 @@ flush_cb(hid_t H5_ATTR_UNUSED obj_id, void *_udata) static int test_object_flush_cb(hid_t in_fapl) { - hid_t fapl = -1; /* A copy of file access property list */ - hid_t ffapl = -1; /* A file's file access property list */ - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hid_t sid = -1; /* Dataspace ID */ - hsize_t dims[2] = {5, 10}; /* Dataset dimension sizes */ - int buf[50]; /* Data buffer */ + hid_t fapl = H5I_INVALID_HID; /* A copy of file access property list */ + hid_t ffapl = H5I_INVALID_HID; /* A file's file access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dims[2] = {5, 10}; /* Dataset dimension sizes */ + int buf[50]; /* Data buffer */ H5F_flush_cb_t ret_cb; /* The callback function set in object flush property */ void *ret_ct; /* The user data set in object flush property */ unsigned flush_ct = 0; /* The user data for object flush property */ @@ -3860,13 +3860,13 @@ append_cb2(hid_t H5_ATTR_UNUSED dset_id, hsize_t H5_ATTR_UNUSED *cur_dims, void static int test_append_flush_generic(void) { - hid_t dapl = -1; /* A copy of dataset access property */ - hsize_t boundary[3]; /* The boundary for append flush property */ - unsigned count = 0; /* The user data for append flush property */ - hsize_t ret_boundary[3]; /* The boundary set in append flush property */ - H5D_append_cb_t ret_cb; /* The callback function set in append flush property */ - unsigned *ret_count; /* The user data set in append flush property */ - herr_t ret; /* The return value */ + hid_t dapl = H5I_INVALID_HID; /* A copy of dataset access property */ + hsize_t boundary[3]; /* The boundary for append flush property */ + unsigned count = 0; /* The user data for append flush property */ + hsize_t ret_boundary[3]; /* The boundary set in append flush property */ + H5D_append_cb_t ret_cb; /* The callback function set in append flush property */ + unsigned *ret_count; /* The user data set in append flush property */ + herr_t ret; /* The return value */ TESTING("H5Fget/set_append_flush() for a generic dataset access property list"); @@ -4035,13 +4035,13 @@ test_append_flush_generic(void) static int test_append_flush_dataset_chunked(hid_t in_fapl) { - hid_t fid = -1; /* file ID */ - hid_t fapl = -1; /* A copy of file access property */ - hid_t did1 = -1, did2 = -1; /* The dataset ID */ - hid_t sid = -1; /* The dataspace ID */ - hid_t dcpl = -1; /* A copy of dataset creation property */ - hid_t dapl = -1; /* A copy of dataset access property */ - hid_t ddapl = -1; /* The dataset access property of the opened dataset */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl = H5I_INVALID_HID; /* A copy of file access property */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* The dataset ID */ + hid_t sid = H5I_INVALID_HID; /* The dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* A copy of dataset creation property */ + hid_t dapl = H5I_INVALID_HID; /* A copy of dataset access property */ + hid_t ddapl = H5I_INVALID_HID; /* The dataset access property of the opened dataset */ hsize_t boundary[3]; /* Boundary size */ unsigned count = 0; /* User data */ @@ -4258,12 +4258,12 @@ test_append_flush_dataset_chunked(hid_t in_fapl) static int test_append_flush_dataset_fixed(hid_t in_fapl) { - hid_t fid = -1; /* file ID */ - hid_t fapl = -1; /* A copy of file access property */ - hid_t did1 = -1, did2 = -1; /* The dataset ID */ - hid_t sid = -1; /* The dataspace ID */ - hid_t dapl = -1; /* A copy of dataset access property */ - hid_t ddapl = -1; /* The dataset access property of the opened dataset */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl = H5I_INVALID_HID; /* A copy of file access property */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* The dataset ID */ + hid_t sid = H5I_INVALID_HID; /* The dataspace ID */ + hid_t dapl = H5I_INVALID_HID; /* A copy of dataset access property */ + hid_t ddapl = H5I_INVALID_HID; /* The dataset access property of the opened dataset */ hsize_t boundary[3]; /* Boundary size */ unsigned count = 0; /* User data */ @@ -4476,14 +4476,14 @@ test_append_flush_dataset_fixed(hid_t in_fapl) static int test_append_flush_dataset_multiple(hid_t in_fapl) { - hid_t fid = -1; /* file ID */ - hid_t fapl = -1; /* A copy of file access property */ - hid_t did1 = -1, did2 = -1; /* The dataset ID */ - hid_t sid = -1; /* The dataspace ID */ - hid_t dcpl = -1; /* A copy of dataset creation property */ - hid_t dapl1 = -1; /* A copy of dataset access property */ - hid_t dapl2 = -1; /* A copy of dataset access property */ - hid_t ddapl = -1; /* The dataset access property of the opened dataset */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl = H5I_INVALID_HID; /* A copy of file access property */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* The dataset ID */ + hid_t sid = H5I_INVALID_HID; /* The dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* A copy of dataset creation property */ + hid_t dapl1 = H5I_INVALID_HID; /* A copy of dataset access property */ + hid_t dapl2 = H5I_INVALID_HID; /* A copy of dataset access property */ + hid_t ddapl = H5I_INVALID_HID; /* The dataset access property of the opened dataset */ hsize_t boundary1[3]; /* Boundary size */ hsize_t boundary2[3]; /* Boundary size */ @@ -4705,10 +4705,10 @@ test_append_flush_dataset_multiple(hid_t in_fapl) static int test_file_lock_same(hid_t in_fapl) { - hid_t fid = -1, fid2 = -1; /* File IDs */ - hid_t fapl = -1; /* File access property list */ - unsigned intent; /* File access flags */ - char filename[NAME_BUF_SIZE]; /* file name */ + hid_t fid = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + unsigned intent; /* File access flags */ + char filename[NAME_BUF_SIZE]; /* file name */ /* Output message about test being performed */ TESTING("File open with different combinations of flags--single process access"); @@ -5198,8 +5198,8 @@ test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl) static int test_file_lock_concur(hid_t in_fapl) { - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ char filename[NAME_BUF_SIZE]; /* file name */ pid_t childpid = 0; /* Child process ID */ int child_status; /* Status passed to waitpid */ @@ -6611,8 +6611,8 @@ test_file_locking(hid_t in_fapl, bool turn_locking_on, bool env_var_override) HDputs(" Test skipped due to fork or waitpid not defined."); return 0; #else /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */ - hid_t fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ char filename[NAME_BUF_SIZE]; /* file name */ pid_t childpid = 0; /* Child process ID */ int child_status; /* Status passed to waitpid */ @@ -6860,10 +6860,10 @@ test_different_lock_flags(hid_t in_fapl) static int test_swmr_vfd_flag(void) { - hid_t fid = -1; /* file ID */ - hid_t sec2_fapl = -1; /* fapl ID of a VFD that supports SWMR writes (sec2) */ - hid_t bad_fapl = -1; /* fapl ID of a VFD that does not support SWMR writes (stdio) */ - char filename[NAME_BUF_SIZE]; /* file name */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t sec2_fapl = H5I_INVALID_HID; /* fapl ID of a VFD that supports SWMR writes (sec2) */ + hid_t bad_fapl = H5I_INVALID_HID; /* fapl ID of a VFD that does not support SWMR writes (stdio) */ + char filename[NAME_BUF_SIZE]; /* file name */ TESTING("SWMR-enabled VFD flag functionality"); @@ -7101,9 +7101,9 @@ test_refresh_concur(hid_t in_fapl, bool new_format) int child_exit_val; /* Exit status of the child */ char filename[NAME_BUF_SIZE]; /* File name */ - hid_t did = -1; - hid_t sid = -1; - hid_t dcpl = -1; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; hsize_t chunk_dims[1] = {1}; hsize_t maxdims[1] = {H5S_UNLIMITED}; hsize_t dims[1] = {1}; @@ -7175,11 +7175,11 @@ test_refresh_concur(hid_t in_fapl, bool new_format) if ((childpid = fork()) < 0) FAIL_STACK_ERROR; - if (childpid == 0) { /* Child process */ - hid_t child_fid1 = -1; /* File ID */ - hid_t child_fid2 = -1; /* File ID */ - hid_t child_did1 = -1, child_did2 = -1; - hid_t child_sid = -1; + if (childpid == 0) { /* Child process */ + hid_t child_fid1 = H5I_INVALID_HID; /* File ID */ + hid_t child_fid2 = H5I_INVALID_HID; /* File ID */ + hid_t child_did1 = H5I_INVALID_HID, child_did2 = H5I_INVALID_HID; + hid_t child_sid = H5I_INVALID_HID; hsize_t tdims[1]; int rbuf[2] = {0, 0}; int child_notify = 0; @@ -7405,12 +7405,13 @@ test_refresh_concur(hid_t in_fapl, bool new_format) static int test_multiple_same(hid_t in_fapl, bool new_format) { - hid_t fid = -1, fid1 = -1, fid2 = -1, fid3 = -1; /* File IDs */ - hid_t fapl; /* File access property list */ - char filename[NAME_BUF_SIZE]; /* File name */ - hid_t did = -1, did1 = -1, did2 = -1, did3 = -1; - hid_t sid = -1; - hid_t dcpl = -1; + hid_t fid = H5I_INVALID_HID, fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID, + fid3 = H5I_INVALID_HID; /* File IDs */ + hid_t fapl; /* File access property list */ + char filename[NAME_BUF_SIZE]; /* File name */ + hid_t did = H5I_INVALID_HID, did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID, did3 = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; hsize_t chunk_dims[2] = {1, 2}; hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t dims[2] = {1, 1}; diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 61d7ef0a606..c4e206d1ad6 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -43,7 +43,7 @@ static int read_records(const char *filename, bool verbose, FILE *verbose_file, /* Local Variables */ /*******************/ -static hid_t symbol_tid = -1; /* The type ID for the SWMR datasets */ +static hid_t symbol_tid = H5I_INVALID_HID; /* The type ID for the SWMR datasets */ /*------------------------------------------------------------------------- * Function: check_dataset diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 9a393565aa3..614aed2cfa6 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -35,7 +35,7 @@ /* Local Variables */ /*******************/ -static hid_t symbol_tid = -1; +static hid_t symbol_tid = H5I_INVALID_HID; /********************/ /* Local Prototypes */ diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 5a2f4648807..a6d8fd49d38 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -41,7 +41,7 @@ /* Local Variables */ /*******************/ -static hid_t symbol_tid = (-1); +static hid_t symbol_tid = (H5I_INVALID_HID); /********************/ /* Local Prototypes */ diff --git a/test/tattr.c b/test/tattr.c index 25f8ddb94bf..a246cf2802c 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -4239,7 +4239,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) /* Get number of attributes with bad ID */ H5E_BEGIN_TRY { - ret = H5Aget_num_attrs((hid_t)-1); + ret = H5Aget_num_attrs((hid_t)H5I_INVALID_HID); } H5E_END_TRY VERIFY(ret, FAIL, "H5Aget_num_attrs"); @@ -4975,13 +4975,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) static void test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gcpl_id = -1; /* Group creation property list ID */ - hid_t gid = -1; /* Group ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - int buf; /* Attribute data */ - herr_t ret; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + int buf; /* Attribute data */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Creating Attributes w/New & Old Format\n")); @@ -11168,17 +11168,17 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) static void test_attr_bug9(hid_t fcpl, hid_t fapl) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - hsize_t dims[1] = {32768}; /* Attribute dimensions */ - int create_link; /* Whether to create a soft link */ - unsigned max_compact; /* Setting from fcpl */ - unsigned min_dense; /* Setting from fcpl */ - char aname[11]; /* Attribute name */ - unsigned i; /* Local index variable */ - herr_t ret; /* Generic return status */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dims[1] = {32768}; /* Attribute dimensions */ + int create_link; /* Whether to create a soft link */ + unsigned max_compact; /* Setting from fcpl */ + unsigned min_dense; /* Setting from fcpl */ + char aname[11]; /* Attribute name */ + unsigned i; /* Local index variable */ + herr_t ret; /* Generic return status */ /* Output message about test being performed */ MESSAGE(5, ("Testing that attributes can always be added to named datatypes\n")); @@ -11414,13 +11414,13 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) void test_attr(void) { - hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ - hid_t dcpl = -1; /* Dataset creation property list */ - unsigned new_format; /* Whether to use the new format or not */ - unsigned use_shared; /* Whether to use shared attributes or not */ - unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */ - herr_t ret; /* Generic return value */ + hid_t fapl = (H5I_INVALID_HID), fapl2 = (H5I_INVALID_HID); /* File access property lists */ + hid_t fcpl = (H5I_INVALID_HID), fcpl2 = (H5I_INVALID_HID); /* File creation property lists */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + unsigned new_format; /* Whether to use the new format or not */ + unsigned use_shared; /* Whether to use shared attributes or not */ + unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */ + herr_t ret; /* Generic return value */ MESSAGE(5, ("Testing Attributes\n")); diff --git a/test/tfile.c b/test/tfile.c index 97843703d36..d5d48991eba 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -653,12 +653,12 @@ test_file_open(const char *env_h5_drvr) static void test_file_reopen(void) { - hid_t fid = -1; /* file ID from initial open */ - hid_t rfid = -1; /* file ID from reopen */ - hid_t did = -1; /* dataset ID (both opens) */ - hid_t sid = -1; /* dataspace ID for dataset creation */ - hsize_t dims = 6; /* dataspace size */ - herr_t ret; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* file ID from initial open */ + hid_t rfid = H5I_INVALID_HID; /* file ID from reopen */ + hid_t did = H5I_INVALID_HID; /* dataset ID (both opens) */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID for dataset creation */ + hsize_t dims = 6; /* dataspace size */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing File Re-opening\n")); @@ -2592,17 +2592,17 @@ test_file_double_dataset_open(void) static void test_file_double_file_dataset_open(bool new_format) { - hid_t fapl = -1; /* File access property list */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ - hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ - hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ - hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ - hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ - hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ + hid_t sid1 = H5I_INVALID_HID, sid2 = H5I_INVALID_HID; /* Dataspace IDs */ + hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ + hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ + hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ + hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */ hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */ hsize_t size; /* File size */ @@ -4857,8 +4857,8 @@ static void test_filespace_compatible(void) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t did = H5I_INVALID_HID; /* Dataset id */ hid_t fcpl; /* File creation property list template */ int check[100]; /* Temporary buffer for verifying dataset data */ int rdbuf[100]; /* Temporary buffer for reading in dataset data */ @@ -4988,17 +4988,17 @@ test_filespace_compatible(void) static void test_filespace_1_10_0_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ - hid_t fcpl; /* File creation property list */ - bool persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - H5F_fspace_strategy_t strategy; /* File space handling strategy */ - int wbuf[24]; /* Buffer for dataset data */ - int rdbuf[24]; /* Buffer for dataset data */ - int status; /* Status from copying the existing file */ - unsigned i, j; /* Local index variable */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t did = H5I_INVALID_HID; /* Dataset id */ + hid_t fcpl; /* File creation property list */ + bool persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + H5F_fspace_strategy_t strategy; /* File space handling strategy */ + int wbuf[24]; /* Buffer for dataset data */ + int rdbuf[24]; /* Buffer for dataset data */ + int status; /* Status from copying the existing file */ + unsigned i, j; /* Local index variable */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for 1.10.0 files\n")); @@ -5302,15 +5302,15 @@ test_filespace_1_10_0_compatible(void) static void test_filespace_round_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t fcpl = -1; /* File creation property list ID */ - unsigned j; /* Local index variable */ - H5F_fspace_strategy_t strategy; /* File space strategy */ - bool persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - hssize_t free_space; /* Amount of free space in the file */ - int status; /* Status from copying the existing file */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File id */ + hid_t fcpl = H5I_INVALID_HID; /* File creation property list ID */ + unsigned j; /* Local index variable */ + H5F_fspace_strategy_t strategy; /* File space strategy */ + bool persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hssize_t free_space; /* Amount of free space in the file */ + int status; /* Status from copying the existing file */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for files from trunk to 1_8 to trunk\n")); @@ -5467,12 +5467,12 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, H5F static void test_libver_bounds_open(void) { - hid_t file = -1; /* File ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t new_fapl = -1; /* File access property list ID for reopened file */ - hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t new_fapl = H5I_INVALID_HID; /* File access property list ID for reopened file */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */ hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */ H5F_libver_t low, high; /* File format bounds */ hsize_t chunk_dim[1] = {SPACE1_DIM1}; /* Chunk dimensions */ @@ -5604,11 +5604,11 @@ test_libver_bounds_open(void) static void test_libver_bounds_copy(void) { - hid_t src_fid = -1; /* File ID */ - hid_t dst_fid = -1; /* File ID */ - hid_t fapl = -1; /* File access property list ID */ - const char *src_fname; /* Source file name */ - herr_t ret; /* Generic return value */ + hid_t src_fid = H5I_INVALID_HID; /* File ID */ + hid_t dst_fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + const char *src_fname; /* Source file name */ + herr_t ret; /* Generic return value */ bool driver_is_default_compatible; /* Output message about the test being performed */ @@ -7631,20 +7631,20 @@ test_libver_macros2(void) static void test_incr_filesize(void) { - hid_t fid; /* File opened with read-write permission */ - h5_stat_size_t filesize; /* Size of file when empty */ - hid_t fcpl; /* File creation property list */ - hid_t fapl; /* File access property list */ - hid_t dspace; /* Dataspace ID */ - hid_t dset; /* Dataset ID */ - hid_t dcpl; /* Dataset creation property list */ - unsigned u; /* Local index variable */ - char filename[FILENAME_LEN]; /* Filename to use */ - char name[32]; /* Dataset name */ - haddr_t stored_eoa; /* The stored EOA value */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ - herr_t ret; /* Return value */ + hid_t fid; /* File opened with read-write permission */ + h5_stat_size_t filesize; /* Size of file when empty */ + hid_t fcpl; /* File creation property list */ + hid_t fapl; /* File access property list */ + hid_t dspace; /* Dataspace ID */ + hid_t dset; /* Dataset ID */ + hid_t dcpl; /* Dataset creation property list */ + unsigned u; /* Local index variable */ + char filename[FILENAME_LEN]; /* Filename to use */ + char name[32]; /* Dataset name */ + haddr_t stored_eoa; /* The stored EOA value */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing H5Fincrement_filesize() and H5Fget_eoa())\n")); @@ -7760,8 +7760,8 @@ test_min_dset_ohdr(void) { const char basename[] = "min_dset_ohdr_testfile"; char filename[FILENAME_LEN] = ""; - hid_t file_id = -1; - hid_t file2_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t file2_id = H5I_INVALID_HID; bool minimize; herr_t ret; diff --git a/test/th5o.c b/test/th5o.c index 8c44f6f61ab..b0fde409bd1 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -934,13 +934,13 @@ test_h5o_plist(void) static void test_h5o_link(void) { - hid_t file_id = -1; - hid_t group_id = -1; - hid_t space_id = -1; - hid_t dset_id = -1; - hid_t type_id = -1; - hid_t fapl_id = -1; - hid_t lcpl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t type_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t lcpl_id = H5I_INVALID_HID; char filename[1024]; hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2}; htri_t committed; /* Whether the named datatype is committed */ @@ -1731,10 +1731,10 @@ visit_obj_cb(hid_t group_id, const char *name, const H5O_info1_t *oinfo1, void H static void test_h5o_getinfo_visit(void) { - hid_t fid = -1; /* HDF5 File ID */ - hid_t gid1 = -1, gid2 = -1; /* Group IDs */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ + hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ char filename[1024]; H5O_info1_t oinfo1, oinfo2; /* Object info structs */ char attrname[25]; /* Attribute name */ diff --git a/test/th5s.c b/test/th5s.c index 71b332b308d..734365398f6 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1210,8 +1210,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) { hid_t sid1, sid2, sid3; /* Dataspace ID */ hid_t decoded_sid1, decoded_sid2, decoded_sid3; - int rank; /* Logical rank of dataspace */ - hid_t fapl = -1; /* File access property list ID */ + int rank; /* Logical rank of dataspace */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; size_t sbuf_size = 0, null_size = 0, scalar_size = 0; unsigned char *sbuf = NULL, *null_sbuf = NULL, *scalar_buf = NULL; @@ -1608,9 +1608,9 @@ static herr_t test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, uint8_t expected_enc_size, bool expected_to_fail) { - char *buf = NULL; /* Pointer to the encoded buffer */ - size_t buf_size; /* Size of the encoded buffer */ - hid_t d_sid = -1; /* The decoded dataspace ID */ + char *buf = NULL; /* Pointer to the encoded buffer */ + size_t buf_size; /* Size of the encoded buffer */ + hid_t d_sid = H5I_INVALID_HID; /* The decoded dataspace ID */ htri_t check; hsize_t in_low_bounds[1]; /* The low bounds for the selection for in_sid */ hsize_t in_high_bounds[1]; /* The high bounds for the selection for in_sid */ @@ -1711,10 +1711,10 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, static void test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) { - hid_t fapl = -1; /* File access property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hsize_t numparticles = 8388608; /* Used to calculate dimension size */ - unsigned num_dsets = 513; /* Used to calculate dimension size */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t numparticles = 8388608; /* Used to calculate dimension size */ + unsigned num_dsets = 513; /* Used to calculate dimension size */ hsize_t total_particles = numparticles * num_dsets; hsize_t vdsdims[1] = {total_particles}; /* Dimension size */ hsize_t start, stride, count, block; /* Selection info */ @@ -1906,7 +1906,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) static void test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) { - hid_t fapl = -1; /* File access property list ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ hid_t sid; /* Dataspace ID */ hsize_t numparticles = 8388608; /* Used to calculate dimension size */ unsigned num_dsets = 513; /* Used to calculate dimension size */ @@ -2031,7 +2031,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) static void test_h5s_encode_points(H5F_libver_t low, H5F_libver_t high) { - hid_t fapl = -1; /* File access property list ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ hid_t sid; /* Dataspace ID */ hsize_t numparticles = 8388608; /* Used to calculate dimension size */ unsigned num_dsets = 513; /* used to calculate dimension size */ @@ -3120,8 +3120,11 @@ test_h5s_extent_equal(void) static void test_h5s_extent_copy(void) { - hid_t spaces[14] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; /* Array of all dataspaces */ - hid_t tmp_space = -1; + hid_t spaces[14] = { + H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID}; /* Array of all dataspaces */ + hid_t tmp_space = H5I_INVALID_HID; hsize_t d1_dims1[1] = {10}, /* 1-D dimensions */ d1_dims2[1] = {20}, d1_dims3[1] = {H5S_UNLIMITED}; hsize_t d2_dims1[2] = {10, 10}, /* 2-D dimensions */ @@ -3342,15 +3345,15 @@ test_h5s_bug2(void) static void test_versionbounds(void) { - hid_t file = -1; /* File ID */ - hid_t space = -1; /* Dataspace ID */ - hid_t dset = -1; /* Dataset ID */ - hid_t fapl = -1; /* File access property list ID */ - hid_t dset_space = -1; /* Retrieved dataset's dataspace ID */ - hsize_t dim[1]; /* Dataset dimensions */ - H5F_libver_t low, high; /* File format bounds */ - H5S_t *spacep = NULL; /* Pointer to internal dataspace */ - herr_t ret = 0; /* Generic return value */ + hid_t file = H5I_INVALID_HID; /* File ID */ + hid_t space = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dset = H5I_INVALID_HID; /* Dataset ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list ID */ + hid_t dset_space = H5I_INVALID_HID; /* Retrieved dataset's dataspace ID */ + hsize_t dim[1]; /* Dataset dimensions */ + H5F_libver_t low, high; /* File format bounds */ + H5S_t *spacep = NULL; /* Pointer to internal dataspace */ + herr_t ret = 0; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Version Bounds\n")); diff --git a/test/tid.c b/test/tid.c index cd88db8d66a..bf557fa34da 100644 --- a/test/tid.c +++ b/test/tid.c @@ -424,7 +424,7 @@ test_is_valid(void) goto out; /* Check that an id of -1 is invalid */ - tri_ret = H5Iis_valid((hid_t)-1); + tri_ret = H5Iis_valid((hid_t)H5I_INVALID_HID); VERIFY(tri_ret, false, "H4Iis_valid"); if (tri_ret != false) goto out; @@ -465,7 +465,7 @@ test_get_type(void) goto out; /* Check that the ID is correct */ - type_ret = H5Iget_type((hid_t)-1); + type_ret = H5Iget_type((hid_t)H5I_INVALID_HID); VERIFY(type_ret, H5I_BADID, "H5Iget_type"); if (type_ret != H5I_BADID) goto out; diff --git a/test/titerate.c b/test/titerate.c index 7c758c4c08d..43f3ddc931c 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -1003,11 +1003,11 @@ find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_ static void test_corrupted_attnamelen(void) { - hid_t fid = -1; /* File ID */ - hid_t did = -1; /* Dataset ID */ - searched_err_t err_caught; /* Data to be passed to callback func */ - int err_status; /* Status returned by H5Aiterate2 */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + searched_err_t err_caught; /* Data to be passed to callback func */ + int err_status; /* Status returned by H5Aiterate2 */ + herr_t ret; /* Return value */ bool driver_is_default_compatible; const char *testfile = H5_get_srcdir_filename(CORRUPTED_ATNAMELEN_FILE); /* Corrected test file name */ diff --git a/test/tmisc.c b/test/tmisc.c index 71791b29ba8..97224eec11d 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2172,10 +2172,10 @@ misc13_verify_data_match(const unsigned *original_data, const unsigned *read_dat static void misc13_create_dataset(hid_t loc_id, const char *name, hid_t dcpl, const unsigned *data) { - hid_t dsid = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ - hsize_t dims[MISC13_RANK]; /* Dataset dimensions */ - herr_t ret; /* Generic return value */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hsize_t dims[MISC13_RANK]; /* Dataset dimensions */ + herr_t ret; /* Generic return value */ /* Create dataspace for use with dataset */ dims[0] = MISC13_DIM1; @@ -2203,9 +2203,9 @@ misc13_create_dataset(hid_t loc_id, const char *name, hid_t dcpl, const unsigned static void misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) { - unsigned *read_data = NULL; /* Data to write to dataset */ - hid_t dsid = -1; /* Dataset ID */ - herr_t ret; /* Generic return value */ + unsigned *read_data = NULL; /* Data to write to dataset */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + herr_t ret; /* Generic return value */ /* Create a data buffer for the dataset read */ read_data = (unsigned *)calloc(MISC13_DIM1, sizeof(unsigned)); @@ -2235,13 +2235,13 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) static void misc13_create_hdf_file(const char *name, const unsigned *data) { - hid_t fid = -1; /* File ID */ - hid_t gid1 = -1; /* Group ID (level 1) */ - hid_t gid2 = -1; /* Group ID (level 2) */ - hid_t tid = -1; /* Datatype ID */ - hid_t dcplid = -1; /* Dataset creation property list ID */ - hsize_t chunk_dims[MISC13_RANK]; /* Chunk dimensions */ - herr_t ret; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid1 = H5I_INVALID_HID; /* Group ID (level 1) */ + hid_t gid2 = H5I_INVALID_HID; /* Group ID (level 2) */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t dcplid = H5I_INVALID_HID; /* Dataset creation property list ID */ + hsize_t chunk_dims[MISC13_RANK]; /* Chunk dimensions */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2382,13 +2382,13 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char static void misc13_verify_file(const char *name, const unsigned *data, hsize_t userblock_size, bool check_for_new_dataset) { - hid_t fid = -1; /* File ID */ - hid_t gid1 = -1; /* Group IDs */ - hid_t gid2 = -1; /* Group IDs */ - hid_t tid = -1; /* Datatype ID */ - hid_t fcplid = -1; /* File creation property list ID */ - hsize_t ub_size_out; /* Userblock size retrieved from FCPL */ - herr_t ret; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid1 = H5I_INVALID_HID; /* Group IDs */ + hid_t gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t fcplid = H5I_INVALID_HID; /* File creation property list ID */ + hsize_t ub_size_out; /* Userblock size retrieved from FCPL */ + herr_t ret; /* Generic return value */ /* Open the file */ fid = H5Fopen(name, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -2472,8 +2472,8 @@ misc13_verify_file(const char *name, const unsigned *data, hsize_t userblock_siz static void misc13_add_to_new_file(const char *name, const unsigned *data) { - hid_t fid = -1; /* File ID */ - herr_t ret; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + herr_t ret; /* Generic return value */ /* Open the file */ fid = H5Fopen(name, H5F_ACC_RDWR, H5P_DEFAULT); @@ -3153,23 +3153,23 @@ test_misc18(void) static void test_misc19(void) { - hid_t fid = -1; /* File ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t plid = -1; /* Property List ID */ - hid_t pcid = -1; /* Property Class ID */ - hid_t gid = -1; /* Group ID */ - hid_t ecid = -1; /* Error Class ID */ - hid_t emid = -1; /* Error Message ID */ - hid_t esid = -1; /* Error Stack ID */ - hid_t vfdid = -1; /* Virtual File Driver ID */ - hid_t volid = -1; /* Virtual Object Layer ID */ - H5FD_class_t *vfd_cls = NULL; /* VFD class */ - H5VL_class_t *vol_cls = NULL; /* VOL class */ - int rc; /* Reference count */ - herr_t ret; /* Generic return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t did = H5I_INVALID_HID; /* Dataset ID */ + hid_t tid = H5I_INVALID_HID; /* Datatype ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t plid = H5I_INVALID_HID; /* Property List ID */ + hid_t pcid = H5I_INVALID_HID; /* Property Class ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t ecid = H5I_INVALID_HID; /* Error Class ID */ + hid_t emid = H5I_INVALID_HID; /* Error Message ID */ + hid_t esid = H5I_INVALID_HID; /* Error Stack ID */ + hid_t vfdid = H5I_INVALID_HID; /* Virtual File Driver ID */ + hid_t volid = H5I_INVALID_HID; /* Virtual Object Layer ID */ + H5FD_class_t *vfd_cls = NULL; /* VFD class */ + H5VL_class_t *vol_cls = NULL; /* VOL class */ + int rc; /* Reference count */ + herr_t ret; /* Generic return value */ /* Check H5I operations on files */ @@ -5771,7 +5771,7 @@ test_misc32(void) static void test_misc33(void) { - hid_t fid = -1; /* File ID */ + hid_t fid = H5I_INVALID_HID; /* File ID */ const char *testfile = H5_get_srcdir_filename(MISC33_FILE); /* Corrected test file name */ H5O_info2_t oinfo; /* Structure for object metadata information */ bool driver_is_default_compatible; diff --git a/test/trefer.c b/test/trefer.c index d4c91750e08..a8bef0999a3 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -2155,17 +2155,17 @@ test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2 static void test_reference_group(void) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - H5R_ref_t wref; /* Reference to write */ - H5R_ref_t rref; /* Reference to read */ - H5G_info_t ginfo; /* Group info struct */ - char objname[NAME_SIZE]; /* Buffer to store name */ - H5O_info2_t oinfo; /* Object info struct */ - int count = 0; /* Count within iterated group */ - ssize_t size; /* Name length */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + H5R_ref_t wref; /* Reference to write */ + H5R_ref_t rref; /* Reference to read */ + H5G_info_t ginfo; /* Group info struct */ + char objname[NAME_SIZE]; /* Buffer to store name */ + H5O_info2_t oinfo; /* Object info struct */ + int count = 0; /* Count within iterated group */ + ssize_t size; /* Name length */ herr_t ret; /* Create file with a group and a dataset containing an object reference to the group */ diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index f6c2872f116..a84815f497c 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -166,25 +166,25 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Test parameters to H5Rcreate */ - ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); VERIFY(ret, FAIL, "H5Rcreate ref"); - ret = H5Rcreate(&wbuf[0], (hid_t)-1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[0], (hid_t)H5I_INVALID_HID, "/Group1/Dataset1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); VERIFY(ret, FAIL, "H5Rcreate loc_id"); - ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, (hid_t)H5I_INVALID_HID); VERIFY(ret, FAIL, "H5Rcreate name"); - ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, (hid_t)H5I_INVALID_HID); VERIFY(ret, FAIL, "H5Rcreate null name"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)-1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)H5I_INVALID_HID); VERIFY(ret, FAIL, "H5Rcreate type"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, (hid_t)-1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, (hid_t)H5I_INVALID_HID); VERIFY(ret, FAIL, "H5Rcreate region space"); ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)0); VERIFY(ret, FAIL, "H5Rcreate space"); /* Test parameters to H5Rdereference */ - dset2 = H5Rdereference2((hid_t)-1, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]); + dset2 = H5Rdereference2((hid_t)H5I_INVALID_HID, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]); VERIFY(dset2, FAIL, "H5Rdereference2 loc_id"); - dset2 = H5Rdereference2(dataset, (hid_t)-1, H5R_OBJECT, &rbuf[0]); + dset2 = H5Rdereference2(dataset, (hid_t)H5I_INVALID_HID, H5R_OBJECT, &rbuf[0]); VERIFY(dset2, FAIL, "H5Rdereference2 oapl_id"); dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, NULL); VERIFY(dset2, FAIL, "H5Rdereference2 ref"); @@ -192,7 +192,7 @@ test_reference_params(void) VERIFY(dset2, FAIL, "H5Rdereference2 type"); /* Test parameters to H5Rget_obj_type2 */ - ret = H5Rget_obj_type2((hid_t)-1, H5R_OBJECT, &rbuf[0], NULL); + ret = H5Rget_obj_type2((hid_t)H5I_INVALID_HID, H5R_OBJECT, &rbuf[0], NULL); VERIFY(ret, FAIL, "H5Rget_obj_type2 loc_id"); ret = H5Rget_obj_type2(fid1, H5R_OBJECT, NULL, NULL); VERIFY(ret, FAIL, "H5Rget_obj_type2 ref"); @@ -200,7 +200,7 @@ test_reference_params(void) VERIFY(ret, FAIL, "H5Rget_obj_type2 type"); /* Test parameters to H5Rget_name */ - name_size = H5Rget_name((hid_t)-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0); + name_size = H5Rget_name((hid_t)H5I_INVALID_HID, H5R_DATASET_REGION, &rbuf[0], NULL, 0); VERIFY(name_size, FAIL, "H5Rget_name loc_id"); name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0); VERIFY(name_size, FAIL, "H5Rget_name ref"); @@ -208,7 +208,7 @@ test_reference_params(void) VERIFY(name_size, FAIL, "H5Rget_name type"); /* Test parameters to H5Rget_region */ - ret_id = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); + ret_id = H5Rget_region((hid_t)H5I_INVALID_HID, H5R_OBJECT, &rbuf[0]); VERIFY(ret_id, FAIL, "H5Rget_region loc_id"); ret_id = H5Rget_region(fid1, H5R_OBJECT, NULL); VERIFY(ret_id, FAIL, "H5Rget_region ref"); @@ -351,28 +351,28 @@ test_reference_obj(void) CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[0], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[1], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Create reference to group */ - ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[2], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type2"); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[3], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); @@ -504,13 +504,13 @@ test_reference_obj(void) static void test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) { - hid_t fid1; /* HDF5 File IDs */ - hid_t fapl = -1; /* File access property list */ - hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ - hid_t dapl_id; /* Dataset access property list */ + hid_t fid1; /* HDF5 File IDs */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t dset1, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid2; /* Dataspace ID #2 */ + hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ @@ -950,13 +950,13 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) static void test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) { - hid_t fid1; /* HDF5 File IDs */ - hid_t fapl = -1; /* File access property list */ - hid_t dset1, /* Dataset ID */ - dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid3; /* Dataspace ID #3 */ - hid_t dapl_id; /* Dataset access property list */ + hid_t fid1; /* HDF5 File IDs */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t dset1, /* Dataset ID */ + dset3; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid3; /* Dataspace ID #3 */ + hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}, dims3[] = {SPACE3_DIM1}; hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ @@ -1279,7 +1279,7 @@ test_reference_obj_deleted(void) CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &oref, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); @@ -1389,17 +1389,17 @@ test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2 static void test_reference_group(void) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hobj_ref_t wref; /* Reference to write */ - hobj_ref_t rref; /* Reference to read */ - H5G_info_t ginfo; /* Group info struct */ - char objname[NAME_SIZE]; /* Buffer to store name */ - H5O_info2_t oinfo; /* Object info struct */ - int count = 0; /* Count within iterated group */ - ssize_t size; /* Name length */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hobj_ref_t wref; /* Reference to write */ + hobj_ref_t rref; /* Reference to read */ + H5G_info_t ginfo; /* Group info struct */ + char objname[NAME_SIZE]; /* Buffer to store name */ + H5O_info2_t oinfo; /* Object info struct */ + int count = 0; /* Count within iterated group */ + ssize_t size; /* Name length */ herr_t ret; /* Create file with a group and a dataset containing an object reference to the group */ @@ -1439,7 +1439,7 @@ test_reference_group(void) CHECK(did, FAIL, "H5Dcreate2"); /* Create reference to group */ - ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); /* Write reference to disk */ @@ -1607,19 +1607,19 @@ test_reference_compat(void) CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to group */ - ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); /* Write references to disk */ diff --git a/test/tselect.c b/test/tselect.c index 7bb19b85289..fa93c213e39 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -5541,11 +5541,11 @@ test_select_hyper_union_3d(void) static void test_select_hyper_valid_combination(void) { - hid_t single_pt_sid; /* Dataspace ID with single point selection */ - hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ - hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ - hid_t non_existent_sid = -1; /* A non-existent space id */ - hid_t tmp_sid; /* Temporary dataspace ID */ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t non_existent_sid = H5I_INVALID_HID; /* A non-existent space id */ + hid_t tmp_sid; /* Temporary dataspace ID */ hsize_t dims2D[] = {SPACE9_DIM1, SPACE9_DIM2}; hsize_t dims3D[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; diff --git a/test/tsohm.c b/test/tsohm.c index 6c20a8c912e..bcd540f9431 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -193,9 +193,9 @@ verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected, const unsign static void test_sohm_fcpl(void) { - hid_t fid = -1; - hid_t fcpl_id = -1; - hid_t fcpl2_id = -1; + hid_t fid = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t fcpl2_id = H5I_INVALID_HID; unsigned x; herr_t ret; @@ -328,8 +328,8 @@ test_sohm_fcpl(void) static void test_sohm_fcpl_errors(void) { - hid_t fcpl_id = -1; - hid_t fid = -1; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t fid = H5I_INVALID_HID; unsigned x; herr_t ret; @@ -417,8 +417,8 @@ test_sohm_fcpl_errors(void) static hid_t make_dtype_1(void) { - hid_t dtype1_id = -1; - hid_t str_id = -1; + hid_t dtype1_id = H5I_INVALID_HID; + hid_t str_id = H5I_INVALID_HID; /* Create compound datatype. */ if ((dtype1_id = H5Tcreate(H5T_COMPOUND, sizeof(struct dtype1_struct))) < 0) @@ -480,9 +480,9 @@ make_dtype_1(void) static hid_t make_dtype_2(void) { - hid_t dtype2_id = -1; - hid_t enum_id = -1; - hid_t int_id = -1; + hid_t dtype2_id = H5I_INVALID_HID; + hid_t enum_id = H5I_INVALID_HID; + hid_t int_id = H5I_INVALID_HID; int x; hsize_t dims[] = {2, 1, 2, 4}; size_t size; @@ -785,9 +785,9 @@ getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id, bool test_ static void test_sohm_size1(void) { - hid_t file = -1; - hid_t fcpl_id = -1; - hid_t fapl_id = -1; + hid_t file = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; unsigned use_shared = 0; unsigned use_btree = 0; @@ -970,9 +970,9 @@ test_sohm_size1(void) static void test_sohm_size_consistency_open_create(void) { - hid_t file = -1; - hid_t fcpl_id = -1; - hid_t fapl_id = -1; + hid_t file = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; unsigned use_btree; hsize_t oh_size_open; hsize_t oh_size_create; @@ -1101,10 +1101,10 @@ sohm_attr_helper(hid_t fcpl_id) * 2 - committed datatype, read through second ID */ for (op_index = 0; op_index < TSOHM_SAH_OP_COUNT; op_index++) { - hid_t type_id = -1; - hid_t group_id = -1; - hid_t attr_id = -1; - hid_t attr_id2 = -1; + hid_t type_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; + hid_t attr_id2 = H5I_INVALID_HID; hid_t attr_read_id; /* create group in file with name unique to op_index */ @@ -1525,18 +1525,18 @@ size2_dump_struct(const char *name, size2_helper_struct *sizes) static int size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_sizes) { - hid_t file_id = -1; - hid_t dtype1_id = -1; - hid_t dtype2_id = -1; - hid_t dspace1_id = -1; - hid_t dspace2_id = -1; - hid_t dcpl1_id = -1; - hid_t dcpl2_id = -1; - hid_t dset_id = -1; - hid_t attr_type_id = -1; - hid_t attr_space_id = -1; - hid_t attr_id = -1; - hid_t group_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dtype1_id = H5I_INVALID_HID; + hid_t dtype2_id = H5I_INVALID_HID; + hid_t dspace1_id = H5I_INVALID_HID; + hid_t dspace2_id = H5I_INVALID_HID; + hid_t dcpl1_id = H5I_INVALID_HID; + hid_t dcpl2_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t attr_type_id = H5I_INVALID_HID; + hid_t attr_space_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; char attr_string1[NAME_BUF_SIZE]; char attr_string2[NAME_BUF_SIZE]; char attr_name[NAME_BUF_SIZE]; @@ -1894,10 +1894,10 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size static void size2_verify(void) { - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t plist_id = -1; - hid_t space_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t plist_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; hid_t group1_id, group2_id; hid_t attr1_id, attr2_id; hid_t attr_type_id; @@ -2096,7 +2096,7 @@ size2_verify(void) static void test_sohm_size2(int close_reopen) { - hid_t fcpl_id = -1; + hid_t fcpl_id = H5I_INVALID_HID; /* Sizes for file with no shared messages at all */ size2_helper_struct norm_sizes; /* Sizes for files with all messages in one index */ @@ -2672,8 +2672,8 @@ test_sohm_size2(int close_reopen) static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x) { - hid_t dset_id = -1; - hid_t attr_id = -1; + hid_t dset_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; char wdata; herr_t ret; @@ -2706,8 +2706,8 @@ delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x) static void delete_helper_read(hid_t file_id, hid_t *dspace_id, int x) { - hid_t dset_id = -1; - hid_t attr_id = -1; + hid_t dset_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; char rdata; herr_t ret; @@ -2750,7 +2750,7 @@ delete_helper_read(hid_t file_id, hid_t *dspace_id, int x) static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id) { - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; int x; h5_stat_size_t norm_filesize; h5_stat_size_t deleted_filesize; @@ -3135,10 +3135,10 @@ test_sohm_delete_revert(void) static void verify_dset_create_and_open_through_extlink_with_sohm(hid_t src_fcpl_id, hid_t dst_fcpl_id) { - hid_t src_file_id = -1; - hid_t dst_file_id = -1; - hid_t space_id = -1; - hid_t dset_id = -1; + hid_t src_file_id = H5I_INVALID_HID; + hid_t dst_file_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; hsize_t dims[] = {1, 1}; herr_t ret; @@ -3198,7 +3198,7 @@ verify_dset_create_and_open_through_extlink_with_sohm(hid_t src_fcpl_id, hid_t d static void test_sohm_extlink(void) { - hid_t fcpl_id = -1; + hid_t fcpl_id = H5I_INVALID_HID; bool driver_is_default_compatible; herr_t ret; @@ -3499,7 +3499,7 @@ verify_dataset_extension(hid_t fcpl_id, bool close_reopen) static void test_sohm_extend_dset(void) { - hid_t fcpl_id = -1; + hid_t fcpl_id = H5I_INVALID_HID; herr_t ret; MESSAGE(5, ("Testing extending shared dataspaces\n")); diff --git a/test/tunicode.c b/test/tunicode.c index 6b6e5849136..b7e20152443 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -449,7 +449,7 @@ test_objnames(hid_t fid, const char *string) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to named datatype */ - ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, (hid_t)-1); + ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, (hid_t)H5I_INVALID_HID); CHECK(ret, FAIL, "H5Rcreate"); /* Write selection and read it back*/ ret = H5Dwrite(dset_id, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &obj_ref); diff --git a/test/tvltypes.c b/test/tvltypes.c index 88401d448b7..9e3c7a79905 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -2499,33 +2499,33 @@ test_vltypes_fill_value(void) const char *str_unit; } dtype1_struct; - herr_t ret; - hid_t file_id; - hid_t dtype1_id = -1; - hid_t str_id = -1; - hid_t small_dspace_id; /* Dataspace ID for small datasets */ - hid_t large_dspace_id; /* Dataspace ID for large datasets */ - hid_t small_select_dspace_id; /* Dataspace ID for selection in small datasets */ - hid_t large_select_dspace_id; /* Dataspace ID for selection in large datasets */ - hid_t dset_dspace_id = -1; /* Dataspace ID for a particular dataset */ - hid_t dset_select_dspace_id = -1; /* Dataspace ID for selection in a particular dataset */ - hid_t scalar_dspace_id; /* Dataspace ID for scalar dataspace */ - hid_t single_dspace_id; /* Dataspace ID for single element selection */ - hsize_t single_offset[] = {2}; /* Offset of single element selection */ - hsize_t single_block[] = {1}; /* Block size of single element selection */ - hsize_t select_offset[] = {0}; /* Offset of non-contiguous element selection */ - hsize_t select_stride[] = {2}; /* Stride size of non-contiguous element selection */ - hsize_t small_select_count[] = {SPACE4_DIM_SMALL / + herr_t ret; + hid_t file_id; + hid_t dtype1_id = H5I_INVALID_HID; + hid_t str_id = H5I_INVALID_HID; + hid_t small_dspace_id; /* Dataspace ID for small datasets */ + hid_t large_dspace_id; /* Dataspace ID for large datasets */ + hid_t small_select_dspace_id; /* Dataspace ID for selection in small datasets */ + hid_t large_select_dspace_id; /* Dataspace ID for selection in large datasets */ + hid_t dset_dspace_id = H5I_INVALID_HID; /* Dataspace ID for a particular dataset */ + hid_t dset_select_dspace_id = H5I_INVALID_HID; /* Dataspace ID for selection in a particular dataset */ + hid_t scalar_dspace_id; /* Dataspace ID for scalar dataspace */ + hid_t single_dspace_id; /* Dataspace ID for single element selection */ + hsize_t single_offset[] = {2}; /* Offset of single element selection */ + hsize_t single_block[] = {1}; /* Block size of single element selection */ + hsize_t select_offset[] = {0}; /* Offset of non-contiguous element selection */ + hsize_t select_stride[] = {2}; /* Stride size of non-contiguous element selection */ + hsize_t small_select_count[] = {SPACE4_DIM_SMALL / 2}; /* Count of small non-contiguous element selection */ - hsize_t large_select_count[] = {SPACE4_DIM_LARGE / + hsize_t large_select_count[] = {SPACE4_DIM_LARGE / 2}; /* Count of large non-contiguous element selection */ - hsize_t select_block[] = {1}; /* Block size of non-contiguous element selection */ - hid_t dcpl_id, xfer_pid; - hid_t dset_id; - hsize_t small_dims[] = {SPACE4_DIM_SMALL}; - hsize_t large_dims[] = {SPACE4_DIM_LARGE}; - size_t dset_elmts = 0; /* Number of elements in a particular dataset */ - const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", + hsize_t select_block[] = {1}; /* Block size of non-contiguous element selection */ + hid_t dcpl_id, xfer_pid; + hid_t dset_id; + hsize_t small_dims[] = {SPACE4_DIM_SMALL}; + hsize_t large_dims[] = {SPACE4_DIM_LARGE}; + size_t dset_elmts = 0; /* Number of elements in a particular dataset */ + const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", 3, 4.0, 100.0, 1.0, "liquid", "meter"}; const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0, 200.0, 2.0, "solid", "yard"}; dtype1_struct *rbuf = NULL; /* Buffer for reading data */ diff --git a/test/unlink.c b/test/unlink.c index 6740a1ff581..4c4b9cf174f 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -77,7 +77,7 @@ static const char *FILENAME[] = {"unlink", "new_move_a", "new_move_ static int test_one(hid_t file) { - hid_t work = -1, grp = -1; + hid_t work = H5I_INVALID_HID, grp = H5I_INVALID_HID; herr_t status; /* Create a test group */ @@ -149,7 +149,7 @@ test_one(hid_t file) static int test_many(hid_t file) { - hid_t work = -1, grp = -1; + hid_t work = H5I_INVALID_HID, grp = H5I_INVALID_HID; int i; const int how_many = 500; char name[32]; @@ -253,7 +253,7 @@ test_many(hid_t file) static int test_symlink(hid_t file) { - hid_t work = -1; + hid_t work = H5I_INVALID_HID; TESTING("symlink removal"); @@ -295,7 +295,7 @@ test_symlink(hid_t file) static int test_rename(hid_t file) { - hid_t work = -1, foo = -1, inner = -1; + hid_t work = H5I_INVALID_HID, foo = H5I_INVALID_HID, inner = H5I_INVALID_HID; /* Create a test group and rename something */ TESTING("object renaming"); @@ -356,9 +356,10 @@ test_rename(hid_t file) static int test_new_move(hid_t fapl) { - hid_t file_a, file_b = (-1); - hid_t grp_1 = (-1), grp_2 = (-1), grp_move = (-1), moved_grp = (-1); - char filename[1024]; + hid_t file_a, file_b = (H5I_INVALID_HID); + hid_t grp_1 = (H5I_INVALID_HID), grp_2 = (H5I_INVALID_HID), grp_move = (H5I_INVALID_HID), + moved_grp = (H5I_INVALID_HID); + char filename[1024]; TESTING("new move"); @@ -1691,11 +1692,11 @@ delete_node(hid_t pid, hid_t id) static int test_unlink_rightleaf(hid_t fid) { - hid_t rootid = -1, /* Group ID for root group */ - *gids = NULL; /* Array of IDs for groups created */ - int n, /* Local index variable */ - ngroups = 150; /* Number of groups to create */ - char name[256]; /* Name of object to create */ + hid_t rootid = H5I_INVALID_HID, /* Group ID for root group */ + *gids = NULL; /* Array of IDs for groups created */ + int n, /* Local index variable */ + ngroups = 150; /* Number of groups to create */ + char name[256]; /* Name of object to create */ TESTING("deleting right-most child in non-leaf B-tree node"); @@ -1775,11 +1776,11 @@ test_unlink_rightleaf(hid_t fid) static int test_unlink_rightnode(hid_t fid) { - hid_t rootid = -1, /* Group ID for root group */ - *gids = NULL; /* Array of IDs for groups created */ - int n, /* Local index variable */ - ngroups = 150; /* Number of groups to create */ - char name[256]; /* Name of object to create */ + hid_t rootid = H5I_INVALID_HID, /* Group ID for root group */ + *gids = NULL; /* Array of IDs for groups created */ + int n, /* Local index variable */ + ngroups = 150; /* Number of groups to create */ + char name[256]; /* Name of object to create */ TESTING("deleting right-most child in non-leaf B-tree node"); @@ -1862,11 +1863,11 @@ test_unlink_rightnode(hid_t fid) static int test_unlink_middlenode(hid_t fid) { - hid_t rootid = -1, /* Group ID for root group */ - *gids = NULL; /* Array of IDs for groups created */ - int n, /* Local index variable */ - ngroups = 250; /* Number of groups to create */ - char name[256]; /* Name of object to create */ + hid_t rootid = H5I_INVALID_HID, /* Group ID for root group */ + *gids = NULL; /* Array of IDs for groups created */ + int n, /* Local index variable */ + ngroups = 250; /* Number of groups to create */ + char name[256]; /* Name of object to create */ TESTING("deleting right-most child in non-leaf B-tree node"); @@ -2235,7 +2236,7 @@ test_unlink_middlenode(hid_t fid) static int test_resurrect_dataset(hid_t fapl) { - hid_t f = -1, s = -1, d = -1; + hid_t f = H5I_INVALID_HID, s = H5I_INVALID_HID, d = H5I_INVALID_HID; char filename[1024]; TESTING("resurrecting dataset after deletion"); @@ -2315,7 +2316,7 @@ test_resurrect_dataset(hid_t fapl) static int test_resurrect_datatype(hid_t fapl) { - hid_t file = -1, type = -1; + hid_t file = H5I_INVALID_HID, type = H5I_INVALID_HID; char filename[1024]; TESTING("resurrecting datatype after deletion"); @@ -2392,7 +2393,7 @@ test_resurrect_datatype(hid_t fapl) static int test_resurrect_group(hid_t fapl) { - hid_t file = -1, group = -1; + hid_t file = H5I_INVALID_HID, group = H5I_INVALID_HID; char filename[1024]; TESTING("resurrecting group after deletion"); @@ -2466,10 +2467,10 @@ test_resurrect_group(hid_t fapl) static int test_unlink_chunked_dataset(hid_t fapl) { - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t space_id = -1; - hid_t dcpl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t dcpl_id = H5I_INVALID_HID; hsize_t dims[FILESPACE_NDIMS] = {FILESPACE_DIM0, FILESPACE_DIM1, FILESPACE_DIM2}; hsize_t max_dims[FILESPACE_NDIMS] = {H5S_UNLIMITED, H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[FILESPACE_NDIMS] = {FILESPACE_CHUNK0, FILESPACE_CHUNK1, FILESPACE_CHUNK2}; @@ -2561,15 +2562,15 @@ test_unlink_chunked_dataset(hid_t fapl) static int test_full_group_compact(hid_t fapl) { - hid_t file_id = -1; - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5O_info2_t oi; /* Stat buffer for object */ - char objname[128]; /* Buffer for name of objects to create */ - char objname2[128]; /* Buffer for name of objects to create */ - char filename[1024]; /* Buffer for filename */ - h5_stat_size_t keep_size; /* Size of the file with objects to keep */ - h5_stat_size_t file_size; /* Size of each file created */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5O_info2_t oi; /* Stat buffer for object */ + char objname[128]; /* Buffer for name of objects to create */ + char objname2[128]; /* Buffer for name of objects to create */ + char filename[1024]; /* Buffer for filename */ + h5_stat_size_t keep_size; /* Size of the file with objects to keep */ + h5_stat_size_t file_size; /* Size of each file created */ + unsigned u; /* Local index variable */ TESTING("unlinking non-empty compact group"); @@ -2719,16 +2720,16 @@ test_full_group_compact(hid_t fapl) static int test_full_group_dense(hid_t fapl) { - hid_t file_id = -1; - hid_t gcpl = (-1); /* Group creation property list ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - H5O_info2_t oi; /* Stat buffer for object */ - char objname[128]; /* Buffer for name of objects to create */ - char objname2[128]; /* Buffer for name of objects to create */ - char filename[1024]; /* Buffer for filename */ - h5_stat_size_t keep_size; /* Size of the file with objects to keep */ - h5_stat_size_t file_size; /* Size of each file created */ - unsigned u; /* Local index variable */ + hid_t file_id = H5I_INVALID_HID; + hid_t gcpl = (H5I_INVALID_HID); /* Group creation property list ID */ + hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + H5O_info2_t oi; /* Stat buffer for object */ + char objname[128]; /* Buffer for name of objects to create */ + char objname2[128]; /* Buffer for name of objects to create */ + char filename[1024]; /* Buffer for filename */ + h5_stat_size_t keep_size; /* Size of the file with objects to keep */ + h5_stat_size_t file_size; /* Size of each file created */ + unsigned u; /* Local index variable */ TESTING("unlinking non-empty dense group"); diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 5a9b7489b6f..b5fb9388eee 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -117,8 +117,8 @@ main(int argc, char *argv[]) int ret_value = 0; int child_ret_value; bool send_wait = false; - hid_t fapl = -1; /* File access property list */ - hid_t fid = -1; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ if (setup_parameters(argc, argv, &UC_opts) < 0) { Hgoto_error(1); diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index 8413645ff6e..1c5bf41651b 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -111,8 +111,8 @@ main(int argc, char *argv[]) int ret_value = 0; int child_ret_value; bool send_wait = 0; - hid_t fapl = -1; /* File access property list */ - hid_t fid = -1; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ if (setup_parameters(argc, argv, &UC_opts) < 0) { Hgoto_error(1); diff --git a/test/vds.c b/test/vds.c index 40c9e871ea0..354600e7cd9 100644 --- a/test/vds.c +++ b/test/vds.c @@ -269,7 +269,7 @@ static int vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, const char *filename, const char *dsetname) { - hid_t space_out = -1; + hid_t space_out = H5I_INVALID_HID; char name_out[32]; htri_t tri_ret; ssize_t str_len; @@ -358,11 +358,11 @@ static int test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, hid_t *ex_dcpl, hid_t vspace, char *filename, hsize_t exp_meta_size) { - hid_t file = -1; /* File */ - hid_t dset = -1; /* Virtual dataset */ - H5D_space_status_t space_status; /* Dataset space status */ - void *plist_buf = NULL; /* Serialized property list buffer */ - H5O_native_info_t ninfo; /* Object info struct */ + hid_t file = H5I_INVALID_HID; /* File */ + hid_t dset = H5I_INVALID_HID; /* Virtual dataset */ + H5D_space_status_t space_status; /* Dataset space status */ + void *plist_buf = NULL; /* Serialized property list buffer */ + H5O_native_info_t ninfo; /* Object info struct */ htri_t tri_ret; assert((config >= TEST_API_BASIC) && (config < TEST_API_NTESTS)); @@ -519,10 +519,11 @@ static int test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low) { char filename[FILENAME_BUF_SIZE]; - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t ex_dcpl = -1; /* Temporary dcpl for examination */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[LIST_DOUBLE_SIZE]; /* Virtual dset dataspaces */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t ex_dcpl = H5I_INVALID_HID; /* Temporary dcpl for examination */ + hid_t srcspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source dataspaces */ + hid_t vspace[LIST_DOUBLE_SIZE]; /* Virtual dset dataspaces */ const char *src_file[4] = {"src_file1", "src_file2.", "src_file3..", "src_file4..."}; /* Source file names (different lengths) */ const char *src_dset[4] = {"src_dset1....", "src_dset2.....", "src_dset3......", @@ -1186,19 +1187,23 @@ test_vds_prefix_first(unsigned config, hid_t vds_fapl, hid_t src_fapl) char *srcfilenamepct = NULL; char *srcfilenamepct_map = NULL; const char *srcfilenamepct_map_orig = "vds%%%%_src"; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t dapl = -1; /* Dataset access property list */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ - int buf[10][26]; /* Write and expected read buffer */ - int rbuf[10][26]; /* Read buffer */ - int fill = -1; /* Fill value */ + hid_t srcfile[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Files with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t dapl = H5I_INVALID_HID; /* Dataset access property list */ + hid_t srcspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source dataspaces */ + hid_t vspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Virtual dset dataspaces */ + hid_t memspace = H5I_INVALID_HID; /* Memory dataspace */ + hid_t srcdset[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source datasets */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int fill = -1; /* Fill value */ int i, j; char buffer[1024]; /* buffer to read vds_prefix */ @@ -1465,28 +1470,32 @@ test_basic_io(unsigned config, hid_t vds_fapl, hid_t src_fapl) char *srcfilenamepct = NULL; char *srcfilenamepct_map = NULL; const char *srcfilenamepct_map_orig = "vds%%%%_src"; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t vfile2 = -1; /* File with copied virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ - hsize_t start[4]; /* Hyperslab start */ - hsize_t stride[4]; /* Hyperslab stride */ - hsize_t count[4]; /* Hyperslab count */ - hsize_t block[4]; /* Hyperslab block */ - hssize_t offset[2] = {0, 0}; /* Selection offset */ - int buf[10][26]; /* Write and expected read buffer */ - int rbuf[10][26]; /* Read buffer */ - int rbuf99[9][9]; /* 9x9 Read buffer */ - int evbuf[10][26]; /* Expected VDS "buffer" */ - int erbuf[10][26]; /* Expected read buffer */ - int fill = -1; /* Fill value */ - herr_t ret; /* Generic return value */ + hid_t srcfile[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Files with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t vfile2 = H5I_INVALID_HID; /* File with copied virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t srcspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source dataspaces */ + hid_t vspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Virtual dset dataspaces */ + hid_t memspace = H5I_INVALID_HID; /* Memory dataspace */ + hid_t srcdset[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source datasets */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + hsize_t start[4]; /* Hyperslab start */ + hsize_t stride[4]; /* Hyperslab stride */ + hsize_t count[4]; /* Hyperslab count */ + hsize_t block[4]; /* Hyperslab block */ + hssize_t offset[2] = {0, 0}; /* Selection offset */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int rbuf99[9][9]; /* 9x9 Read buffer */ + int evbuf[10][26]; /* Expected VDS "buffer" */ + int erbuf[10][26]; /* Expected read buffer */ + int fill = -1; /* Fill value */ + herr_t ret; /* Generic return value */ int i, j, u, v; TESTING_2_SUPPRESSED("basic virtual dataset I/O"); @@ -4391,30 +4400,34 @@ test_unlim(unsigned config, hid_t vds_fapl, hid_t src_fapl) char srcfilename[FILENAME_BUF_SIZE]; char srcfilename_map[FILENAME_BUF_SIZE]; char vfilename[FILENAME_BUF_SIZE]; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t srcdcpl = -1; /* DCPL for source dset */ - hid_t dapl = -1; /* Dataset access property list */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t filespace = -1; /* File dataspace */ - hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[2] = {10, 10}; /* Data space current size */ - hsize_t mdims[2] = {10, 20}; /* Data space maximum size */ - hsize_t cdims[2] = {4, 4}; /* Chunk dimensions */ - hsize_t start[4]; /* Hyperslab start */ - hsize_t stride[4]; /* Hyperslab stride */ - hsize_t count[4]; /* Hyperslab count */ - hsize_t block[4]; /* Hyperslab block */ - int buf[10][20]; /* Write and expected read buffer */ - int rbuf[10][20]; /* Read buffer */ - int erbuf[10][20]; /* Expected read buffer */ - int ndims; /* Number of dimensions */ - int fill = -1; /* Fill value */ - H5D_vds_view_t virtual_view; /* Virtual view property */ + hid_t srcfile[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Files with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t srcdcpl = H5I_INVALID_HID; /* DCPL for source dset */ + hid_t dapl = H5I_INVALID_HID; /* Dataset access property list */ + hid_t srcspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source dataspaces */ + hid_t vspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Virtual dset dataspaces */ + hid_t memspace = H5I_INVALID_HID; /* Memory dataspace */ + hid_t filespace = H5I_INVALID_HID; /* File dataspace */ + hid_t srcdset[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source datasets */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[2] = {10, 10}; /* Data space current size */ + hsize_t mdims[2] = {10, 20}; /* Data space maximum size */ + hsize_t cdims[2] = {4, 4}; /* Chunk dimensions */ + hsize_t start[4]; /* Hyperslab start */ + hsize_t stride[4]; /* Hyperslab stride */ + hsize_t count[4]; /* Hyperslab count */ + hsize_t block[4]; /* Hyperslab block */ + int buf[10][20]; /* Write and expected read buffer */ + int rbuf[10][20]; /* Read buffer */ + int erbuf[10][20]; /* Expected read buffer */ + int ndims; /* Number of dimensions */ + int fill = -1; /* Fill value */ + H5D_vds_view_t virtual_view; /* Virtual view property */ int i, j; TESTING_2_SUPPRESSED("virtual dataset I/O with unlimited selections"); @@ -7406,28 +7419,30 @@ test_printf(unsigned config, hid_t vds_fapl, hid_t src_fapl) char *srcfilenamepct_map = NULL; const char *printf_srcfilename_map_orig = "vds_src_%b"; const char *srcfilenamepct_map_orig = "vds%%%%_src"; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t dapl = -1; /* Dataset access property list */ - hid_t srcspace = -1; /* Source dataspace */ - hid_t vspace[2] = {-1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t filespace = -1; /* File dataspace */ - hid_t srcdset[6] = {-1, -1, -1, -1, -1, -1}; /* Source datasets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[2] = {10, 0}; /* Data space current size */ - hsize_t mdims[2] = {10, 20}; /* Data space maximum size */ - hsize_t start[2] = {0, 0}; /* Hyperslab start */ - hsize_t stride[2]; /* Hyperslab stride */ - hsize_t count[2]; /* Hyperslab count */ - hsize_t block[2]; /* Hyperslab block */ - int buf[10][20]; /* Write and expected read buffer */ - int rbuf[10][20]; /* Read buffer */ - int erbuf[10][20]; /* Expected read buffer */ - int ndims; /* Number of dimensions */ - int fill = -1; /* Fill value */ - hsize_t gap_size; /* Gap size property */ + hid_t srcfile[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Files with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t dapl = H5I_INVALID_HID; /* Dataset access property list */ + hid_t srcspace = H5I_INVALID_HID; /* Source dataspace */ + hid_t vspace[2] = {H5I_INVALID_HID, H5I_INVALID_HID}; /* Virtual dset dataspaces */ + hid_t memspace = H5I_INVALID_HID; /* Memory dataspace */ + hid_t filespace = H5I_INVALID_HID; /* File dataspace */ + hid_t srcdset[6] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID}; /* Source datasets */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[2] = {10, 0}; /* Data space current size */ + hsize_t mdims[2] = {10, 20}; /* Data space maximum size */ + hsize_t start[2] = {0, 0}; /* Hyperslab start */ + hsize_t stride[2]; /* Hyperslab stride */ + hsize_t count[2]; /* Hyperslab count */ + hsize_t block[2]; /* Hyperslab block */ + int buf[10][20]; /* Write and expected read buffer */ + int rbuf[10][20]; /* Read buffer */ + int erbuf[10][20]; /* Expected read buffer */ + int ndims; /* Number of dimensions */ + int fill = -1; /* Fill value */ + hsize_t gap_size; /* Gap size property */ int i, j; TESTING_2_SUPPRESSED("virtual dataset I/O with printf source"); @@ -11114,28 +11129,29 @@ test_all(unsigned config, hid_t vds_fapl, hid_t src_fapl) char vfilename[FILENAME_BUF_SIZE]; char srcfilename[FILENAME_BUF_SIZE]; char srcfilename_map[FILENAME_BUF_SIZE]; - hid_t srcfile = -1; /* File with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t srcdcpl = -1; /* DCPL for source dset */ - hid_t srcspace[3] = {-1, -1, -1}; /* Source dataspaces */ - hid_t vspace[3] = {-1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t filespace = -1; /* File dataspace */ - hid_t srcdset[5] = {-1, -1, -1, -1, -1}; /* Source datasets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[2] = {6, 6}; /* Data space current size */ - hsize_t mdims[2] = {10, 10}; /* Data space maximum size */ - hsize_t cdims[2] = {2, 2}; /* Chunk dimensions */ - hsize_t start[2]; /* Hyperslab start */ - hsize_t stride[2]; /* Hyperslab stride */ - hsize_t count[2]; /* Hyperslab count */ - hsize_t block[2]; /* Hyperslab block */ - int buf[10][10]; /* Write and expected read buffer */ - int rbuf[10][10]; /* Read buffer */ - int erbuf[10][10]; /* Expected read buffer */ - int ndims; /* Number of dimensions */ - int fill = -1; /* Fill value */ + hid_t srcfile = H5I_INVALID_HID; /* File with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t srcdcpl = H5I_INVALID_HID; /* DCPL for source dset */ + hid_t srcspace[3] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID}; /* Source dataspaces */ + hid_t vspace[3] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID}; /* Virtual dset dataspaces */ + hid_t memspace = H5I_INVALID_HID; /* Memory dataspace */ + hid_t filespace = H5I_INVALID_HID; /* File dataspace */ + hid_t srcdset[5] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source datasets */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[2] = {6, 6}; /* Data space current size */ + hsize_t mdims[2] = {10, 10}; /* Data space maximum size */ + hsize_t cdims[2] = {2, 2}; /* Chunk dimensions */ + hsize_t start[2]; /* Hyperslab start */ + hsize_t stride[2]; /* Hyperslab stride */ + hsize_t count[2]; /* Hyperslab count */ + hsize_t block[2]; /* Hyperslab block */ + int buf[10][10]; /* Write and expected read buffer */ + int rbuf[10][10]; /* Read buffer */ + int erbuf[10][10]; /* Expected read buffer */ + int ndims; /* Number of dimensions */ + int fill = -1; /* Fill value */ int i, j; TESTING_2_SUPPRESSED("virtual dataset I/O with mixed selection types"); @@ -12138,23 +12154,23 @@ test_all(unsigned config, hid_t vds_fapl, hid_t src_fapl) static int test_dapl_values(hid_t fapl_id) { - hid_t fid = -1; /* file to write to */ - hid_t dcpl_id = -1; /* dataset creation properties */ - hid_t dapl_id1 = -1; /* dataset access properties */ - hid_t dapl_id2 = -1; /* dataset access properties */ - hid_t vds_sid = -1; /* vds data space */ - hid_t src_sid = -1; /* source data space */ - hid_t did1 = -1; /* dataset */ - hid_t did2 = -1; /* dataset */ - hsize_t start; /* hyperslab start */ - hsize_t stride; /* hyperslab count */ - hsize_t count; /* hyperslab count */ - hsize_t block; /* hyperslab count */ - hsize_t dims; /* dataset size */ - hsize_t max_dims; /* dataset max size */ - H5D_vds_view_t view; /* view from dapl */ - hsize_t gap_size; /* gap size from dapl */ - char filename[1024]; /* file names */ + hid_t fid = H5I_INVALID_HID; /* file to write to */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation properties */ + hid_t dapl_id1 = H5I_INVALID_HID; /* dataset access properties */ + hid_t dapl_id2 = H5I_INVALID_HID; /* dataset access properties */ + hid_t vds_sid = H5I_INVALID_HID; /* vds data space */ + hid_t src_sid = H5I_INVALID_HID; /* source data space */ + hid_t did1 = H5I_INVALID_HID; /* dataset */ + hid_t did2 = H5I_INVALID_HID; /* dataset */ + hsize_t start; /* hyperslab start */ + hsize_t stride; /* hyperslab count */ + hsize_t count; /* hyperslab count */ + hsize_t block; /* hyperslab count */ + hsize_t dims; /* dataset size */ + hsize_t max_dims; /* dataset max size */ + H5D_vds_view_t view; /* view from dapl */ + hsize_t gap_size; /* gap size from dapl */ + char filename[1024]; /* file names */ TESTING_2("H5Dget_access_plist() returns dapl w/ correct values"); @@ -12295,8 +12311,8 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t fapl; - hid_t vds_fapl = -1; /* File access property list */ - hid_t src_fapl = -1; /* File access property list */ + hid_t vds_fapl = H5I_INVALID_HID; /* File access property list */ + hid_t src_fapl = H5I_INVALID_HID; /* File access property list */ int test_api_config; unsigned bit_config; H5F_libver_t low, high; /* Low and high bounds */ diff --git a/test/vds_env.c b/test/vds_env.c index e2ab024fb99..fc75f958d70 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -48,19 +48,23 @@ test_vds_prefix_second(unsigned config, hid_t fapl) char *vfilename2 = NULL; char *srcfilenamepct = NULL; char *srcfilenamepct_map = NULL; - hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */ - hid_t vfile = -1; /* File with virtual dset */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t dapl = -1; /* Dataset access property list */ - hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */ - hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */ - hid_t memspace = -1; /* Memory dataspace */ - hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datasets */ - hid_t vdset = -1; /* Virtual dataset */ - hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ - int buf[10][26]; /* Write and expected read buffer */ - int rbuf[10][26]; /* Read buffer */ - int fill = -1; /* Fill value */ + hid_t srcfile[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Files with source dsets */ + hid_t vfile = H5I_INVALID_HID; /* File with virtual dset */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ + hid_t dapl = H5I_INVALID_HID; /* Dataset access property list */ + hid_t srcspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source dataspaces */ + hid_t vspace[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Virtual dset dataspaces */ + hid_t memspace = H5I_INVALID_HID; /* Memory dataspace */ + hid_t srcdset[4] = {H5I_INVALID_HID, H5I_INVALID_HID, H5I_INVALID_HID, + H5I_INVALID_HID}; /* Source datasets */ + hid_t vdset = H5I_INVALID_HID; /* Virtual dataset */ + hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */ + int buf[10][26]; /* Write and expected read buffer */ + int rbuf[10][26]; /* Read buffer */ + int fill = -1; /* Fill value */ int i, j; char buffer[1024]; /* buffer to read vds_prefix */ diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c index bdfa18e30a1..a22b1552270 100644 --- a/test/vds_swmr_gen.c +++ b/test/vds_swmr_gen.c @@ -44,16 +44,16 @@ static int32_t VDS_FILL_VALUE = -9; int main(void) { - hid_t faplid = -1; /* file access property list ID (all files) */ + hid_t faplid = H5I_INVALID_HID; /* file access property list ID (all files) */ - hid_t src_sid = -1; /* source dataset's dataspace ID */ - hid_t src_dcplid = -1; /* source dataset property list ID */ + hid_t src_sid = H5I_INVALID_HID; /* source dataset's dataspace ID */ + hid_t src_dcplid = H5I_INVALID_HID; /* source dataset property list ID */ - hid_t vds_sid = -1; /* VDS dataspace ID */ - hid_t vds_dcplid = -1; /* VDS dataset property list ID */ + hid_t vds_sid = H5I_INVALID_HID; /* VDS dataspace ID */ + hid_t vds_dcplid = H5I_INVALID_HID; /* VDS dataset property list ID */ - hid_t fid = -1; /* HDF5 file ID */ - hid_t did = -1; /* dataset ID */ + hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ hsize_t start[RANK]; /* starting point for hyperslab */ int map_start = -1; /* starting point in the VDS map */ diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c index f6e9ddd6c97..76cdb8aa3d5 100644 --- a/test/vds_swmr_reader.c +++ b/test/vds_swmr_reader.c @@ -18,11 +18,11 @@ static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH}; int main(void) { - hid_t fid = -1; /* HDF5 file ID */ - hid_t faplid = -1; /* file access property list ID */ - hid_t did = -1; /* dataset ID */ - hid_t msid = -1; /* memory dataspace ID */ - hid_t fsid = -1; /* file dataspace ID */ + hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ + hid_t faplid = H5I_INVALID_HID; /* file access property list ID */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */ + hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */ hsize_t start[RANK]; /* hyperslab start point */ diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c index d5fa74b2f6e..752cc509e24 100644 --- a/test/vds_swmr_writer.c +++ b/test/vds_swmr_writer.c @@ -18,11 +18,11 @@ main(int argc, char *argv[]) { int file_number = -1; /* Source file number */ - hid_t fid = -1; /* HDF5 file ID */ - hid_t faplid = -1; /* file access property list ID */ - hid_t did = -1; /* dataset ID */ - hid_t msid = -1; /* memory dataspace ID */ - hid_t fsid = -1; /* file dataspace ID */ + hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ + hid_t faplid = H5I_INVALID_HID; /* file access property list ID */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + hid_t msid = H5I_INVALID_HID; /* memory dataspace ID */ + hid_t fsid = H5I_INVALID_HID; /* file dataspace ID */ hsize_t extent[RANK]; /* dataset extents */ hsize_t start[RANK]; /* hyperslab start point */ diff --git a/test/vfd.c b/test/vfd.c index 933d95d99fe..a09ce23baed 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -191,14 +191,14 @@ static herr_t H5FD__ctl_test_vfd_ctl(H5FD_t *_file, uint64_t op_code, uint64_t static herr_t test_sec2(void) { - hid_t fid = -1; /* file ID */ - hid_t fapl_id = -1; /* file access property list ID */ - hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ - char filename[1024]; /* filename */ - void *os_file_handle = NULL; /* OS file handle */ - hsize_t file_size; /* file size */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t fapl_id_out = H5I_INVALID_HID; /* from H5Fget_access_plist */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + char filename[1024]; /* filename */ + void *os_file_handle = NULL; /* OS file handle */ + hsize_t file_size; /* file size */ TESTING("SEC2 file driver"); @@ -303,28 +303,28 @@ test_sec2(void) static herr_t test_core(void) { - hid_t fid = -1; /* file ID */ - hid_t fapl_id = -1; /* file access property list ID */ - hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ - hid_t did = -1; /* dataset ID */ - hid_t sid = -1; /* dataspace ID */ - char filename[1024]; /* filename */ - void *os_file_handle = NULL; /* OS file handle */ - hsize_t file_size; /* file size */ - size_t increment; /* core VFD increment */ - bool backing_store; /* use backing store? */ - bool use_write_tracking; /* write tracking flag */ - size_t write_tracking_page_size; /* write tracking page size */ - int *data_w = NULL; /* data written to the dataset */ - int *data_r = NULL; /* data read from the dataset */ - int val; /* data value */ - int *pw = NULL, *pr = NULL; /* pointers for iterating over - data arrays (write & read) */ - hsize_t dims[2]; /* dataspace dimensions */ - int i, j; /* iterators */ - htri_t status; /* return value from H5Lexists */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t fapl_id_out = H5I_INVALID_HID; /* from H5Fget_access_plist */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ + char filename[1024]; /* filename */ + void *os_file_handle = NULL; /* OS file handle */ + hsize_t file_size; /* file size */ + size_t increment; /* core VFD increment */ + bool backing_store; /* use backing store? */ + bool use_write_tracking; /* write tracking flag */ + size_t write_tracking_page_size; /* write tracking page size */ + int *data_w = NULL; /* data written to the dataset */ + int *data_r = NULL; /* data read from the dataset */ + int val; /* data value */ + int *pw = NULL, *pr = NULL; /* pointers for iterating over + data arrays (write & read) */ + hsize_t dims[2]; /* dataspace dimensions */ + int i, j; /* iterators */ + htri_t status; /* return value from H5Lexists */ TESTING("CORE file driver"); @@ -693,8 +693,9 @@ static herr_t test_direct(void) { #ifdef H5_HAVE_DIRECT - hid_t file = -1, fapl = -1, access_fapl = -1; - hid_t dset1 = -1, dset2 = -1, space1 = -1, space2 = -1; + hid_t file = H5I_INVALID_HID, fapl = H5I_INVALID_HID, access_fapl = H5I_INVALID_HID; + hid_t dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID, space1 = H5I_INVALID_HID, + space2 = H5I_INVALID_HID; char filename[1024]; int *fhandle = NULL; hsize_t file_size; @@ -925,7 +926,7 @@ H5_GCC_CLANG_DIAG_OFF("format-nonliteral") static herr_t test_family_opens(char *fname, hid_t fa_pl) { - hid_t file = -1; + hid_t file = H5I_INVALID_HID; char first_name[1024]; char wrong_name[1024]; int i; @@ -1000,10 +1001,11 @@ H5_GCC_CLANG_DIAG_ON("format-nonliteral") static herr_t test_family(void) { - hid_t file = -1, fapl = -1, fapl2 = -1, space = -1, dset = -1; - hid_t access_fapl = -1; - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t file = H5I_INVALID_HID, fapl = H5I_INVALID_HID, fapl2 = H5I_INVALID_HID, space = H5I_INVALID_HID, + dset = H5I_INVALID_HID; + hid_t access_fapl = H5I_INVALID_HID; + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; char dname[] = "dataset"; unsigned int i, j; @@ -1210,8 +1212,8 @@ H5_GCC_CLANG_DIAG_OFF("format-nonliteral") static herr_t test_family_compat(void) { - hid_t file = -1, fapl = -1; - hid_t dset = -1; + hid_t file = H5I_INVALID_HID, fapl = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; char dname[] = "dataset"; char filename[1024]; char pathname[1024], pathname_individual[1024]; @@ -1460,11 +1462,12 @@ H5_GCC_CLANG_DIAG_ON("format-nonliteral") static herr_t test_multi(void) { - hid_t file = -1, fapl = -1, fapl2 = -1, dset = -1, space = -1; - hid_t root = -1, attr = -1, aspace = -1, atype = -1; - hid_t access_fapl = -1; - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t file = H5I_INVALID_HID, fapl = H5I_INVALID_HID, fapl2 = H5I_INVALID_HID, dset = H5I_INVALID_HID, + space = H5I_INVALID_HID; + hid_t root = H5I_INVALID_HID, attr = H5I_INVALID_HID, aspace = H5I_INVALID_HID, atype = H5I_INVALID_HID; + hid_t access_fapl = H5I_INVALID_HID; + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle2 = NULL, *fhandle = NULL; hsize_t file_size; @@ -1716,10 +1719,10 @@ test_multi(void) static herr_t test_multi_compat(void) { - hid_t file = -1, fapl = -1, dset = -1, space = -1; - char newname[1024]; - char filename_s[1024], newname_s[1024]; - char filename_r[1024], newname_r[1024]; + hid_t file = H5I_INVALID_HID, fapl = H5I_INVALID_HID, dset = H5I_INVALID_HID, space = H5I_INVALID_HID; + char newname[1024]; + char filename_s[1024], newname_s[1024]; + char filename_r[1024], newname_r[1024]; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; @@ -1898,11 +1901,11 @@ test_multi_compat(void) static herr_t test_log(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t file = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; + hid_t access_fapl = H5I_INVALID_HID; + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -2021,11 +2024,11 @@ test_log(void) static herr_t test_stdio(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t file = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; + hid_t access_fapl = H5I_INVALID_HID; + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; FILE *fhandle = NULL; hsize_t file_size = 0; @@ -2127,11 +2130,11 @@ test_windows(void) { #ifdef H5_HAVE_WINDOWS - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ + hid_t file = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; + hid_t access_fapl = H5I_INVALID_HID; + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -2255,12 +2258,12 @@ static herr_t test_ros3(void) { #ifdef H5_HAVE_ROS3_VFD - hid_t fid = -1; /* file ID */ - hid_t fapl_id = -1; /* file access property list ID */ - hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ - char filename[1024]; /* filename */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t fapl_id_out = H5I_INVALID_HID; /* from H5Fget_access_plist */ + hid_t driver_id = H5I_INVALID_HID; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + char filename[1024]; /* filename */ H5FD_ros3_fapl_t test_ros3_fa; H5FD_ros3_fapl_t ros3_fa_0 = { /* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION, @@ -4470,51 +4473,51 @@ test_vector_io(const char *vfd_name) bool type_fixed_1 = false; /* types in vector are fixed. */ bool type_fixed_2 = false; /* */ bool verbose = false; - hid_t fapl_id = -1; /* file access property list ID */ - haddr_t eoa; /* file eoa */ - char filename[1024]; /* filename */ - char *buf; /* tmp ptr to buf */ - unsigned flags = 0; /* file open flags */ - H5FD_t *lf = NULL; /* VFD struct ptr */ - uint32_t i; /* index */ - uint32_t j; /* index */ - uint32_t count = VECTOR_LEN; /* length of vectors */ - H5FD_mem_t types_0[VECTOR_LEN]; /* types vector */ - H5FD_mem_t types_1[VECTOR_LEN]; /* types vector */ - H5FD_mem_t types_2[VECTOR_LEN]; /* types vector */ - H5FD_mem_t f_types_0[VECTOR_LEN]; /* fixed types vector */ - H5FD_mem_t f_types_1[VECTOR_LEN]; /* fixed types vector */ - H5FD_mem_t f_types_2[VECTOR_LEN]; /* fixed types vector */ - H5FD_mem_t f_type_0 = H5FD_MEM_NTYPES; /* current type for f vector 0 */ - H5FD_mem_t f_type_1 = H5FD_MEM_NTYPES; /* current type for f vector 1 */ - H5FD_mem_t f_type_2 = H5FD_MEM_NTYPES; /* current type for f vector 2 */ - haddr_t addrs_0[VECTOR_LEN]; /* addresses vector */ - haddr_t addrs_1[VECTOR_LEN]; /* addresses vector */ - haddr_t addrs_2[VECTOR_LEN]; /* addresses vector */ - haddr_t f_addrs_0[VECTOR_LEN]; /* fixed addresses vector */ - haddr_t f_addrs_1[VECTOR_LEN]; /* fixed addresses vector */ - haddr_t f_addrs_2[VECTOR_LEN]; /* fixed addresses vector */ - size_t sizes_0[VECTOR_LEN]; /* sizes vector */ - size_t sizes_1[VECTOR_LEN]; /* sizes vector */ - size_t sizes_2[VECTOR_LEN]; /* sizes vector */ - size_t f_sizes_0[VECTOR_LEN]; /* fixed sizes vector */ - size_t f_sizes_1[VECTOR_LEN]; /* fixed sizes vector */ - size_t f_sizes_2[VECTOR_LEN]; /* fixed sizes vector */ - size_t f_size_0 = 0; /* current size for f vector 0 */ - size_t f_size_1 = 0; /* current size for f vector 1 */ - size_t f_size_2 = 0; /* current size for f vector 2 */ - const void *write_bufs_0[VECTOR_LEN]; /* write bufs vector */ - const void *write_bufs_1[VECTOR_LEN]; /* write bufs vector */ - const void *write_bufs_2[VECTOR_LEN]; /* write bufs vector */ - const void *f_write_bufs_0[VECTOR_LEN]; /* fixed write bufs vector */ - const void *f_write_bufs_1[VECTOR_LEN]; /* fixed write bufs vector */ - const void *f_write_bufs_2[VECTOR_LEN]; /* fixed write bufs vector */ - void *read_bufs_0[VECTOR_LEN]; /* read bufs vector */ - void *read_bufs_1[VECTOR_LEN]; /* read bufs vector */ - void *read_bufs_2[VECTOR_LEN]; /* read bufs vector */ - void *f_read_bufs_0[VECTOR_LEN]; /* fixed read bufs vector */ - void *f_read_bufs_1[VECTOR_LEN]; /* fixed read bufs vector */ - void *f_read_bufs_2[VECTOR_LEN]; /* fixed read bufs vector */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + haddr_t eoa; /* file eoa */ + char filename[1024]; /* filename */ + char *buf; /* tmp ptr to buf */ + unsigned flags = 0; /* file open flags */ + H5FD_t *lf = NULL; /* VFD struct ptr */ + uint32_t i; /* index */ + uint32_t j; /* index */ + uint32_t count = VECTOR_LEN; /* length of vectors */ + H5FD_mem_t types_0[VECTOR_LEN]; /* types vector */ + H5FD_mem_t types_1[VECTOR_LEN]; /* types vector */ + H5FD_mem_t types_2[VECTOR_LEN]; /* types vector */ + H5FD_mem_t f_types_0[VECTOR_LEN]; /* fixed types vector */ + H5FD_mem_t f_types_1[VECTOR_LEN]; /* fixed types vector */ + H5FD_mem_t f_types_2[VECTOR_LEN]; /* fixed types vector */ + H5FD_mem_t f_type_0 = H5FD_MEM_NTYPES; /* current type for f vector 0 */ + H5FD_mem_t f_type_1 = H5FD_MEM_NTYPES; /* current type for f vector 1 */ + H5FD_mem_t f_type_2 = H5FD_MEM_NTYPES; /* current type for f vector 2 */ + haddr_t addrs_0[VECTOR_LEN]; /* addresses vector */ + haddr_t addrs_1[VECTOR_LEN]; /* addresses vector */ + haddr_t addrs_2[VECTOR_LEN]; /* addresses vector */ + haddr_t f_addrs_0[VECTOR_LEN]; /* fixed addresses vector */ + haddr_t f_addrs_1[VECTOR_LEN]; /* fixed addresses vector */ + haddr_t f_addrs_2[VECTOR_LEN]; /* fixed addresses vector */ + size_t sizes_0[VECTOR_LEN]; /* sizes vector */ + size_t sizes_1[VECTOR_LEN]; /* sizes vector */ + size_t sizes_2[VECTOR_LEN]; /* sizes vector */ + size_t f_sizes_0[VECTOR_LEN]; /* fixed sizes vector */ + size_t f_sizes_1[VECTOR_LEN]; /* fixed sizes vector */ + size_t f_sizes_2[VECTOR_LEN]; /* fixed sizes vector */ + size_t f_size_0 = 0; /* current size for f vector 0 */ + size_t f_size_1 = 0; /* current size for f vector 1 */ + size_t f_size_2 = 0; /* current size for f vector 2 */ + const void *write_bufs_0[VECTOR_LEN]; /* write bufs vector */ + const void *write_bufs_1[VECTOR_LEN]; /* write bufs vector */ + const void *write_bufs_2[VECTOR_LEN]; /* write bufs vector */ + const void *f_write_bufs_0[VECTOR_LEN]; /* fixed write bufs vector */ + const void *f_write_bufs_1[VECTOR_LEN]; /* fixed write bufs vector */ + const void *f_write_bufs_2[VECTOR_LEN]; /* fixed write bufs vector */ + void *read_bufs_0[VECTOR_LEN]; /* read bufs vector */ + void *read_bufs_1[VECTOR_LEN]; /* read bufs vector */ + void *read_bufs_2[VECTOR_LEN]; /* read bufs vector */ + void *f_read_bufs_0[VECTOR_LEN]; /* fixed read bufs vector */ + void *f_read_bufs_1[VECTOR_LEN]; /* fixed read bufs vector */ + void *f_read_bufs_2[VECTOR_LEN]; /* fixed read bufs vector */ HDsnprintf(test_title, sizeof(test_title), "vector I/O with %s VFD", vfd_name); @@ -5019,7 +5022,7 @@ static herr_t test_selection_io(const char *vfd_name) { char test_title[80]; - hid_t fapl_id = -1; /* file access property list ID */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ char filename[1024]; /* filename */ unsigned flags = 0; /* file open flags */ H5FD_t *lf = NULL; /* VFD struct ptr */ diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index e7e0cfe7cf5..91859ac93a1 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -245,7 +245,7 @@ parse_options(int argc, char **argv) hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { - hid_t ret_pl = -1; + hid_t ret_pl = H5I_INVALID_HID; herr_t ret; /* generic return value */ int mpi_rank; /* mpi variables */ @@ -3355,16 +3355,16 @@ test_actual_io_mode(int selection_mode) int i; MPI_Comm mpi_comm = MPI_COMM_NULL; MPI_Info mpi_info = MPI_INFO_NULL; - hid_t fid = -1; - hid_t sid = -1; - hid_t dataset = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl_id = -1; - hid_t mem_space = -1; - hid_t file_space = -1; - hid_t dcpl = -1; - hid_t dxpl_write = -1; - hid_t dxpl_read = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t file_space = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl_write = H5I_INVALID_HID; + hid_t dxpl_read = H5I_INVALID_HID; hsize_t dims[MAX_RANK]; hsize_t chunk_dims[MAX_RANK]; hsize_t start[MAX_RANK]; @@ -3867,17 +3867,17 @@ test_no_collective_cause_mode(int selection_mode) int i; MPI_Comm mpi_comm; MPI_Info mpi_info; - hid_t fid = -1; - hid_t sid = -1; - hid_t dataset = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl_id = -1; - hid_t dcpl = -1; - hid_t dxpl_write = -1; - hid_t dxpl_read = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl_write = H5I_INVALID_HID; + hid_t dxpl_read = H5I_INVALID_HID; hsize_t dims[MAX_RANK]; - hid_t mem_space = -1; - hid_t file_space = -1; + hid_t mem_space = H5I_INVALID_HID; + hid_t file_space = H5I_INVALID_HID; hsize_t chunk_dims[MAX_RANK]; herr_t ret; /* set to global value as default */ diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 24721b5415d..2726f91b55c 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -1107,10 +1107,10 @@ single_rank_independent_io(void) if (MAIN_PROCESS) { hsize_t dims[1]; - hid_t file_id = -1; - hid_t fapl_id = -1; - hid_t dset_id = -1; - hid_t fspace_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t fspace_id = H5I_INVALID_HID; herr_t ret; int *data = NULL; uint64_t i; @@ -1181,7 +1181,7 @@ single_rank_independent_io(void) hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { - hid_t ret_pl = -1; + hid_t ret_pl = H5I_INVALID_HID; herr_t ret; /* generic return value */ int mpi_rank; /* mpi variables */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 3659b2bc09e..6a49354bfa5 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -3585,7 +3585,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr { bool success = false; /* will set to true if appropriate. */ bool enable_rpt_fcn = false; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5AC_cache_config_t config; H5AC_cache_config_t test_config; H5F_t *file_ptr = NULL; @@ -4902,7 +4902,7 @@ smoke_check_1(int metadata_write_strategy) bool success = true; int i; int max_nerrors; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; struct mssg_t mssg; @@ -5064,7 +5064,7 @@ smoke_check_2(int metadata_write_strategy) bool success = true; int i; int max_nerrors; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; struct mssg_t mssg; @@ -5267,7 +5267,7 @@ smoke_check_3(int metadata_write_strategy) int max_count; int min_idx; int max_idx; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; struct mssg_t mssg; @@ -5550,7 +5550,7 @@ smoke_check_4(int metadata_write_strategy) int max_count; int min_idx; int max_idx; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; struct mssg_t mssg; @@ -5823,7 +5823,7 @@ smoke_check_5(int metadata_write_strategy) bool success = true; int i; int max_nerrors; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; struct mssg_t mssg; @@ -6095,7 +6095,7 @@ trace_file_check(int metadata_write_strategy) int max_nerrors; size_t expected_line_len; size_t actual_line_len; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; FILE *trace_file_ptr = NULL; @@ -6411,7 +6411,7 @@ smoke_check_6(int metadata_write_strategy) bool success = true; int i; int max_nerrors; - hid_t fid = -1; + hid_t fid = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; struct mssg_t mssg; diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index d103cf71d83..7e144545e42 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -129,7 +129,7 @@ construct_test_file(int test_file_index) const char *fcn_name = "construct_test_file()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -393,11 +393,11 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) int i, j, k, l, m; int data_chunk[CHUNK_SIZE][CHUNK_SIZE]; herr_t status; - hid_t dataspace_id = -1; + hid_t dataspace_id = H5I_INVALID_HID; hid_t filespace_ids[MAX_NUM_DSETS]; - hid_t memspace_id = -1; + hid_t memspace_id = H5I_INVALID_HID; hid_t dataset_ids[MAX_NUM_DSETS]; - hid_t properties = -1; + hid_t properties = H5I_INVALID_HID; hsize_t dims[2]; hsize_t a_size[2]; hsize_t offset[2]; @@ -807,9 +807,9 @@ open_hdf5_file(const bool create_file, const bool mdci_sbem_expected, const bool bool show_progress = false; bool verbose = false; int cp = 0; - hid_t fapl_id = -1; - hid_t fcpl_id = -1; - hid_t file_id = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; herr_t result; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; @@ -1277,12 +1277,12 @@ par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, int mpi_size) hsize_t offset[3]; hsize_t chunk_size[3]; hid_t status; - hid_t dataspace_id = -1; - hid_t memspace_id = -1; - hid_t dset_id = -1; - hid_t filespace_id = -1; - hid_t dcpl_id = -1; - hid_t dxpl_id = -1; + hid_t dataspace_id = H5I_INVALID_HID; + hid_t memspace_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t filespace_id = H5I_INVALID_HID; + hid_t dcpl_id = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; show_progress = (show_progress && (mpi_rank == 0)); verbose = (verbose && (mpi_rank == 0)); @@ -1764,10 +1764,10 @@ par_verify_dataset(int dset_num, hid_t file_id, int mpi_rank) hsize_t a_size[3]; hsize_t offset[3]; hid_t status; - hid_t memspace_id = -1; - hid_t dset_id = -1; - hid_t filespace_id = -1; - hid_t dxpl_id = -1; + hid_t memspace_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t filespace_id = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; show_progress = (show_progress && (mpi_rank == 0)); verbose = (verbose && (mpi_rank == 0)); @@ -2009,7 +2009,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size) int cp = 0; int i; int num_dsets = PAR_NUM_DSETS; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; MPI_Comm dummy_comm = MPI_COMM_WORLD; @@ -2122,9 +2122,9 @@ serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size) hsize_t a_size[3]; hsize_t offset[3]; hid_t status; - hid_t memspace_id = -1; - hid_t dset_id = -1; - hid_t filespace_id = -1; + hid_t memspace_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t filespace_id = H5I_INVALID_HID; HDsnprintf(dset_name, sizeof(dset_name), "/dset%03d", dset_num); @@ -2344,7 +2344,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) int data_chunk[CHUNK_SIZE][CHUNK_SIZE]; herr_t status; hid_t filespace_ids[MAX_NUM_DSETS]; - hid_t memspace_id = -1; + hid_t memspace_id = H5I_INVALID_HID; hid_t dataset_ids[MAX_NUM_DSETS]; hsize_t dims[2]; hsize_t a_size[2]; @@ -2591,7 +2591,7 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) const char *fcn_name = "verify_cache_image_RO()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -2851,7 +2851,7 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) const char *fcn_name = "verify_cache_imageRW()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; @@ -3113,7 +3113,7 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) const char *fcn_name = "smoke_check_1()"; char filename[512]; bool show_progress = false; - hid_t file_id = -1; + hid_t file_id = H5I_INVALID_HID; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 789d9a01d66..51b8a7ae5d0 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -2913,16 +2913,16 @@ test_actual_io_mode(int selection_mode) int i; MPI_Comm mpi_comm = MPI_COMM_NULL; MPI_Info mpi_info = MPI_INFO_NULL; - hid_t fid = -1; - hid_t sid = -1; - hid_t dataset = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl = -1; - hid_t mem_space = -1; - hid_t file_space = -1; - hid_t dcpl = -1; - hid_t dxpl_write = -1; - hid_t dxpl_read = -1; + hid_t fapl = H5I_INVALID_HID; + hid_t mem_space = H5I_INVALID_HID; + hid_t file_space = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl_write = H5I_INVALID_HID; + hid_t dxpl_read = H5I_INVALID_HID; hsize_t dims[RANK]; hsize_t chunk_dims[RANK]; hsize_t start[RANK]; @@ -3453,17 +3453,17 @@ test_no_collective_cause_mode(int selection_mode) int i; MPI_Comm mpi_comm; MPI_Info mpi_info; - hid_t fid = -1; - hid_t sid = -1; - hid_t dataset = -1; + hid_t fid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl = -1; - hid_t dcpl = -1; - hid_t dxpl_write = -1; - hid_t dxpl_read = -1; + hid_t fapl = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl_write = H5I_INVALID_HID; + hid_t dxpl_read = H5I_INVALID_HID; hsize_t dims[RANK]; - hid_t mem_space = -1; - hid_t file_space = -1; + hid_t mem_space = H5I_INVALID_HID; + hid_t file_space = H5I_INVALID_HID; hsize_t chunk_dims[RANK]; herr_t ret; /* set to global value as default */ diff --git a/testpar/t_file.c b/testpar/t_file.c index 67e699991da..89cca67bbf8 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -120,7 +120,7 @@ test_split_comm_access(void) void test_page_buffer_access(void) { - hid_t file_id = -1; /* File ID */ + hid_t file_id = H5I_INVALID_HID; /* File ID */ hid_t fcpl, fapl; size_t page_count = 0; int i, num_elements = 200; diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c index a4d5d3971eb..7be03f66a76 100644 --- a/testpar/t_file_image.c +++ b/testpar/t_file_image.c @@ -67,11 +67,11 @@ file_image_daisy_chain_test(void) int space_ndims; MPI_Status rcvstat; int *vector_ptr = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = H5I_INVALID_HID; hid_t file_id; /* file IDs */ - hid_t dset_id = -1; - hid_t dset_type_id = -1; - hid_t space_id = -1; + hid_t dset_id = H5I_INVALID_HID; + hid_t dset_type_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; herr_t err; hsize_t dims[1]; void *image_ptr = NULL; diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index eabd7621310..9f218175889 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -1806,9 +1806,9 @@ rr_obj_hdr_flush_confusion_writer(MPI_Comm comm) { int i; int j; - hid_t file_id = -1; - hid_t fapl_id = -1; - hid_t dxpl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; hid_t att_id[NUM_DATA_SETS]; hid_t att_space[NUM_DATA_SETS]; hid_t lg_att_id[NUM_DATA_SETS]; @@ -2187,9 +2187,9 @@ rr_obj_hdr_flush_confusion_reader(MPI_Comm comm) { int i; int j; - hid_t file_id = -1; - hid_t fapl_id = -1; - hid_t dxpl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; hid_t lg_att_id[NUM_DATA_SETS]; hid_t lg_att_type[NUM_DATA_SETS]; hid_t disk_space[NUM_DATA_SETS]; diff --git a/testpar/t_pmulti_dset.c b/testpar/t_pmulti_dset.c index 3740f774adc..4d8bc7707ec 100644 --- a/testpar/t_pmulti_dset.c +++ b/testpar/t_pmulti_dset.c @@ -102,10 +102,10 @@ test_pmdset(size_t niter, unsigned flags) size_t max_dsets; size_t buf_size; size_t ndsets; - hid_t file_id = -1; - hid_t fapl_id = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; hid_t dcpl_id[MAX_DSETS]; - hid_t dxpl_id = -1; + hid_t dxpl_id = H5I_INVALID_HID; hsize_t dset_dims[MAX_DSETS][3]; hsize_t chunk_dims[2]; hsize_t max_dims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 5fefcf3d6a6..5a7176a0603 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -92,14 +92,14 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) hsize_t i; hsize_t offset; hsize_t dims[1] = {0}; - hid_t file_id = -1; - hid_t memspace = -1; - hid_t filespace = -1; - hid_t fctmpl = -1; - hid_t fapl_id = -1; - hid_t dxpl_id = -1; - hid_t dset_id = -1; - hid_t dset_id_ch = -1; + hid_t file_id = H5I_INVALID_HID; + hid_t memspace = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; + hid_t fctmpl = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t dset_id_ch = H5I_INVALID_HID; hid_t dcpl_id = H5P_DEFAULT; hsize_t chunk[1]; float nextValue; @@ -486,14 +486,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) int global_failures = 0; int group_size; int group_rank; - hid_t fapl_id = -1; - hid_t file_id = -1; - hid_t dset_id = -1; - hid_t dset_id_ch = -1; + hid_t fapl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t dset_id_ch = H5I_INVALID_HID; hid_t dxpl_id = H5P_DEFAULT; - hid_t memspace = -1; - hid_t filespace = -1; - hid_t filetype = -1; + hid_t memspace = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; + hid_t filetype = H5I_INVALID_HID; size_t filetype_size; hssize_t dset_size; hsize_t i; diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 2882c36eb10..56e2396bee7 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -1701,7 +1701,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i /* int chunk_edge_size = */ -1, /* int small_rank = */ -1, /* int large_rank = */ -1, - /* hid_t dset_type = */ -1, + /* hid_t dset_type = */ H5I_INVALID_HID, /* uint32_t * small_ds_buf_0 = */ NULL, /* uint32_t * small_ds_buf_1 = */ NULL, /* uint32_t * small_ds_buf_2 = */ NULL, @@ -1712,24 +1712,24 @@ contig_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i /* uint32_t * large_ds_slice_buf = */ NULL, /* int small_ds_offset = */ -1, /* int large_ds_offset = */ -1, - /* hid_t fid = */ -1, /* HDF5 file ID */ + /* hid_t fid = */ H5I_INVALID_HID, /* HDF5 file ID */ /* hid_t xfer_plist = */ H5P_DEFAULT, - /* hid_t full_mem_small_ds_sid = */ -1, - /* hid_t full_file_small_ds_sid = */ -1, - /* hid_t mem_small_ds_sid = */ -1, - /* hid_t file_small_ds_sid_0 = */ -1, - /* hid_t file_small_ds_sid_1 = */ -1, - /* hid_t small_ds_slice_sid = */ -1, - /* hid_t full_mem_large_ds_sid = */ -1, - /* hid_t full_file_large_ds_sid = */ -1, - /* hid_t mem_large_ds_sid = */ -1, - /* hid_t file_large_ds_sid_0 = */ -1, - /* hid_t file_large_ds_sid_1 = */ -1, - /* hid_t file_large_ds_process_slice_sid = */ -1, - /* hid_t mem_large_ds_process_slice_sid = */ -1, - /* hid_t large_ds_slice_sid = */ -1, - /* hid_t small_dataset = */ -1, /* Dataset ID */ - /* hid_t large_dataset = */ -1, /* Dataset ID */ + /* hid_t full_mem_small_ds_sid = */ H5I_INVALID_HID, + /* hid_t full_file_small_ds_sid = */ H5I_INVALID_HID, + /* hid_t mem_small_ds_sid = */ H5I_INVALID_HID, + /* hid_t file_small_ds_sid_0 = */ H5I_INVALID_HID, + /* hid_t file_small_ds_sid_1 = */ H5I_INVALID_HID, + /* hid_t small_ds_slice_sid = */ H5I_INVALID_HID, + /* hid_t full_mem_large_ds_sid = */ H5I_INVALID_HID, + /* hid_t full_file_large_ds_sid = */ H5I_INVALID_HID, + /* hid_t mem_large_ds_sid = */ H5I_INVALID_HID, + /* hid_t file_large_ds_sid_0 = */ H5I_INVALID_HID, + /* hid_t file_large_ds_sid_1 = */ H5I_INVALID_HID, + /* hid_t file_large_ds_process_slice_sid = */ H5I_INVALID_HID, + /* hid_t mem_large_ds_process_slice_sid = */ H5I_INVALID_HID, + /* hid_t large_ds_slice_sid = */ H5I_INVALID_HID, + /* hid_t small_dataset = */ H5I_INVALID_HID, /* Dataset ID */ + /* hid_t large_dataset = */ H5I_INVALID_HID, /* Dataset ID */ /* size_t small_ds_size = */ 1, /* size_t small_ds_slice_size = */ 1, /* size_t large_ds_size = */ 1, @@ -3626,7 +3626,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i /* int chunk_edge_size = */ -1, /* int small_rank = */ -1, /* int large_rank = */ -1, - /* hid_t dset_type = */ -1, + /* hid_t dset_type = */ H5I_INVALID_HID, /* uint32_t * small_ds_buf_0 = */ NULL, /* uint32_t * small_ds_buf_1 = */ NULL, /* uint32_t * small_ds_buf_2 = */ NULL, @@ -3637,24 +3637,24 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i /* uint32_t * large_ds_slice_buf = */ NULL, /* int small_ds_offset = */ -1, /* int large_ds_offset = */ -1, - /* hid_t fid = */ -1, /* HDF5 file ID */ + /* hid_t fid = */ H5I_INVALID_HID, /* HDF5 file ID */ /* hid_t xfer_plist = */ H5P_DEFAULT, - /* hid_t full_mem_small_ds_sid = */ -1, - /* hid_t full_file_small_ds_sid = */ -1, - /* hid_t mem_small_ds_sid = */ -1, - /* hid_t file_small_ds_sid_0 = */ -1, - /* hid_t file_small_ds_sid_1 = */ -1, - /* hid_t small_ds_slice_sid = */ -1, - /* hid_t full_mem_large_ds_sid = */ -1, - /* hid_t full_file_large_ds_sid = */ -1, - /* hid_t mem_large_ds_sid = */ -1, - /* hid_t file_large_ds_sid_0 = */ -1, - /* hid_t file_large_ds_sid_1 = */ -1, - /* hid_t file_large_ds_process_slice_sid = */ -1, - /* hid_t mem_large_ds_process_slice_sid = */ -1, - /* hid_t large_ds_slice_sid = */ -1, - /* hid_t small_dataset = */ -1, /* Dataset ID */ - /* hid_t large_dataset = */ -1, /* Dataset ID */ + /* hid_t full_mem_small_ds_sid = */ H5I_INVALID_HID, + /* hid_t full_file_small_ds_sid = */ H5I_INVALID_HID, + /* hid_t mem_small_ds_sid = */ H5I_INVALID_HID, + /* hid_t file_small_ds_sid_0 = */ H5I_INVALID_HID, + /* hid_t file_small_ds_sid_1 = */ H5I_INVALID_HID, + /* hid_t small_ds_slice_sid = */ H5I_INVALID_HID, + /* hid_t full_mem_large_ds_sid = */ H5I_INVALID_HID, + /* hid_t full_file_large_ds_sid = */ H5I_INVALID_HID, + /* hid_t mem_large_ds_sid = */ H5I_INVALID_HID, + /* hid_t file_large_ds_sid_0 = */ H5I_INVALID_HID, + /* hid_t file_large_ds_sid_1 = */ H5I_INVALID_HID, + /* hid_t file_large_ds_process_slice_sid = */ H5I_INVALID_HID, + /* hid_t mem_large_ds_process_slice_sid = */ H5I_INVALID_HID, + /* hid_t large_ds_slice_sid = */ H5I_INVALID_HID, + /* hid_t small_dataset = */ H5I_INVALID_HID, /* Dataset ID */ + /* hid_t large_dataset = */ H5I_INVALID_HID, /* Dataset ID */ /* size_t small_ds_size = */ 1, /* size_t small_ds_slice_size = */ 1, /* size_t large_ds_size = */ 1, @@ -4142,7 +4142,7 @@ parse_options(int argc, char **argv) hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { - hid_t ret_pl = -1; + hid_t ret_pl = H5I_INVALID_HID; herr_t ret; /* generic return value */ int mpi_rank; /* mpi variables */ diff --git a/testpar/t_vfd.c b/testpar/t_vfd.c index d1950a9e96c..cf6c4c948ae 100644 --- a/testpar/t_vfd.c +++ b/testpar/t_vfd.c @@ -349,10 +349,10 @@ setup_vfd_test_file(int file_name_id, char *file_name, int mpi_size, H5FD_mpio_x char filename[512]; int cp = 0; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - unsigned flags = 0; /* file open flags */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + unsigned flags = 0; /* file open flags */ + H5FD_t *lf = NULL; /* VFD struct ptr */ assert(vfd_name); assert(lf_ptr); @@ -732,9 +732,9 @@ vector_read_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ char filename[512]; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; uint32_t count; @@ -962,9 +962,9 @@ vector_read_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ char filename[512]; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; uint32_t count; @@ -1263,9 +1263,9 @@ vector_read_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ int32_t buf_3[(INTS_PER_RANK / 4) + 1]; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; uint32_t count; @@ -1613,9 +1613,9 @@ vector_read_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ haddr_t eoa; haddr_t base_addr; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; @@ -2041,9 +2041,9 @@ vector_read_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ haddr_t eoa; haddr_t base_addr; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; @@ -2279,9 +2279,9 @@ vector_write_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer char filename[512]; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; uint32_t count; @@ -2465,9 +2465,9 @@ vector_write_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer char filename[512]; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; @@ -2718,9 +2718,9 @@ vector_write_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer size_t bytes_per_write; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; @@ -2978,9 +2978,9 @@ vector_write_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer size_t bytes_per_write; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; @@ -3274,9 +3274,9 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer int base_index; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; @@ -3709,9 +3709,9 @@ vector_write_test_6(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer haddr_t eoa; haddr_t base_addr; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int base_index; @@ -3965,9 +3965,9 @@ vector_write_test_7(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer int base_index; haddr_t eoa; bool show_progress = false; - hid_t fapl_id = -1; /* file access property list ID */ - hid_t dxpl_id = -1; /* data access property list ID */ - H5FD_t *lf = NULL; /* VFD struct ptr */ + hid_t fapl_id = H5I_INVALID_HID; /* file access property list ID */ + hid_t dxpl_id = H5I_INVALID_HID; /* data access property list ID */ + H5FD_t *lf = NULL; /* VFD struct ptr */ int cp = 0; int i; int j; diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index fcdf8fe5912..584ca1f6107 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -250,7 +250,7 @@ parse_options(int argc, char **argv) hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { - hid_t ret_pl = -1; + hid_t ret_pl = H5I_INVALID_HID; herr_t ret; /* generic return value */ int mpi_rank; /* mpi variables */