summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-13 23:09:48 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-13 23:10:09 (GMT)
commit341600b4a68dc9dbf11e1c43c3ff2746c200bd2c (patch)
treeb8c1644d019ab10eb862fe477fe09f8c3db9b027 /tools/lib
parentc3c60dc7b5d5104475748f9967135903e3974cc3 (diff)
downloadhdf5-341600b4a68dc9dbf11e1c43c3ff2746c200bd2c.zip
hdf5-341600b4a68dc9dbf11e1c43c3ff2746c200bd2c.tar.gz
hdf5-341600b4a68dc9dbf11e1c43c3ff2746c200bd2c.tar.bz2
Update tools hid_t declarations with H5I_INVALID_HID
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c4
-rw-r--r--tools/lib/h5diff_array.c20
-rw-r--r--tools/lib/h5diff_attr.c8
-rw-r--r--tools/lib/h5diff_dset.c12
-rw-r--r--tools/lib/h5tools.c34
-rw-r--r--tools/lib/h5tools_dump.c22
-rw-r--r--tools/lib/h5tools_type.c4
-rw-r--r--tools/lib/h5tools_utils.c2
-rw-r--r--tools/lib/h5trav.c4
9 files changed, 55 insertions, 55 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 92d2769..d7fc991 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -510,8 +510,8 @@ h5diff(const char *fname1,
const char *objname2,
diff_opt_t *opts)
{
- hid_t file1_id = -1;
- hid_t file2_id = -1;
+ hid_t file1_id = H5I_INVALID_HID;
+ hid_t file2_id = H5I_INVALID_HID;
char filenames[2][MAX_FILENAME];
hsize_t nfound = 0;
int l_ret1 = -1;
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 98b9db3..f671b06 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -487,7 +487,7 @@ static hsize_t diff_datum(
case H5T_COMPOUND:
H5TOOLS_DEBUG("diff_datum H5T_COMPOUND");
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
nmembs = members->n;
for (j = 0; j < nmembs; j++) {
@@ -698,7 +698,7 @@ static hsize_t diff_datum(
*/
case H5T_ARRAY:
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
hsize_t adims[H5S_MAX_RANK];
int ndims;
@@ -734,8 +734,8 @@ static hsize_t diff_datum(
H5TOOLS_GOTO_DONE(opts->err_stat);
}
else if (!iszero1 && !iszero2) {
- hid_t obj1_id = -1;
- hid_t obj2_id = -1;
+ hid_t obj1_id = H5I_INVALID_HID;
+ hid_t obj2_id = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_STD_REF
@@ -744,8 +744,8 @@ static hsize_t diff_datum(
*/
if (H5Tequal(m_type, H5T_STD_REF)) {
/* if (type_size == H5R_STD_REF_SIZE) */
- hid_t region1_id = -1;
- hid_t region2_id = -1;
+ hid_t region1_id = H5I_INVALID_HID;
+ hid_t region2_id = H5I_INVALID_HID;
H5R_ref_t *ref1_buf = (const H5R_ref_t *)_mem1;
H5R_ref_t *ref2_buf = (const H5R_ref_t *)_mem2;
H5O_type_t obj1_type = -1; /* Object type */
@@ -1024,8 +1024,8 @@ static hsize_t diff_datum(
*/
else if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) {
/* if (type_size == H5R_DSET_REG_REF_BUF_SIZE) */
- hid_t region1_id = -1;
- hid_t region2_id = -1;
+ hid_t region1_id = H5I_INVALID_HID;
+ hid_t region2_id = H5I_INVALID_HID;
H5TOOLS_INFO("H5T_STD_REF_DSETREG reference type");
@@ -1113,7 +1113,7 @@ static hsize_t diff_datum(
*/
case H5T_VLEN:
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
H5TOOLS_DEBUG("diff_datum H5T_VLEN");
/* get the VL sequences's base datatype for each element */
@@ -4509,7 +4509,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
static
int ull2float(unsigned long long ull_value, float *f_value)
{
- hid_t dxpl_id = -1;
+ hid_t dxpl_id = H5I_INVALID_HID;
unsigned char *buf = NULL;
size_t src_size;
size_t dst_size;
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 5a85d79..e92e141 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -218,9 +218,9 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
/* close for next turn */
H5Aclose(attr1_id);
- attr1_id = -1;
+ attr1_id = H5I_INVALID_HID;
H5Aclose(attr2_id);
- attr2_id = -1;
+ attr2_id = H5I_INVALID_HID;
} /* end while */
/* list1 did not end */
@@ -244,7 +244,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
/* close for next turn */
H5Aclose(attr1_id);
- attr1_id = -1;
+ attr1_id = H5I_INVALID_HID;
}
/* list2 did not end */
@@ -267,7 +267,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
/* close for next turn */
H5Aclose(attr2_id);
- attr2_id = -1;
+ attr2_id = H5I_INVALID_HID;
}
/*------------------------------------------------------
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 8a6eeeb..f757f92 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -34,10 +34,10 @@ hsize_t diff_dataset(hid_t file1_id,
diff_opt_t *opts)
{
int status = -1;
- hid_t did1 = -1;
- hid_t did2 = -1;
- hid_t dcpl1 = -1;
- hid_t dcpl2 = -1;
+ hid_t did1 = H5I_INVALID_HID;
+ hid_t did2 = H5I_INVALID_HID;
+ hid_t dcpl1 = H5I_INVALID_HID;
+ hid_t dcpl2 = H5I_INVALID_HID;
hsize_t nfound = 0;
diff_err_t ret_value = opts->err_stat;
@@ -814,8 +814,8 @@ int diff_can_type(hid_t f_tid1, /* file data type */
int nmembs1;
int nmembs2;
int j;
- hid_t memb_type1 = -1;
- hid_t memb_type2 = -1;
+ hid_t memb_type1 = H5I_INVALID_HID;
+ hid_t memb_type2 = H5I_INVALID_HID;
H5TOOLS_DEBUG("diff_can_type end - H5T_COMPOUND");
nmembs1 = H5Tget_nmembers(f_tid1);
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 84b8eb8..7aa2419 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -24,11 +24,11 @@
/* global variables */
hid_t H5tools_ERR_STACK_g = 0;
-hid_t H5tools_ERR_CLS_g = -1;
-hid_t H5E_tools_g = -1;
-hid_t H5E_tools_min_id_g = -1;
-hid_t H5E_tools_min_info_id_g = -1;
-hid_t H5E_tools_min_dbg_id_g = -1;
+hid_t H5tools_ERR_CLS_g = H5I_INVALID_HID;
+hid_t H5E_tools_g = H5I_INVALID_HID;
+hid_t H5E_tools_min_id_g = H5I_INVALID_HID;
+hid_t H5E_tools_min_info_id_g = H5I_INVALID_HID;
+hid_t H5E_tools_min_dbg_id_g = H5I_INVALID_HID;
int compound_data;
FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */
FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */
@@ -430,7 +430,7 @@ h5tools_set_error_file(const char *fname, int is_bin)
static hid_t
h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
{
- hid_t new_fapl = -1; /* Copy of file access property list passed in, or new property list */
+ hid_t new_fapl = H5I_INVALID_HID; /* Copy of file access property list passed in, or new property list */
herr_t ret_value = SUCCEED;
/* Make a copy of the FAPL, for the file open call to use, eventually */
@@ -504,7 +504,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
done:
if((new_fapl != H5P_DEFAULT) && (ret_value < 0)) {
H5Pclose(new_fapl);
- new_fapl = -1;
+ new_fapl = H5I_INVALID_HID;
}
return(new_fapl);
@@ -1343,7 +1343,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
mem = ((unsigned char*)_mem) + block_index * size;
for (j = 0; j < nmembs; j++) {
- hid_t memb = -1;
+ hid_t memb = H5I_INVALID_HID;
size_t offset;
offset = H5Tget_member_offset(tid, j);
@@ -1363,7 +1363,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
{
int k, ndims;
hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts;
- hid_t memb = -1;
+ hid_t memb = H5I_INVALID_HID;
H5TOOLS_DEBUG("H5T_ARRAY");
/* get the array's base datatype for each element */
@@ -1397,7 +1397,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
case H5T_VLEN:
{
hsize_t nelmts;
- hid_t memb = -1;
+ hid_t memb = H5I_INVALID_HID;
H5TOOLS_DEBUG("H5T_VLEN");
/* get the VL sequences's base datatype for each element */
@@ -1509,11 +1509,11 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
hsize_t total_size[H5S_MAX_RANK];
unsigned jndx;
size_t type_size;
- hid_t mem_space = -1;
+ hid_t mem_space = H5I_INVALID_HID;
void *region_buf = NULL;
hbool_t past_catch = FALSE;
hsize_t blkndx;
- hid_t sid1 = -1;
+ hid_t sid1 = H5I_INVALID_HID;
int ret_value = -1;
/* Get the dataspace of the dataset */
@@ -1606,8 +1606,8 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
hsize_t *ptdata = NULL;
int sndims;
unsigned ndims;
- hid_t dtype = -1;
- hid_t type_id = -1;
+ hid_t dtype = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
@@ -1674,7 +1674,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
{
hsize_t *dims1 = NULL;
size_t type_size;
- hid_t mem_space = -1;
+ hid_t mem_space = H5I_INVALID_HID;
void *region_buf = NULL;
int ret_value = 0;
@@ -1729,8 +1729,8 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
hsize_t npoints;
int sndims;
unsigned ndims;
- hid_t dtype = -1;
- hid_t type_id = -1;
+ hid_t dtype = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 93f7550..3af2bd8 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -504,8 +504,8 @@ h5tools_print_region_data_blocks(hid_t region_id,
unsigned jndx;
hbool_t past_catch = FALSE;
size_t type_size;
- hid_t mem_space = -1;
- hid_t sid1 = -1;
+ hid_t mem_space = H5I_INVALID_HID;
+ hid_t sid1 = H5I_INVALID_HID;
h5tools_context_t ctx;
void *region_buf = NULL;
int ret_value = 0;
@@ -2062,10 +2062,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_context_t *ctx, hid_t type, int object_search)
{
char *mname;
- hid_t mtype = -1;
- hid_t str_type = -1;
- hid_t super = -1;
- hid_t tmp_type = -1;
+ hid_t mtype = H5I_INVALID_HID;
+ hid_t str_type = H5I_INVALID_HID;
+ hid_t super = H5I_INVALID_HID;
+ hid_t tmp_type = H5I_INVALID_HID;
int snmembers;
int sndims;
unsigned nmembers;
@@ -2734,8 +2734,8 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
unsigned i;
unsigned nmembs = 0; /*number of members */
int snmembs;
- hid_t super = -1; /*enum base integer type */
- hid_t native = -1; /*native integer datatype */
+ hid_t super = H5I_INVALID_HID; /*enum base integer type */
+ hid_t native = H5I_INVALID_HID; /*native integer datatype */
H5T_sign_t sign_type; /*sign of value type */
size_t type_size; /*value type size */
size_t dst_size; /*destination value type size */
@@ -3074,7 +3074,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t
h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id)
{
size_t size;
- hid_t n_type = -1;
+ hid_t n_type = H5I_INVALID_HID;
void *buf = NULL;
n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT);
@@ -3776,8 +3776,8 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex
error_msg("unable to open attribute \"%s\"\n", attr_name);
}
else {
- hid_t type = -1;
- hid_t space = -1;
+ hid_t type = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
ctx->indent_level++;
diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c
index f63c228..22e4a39 100644
--- a/tools/lib/h5tools_type.c
+++ b/tools/lib/h5tools_type.c
@@ -26,7 +26,7 @@
hid_t
h5tools_get_little_endian_type(hid_t tid)
{
- hid_t p_type=-1;
+ hid_t p_type=H5I_INVALID_HID;
H5T_class_t type_class;
size_t size;
H5T_sign_t sign;
@@ -106,7 +106,7 @@ h5tools_get_little_endian_type(hid_t tid)
hid_t
h5tools_get_big_endian_type(hid_t tid)
{
- hid_t p_type = -1;
+ hid_t p_type = H5I_INVALID_HID;
H5T_class_t type_class;
size_t size;
H5T_sign_t sign;
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 1036199..323c9b3 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -721,7 +721,7 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen
case H5O_TYPE_DATASET:
if(NULL == already_seen) {
- hid_t dset = -1;
+ hid_t dset = H5I_INVALID_HID;
/* Add the dataset to the list of objects */
add_obj(info->dset_table, oinfo->addr, name, TRUE);
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 1ecd5c0..fb768a4 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -834,8 +834,8 @@ trav_attr(hid_t
#ifdef H5TRAV_PRINT_SPACE
}
else {
- hid_t attr = -1;
- hid_t space = -1;
+ hid_t attr = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
hsize_t size[H5S_MAX_RANK];
int ndims;
int i;