summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 00:42:48 (GMT)
committerGitHub <noreply@github.com>2023-06-28 00:42:48 (GMT)
commitd278ce1f21903c33c6b28e8acb827e94275d4421 (patch)
treed52c322015ac8ce3b8fb992958ab8be1f13d4886 /hl
parent942739e6fbea0ebf736c35f461e1386396b54e11 (diff)
downloadhdf5-d278ce1f21903c33c6b28e8acb827e94275d4421.zip
hdf5-d278ce1f21903c33c6b28e8acb827e94275d4421.tar.gz
hdf5-d278ce1f21903c33c6b28e8acb827e94275d4421.tar.bz2
Remove HD/hbool_t from high-level lib (#3183)
Diffstat (limited to 'hl')
-rw-r--r--hl/fortran/src/H5DSfc.c12
-rw-r--r--hl/fortran/src/H5IMcc.c4
-rw-r--r--hl/fortran/src/H5IMfc.c34
-rw-r--r--hl/fortran/src/H5LTfc.c68
-rw-r--r--hl/fortran/src/H5TBfc.c108
-rw-r--r--hl/src/H5DO.c10
-rw-r--r--hl/src/H5DS.c194
-rw-r--r--hl/src/H5IM.c34
-rw-r--r--hl/src/H5LD.c84
-rw-r--r--hl/src/H5LT.c314
-rw-r--r--hl/src/H5LTanalyze.c156
-rw-r--r--hl/src/H5LTanalyze.l14
-rw-r--r--hl/src/H5LTparse.c184
-rw-r--r--hl/src/H5LTparse.h2
-rw-r--r--hl/src/H5LTparse.y26
-rw-r--r--hl/src/H5LTprivate.h2
-rw-r--r--hl/src/H5PT.c18
-rw-r--r--hl/src/H5TB.c130
-rw-r--r--hl/test/gen_test_ds.c16
-rw-r--r--hl/test/gen_test_ld.c6
-rw-r--r--hl/test/h5hltest.h8
-rw-r--r--hl/test/test_ds.c472
-rw-r--r--hl/test/test_dset_append.c14
-rw-r--r--hl/test/test_file_image.c72
-rw-r--r--hl/test/test_h5do_compat.c10
-rw-r--r--hl/test/test_image.c158
-rw-r--r--hl/test/test_ld.c60
-rw-r--r--hl/test/test_lite.c223
-rw-r--r--hl/test/test_packet.c14
-rw-r--r--hl/test/test_packet_vlen.c161
-rw-r--r--hl/test/test_table.c63
-rw-r--r--hl/tools/gif2h5/hdf2gif.c2
-rw-r--r--hl/tools/h5watch/extend_dset.c60
-rw-r--r--hl/tools/h5watch/h5watch.c165
-rw-r--r--hl/tools/h5watch/h5watchgentest.c16
35 files changed, 1455 insertions, 1459 deletions
diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c
index 9ebd322..8029d34 100644
--- a/hl/fortran/src/H5DSfc.c
+++ b/hl/fortran/src/H5DSfc.c
@@ -54,7 +54,7 @@ h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen)
done:
if (c_dimname)
- HDfree(c_dimname);
+ free(c_dimname);
return ret_value;
@@ -231,7 +231,7 @@ h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen)
done:
if (c_label)
- HDfree(c_label);
+ free(c_label);
return ret_value;
@@ -262,7 +262,7 @@ h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size)
/*
* Allocate buffer to hold label
*/
- if ((c_label = (char *)HDmalloc((size_t)*size + 1)) == NULL)
+ if ((c_label = (char *)malloc((size_t)*size + 1)) == NULL)
HGOTO_DONE(FAIL);
/*
@@ -282,7 +282,7 @@ done:
*size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the
* trailing NULL in the length calculation, Ref. HDFFV-7596 */
if (c_label)
- HDfree(c_label);
+ free(c_label);
return ret_value;
} /* end h5dsget_label_c() */
@@ -312,7 +312,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size)
/*
* Allocate buffer to hold name
*/
- if ((c_scale_name = (char *)HDmalloc((size_t)*size + 1)) == NULL)
+ if ((c_scale_name = (char *)malloc((size_t)*size + 1)) == NULL)
HGOTO_DONE(FAIL);
/*
@@ -330,7 +330,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size)
done:
if (c_scale_name)
- HDfree(c_scale_name);
+ free(c_scale_name);
return ret_value;
} /* end h5dsget_scale_name_c() */
diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c
index 2084826..53c1f69 100644
--- a/hl/fortran/src/H5IMcc.c
+++ b/hl/fortran/src/H5IMcc.c
@@ -469,7 +469,7 @@ H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hid_t tid
dim_ref = (size_t)n_refs;
- refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * dim_ref);
+ refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * dim_ref);
if (H5Aread(attr_id, attr_type, refbuf) < 0)
goto out;
@@ -489,7 +489,7 @@ H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hid_t tid
if (H5Dclose(pal_id) < 0)
goto out;
- HDfree(refbuf);
+ free(refbuf);
} /* H5T_REFERENCE */
diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c
index cead871..1e060ad 100644
--- a/hl/fortran/src/H5IMfc.c
+++ b/hl/fortran/src/H5IMfc.c
@@ -63,7 +63,7 @@ h5immake_image_8bit_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -110,7 +110,7 @@ h5imread_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *buf)
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -168,9 +168,9 @@ h5immake_image_24bit_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_il != NULL)
- HDfree(c_il);
+ free(c_il);
return ret_value;
}
@@ -215,7 +215,7 @@ h5imget_image_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *w
/*
* allocate buffer to hold name of an attribute
*/
- if ((c_buf = (char *)HDmalloc((size_t)*ilen + 1)) == NULL)
+ if ((c_buf = (char *)malloc((size_t)*ilen + 1)) == NULL)
goto done;
/*
@@ -242,9 +242,9 @@ h5imget_image_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *w
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_buf != NULL)
- HDfree(c_buf);
+ free(c_buf);
return ret_value;
}
@@ -287,7 +287,7 @@ h5imis_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name)
ret = H5IMis_image(c_loc_id, c_name);
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret;
}
@@ -334,7 +334,7 @@ h5immake_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dim
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -389,9 +389,9 @@ h5imlink_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_namepal != NULL)
- HDfree(c_namepal);
+ free(c_namepal);
return ret_value;
}
@@ -446,9 +446,9 @@ h5imunlink_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *il
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_namepal != NULL)
- HDfree(c_namepal);
+ free(c_namepal);
return ret_value;
}
@@ -501,7 +501,7 @@ h5imget_npalettes_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *np
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -557,7 +557,7 @@ h5imget_palette_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -607,7 +607,7 @@ h5imget_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal_numb
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -650,7 +650,7 @@ h5imis_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name)
ret = H5IMis_palette(c_loc_id, c_name);
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret;
}
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index c888eec..e6d7b3a 100644
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -49,7 +49,7 @@ h5ltmake_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank, h
if (c_name == NULL)
goto done;
- c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * ((size_t)*rank));
+ c_dims = (hsize_t *)malloc(sizeof(hsize_t) * ((size_t)*rank));
if (c_dims == NULL)
goto done;
/*
@@ -71,9 +71,9 @@ h5ltmake_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank, h
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_dims != NULL)
- HDfree(c_dims);
+ free(c_dims);
return ret_value;
}
@@ -124,7 +124,7 @@ h5ltread_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hid_t_f *type_
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -179,9 +179,9 @@ h5ltmake_dataset_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_buf != NULL)
- HDfree(c_buf);
+ free(c_buf);
return ret_value;
}
@@ -231,7 +231,7 @@ h5ltread_dataset_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, char *b
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -281,7 +281,7 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
c_loc_id = (hid_t)*loc_id;
c_size = (size_t)*size;
- if (HDstrncmp(dtype, "I", 1) == 0) {
+ if (strncmp(dtype, "I", 1) == 0) {
if ((size_t)*sizeof_val == sizeof(int))
ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_INT,
(const int *)buf);
@@ -296,7 +296,7 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
else
goto done;
}
- else if (HDstrncmp(dtype, "R", 1) == 0) {
+ else if (strncmp(dtype, "R", 1) == 0) {
if ((size_t)*sizeof_val == sizeof(float))
ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_FLOAT,
(const float *)buf);
@@ -309,7 +309,7 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
else
goto done;
}
- else if (HDstrncmp(dtype, "C", 1) == 0) {
+ else if (strncmp(dtype, "C", 1) == 0) {
c_buf = (char *)HD5f2cstring((_fcd)buf, c_size);
if (c_buf == NULL)
@@ -324,11 +324,11 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_attrname != NULL)
- HDfree(c_attrname);
+ free(c_attrname);
if (c_buf != NULL)
- HDfree(c_buf);
+ free(c_buf);
return ret_value;
}
@@ -375,7 +375,7 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
*/
c_loc_id = (hid_t)*loc_id;
- if (HDstrncmp(dtype, "I", 1) == 0) {
+ if (strncmp(dtype, "I", 1) == 0) {
if ((size_t)*sizeof_val == sizeof(int))
ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_INT, buf);
else if ((size_t)*sizeof_val == sizeof(long))
@@ -387,7 +387,7 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
else
goto done;
}
- else if (HDstrncmp(dtype, "R", 1) == 0) {
+ else if (strncmp(dtype, "R", 1) == 0) {
if ((size_t)*sizeof_val == sizeof(float))
ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_FLOAT, buf);
else if ((size_t)*sizeof_val == sizeof(double))
@@ -405,9 +405,9 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_attrname != NULL)
- HDfree(c_attrname);
+ free(c_attrname);
return ret_value;
}
@@ -451,7 +451,7 @@ h5ltget_attribute_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, si
/*
* Allocate buffer to hold C attribute string
*/
- if ((c_buf = (char *)HDmalloc((size_t)*buf_size + 1)) == NULL)
+ if ((c_buf = (char *)malloc((size_t)*buf_size + 1)) == NULL)
goto done;
/*
@@ -470,11 +470,11 @@ h5ltget_attribute_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, si
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_attrname != NULL)
- HDfree(c_attrname);
+ free(c_attrname);
if (c_buf != NULL)
- HDfree(c_buf);
+ free(c_buf);
return ret_value;
}
@@ -526,7 +526,7 @@ h5ltget_dataset_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *ra
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -569,7 +569,7 @@ h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name)
ret = H5LTfind_dataset(c_loc_id, c_name);
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret;
}
@@ -639,7 +639,7 @@ h5ltget_dataset_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -697,9 +697,9 @@ h5ltget_attribute_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, siz
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_attrname != NULL)
- HDfree(c_attrname);
+ free(c_attrname);
return ret_value;
}
@@ -774,9 +774,9 @@ h5ltget_attribute_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f
done:
if (c_name != NULL)
- HDfree(c_name);
+ free(c_name);
if (c_attrname != NULL)
- HDfree(c_attrname);
+ free(c_attrname);
return ret_value;
}
@@ -800,9 +800,9 @@ done:
int_f
h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_object_valid_c)
{
- htri_t ret = -1;
- char *c_path = NULL;
- hbool_t check_object_valid;
+ htri_t ret = -1;
+ char *c_path = NULL;
+ bool check_object_valid;
/*
* convert FORTRAN name to C name
@@ -810,9 +810,9 @@ h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_obj
if (NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen)))
goto done;
- check_object_valid = FALSE;
+ check_object_valid = false;
if (*check_object_valid_c == 1)
- check_object_valid = TRUE;
+ check_object_valid = true;
/*
* call H5LTpath_valid function.
@@ -821,7 +821,7 @@ h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_obj
done:
if (c_path != NULL)
- HDfree(c_path);
+ free(c_path);
return (int_f)ret;
}
diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c
index 588638c..5d4212d 100644
--- a/hl/fortran/src/H5TBfc.c
+++ b/hl/fortran/src/H5TBfc.c
@@ -61,9 +61,9 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name
HGOTO_DONE(FAIL)
if (NULL == (c_name1 = (char *)HD5f2cstring(name1, (size_t)*namelen1)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
+ if (NULL == (c_field_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_types = (hid_t *)HDmalloc(sizeof(hid_t) * (size_t)c_nfields)))
+ if (NULL == (c_field_types = (hid_t *)malloc(sizeof(hid_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
for (i = 0; i < num_elem; i++) {
@@ -74,7 +74,7 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name
/*
* allocate array of character pointers
*/
- if (NULL == (c_field_names = (char **)HDcalloc((size_t)num_elem, sizeof(char *))))
+ if (NULL == (c_field_names = (char **)calloc((size_t)num_elem, sizeof(char *))))
HGOTO_DONE(FAIL)
/* copy data to long C string */
@@ -86,9 +86,9 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name
*/
tmp_p = tmp;
for (i = 0; i < num_elem; i++) {
- if (NULL == (c_field_names[i] = (char *)HDmalloc((size_t)char_len_field_names[i] + 1)))
+ if (NULL == (c_field_names[i] = (char *)malloc((size_t)char_len_field_names[i] + 1)))
HGOTO_DONE(FAIL)
- HDmemcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]);
+ memcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]);
c_field_names[i][char_len_field_names[i]] = '\0';
tmp_p = tmp_p + *max_char_size_field_names;
} /* end for */
@@ -103,22 +103,22 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_name1)
- HDfree(c_name1);
+ free(c_name1);
if (c_field_names) {
for (i = 0; i < num_elem; i++) {
if (c_field_names[i])
- HDfree(c_field_names[i]);
+ free(c_field_names[i]);
} /* end for */
- HDfree(c_field_names);
+ free(c_field_names);
} /* end if */
if (tmp)
- HDfree(tmp);
+ free(tmp);
if (c_field_offset)
- HDfree(c_field_offset);
+ free(c_field_offset);
if (c_field_types)
- HDfree(c_field_types);
+ free(c_field_types);
return ret_value;
} /* end h5tbmake_table_c() */
@@ -166,9 +166,9 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *
HGOTO_DONE(FAIL)
if (NULL == (c_name1 = (char *)HD5f2cstring(name1, (size_t)*namelen1)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
+ if (NULL == (c_field_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_types = (hid_t *)HDmalloc(sizeof(hid_t) * (size_t)c_nfields)))
+ if (NULL == (c_field_types = (hid_t *)malloc(sizeof(hid_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
for (i = 0; i < num_elem; i++) {
@@ -179,7 +179,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *
/*
* allocate array of character pointers
*/
- if (NULL == (c_field_names = (char **)HDcalloc((size_t)num_elem, sizeof(char *))))
+ if (NULL == (c_field_names = (char **)calloc((size_t)num_elem, sizeof(char *))))
HGOTO_DONE(FAIL)
/* copy data to long C string */
@@ -191,9 +191,9 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *
*/
tmp_p = tmp;
for (i = 0; i < num_elem; i++) {
- if (NULL == (c_field_names[i] = (char *)HDmalloc((size_t)char_len_field_names[i] + 1)))
+ if (NULL == (c_field_names[i] = (char *)malloc((size_t)char_len_field_names[i] + 1)))
HGOTO_DONE(FAIL)
- HDmemcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]);
+ memcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]);
c_field_names[i][char_len_field_names[i]] = '\0';
tmp_p = tmp_p + *max_char_size_field_names;
} /* end for */
@@ -208,22 +208,22 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_name1)
- HDfree(c_name1);
+ free(c_name1);
if (c_field_names) {
for (i = 0; i < num_elem; i++) {
if (c_field_names[i])
- HDfree(c_field_names[i]);
+ free(c_field_names[i]);
} /* end for */
- HDfree(c_field_names);
+ free(c_field_names);
} /* end if */
if (tmp)
- HDfree(tmp);
+ free(tmp);
if (c_field_offset)
- HDfree(c_field_offset);
+ free(c_field_offset);
if (c_field_types)
- HDfree(c_field_types);
+ free(c_field_types);
return ret_value;
} /* end h5tbmake_table_c() */
@@ -260,9 +260,9 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel
if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
- if (NULL == (c_dst_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
+ if (NULL == (c_dst_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
- if (NULL == (c_dst_sizes = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
+ if (NULL == (c_dst_sizes = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
for (i = 0; i < c_nfields; i++) {
@@ -278,12 +278,12 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_dst_offset)
- HDfree(c_dst_offset);
+ free(c_dst_offset);
if (c_dst_sizes)
- HDfree(c_dst_sizes);
+ free(c_dst_sizes);
return ret_value;
} /* end h5tbmake_table_c() */
@@ -329,9 +329,9 @@ h5tbwrite_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_name1)
- HDfree(c_name1);
+ free(c_name1);
return ret_value;
}
@@ -377,9 +377,9 @@ h5tbread_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *n
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_name1)
- HDfree(c_name1);
+ free(c_name1);
return ret_value;
}
@@ -423,7 +423,7 @@ h5tbwrite_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *fi
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -467,7 +467,7 @@ h5tbread_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *fie
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -512,9 +512,9 @@ h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_name1)
- HDfree(c_name1);
+ free(c_name1);
return ret_value;
}
@@ -557,9 +557,9 @@ h5tbdelete_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_name1)
- HDfree(c_name1);
+ free(c_name1);
return ret_value;
}
@@ -604,7 +604,7 @@ h5tbget_table_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
return ret_value;
}
@@ -655,15 +655,15 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n
*/
if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_offsets = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
+ if (NULL == (c_field_offsets = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_sizes = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
+ if (NULL == (c_field_sizes = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
- if (NULL == (c_field_names = (char **)HDcalloc((size_t)c_nfields, sizeof(char *))))
+ if (NULL == (c_field_names = (char **)calloc((size_t)c_nfields, sizeof(char *))))
HGOTO_DONE(FAIL)
for (i = 0; i < c_nfields; i++)
- if (NULL == (c_field_names[i] = (char *)HDmalloc(sizeof(char) * HLTB_MAX_FIELD_LEN)))
+ if (NULL == (c_field_names[i] = (char *)malloc(sizeof(char) * HLTB_MAX_FIELD_LEN)))
HGOTO_DONE(FAIL)
/*
@@ -676,15 +676,15 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n
/* return values */
/* names array */
- if (NULL == (tmp = (char *)HDmalloc((c_lenmax * (size_t)c_nfields) + 1)))
+ if (NULL == (tmp = (char *)malloc((c_lenmax * (size_t)c_nfields) + 1)))
HGOTO_DONE(FAIL)
tmp_p = tmp;
- HDmemset(tmp, ' ', c_lenmax * (size_t)c_nfields);
+ memset(tmp, ' ', c_lenmax * (size_t)c_nfields);
tmp[c_lenmax * c_nfields] = '\0';
for (i = 0; i < c_nfields; i++) {
- size_t field_name_len = HDstrlen(c_field_names[i]);
+ size_t field_name_len = strlen(c_field_names[i]);
- HDmemcpy(tmp_p, c_field_names[i], field_name_len);
+ memcpy(tmp_p, c_field_names[i], field_name_len);
namelen2[i] = (size_t_f)field_name_len;
length = MAX(length, strlen((c_field_names[i])));
tmp_p = tmp_p + c_lenmax;
@@ -702,19 +702,19 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n
done:
if (c_name)
- HDfree(c_name);
+ free(c_name);
if (c_field_names) {
for (i = 0; i < num_elem; i++)
if (c_field_names[i])
- HDfree(c_field_names[i]);
- HDfree(c_field_names);
+ free(c_field_names[i]);
+ free(c_field_names);
} /* end if */
if (tmp)
- HDfree(tmp);
+ free(tmp);
if (c_field_offsets)
- HDfree(c_field_offsets);
+ free(c_field_offsets);
if (c_field_sizes)
- HDfree(c_field_sizes);
+ free(c_field_sizes);
return ret_value;
}
diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c
index 580c6a1..9c6928e 100644
--- a/hl/src/H5DO.c
+++ b/hl/src/H5DO.c
@@ -120,7 +120,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
hsize_t *boundary = NULL; /* Boundary set in append flush property */
H5D_append_cb_t append_cb; /* Callback function set in append flush property */
void *udata; /* User data set in append flush property */
- hbool_t hit = FALSE; /* Boundary is hit or not */
+ bool hit = false; /* Boundary is hit or not */
hsize_t k; /* Local index variable */
unsigned u; /* Local index variable */
herr_t ret_value = FAIL; /* Return value */
@@ -131,7 +131,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
/* If the user passed in a default DXPL, sanity check it */
if (H5P_DEFAULT != dxpl_id)
- if (TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
+ if (true != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
goto done;
/* Get the dataspace of the dataset */
@@ -199,7 +199,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
goto done;
/* Allocate the boundary array */
- boundary = (hsize_t *)HDmalloc(ndims * sizeof(hsize_t));
+ boundary = (hsize_t *)malloc(ndims * sizeof(hsize_t));
/* Retrieve the append flush property */
if (H5Pget_append_flush(dapl, ndims, boundary, &append_cb, &udata) < 0)
@@ -211,7 +211,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
/* Determine whether a boundary is hit or not */
for (k = start[axis]; k < size[axis]; k++)
if (!((k + 1) % boundary[axis])) {
- hit = TRUE;
+ hit = true;
break;
}
@@ -247,7 +247,7 @@ done:
ret_value = FAIL;
if (boundary)
- HDfree(boundary);
+ free(boundary);
return ret_value;
} /* H5DOappend() */
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index c576573..0a3fa5f 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -16,7 +16,7 @@
#include "H5TBprivate.h"
/* Local routines */
-static herr_t H5DS_is_reserved(hid_t did, hbool_t *is_reserved);
+static herr_t H5DS_is_reserved(hid_t did, bool *is_reserved);
/*-------------------------------------------------------------------------
* Function: H5DSwith_new_ref
@@ -34,8 +34,8 @@ static herr_t H5DS_is_reserved(hid_t did, hbool_t *is_reserved);
herr_t
H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref)
{
- hbool_t config_flag = FALSE;
- hbool_t native = FALSE;
+ bool config_flag = false;
+ bool native = false;
if (!with_new_ref)
return FAIL;
@@ -44,7 +44,7 @@ H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref)
return FAIL;
#ifdef H5_DIMENSION_SCALES_WITH_NEW_REF
- config_flag = TRUE;
+ config_flag = true;
#endif
*with_new_ref = (config_flag || !native);
@@ -161,7 +161,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
nds_list_t *ndsbuf_w = NULL;
H5R_ref_t nref_to_ds = {0};
H5R_ref_t nref_j;
- hbool_t is_new_ref;
+ bool is_new_ref;
hvl_t *buf = NULL; /* VL buffer to store in the attribute */
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
@@ -171,7 +171,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
size_t len;
int found_ds = 0;
htri_t is_scale;
- hbool_t is_reserved;
+ bool is_reserved;
/*-------------------------------------------------------------------------
* parameter checking
@@ -227,7 +227,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
/* Check if the dataset is a "reserved" dataset (image, table) */
if (H5DS_is_reserved(did, &is_reserved) < 0)
return FAIL;
- if (is_reserved == TRUE)
+ if (is_reserved == true)
return FAIL;
/*-------------------------------------------------------------------------
@@ -310,7 +310,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
if (buf == NULL)
goto out;
@@ -322,11 +322,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
/* store the REF information in the index of the dataset that has the DS */
buf[idx].len = 1;
if (is_new_ref) {
- buf[idx].p = HDmalloc(1 * sizeof(H5R_ref_t));
+ buf[idx].p = malloc(1 * sizeof(H5R_ref_t));
((H5R_ref_t *)buf[idx].p)[0] = nref_to_ds;
}
else {
- buf[idx].p = HDmalloc(1 * sizeof(hobj_ref_t));
+ buf[idx].p = malloc(1 * sizeof(hobj_ref_t));
((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
}
/* write the attribute with the reference */
@@ -344,9 +344,9 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- HDfree(buf[idx].p);
+ free(buf[idx].p);
buf[idx].p = NULL;
- HDfree(buf);
+ free(buf);
buf = NULL;
}
@@ -366,7 +366,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
if (buf == NULL)
goto out;
@@ -421,11 +421,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
buf[idx].len++;
len = buf[idx].len;
if (is_new_ref) {
- buf[idx].p = HDrealloc(buf[idx].p, len * sizeof(H5R_ref_t));
+ buf[idx].p = realloc(buf[idx].p, len * sizeof(H5R_ref_t));
((H5R_ref_t *)buf[idx].p)[len - 1] = nref_to_ds;
}
else {
- buf[idx].p = HDrealloc(buf[idx].p, len * sizeof(hobj_ref_t));
+ buf[idx].p = realloc(buf[idx].p, len * sizeof(hobj_ref_t));
((hobj_ref_t *)buf[idx].p)[len - 1] = ref_to_ds;
}
} /* end if */
@@ -433,11 +433,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
/* store the REF information in the index of the dataset that has the DS */
buf[idx].len = 1;
if (is_new_ref) {
- buf[idx].p = HDmalloc(sizeof(H5R_ref_t));
+ buf[idx].p = malloc(sizeof(H5R_ref_t));
((H5R_ref_t *)buf[idx].p)[0] = nref_to_ds;
}
else {
- buf[idx].p = HDmalloc(sizeof(hobj_ref_t));
+ buf[idx].p = malloc(sizeof(hobj_ref_t));
((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
}
} /* end else */
@@ -460,7 +460,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- HDfree(buf);
+ free(buf);
buf = NULL;
} /* has_dimlist */
@@ -554,14 +554,14 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
nelmts++;
if (is_new_ref) {
- ndsbuf = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t));
+ ndsbuf = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t));
if (ndsbuf == NULL)
goto out;
if (H5Aread(aid, ntid, ndsbuf) < 0)
goto out;
}
else {
- dsbuf = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t));
if (dsbuf == NULL)
goto out;
if (H5Aread(aid, ntid, dsbuf) < 0)
@@ -580,12 +580,12 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
/* Allocate new buffer to copy old references and add new one */
if (is_new_ref) {
- ndsbuf_w = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t));
+ ndsbuf_w = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t));
if (ndsbuf_w == NULL)
goto out;
}
else {
- dsbuf_w = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf_w = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t));
if (dsbuf_w == NULL)
goto out;
}
@@ -653,15 +653,15 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
if (H5Tclose(ntid) < 0)
goto out;
if (is_new_ref) {
- HDfree(ndsbuf);
+ free(ndsbuf);
dsbuf = NULL;
- HDfree(ndsbuf_w);
+ free(ndsbuf_w);
dsbuf = NULL;
}
else {
- HDfree(dsbuf);
+ free(dsbuf);
dsbuf = NULL;
- HDfree(dsbuf_w);
+ free(dsbuf_w);
dsbuf = NULL;
}
} /* has_reflist */
@@ -684,11 +684,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
/* error zone */
out:
if (buf)
- HDfree(buf);
+ free(buf);
if (dsbuf)
- HDfree(dsbuf);
+ free(dsbuf);
if (dsbuf_w)
- HDfree(dsbuf_w);
+ free(dsbuf_w);
H5E_BEGIN_TRY
{
@@ -754,7 +754,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
int found_dset = 0, found_ds = 0;
int have_ds = 0;
htri_t is_scale;
- hbool_t is_new_ref;
+ bool is_new_ref;
unsigned int tmp_idx;
hid_t tmp_id;
@@ -853,7 +853,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
if (buf == NULL)
goto out;
@@ -915,7 +915,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
}
len = --buf[idx].len;
if (len == 0) {
- HDfree(buf[idx].p);
+ free(buf[idx].p);
buf[idx].p = NULL;
}
/* Since a reference to a dim. scale can be inserted only once,
@@ -958,7 +958,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
if (H5Aclose(aid) < 0)
goto out;
- HDfree(buf);
+ free(buf);
buf = NULL;
/*-------------------------------------------------------------------------
@@ -984,22 +984,22 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
if (is_new_ref) {
- ndsbuf = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t));
+ ndsbuf = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t));
if (ndsbuf == NULL)
goto out;
if (H5Aread(aid, ntid, ndsbuf) < 0)
goto out;
- ndsbuf_w = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t));
+ ndsbuf_w = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t));
if (ndsbuf_w == NULL)
goto out;
}
else {
- dsbuf = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t));
if (dsbuf == NULL)
goto out;
if (H5Aread(aid, ntid, dsbuf) < 0)
goto out;
- dsbuf_w = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf_w = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t));
if (dsbuf_w == NULL)
goto out;
}
@@ -1152,14 +1152,14 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
if (H5Tclose(ntid) < 0)
goto out;
if (is_new_ref) {
- HDfree(ndsbuf);
- HDfree(ndsbuf_w);
+ free(ndsbuf);
+ free(ndsbuf_w);
ndsbuf = NULL;
ndsbuf_w = NULL;
}
else {
- HDfree(dsbuf);
- HDfree(dsbuf_w);
+ free(dsbuf);
+ free(dsbuf_w);
dsbuf = NULL;
dsbuf_w = NULL;
}
@@ -1176,15 +1176,15 @@ out:
H5Tclose(tid);
if (ndsbuf) {
- HDfree(ndsbuf);
+ free(ndsbuf);
ndsbuf = NULL;
}
if (ndsbuf_w) {
- HDfree(ndsbuf_w);
+ free(ndsbuf_w);
ndsbuf_w = NULL;
}
if (dsbuf) {
- HDfree(dsbuf);
+ free(dsbuf);
dsbuf = NULL;
}
if (buf) {
@@ -1192,9 +1192,9 @@ out:
free the pointers allocated when we read data in */
for (i = 0; i < rank; i++) {
if (buf[i].p)
- HDfree(buf[i].p);
+ free(buf[i].p);
}
- HDfree(buf);
+ free(buf);
buf = NULL;
}
}
@@ -1247,7 +1247,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
int i;
int found_dset = 0, found_ds = 0;
htri_t is_scale;
- hbool_t is_new_ref;
+ bool is_new_ref;
/*-------------------------------------------------------------------------
* parameter checking
@@ -1337,7 +1337,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
if (buf == NULL)
goto out;
@@ -1396,7 +1396,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- HDfree(buf);
+ free(buf);
buf = NULL;
} /* has_dimlist */
@@ -1433,14 +1433,14 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
goto out;
if (is_new_ref) {
- ndsbuf = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t));
+ ndsbuf = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t));
if (ndsbuf == NULL)
goto out;
if (H5Aread(aid, ntid, ndsbuf) < 0)
goto out;
}
else {
- dsbuf = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t));
+ dsbuf = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t));
if (dsbuf == NULL)
goto out;
if (H5Aread(aid, ntid, dsbuf) < 0)
@@ -1515,11 +1515,11 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
goto out;
if (ndsbuf) {
- HDfree(ndsbuf);
+ free(ndsbuf);
ndsbuf = NULL;
}
if (dsbuf) {
- HDfree(dsbuf);
+ free(dsbuf);
dsbuf = NULL;
}
} /* has_reflist */
@@ -1541,15 +1541,15 @@ out:
H5E_END_TRY
if (buf) {
- HDfree(buf);
+ free(buf);
buf = NULL;
}
if (ndsbuf) {
- HDfree(ndsbuf);
+ free(ndsbuf);
ndsbuf = NULL;
}
if (dsbuf) {
- HDfree(dsbuf);
+ free(dsbuf);
dsbuf = NULL;
}
return FAIL;
@@ -1611,7 +1611,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
int nscales;
htri_t has_dimlist;
int i;
- hbool_t is_new_ref;
+ bool is_new_ref;
/*-------------------------------------------------------------------------
* parameter checking
@@ -1672,7 +1672,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
if (buf == NULL)
goto out;
@@ -1748,7 +1748,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
if (H5Aclose(aid) < 0)
goto out;
- HDfree(buf);
+ free(buf);
buf = NULL;
} /* if has_dimlist */
@@ -1759,7 +1759,7 @@ out:
{
if (buf) {
H5Treclaim(tid, sid, H5P_DEFAULT, buf);
- HDfree(buf);
+ free(buf);
}
H5Sclose(sid);
H5Aclose(aid);
@@ -1799,7 +1799,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
char const **const_buf; /* buf calls */
} u;
- HDmemset(&u, 0, sizeof(u));
+ memset(&u, 0, sizeof(u));
/*-------------------------------------------------------------------------
* parameter checking
@@ -1862,7 +1862,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
/* allocate and initialize */
- u.const_buf = (char const **)HDmalloc((size_t)rank * sizeof(char *));
+ u.const_buf = (char const **)malloc((size_t)rank * sizeof(char *));
if (u.const_buf == NULL)
goto out;
@@ -1885,7 +1885,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
if (H5Aclose(aid) < 0)
goto out;
if (u.const_buf) {
- HDfree(u.const_buf);
+ free(u.const_buf);
u.const_buf = NULL;
}
}
@@ -1904,7 +1904,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
/* allocate and initialize */
- u.buf = (char **)HDmalloc((size_t)rank * sizeof(char *));
+ u.buf = (char **)malloc((size_t)rank * sizeof(char *));
if (u.buf == NULL)
goto out;
@@ -1915,7 +1915,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
/* free the ptr that will be replaced by label */
if (u.buf[idx])
- HDfree(u.buf[idx]);
+ free(u.buf[idx]);
/* store the label information in the required index */
u.const_buf[idx] = label;
@@ -1930,7 +1930,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
/* free all the ptr's from the H5Aread() */
for (i = 0; i < (unsigned int)rank; i++) {
if (u.buf[i])
- HDfree(u.buf[i]);
+ free(u.buf[i]);
}
/* close */
@@ -1939,7 +1939,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
if (H5Aclose(aid) < 0)
goto out;
if (u.buf) {
- HDfree(u.buf);
+ free(u.buf);
u.buf = NULL;
}
}
@@ -1955,9 +1955,9 @@ out:
/* free all the ptr's from the H5Aread() */
for (i = 0; i < (unsigned int)rank; i++) {
if (u.buf[i])
- HDfree(u.buf[i]);
+ free(u.buf[i]);
}
- HDfree(u.buf);
+ free(u.buf);
}
H5E_BEGIN_TRY
{
@@ -2054,7 +2054,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
goto out;
/* allocate and initialize */
- buf = (char **)HDmalloc((size_t)rank * sizeof(char *));
+ buf = (char **)malloc((size_t)rank * sizeof(char *));
if (buf == NULL)
goto out;
@@ -2066,14 +2066,14 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
/* do only if the label name exists for the dimension */
if (buf[idx] != NULL) {
/* get the real string length */
- nbytes = HDstrlen(buf[idx]);
+ nbytes = strlen(buf[idx]);
/* compute the string length which will fit into the user's buffer */
copy_len = MIN(size - 1, nbytes);
/* copy all/some of the name */
if (label) {
- HDmemcpy(label, buf[idx], copy_len);
+ memcpy(label, buf[idx], copy_len);
/* terminate the string */
label[copy_len] = '\0';
@@ -2082,7 +2082,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
/* free all the ptr's from the H5Aread() */
for (i = 0; i < rank; i++) {
if (buf[i])
- HDfree(buf[i]);
+ free(buf[i]);
}
/* close */
@@ -2091,7 +2091,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
if (H5Aclose(aid) < 0)
goto out;
if (buf) {
- HDfree(buf);
+ free(buf);
buf = NULL;
}
@@ -2103,9 +2103,9 @@ out:
/* free all the ptr's from the H5Aread() */
for (i = 0; i < rank; i++) {
if (buf[i])
- HDfree(buf[i]);
+ free(buf[i]);
}
- HDfree(buf);
+ free(buf);
}
H5E_BEGIN_TRY
{
@@ -2192,7 +2192,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size)
goto out;
/* allocate a temporary buffer */
- buf = (char *)HDmalloc(nbytes * sizeof(char));
+ buf = (char *)malloc(nbytes * sizeof(char));
if (buf == NULL)
goto out;
@@ -2205,7 +2205,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size)
/* copy all/some of the name */
if (name) {
- HDmemcpy(name, buf, copy_len);
+ memcpy(name, buf, copy_len);
/* terminate the string */
name[copy_len] = '\0';
@@ -2219,7 +2219,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size)
if (H5Sclose(sid) < 0)
goto out;
if (buf)
- HDfree(buf);
+ free(buf);
return (ssize_t)(nbytes - 1);
@@ -2233,7 +2233,7 @@ out:
}
H5E_END_TRY
if (buf)
- HDfree(buf);
+ free(buf);
return FAIL;
}
@@ -2315,7 +2315,7 @@ H5DSis_scale(hid_t did)
goto out;
}
- buf = (char *)HDmalloc((size_t)string_size * sizeof(char));
+ buf = (char *)malloc((size_t)string_size * sizeof(char));
if (buf == NULL)
goto out;
@@ -2324,10 +2324,10 @@ H5DSis_scale(hid_t did)
goto out;
/* compare strings */
- if (HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS), HDstrlen(buf))) == 0)
+ if (strncmp(buf, DIMENSION_SCALE_CLASS, MIN(strlen(DIMENSION_SCALE_CLASS), strlen(buf))) == 0)
is_ds = 1;
- HDfree(buf);
+ free(buf);
if (H5Tclose(tid) < 0)
goto out;
@@ -2337,7 +2337,7 @@ H5DSis_scale(hid_t did)
}
out:
if (is_ds < 0) {
- HDfree(buf);
+ free(buf);
H5E_BEGIN_TRY
{
H5Aclose(aid);
@@ -2427,7 +2427,7 @@ H5DSget_num_scales(hid_t did, unsigned int idx)
goto out;
/* allocate and initialize the VL */
- buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t));
+ buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t));
if (buf == NULL)
goto out;
@@ -2446,7 +2446,7 @@ H5DSget_num_scales(hid_t did, unsigned int idx)
goto out;
if (H5Aclose(aid) < 0)
goto out;
- HDfree(buf);
+ free(buf);
buf = NULL;
} /* has_dimlist */
@@ -2463,7 +2463,7 @@ out:
H5E_END_TRY
if (buf)
- HDfree(buf);
+ free(buf);
return FAIL;
}
@@ -2478,7 +2478,7 @@ out:
*-------------------------------------------------------------------------
*/
static herr_t
-H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
+H5DS_is_reserved(hid_t did, bool *is_reserved)
{
htri_t has_class;
hid_t tid = H5I_INVALID_HID;
@@ -2490,7 +2490,7 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
if ((has_class = H5Aexists(did, "CLASS")) < 0)
return FAIL;
if (has_class == 0) {
- *is_reserved = FALSE;
+ *is_reserved = false;
return SUCCEED;
}
@@ -2510,21 +2510,21 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
/* Allocate buffer large enough to hold string */
if ((string_size = H5Tget_size(tid)) == 0)
goto error;
- if (NULL == (buf = HDmalloc(string_size * sizeof(char))))
+ if (NULL == (buf = malloc(string_size * sizeof(char))))
goto error;
/* Read the attribute */
if (H5Aread(aid, tid, buf) < 0)
goto error;
- if (HDstrncmp(buf, IMAGE_CLASS, MIN(HDstrlen(IMAGE_CLASS), HDstrlen(buf))) == 0 ||
- HDstrncmp(buf, PALETTE_CLASS, MIN(HDstrlen(PALETTE_CLASS), HDstrlen(buf))) == 0 ||
- HDstrncmp(buf, TABLE_CLASS, MIN(HDstrlen(TABLE_CLASS), HDstrlen(buf))) == 0)
- *is_reserved = TRUE;
+ if (strncmp(buf, IMAGE_CLASS, MIN(strlen(IMAGE_CLASS), strlen(buf))) == 0 ||
+ strncmp(buf, PALETTE_CLASS, MIN(strlen(PALETTE_CLASS), strlen(buf))) == 0 ||
+ strncmp(buf, TABLE_CLASS, MIN(strlen(TABLE_CLASS), strlen(buf))) == 0)
+ *is_reserved = true;
else
- *is_reserved = FALSE;
+ *is_reserved = false;
- HDfree(buf);
+ free(buf);
if (H5Tclose(tid) < 0)
goto error;
@@ -2541,7 +2541,7 @@ error:
}
H5E_END_TRY
- HDfree(buf);
+ free(buf);
return FAIL;
}
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index 25381fd..04dbc67 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -98,13 +98,13 @@ H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t
/* Initialize the image dimensions */
- if (HDstrncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
+ if (strncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
/* Number of color planes is defined as the third dimension */
dims[0] = height;
dims[1] = width;
dims[2] = IMAGE24_RANK;
}
- else if (HDstrncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
+ else if (strncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
/* Number of color planes is defined as the first dimension */
dims[0] = IMAGE24_RANK;
dims[1] = height;
@@ -170,7 +170,7 @@ find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
*/
- if (HDstrncmp(name, "PALETTE", 7) == 0)
+ if (strncmp(name, "PALETTE", 7) == 0)
ret = H5_ITER_STOP;
return ret;
@@ -281,13 +281,13 @@ H5IMget_image_info(hid_t loc_id, const char *dset_name, hsize_t *width, hsize_t
if (has_attr > 0) {
/* This is a 24 bit image */
- if (HDstrncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
+ if (strncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
/* Number of color planes is defined as the third dimension */
*height = dims[0];
*width = dims[1];
*planes = dims[2];
}
- else if (HDstrncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
+ else if (strncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
/* Number of color planes is defined as the first dimension */
*planes = dims[0];
*height = dims[1];
@@ -570,7 +570,7 @@ H5IMlink_palette(hid_t loc_id, const char *image_name, const char *pal_name)
dim_ref = (hsize_t)n_refs + 1;
- refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * (size_t)dim_ref);
+ refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * (size_t)dim_ref);
if (H5Aread(aid, atid, refbuf) < 0)
goto out;
@@ -611,7 +611,7 @@ H5IMlink_palette(hid_t loc_id, const char *image_name, const char *pal_name)
if (H5Aclose(aid) < 0)
goto out;
- HDfree(refbuf);
+ free(refbuf);
} /* ok_pal > 0 */
@@ -868,7 +868,7 @@ H5IMget_palette_info(hid_t loc_id, const char *image_name, int pal_number, hsize
dim_ref = (hsize_t)n_refs;
- refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * (size_t)dim_ref);
+ refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * (size_t)dim_ref);
if (H5Aread(aid, atid, refbuf) < 0)
goto out;
@@ -897,7 +897,7 @@ H5IMget_palette_info(hid_t loc_id, const char *image_name, int pal_number, hsize
goto out;
if (H5Aclose(aid) < 0)
goto out;
- HDfree(refbuf);
+ free(refbuf);
}
/* Close the image dataset. */
@@ -975,7 +975,7 @@ H5IMget_palette(hid_t loc_id, const char *image_name, int pal_number, unsigned c
dim_ref = (hsize_t)n_refs;
- refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * (size_t)dim_ref);
+ refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * (size_t)dim_ref);
if (H5Aread(aid, atid, refbuf) < 0)
goto out;
@@ -997,7 +997,7 @@ H5IMget_palette(hid_t loc_id, const char *image_name, int pal_number, unsigned c
goto out;
if (H5Aclose(aid) < 0)
goto out;
- HDfree(refbuf);
+ free(refbuf);
}
/* Close the image dataset. */
@@ -1081,19 +1081,19 @@ H5IMis_image(hid_t loc_id, const char *dset_name)
if ((storage_size = H5Aget_storage_size(aid)) == 0)
goto out;
- attr_data = (char *)HDmalloc((size_t)storage_size * sizeof(char) + 1);
+ attr_data = (char *)malloc((size_t)storage_size * sizeof(char) + 1);
if (attr_data == NULL)
goto out;
if (H5Aread(aid, atid, attr_data) < 0)
goto out;
- if (HDstrncmp(attr_data, IMAGE_CLASS, MIN(HDstrlen(IMAGE_CLASS), HDstrlen(attr_data))) == 0)
+ if (strncmp(attr_data, IMAGE_CLASS, MIN(strlen(IMAGE_CLASS), strlen(attr_data))) == 0)
ret = 1;
else
ret = 0;
- HDfree(attr_data);
+ free(attr_data);
if (H5Tclose(atid) < 0)
goto out;
@@ -1180,19 +1180,19 @@ H5IMis_palette(hid_t loc_id, const char *dset_name)
if ((storage_size = H5Aget_storage_size(aid)) == 0)
goto out;
- attr_data = (char *)HDmalloc((size_t)storage_size * sizeof(char) + 1);
+ attr_data = (char *)malloc((size_t)storage_size * sizeof(char) + 1);
if (attr_data == NULL)
goto out;
if (H5Aread(aid, atid, attr_data) < 0)
goto out;
- if (HDstrncmp(attr_data, PALETTE_CLASS, MIN(HDstrlen(PALETTE_CLASS), HDstrlen(attr_data))) == 0)
+ if (strncmp(attr_data, PALETTE_CLASS, MIN(strlen(PALETTE_CLASS), strlen(attr_data))) == 0)
ret = 1;
else
ret = 0;
- HDfree(attr_data);
+ free(attr_data);
if (H5Tclose(atid) < 0)
goto out;
diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c
index 65a15e3..d85ef76 100644
--- a/hl/src/H5LD.c
+++ b/hl/src/H5LD.c
@@ -43,12 +43,12 @@ H5LD_clean_vector(H5LD_memb_t *listv[])
{
unsigned n; /* Local index variable */
- HDassert(listv);
+ assert(listv);
/* Go through info for each field stored in listv[] */
for (n = 0; listv[n] != NULL; n++) {
if (listv[n]->names) {
- HDfree(listv[n]->names);
+ free(listv[n]->names);
listv[n]->names = NULL;
} /* end if */
@@ -59,7 +59,7 @@ H5LD_clean_vector(H5LD_memb_t *listv[])
} /* end if */
/* Free the H5LD_memb_t structure for the field */
- HDfree(listv[n]);
+ free(listv[n]);
listv[n] = NULL;
} /* end for */
} /* H5LD_clean_vector() */
@@ -154,13 +154,13 @@ done:
int
H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
{
- int nfields; /* The # of comma-separated fields in "fields" */
- hbool_t end_of_fields = FALSE; /* end of "fields" */
- char *fields_ptr; /* Pointer to "fields" */
- int ret_value = FAIL; /* Return value */
+ int nfields; /* The # of comma-separated fields in "fields" */
+ bool end_of_fields = false; /* end of "fields" */
+ char *fields_ptr; /* Pointer to "fields" */
+ int ret_value = FAIL; /* Return value */
- HDassert(listv);
- HDassert(fields);
+ assert(listv);
+ assert(fields);
fields_ptr = fields;
nfields = 0;
@@ -170,19 +170,19 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
H5LD_memb_t *memb = NULL; /* Pointer to structure for storing a field's info */
char *cur; /* Pointer to a member in a field */
size_t len; /* Estimated # of members in a field */
- hbool_t gotcomma = FALSE; /* A comma encountered */
- hbool_t gotmember = FALSE; /* Getting member in a field */
- hbool_t valid = TRUE; /* Whether a field being processed is valid or not */
+ bool gotcomma = false; /* A comma encountered */
+ bool gotmember = false; /* Getting member in a field */
+ bool valid = true; /* Whether a field being processed is valid or not */
int j = 0; /* The # of members in a field */
- len = (HDstrlen(fields_ptr) / 2) + 2;
+ len = (strlen(fields_ptr) / 2) + 2;
/* Allocate memory for an H5LD_memb_t for storing a field's info */
- if (NULL == (memb = (H5LD_memb_t *)HDcalloc((size_t)1, sizeof(H5LD_memb_t))))
+ if (NULL == (memb = (H5LD_memb_t *)calloc((size_t)1, sizeof(H5LD_memb_t))))
goto done;
/* Allocate memory for an array of pointers to member names */
- if (NULL == (memb->names = (char **)HDcalloc(len, sizeof(char *))))
+ if (NULL == (memb->names = (char **)calloc(len, sizeof(char *))))
goto done;
memb->names[j] = fields_ptr;
@@ -198,17 +198,17 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
memb->names[++j] = NULL;
} /* end if */
else /* getting nothing but end of list */
- valid = FALSE;
- end_of_fields = TRUE;
+ valid = false;
+ end_of_fields = true;
break;
case '\\': /* escape character */
++fields_ptr; /* skip it */
if (*fields_ptr == '\0')
- valid = FALSE;
+ valid = false;
else {
*cur++ = *fields_ptr++;
- gotmember = TRUE;
+ gotmember = true;
} /* end else */
break;
@@ -216,26 +216,26 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
*fields_ptr++ = *cur++ = '\0';
if (gotmember) {
memb->names[++j] = cur;
- gotmember = FALSE;
+ gotmember = false;
} /* end if */
else
- valid = FALSE;
+ valid = false;
break;
case ',': /* field separator */
*fields_ptr++ = *cur++ = '\0';
if (gotmember) {
memb->names[++j] = NULL;
- gotmember = FALSE;
+ gotmember = false;
} /* end if */
else
- valid = FALSE;
- gotcomma = TRUE;
+ valid = false;
+ gotcomma = true;
break;
default:
*cur++ = *fields_ptr++;
- gotmember = TRUE;
+ gotmember = true;
break;
} /* end switch */
} /* while (valid && !gotcomma && !end_of_fields) */
@@ -248,8 +248,8 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
} /* end if */
else {
if (memb) {
- HDfree(memb->names);
- HDfree(memb);
+ free(memb->names);
+ free(memb);
}
goto done;
} /* end else */
@@ -347,7 +347,7 @@ H5LD_get_dset_type_size(hid_t did, const char *fields)
size_t tot = 0; /* Data type size of all the fields in "fields" */
int n = 0, num = 0; /* Local index variables */
- HDassert(fields && *fields);
+ assert(fields && *fields);
/* Should be a compound datatype if "fields" exists */
if (H5Tget_class(dset_tid) != H5T_COMPOUND)
@@ -358,8 +358,8 @@ H5LD_get_dset_type_size(hid_t did, const char *fields)
goto done;
/* Allocate memory for a list of H5LD_memb_t pointers to store "fields" info */
- len = (HDstrlen(fields) / 2) + 2;
- if (NULL == (listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))))
+ len = (strlen(fields) / 2) + 2;
+ if (NULL == (listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *))))
goto done;
/* Process and store info for "fields" */
@@ -385,11 +385,11 @@ done:
/* Free the array of H5LD_memb_t pointers */
if (listv)
- HDfree(listv);
+ free(listv);
/* Free memory */
if (dup_fields)
- HDfree(dup_fields);
+ free(dup_fields);
return (ret_value);
} /* H5LD_get_dset_type_size() */
@@ -437,8 +437,8 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
goto done;
/* Verify that cur_dims must have one dimension whose size is greater than prev_dims */
- HDmemset(start, 0, sizeof start);
- HDmemset(count, 0, sizeof count);
+ memset(start, 0, sizeof start);
+ memset(count, 0, sizeof count);
ctr = 0;
for (i = 0; i < ndims; i++)
if (cur_dims[i] > prev_dims[i]) {
@@ -459,7 +459,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
goto done;
} /* end if */
else { /* changes for more than one dimensions */
- HDmemset(start, 0, sizeof start);
+ memset(start, 0, sizeof start);
/* Make the selection in the dataset based on "cur_dims" and "prev_dims" */
if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, cur_dims, NULL) < 0)
@@ -503,7 +503,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
goto done;
/* Allocate memory for reading in the elements in the dataset selection */
- if (NULL == (sav_buf = tmp_buf = (char *)HDcalloc((size_t)num_elmts, tot_tsize)))
+ if (NULL == (sav_buf = tmp_buf = (char *)calloc((size_t)num_elmts, tot_tsize)))
goto done;
/* Read the dataset elements in the selection */
@@ -515,8 +515,8 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
goto done;
/* Allocate memory for the vector of H5LD_memb_t pointers */
- len = (HDstrlen(fields) / 2) + 2;
- if (NULL == (listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))))
+ len = (strlen(fields) / 2) + 2;
+ if (NULL == (listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *))))
goto done;
/* Process and store information for "fields" */
@@ -529,7 +529,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
/* Copy data for "fields" to the input buffer */
for (j = 0; listv[j] != NULL; j++) {
- HDmemcpy(buf_p, tmp_buf + listv[j]->tot_offset, listv[j]->last_tsize);
+ memcpy(buf_p, tmp_buf + listv[j]->tot_offset, listv[j]->last_tsize);
buf_p += listv[j]->last_tsize;
} /* end for */
tmp_buf += tot_tsize;
@@ -552,13 +552,13 @@ done:
/* Free the array of H5LD_memb_t pointers */
if (listv)
- HDfree(listv);
+ free(listv);
/* Free memory */
if (dup_fields)
- HDfree(dup_fields);
+ free(dup_fields);
if (sav_buf)
- HDfree(sav_buf);
+ free(sav_buf);
return (ret_value);
} /* H5LD_get_dset_elmts() */
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 657e562..3ed8b31 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -304,7 +304,7 @@ image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *
if (udata->vfd_ref_count != 1)
goto out;
- if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size)))
+ if (NULL == (udata->vfd_image_ptr = realloc(ptr, size)))
goto out;
udata->vfd_image_size = size;
@@ -356,7 +356,7 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
* references */
if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 &&
!(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) {
- HDfree(udata->fapl_image_ptr);
+ free(udata->fapl_image_ptr);
udata->app_image_ptr = NULL;
udata->fapl_image_ptr = NULL;
udata->vfd_image_ptr = NULL;
@@ -375,7 +375,7 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
* references */
if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 &&
!(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) {
- HDfree(udata->vfd_image_ptr);
+ free(udata->vfd_image_ptr);
udata->app_image_ptr = NULL;
udata->fapl_image_ptr = NULL;
udata->vfd_image_ptr = NULL;
@@ -463,7 +463,7 @@ udata_free(void *_udata)
/* checks that there are no references outstanding before deallocating udata */
if (udata->ref_count == 0 && udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0)
- HDfree(udata);
+ free(udata);
return (SUCCEED);
@@ -734,7 +734,7 @@ H5LTmake_dataset_string(hid_t loc_id, const char *dset_name, const char *buf)
if ((tid = H5Tcopy(H5T_C_S1)) < 0)
goto out;
- size = HDstrlen(buf) + 1; /* extra null term */
+ size = strlen(buf) + 1; /* extra null term */
if (H5Tset_size(tid, size) < 0)
goto out;
@@ -824,7 +824,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
alloc_incr = min_incr;
/* Configure FAPL to use the core file driver */
- if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0)
+ if (H5Pset_fapl_core(fapl, alloc_incr, false) < 0)
goto out;
/* Set callbacks for file image ops ONLY if the file image is NOT copied */
@@ -832,7 +832,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
H5LT_file_image_ud_t *udata; /* Pointer to udata structure */
/* Allocate buffer to communicate user data to callbacks */
- if (NULL == (udata = (H5LT_file_image_ud_t *)HDmalloc(sizeof(H5LT_file_image_ud_t))))
+ if (NULL == (udata = (H5LT_file_image_ud_t *)malloc(sizeof(H5LT_file_image_ud_t))))
goto out;
/* Initialize udata with info about app buffer containing file image and flags */
@@ -852,7 +852,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
/* Set file image callbacks */
if (H5Pset_file_image_callbacks(fapl, &callbacks) < 0) {
- HDfree(udata);
+ free(udata);
goto out;
} /* end if */
} /* end if */
@@ -868,7 +868,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
file_open_flags = H5F_ACC_RDONLY;
/* define a unique file name */
- HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++);
+ snprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++);
/* Assign file image in FAPL to the core file driver */
if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0)
@@ -1293,7 +1293,7 @@ find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
*/
- if (HDstrncmp(name, (char *)op_data, HDstrlen((char *)op_data)) == 0)
+ if (strncmp(name, (char *)op_data, strlen((char *)op_data)) == 0)
ret = 1;
return ret;
@@ -1382,7 +1382,7 @@ H5LTset_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_na
if ((attr_type = H5Tcopy(H5T_C_S1)) < 0)
goto out;
- attr_size = HDstrlen(attr_data) + 1; /* extra null term */
+ attr_size = strlen(attr_data) + 1; /* extra null term */
if (H5Tset_size(attr_type, (size_t)attr_size) < 0)
goto out;
@@ -2020,19 +2020,19 @@ H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
goto out;
if (lang_type != H5LT_DDL) {
- HDfprintf(stderr, "only DDL is supported for now.\n");
+ fprintf(stderr, "only DDL is supported for now.\n");
goto out;
}
- input_len = HDstrlen(text);
+ input_len = strlen(text);
myinput = HDstrdup(text);
if ((type_id = H5LTyyparse()) < 0) {
- HDfree(myinput);
+ free(myinput);
goto out;
}
- HDfree(myinput);
+ free(myinput);
input_len = 0;
return type_id;
@@ -2055,7 +2055,7 @@ out:
*-------------------------------------------------------------------------
*/
static char *
-realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str_to_add)
+realloc_and_append(bool _no_user_buf, size_t *len, char *buf, const char *str_to_add)
{
size_t size_str_to_add, size_str;
@@ -2066,16 +2066,16 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str
goto out;
/* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */
- if (str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) {
- *len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT;
+ if (str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) {
+ *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT;
}
- else if (!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) {
+ else if (!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) {
*len += INCREMENT;
}
- tmp_realloc = (char *)HDrealloc(buf, *len);
+ tmp_realloc = (char *)realloc(buf, *len);
if (tmp_realloc == NULL) {
- HDfree(buf);
+ free(buf);
buf = NULL;
goto out;
}
@@ -2085,19 +2085,19 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str
if (str_to_add) {
/* find the size of the buffer to add */
- size_str_to_add = HDstrlen(str_to_add);
+ size_str_to_add = strlen(str_to_add);
/* find the size of the current buffer */
- size_str = HDstrlen(buf);
+ size_str = strlen(buf);
/* Check to make sure the appended string does not
* extend past the allocated buffer; if it does then truncate the string
*/
if (size_str < *len - 1) {
if (size_str + size_str_to_add < *len - 1) {
- HDstrcat(buf, str_to_add);
+ strcat(buf, str_to_add);
}
else {
- HDstrncat(buf, str_to_add, (*len - 1) - size_str);
+ strncat(buf, str_to_add, (*len - 1) - size_str);
}
}
else {
@@ -2125,16 +2125,16 @@ out:
*-------------------------------------------------------------------------
*/
static char *
-indentation(size_t x, char *str, hbool_t no_u_buf, size_t *s_len)
+indentation(size_t x, char *str, bool no_u_buf, size_t *s_len)
{
char tmp_str[TMP_LEN];
if (x < 80) {
- HDmemset(tmp_str, ' ', x);
+ memset(tmp_str, ' ', x);
tmp_str[x] = '\0';
}
else
- HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols.");
+ snprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols.");
if (!(str = realloc_and_append(no_u_buf, s_len, str, tmp_str)))
goto out;
@@ -2156,7 +2156,7 @@ out:
*
*-----------------------------------------------------------------------*/
static char *
-print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt)
+print_enum(hid_t type, char *str, size_t *str_len, bool no_ubuf, size_t indt)
{
char **name = NULL; /*member names */
unsigned char *value = NULL; /*value array */
@@ -2190,8 +2190,8 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt)
dst_size = H5Tget_size(native);
/* Get the names and raw values of all members */
- name = (char **)HDcalloc((size_t)nmembs, sizeof(char *));
- value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(dst_size, super_size));
+ name = (char **)calloc((size_t)nmembs, sizeof(char *));
+ value = (unsigned char *)calloc((size_t)nmembs, MAX(dst_size, super_size));
for (i = 0; i < nmembs; i++) {
if ((name[i] = H5Tget_member_name(type, (unsigned)i)) == NULL)
@@ -2215,22 +2215,22 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt)
for (i = 0; i < nmembs; i++) {
if (!(str = indentation(indt + COL, str, no_ubuf, str_len)))
goto out;
- nchars = HDsnprintf(tmp_str, TMP_LEN, "\"%s\"", name[i]);
+ nchars = snprintf(tmp_str, TMP_LEN, "\"%s\"", name[i]);
if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str)))
goto out;
- HDmemset(tmp_str, ' ', (size_t)MAX(3, 19 - nchars) + 1);
+ memset(tmp_str, ' ', (size_t)MAX(3, 19 - nchars) + 1);
tmp_str[MAX(3, 19 - nchars)] = '\0';
if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str)))
goto out;
if (H5T_SGN_NONE == H5Tget_sign(native))
- HDsnprintf(tmp_str, TMP_LEN, "%u", *((unsigned int *)((void *)(value + (size_t)i * dst_size))));
+ snprintf(tmp_str, TMP_LEN, "%u", *((unsigned int *)((void *)(value + (size_t)i * dst_size))));
else
- HDsnprintf(tmp_str, TMP_LEN, "%d", *((int *)((void *)(value + (size_t)i * dst_size))));
+ snprintf(tmp_str, TMP_LEN, "%d", *((int *)((void *)(value + (size_t)i * dst_size))));
if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, ";\n");
+ snprintf(tmp_str, TMP_LEN, ";\n");
if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str)))
goto out;
}
@@ -2239,8 +2239,8 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt)
for (i = 0; i < nmembs; i++)
H5free_memory(name[i]);
- HDfree(name);
- HDfree(value);
+ free(name);
+ free(value);
H5Tclose(super);
return str;
@@ -2249,8 +2249,8 @@ out:
if (0 == nmembs) {
str = realloc_and_append(no_ubuf, str_len, str, "\n");
- HDassert((indt + 4) < TMP_LEN);
- HDmemset(tmp_str, ' ', (indt + 4) + 1);
+ assert((indt + 4) < TMP_LEN);
+ memset(tmp_str, ' ', (indt + 4) + 1);
tmp_str[(indt + 4)] = '\0';
str = realloc_and_append(no_ubuf, str_len, str, tmp_str);
str = realloc_and_append(no_ubuf, str_len, str, " <empty>");
@@ -2260,12 +2260,12 @@ out:
if (name) {
for (i = 0; i < nmembs; i++)
if (name[i])
- HDfree(name[i]);
- HDfree(name);
+ free(name[i]);
+ free(name);
} /* end if */
if (value)
- HDfree(value);
+ free(value);
if (super >= 0)
H5Tclose(super);
@@ -2299,13 +2299,13 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len)
goto out;
if (len && !str) {
- text_str = (char *)HDcalloc(str_len, sizeof(char));
+ text_str = (char *)calloc(str_len, sizeof(char));
text_str[0] = '\0';
if (!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1)))
goto out;
- *len = HDstrlen(text_str) + 1;
+ *len = strlen(text_str) + 1;
if (text_str)
- HDfree(text_str);
+ free(text_str);
text_str = NULL;
}
else if (len && str) {
@@ -2317,7 +2317,7 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len)
return ret;
out:
- HDfree(text_str);
+ free(text_str);
return FAIL;
}
@@ -2338,7 +2338,7 @@ out:
*-------------------------------------------------------------------------
*/
char *
-H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hbool_t no_user_buf)
+H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, bool no_user_buf)
{
H5T_class_t tcls;
char tmp_str[TMP_LEN];
@@ -2348,7 +2348,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
goto out;
if (lang != H5LT_DDL) {
- HDsnprintf(dt_str, *slen, "only DDL is supported for now");
+ snprintf(dt_str, *slen, "only DDL is supported for now");
goto out;
}
@@ -2359,112 +2359,112 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
case H5T_INTEGER:
case H5T_BITFIELD:
if (H5Tequal(dtype, H5T_STD_I8BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I8BE");
+ snprintf(dt_str, *slen, "H5T_STD_I8BE");
}
else if (H5Tequal(dtype, H5T_STD_I8LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I8LE");
+ snprintf(dt_str, *slen, "H5T_STD_I8LE");
}
else if (H5Tequal(dtype, H5T_STD_I16BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I16BE");
+ snprintf(dt_str, *slen, "H5T_STD_I16BE");
}
else if (H5Tequal(dtype, H5T_STD_I16LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I16LE");
+ snprintf(dt_str, *slen, "H5T_STD_I16LE");
}
else if (H5Tequal(dtype, H5T_STD_I32BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I32BE");
+ snprintf(dt_str, *slen, "H5T_STD_I32BE");
}
else if (H5Tequal(dtype, H5T_STD_I32LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I32LE");
+ snprintf(dt_str, *slen, "H5T_STD_I32LE");
}
else if (H5Tequal(dtype, H5T_STD_I64BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I64BE");
+ snprintf(dt_str, *slen, "H5T_STD_I64BE");
}
else if (H5Tequal(dtype, H5T_STD_I64LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_I64LE");
+ snprintf(dt_str, *slen, "H5T_STD_I64LE");
}
else if (H5Tequal(dtype, H5T_STD_U8BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U8BE");
+ snprintf(dt_str, *slen, "H5T_STD_U8BE");
}
else if (H5Tequal(dtype, H5T_STD_U8LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U8LE");
+ snprintf(dt_str, *slen, "H5T_STD_U8LE");
}
else if (H5Tequal(dtype, H5T_STD_U16BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U16BE");
+ snprintf(dt_str, *slen, "H5T_STD_U16BE");
}
else if (H5Tequal(dtype, H5T_STD_U16LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U16LE");
+ snprintf(dt_str, *slen, "H5T_STD_U16LE");
}
else if (H5Tequal(dtype, H5T_STD_U32BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U32BE");
+ snprintf(dt_str, *slen, "H5T_STD_U32BE");
}
else if (H5Tequal(dtype, H5T_STD_U32LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U32LE");
+ snprintf(dt_str, *slen, "H5T_STD_U32LE");
}
else if (H5Tequal(dtype, H5T_STD_U64BE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U64BE");
+ snprintf(dt_str, *slen, "H5T_STD_U64BE");
}
else if (H5Tequal(dtype, H5T_STD_U64LE)) {
- HDsnprintf(dt_str, *slen, "H5T_STD_U64LE");
+ snprintf(dt_str, *slen, "H5T_STD_U64LE");
}
else if (H5Tequal(dtype, H5T_NATIVE_SCHAR)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_SCHAR");
+ snprintf(dt_str, *slen, "H5T_NATIVE_SCHAR");
}
else if (H5Tequal(dtype, H5T_NATIVE_UCHAR)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_UCHAR");
+ snprintf(dt_str, *slen, "H5T_NATIVE_UCHAR");
}
else if (H5Tequal(dtype, H5T_NATIVE_SHORT)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_SHORT");
+ snprintf(dt_str, *slen, "H5T_NATIVE_SHORT");
}
else if (H5Tequal(dtype, H5T_NATIVE_USHORT)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_USHORT");
+ snprintf(dt_str, *slen, "H5T_NATIVE_USHORT");
}
else if (H5Tequal(dtype, H5T_NATIVE_INT)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_INT");
+ snprintf(dt_str, *slen, "H5T_NATIVE_INT");
}
else if (H5Tequal(dtype, H5T_NATIVE_UINT)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_UINT");
+ snprintf(dt_str, *slen, "H5T_NATIVE_UINT");
}
else if (H5Tequal(dtype, H5T_NATIVE_LONG)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_LONG");
+ snprintf(dt_str, *slen, "H5T_NATIVE_LONG");
}
else if (H5Tequal(dtype, H5T_NATIVE_ULONG)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_ULONG");
+ snprintf(dt_str, *slen, "H5T_NATIVE_ULONG");
}
else if (H5Tequal(dtype, H5T_NATIVE_LLONG)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_LLONG");
+ snprintf(dt_str, *slen, "H5T_NATIVE_LLONG");
}
else if (H5Tequal(dtype, H5T_NATIVE_ULLONG)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_ULLONG");
+ snprintf(dt_str, *slen, "H5T_NATIVE_ULLONG");
}
else {
- HDsnprintf(dt_str, *slen, "undefined integer");
+ snprintf(dt_str, *slen, "undefined integer");
}
break;
case H5T_FLOAT:
if (H5Tequal(dtype, H5T_IEEE_F32BE)) {
- HDsnprintf(dt_str, *slen, "H5T_IEEE_F32BE");
+ snprintf(dt_str, *slen, "H5T_IEEE_F32BE");
}
else if (H5Tequal(dtype, H5T_IEEE_F32LE)) {
- HDsnprintf(dt_str, *slen, "H5T_IEEE_F32LE");
+ snprintf(dt_str, *slen, "H5T_IEEE_F32LE");
}
else if (H5Tequal(dtype, H5T_IEEE_F64BE)) {
- HDsnprintf(dt_str, *slen, "H5T_IEEE_F64BE");
+ snprintf(dt_str, *slen, "H5T_IEEE_F64BE");
}
else if (H5Tequal(dtype, H5T_IEEE_F64LE)) {
- HDsnprintf(dt_str, *slen, "H5T_IEEE_F64LE");
+ snprintf(dt_str, *slen, "H5T_IEEE_F64LE");
}
else if (H5Tequal(dtype, H5T_NATIVE_FLOAT)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_FLOAT");
+ snprintf(dt_str, *slen, "H5T_NATIVE_FLOAT");
}
else if (H5Tequal(dtype, H5T_NATIVE_DOUBLE)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_DOUBLE");
+ snprintf(dt_str, *slen, "H5T_NATIVE_DOUBLE");
}
else if (H5Tequal(dtype, H5T_NATIVE_LDOUBLE)) {
- HDsnprintf(dt_str, *slen, "H5T_NATIVE_LDOUBLE");
+ snprintf(dt_str, *slen, "H5T_NATIVE_LDOUBLE");
}
else {
- HDsnprintf(dt_str, *slen, "undefined float");
+ snprintf(dt_str, *slen, "undefined float");
}
break;
@@ -2492,16 +2492,16 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
goto out;
/* Print lead-in */
- HDsnprintf(dt_str, *slen, "H5T_STRING {\n");
+ snprintf(dt_str, *slen, "H5T_STRING {\n");
indent += COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
if (is_vlstr)
- HDsnprintf(tmp_str, TMP_LEN, "STRSIZE H5T_VARIABLE;\n");
+ snprintf(tmp_str, TMP_LEN, "STRSIZE H5T_VARIABLE;\n");
else
- HDsnprintf(tmp_str, TMP_LEN, "STRSIZE %d;\n", (int)size);
+ snprintf(tmp_str, TMP_LEN, "STRSIZE %d;\n", (int)size);
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2510,13 +2510,13 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
goto out;
if (str_pad == H5T_STR_NULLTERM)
- HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLTERM;\n");
+ snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLTERM;\n");
else if (str_pad == H5T_STR_NULLPAD)
- HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLPAD;\n");
+ snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLPAD;\n");
else if (str_pad == H5T_STR_SPACEPAD)
- HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_SPACEPAD;\n");
+ snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_SPACEPAD;\n");
else
- HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_ERROR;\n");
+ snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_ERROR;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2525,11 +2525,11 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
goto out;
if (cset == H5T_CSET_ASCII)
- HDsnprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_ASCII;\n");
+ snprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_ASCII;\n");
else if (cset == H5T_CSET_UTF8)
- HDsnprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_UTF8;\n");
+ snprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_UTF8;\n");
else
- HDsnprintf(tmp_str, TMP_LEN, "CSET unknown;\n");
+ snprintf(tmp_str, TMP_LEN, "CSET unknown;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2555,7 +2555,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
/* Check C variable-length string first. Are the two types equal? */
if (H5Tequal(tmp_type, str_type)) {
- HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n");
+ snprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
goto next;
@@ -2574,7 +2574,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
}
if (H5Tequal(tmp_type, str_type)) {
- HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n");
+ snprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
goto next;
@@ -2596,7 +2596,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
/* Are the two types equal? */
if (H5Tequal(tmp_type, str_type)) {
- HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n");
+ snprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
goto next;
@@ -2616,14 +2616,14 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb
/* Are the two types equal? */
if (H5Tequal(tmp_type, str_type)) {
- HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n");
+ snprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
goto next;
}
/* Type doesn't match any of above. */
- HDsnprintf(tmp_str, TMP_LEN, "CTYPE unknown_one_character_type;\n");
+ snprintf(tmp_str, TMP_LEN, "CTYPE unknown_one_character_type;\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2635,7 +2635,7 @@ next:
indent -= COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "}");
+ snprintf(tmp_str, TMP_LEN, "}");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2645,12 +2645,12 @@ next:
char *tag = NULL;
/* Print lead-in */
- HDsnprintf(dt_str, *slen, "H5T_OPAQUE {\n");
+ snprintf(dt_str, *slen, "H5T_OPAQUE {\n");
indent += COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype));
+ snprintf(tmp_str, TMP_LEN, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype));
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2658,13 +2658,13 @@ next:
goto out;
tag = H5Tget_tag(dtype);
if (tag) {
- HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag);
+ snprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag);
if (tag)
H5free_memory(tag);
tag = NULL;
}
else
- HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n");
+ snprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2672,7 +2672,7 @@ next:
indent -= COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "}");
+ snprintf(tmp_str, TMP_LEN, "}");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2684,7 +2684,7 @@ next:
char *stmp = NULL;
/* Print lead-in */
- HDsnprintf(dt_str, *slen, "H5T_ENUM {\n");
+ snprintf(dt_str, *slen, "H5T_ENUM {\n");
indent += COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
@@ -2693,21 +2693,21 @@ next:
goto out;
if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
- stmp = (char *)HDcalloc(super_len, sizeof(char));
+ stmp = (char *)calloc(super_len, sizeof(char));
if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) {
- HDfree(stmp);
+ free(stmp);
goto out;
}
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) {
- HDfree(stmp);
+ free(stmp);
goto out;
}
if (stmp)
- HDfree(stmp);
+ free(stmp);
stmp = NULL;
- HDsnprintf(tmp_str, TMP_LEN, ";\n");
+ snprintf(tmp_str, TMP_LEN, ";\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
H5Tclose(super);
@@ -2719,7 +2719,7 @@ next:
indent -= COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "}");
+ snprintf(tmp_str, TMP_LEN, "}");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2731,7 +2731,7 @@ next:
char *stmp = NULL;
/* Print lead-in */
- HDsnprintf(dt_str, *slen, "H5T_VLEN {\n");
+ snprintf(dt_str, *slen, "H5T_VLEN {\n");
indent += COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
@@ -2740,20 +2740,20 @@ next:
goto out;
if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
- stmp = (char *)HDcalloc(super_len, sizeof(char));
+ stmp = (char *)calloc(super_len, sizeof(char));
if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) {
- HDfree(stmp);
+ free(stmp);
goto out;
}
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) {
- HDfree(stmp);
+ free(stmp);
goto out;
}
if (stmp)
- HDfree(stmp);
+ free(stmp);
stmp = NULL;
- HDsnprintf(tmp_str, TMP_LEN, "\n");
+ snprintf(tmp_str, TMP_LEN, "\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
H5Tclose(super);
@@ -2762,7 +2762,7 @@ next:
indent -= COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "}");
+ snprintf(tmp_str, TMP_LEN, "}");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2776,7 +2776,7 @@ next:
int ndims;
/* Print lead-in */
- HDsnprintf(dt_str, *slen, "H5T_ARRAY {\n");
+ snprintf(dt_str, *slen, "H5T_ARRAY {\n");
indent += COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
@@ -2789,11 +2789,11 @@ next:
/* Print array dimensions */
for (i = 0; i < ndims; i++) {
- HDsnprintf(tmp_str, TMP_LEN, "[%d]", (int)dims[i]);
+ snprintf(tmp_str, TMP_LEN, "[%d]", (int)dims[i]);
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
}
- HDsnprintf(tmp_str, TMP_LEN, " ");
+ snprintf(tmp_str, TMP_LEN, " ");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2801,19 +2801,19 @@ next:
goto out;
if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
- stmp = (char *)HDcalloc(super_len, sizeof(char));
+ stmp = (char *)calloc(super_len, sizeof(char));
if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) {
- HDfree(stmp);
+ free(stmp);
goto out;
}
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) {
- HDfree(stmp);
+ free(stmp);
goto out;
}
if (stmp)
- HDfree(stmp);
+ free(stmp);
stmp = NULL;
- HDsnprintf(tmp_str, TMP_LEN, "\n");
+ snprintf(tmp_str, TMP_LEN, "\n");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
H5Tclose(super);
@@ -2822,7 +2822,7 @@ next:
indent -= COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "}");
+ snprintf(tmp_str, TMP_LEN, "}");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
@@ -2840,7 +2840,7 @@ next:
if ((nmembs = H5Tget_nmembers(dtype)) < 0)
goto out;
- HDsnprintf(dt_str, *slen, "H5T_COMPOUND {\n");
+ snprintf(dt_str, *slen, "H5T_COMPOUND {\n");
indent += COL;
for (i = 0; i < nmembs; i++) {
@@ -2859,30 +2859,30 @@ next:
if (H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0)
goto out;
- mtmp = (char *)HDcalloc(mlen, sizeof(char));
+ mtmp = (char *)calloc(mlen, sizeof(char));
if (H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) {
- HDfree(mtmp);
+ free(mtmp);
goto out;
}
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) {
- HDfree(mtmp);
+ free(mtmp);
goto out;
}
if (mtmp)
- HDfree(mtmp);
+ free(mtmp);
mtmp = NULL;
if (H5T_COMPOUND == mclass)
indent -= COL;
- HDsnprintf(tmp_str, TMP_LEN, " \"%s\"", mname);
+ snprintf(tmp_str, TMP_LEN, " \"%s\"", mname);
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
if (mname)
H5free_memory(mname);
mname = NULL;
- HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset);
+ snprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset);
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
}
@@ -2891,30 +2891,30 @@ next:
indent -= COL;
if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen)))
goto out;
- HDsnprintf(tmp_str, TMP_LEN, "}");
+ snprintf(tmp_str, TMP_LEN, "}");
if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str)))
goto out;
break;
}
case H5T_TIME:
- HDsnprintf(dt_str, *slen, "H5T_TIME: not yet implemented");
+ snprintf(dt_str, *slen, "H5T_TIME: not yet implemented");
break;
case H5T_NO_CLASS:
- HDsnprintf(dt_str, *slen, "H5T_NO_CLASS");
+ snprintf(dt_str, *slen, "H5T_NO_CLASS");
break;
case H5T_REFERENCE:
- if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) {
- HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }");
+ if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == true) {
+ snprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }");
}
else {
- HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }");
+ snprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }");
}
break;
case H5T_NCLASSES:
break;
default:
- HDsnprintf(dt_str, *slen, "unknown data type");
+ snprintf(dt_str, *slen, "unknown data type");
}
return dt_str;
@@ -3451,7 +3451,7 @@ H5LT_set_attribute_string(hid_t dset_id, const char *name, const char *buf)
if ((tid = H5Tcopy(H5T_C_S1)) < 0)
return FAIL;
- size = HDstrlen(buf) + 1; /* extra null term */
+ size = strlen(buf) + 1; /* extra null term */
if (H5Tset_size(tid, (size_t)size) < 0)
goto out;
@@ -3507,7 +3507,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
htri_t ret_value;
/* Initialize */
- ret_value = FALSE;
+ ret_value = false;
/* check the arguments */
if (path == NULL) {
@@ -3522,17 +3522,17 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
}
/* Find the length of the path */
- path_length = HDstrlen(path);
+ path_length = strlen(path);
/* Check if the identifier is the object itself, i.e. path is '.' */
- if (HDstrncmp(path, ".", path_length) == 0) {
+ if (strncmp(path, ".", path_length) == 0) {
if (check_object_valid) {
obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT);
ret_value = obj_exists;
goto done;
}
else {
- ret_value = TRUE; /* Since the object is the identifier itself,
+ ret_value = true; /* Since the object is the identifier itself,
* we can only check if loc_id is a valid type */
goto done;
}
@@ -3547,18 +3547,18 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
curr_name = tmp_path;
/* check if absolute pathname */
- if (HDstrncmp(path, "/", 1) == 0)
+ if (strncmp(path, "/", 1) == 0)
curr_name++;
/* check if relative path name starts with "./" */
- if (HDstrncmp(path, "./", 2) == 0)
+ if (strncmp(path, "./", 2) == 0)
curr_name += 2;
- while ((delimit = HDstrchr(curr_name, '/')) != NULL) {
+ while ((delimit = strchr(curr_name, '/')) != NULL) {
/* Change the delimiter to terminate the string */
*delimit = '\0';
- obj_exists = FALSE;
+ obj_exists = false;
if ((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
ret_value = FAIL;
goto done;
@@ -3566,8 +3566,8 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
/* If target link does not exist then no reason to
* continue checking the path */
- if (link_exists != TRUE) {
- ret_value = FALSE;
+ if (link_exists != true) {
+ ret_value = false;
goto done;
}
@@ -3577,7 +3577,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
goto done;
}
- if (obj_exists != TRUE)
+ if (obj_exists != true)
break;
/* Change the delimiter back to '/' */
@@ -3596,8 +3596,8 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
}
else {
ret_value = link_exists;
- /* Determine if link resolves to an actual object for check_object_valid TRUE */
- if (check_object_valid == TRUE && link_exists == TRUE) {
+ /* Determine if link resolves to an actual object for check_object_valid true */
+ if (check_object_valid == true && link_exists == true) {
if ((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
ret_value = FAIL;
}
@@ -3609,7 +3609,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
done:
if (tmp_path != NULL)
- HDfree(tmp_path);
+ free(tmp_path);
return ret_value;
}
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c
index 3f6feaa..8890b8e 100644
--- a/hl/src/H5LTanalyze.c
+++ b/hl/src/H5LTanalyze.c
@@ -10,7 +10,7 @@
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#if !defined (__clang__)
#pragma GCC diagnostic ignored "-Wlarger-than="
#pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
@@ -912,7 +912,7 @@ char *yytext;
* recreate the output files.
*/
-#line 29 "hl/src//H5LTanalyze.l"
+#line 28 "hl/src//H5LTanalyze.l"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -936,8 +936,8 @@ static int my_yyinput(char *, int);
extern char *myinput;
extern size_t input_len;
+#line 909 "hl/src//H5LTanalyze.c"
#line 910 "hl/src//H5LTanalyze.c"
-#line 911 "hl/src//H5LTanalyze.c"
#define INITIAL 0
@@ -1146,10 +1146,10 @@ YY_DECL
}
{
-#line 54 "hl/src//H5LTanalyze.l"
+#line 53 "hl/src//H5LTanalyze.l"
-#line 1123 "hl/src//H5LTanalyze.c"
+#line 1122 "hl/src//H5LTanalyze.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1208,286 +1208,286 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 56 "hl/src//H5LTanalyze.l"
+#line 55 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I8BE_TOKEN);}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 57 "hl/src//H5LTanalyze.l"
+#line 56 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I8LE_TOKEN);}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 58 "hl/src//H5LTanalyze.l"
+#line 57 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I16BE_TOKEN);}
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 59 "hl/src//H5LTanalyze.l"
+#line 58 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I16LE_TOKEN);}
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 60 "hl/src//H5LTanalyze.l"
+#line 59 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I32BE_TOKEN);}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 61 "hl/src//H5LTanalyze.l"
+#line 60 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I32LE_TOKEN);}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 62 "hl/src//H5LTanalyze.l"
+#line 61 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I64BE_TOKEN);}
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 63 "hl/src//H5LTanalyze.l"
+#line 62 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_I64LE_TOKEN);}
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 65 "hl/src//H5LTanalyze.l"
+#line 64 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U8BE_TOKEN);}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 66 "hl/src//H5LTanalyze.l"
+#line 65 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U8LE_TOKEN);}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 67 "hl/src//H5LTanalyze.l"
+#line 66 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U16BE_TOKEN);}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 68 "hl/src//H5LTanalyze.l"
+#line 67 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U16LE_TOKEN);}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 69 "hl/src//H5LTanalyze.l"
+#line 68 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U32BE_TOKEN);}
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 70 "hl/src//H5LTanalyze.l"
+#line 69 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U32LE_TOKEN);}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 71 "hl/src//H5LTanalyze.l"
+#line 70 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U64BE_TOKEN);}
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 72 "hl/src//H5LTanalyze.l"
+#line 71 "hl/src//H5LTanalyze.l"
{return hid(H5T_STD_U64LE_TOKEN);}
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 74 "hl/src//H5LTanalyze.l"
+#line 73 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_CHAR_TOKEN);}
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 75 "hl/src//H5LTanalyze.l"
+#line 74 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_SCHAR_TOKEN);}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 76 "hl/src//H5LTanalyze.l"
+#line 75 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_UCHAR_TOKEN);}
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 77 "hl/src//H5LTanalyze.l"
+#line 76 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_SHORT_TOKEN);}
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 78 "hl/src//H5LTanalyze.l"
+#line 77 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_USHORT_TOKEN);}
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 79 "hl/src//H5LTanalyze.l"
+#line 78 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_INT_TOKEN);}
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 80 "hl/src//H5LTanalyze.l"
+#line 79 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_UINT_TOKEN);}
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 81 "hl/src//H5LTanalyze.l"
+#line 80 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_LONG_TOKEN);}
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 82 "hl/src//H5LTanalyze.l"
+#line 81 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_ULONG_TOKEN);}
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 83 "hl/src//H5LTanalyze.l"
+#line 82 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_LLONG_TOKEN);}
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 84 "hl/src//H5LTanalyze.l"
+#line 83 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_ULLONG_TOKEN);}
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 86 "hl/src//H5LTanalyze.l"
+#line 85 "hl/src//H5LTanalyze.l"
{return hid(H5T_IEEE_F32BE_TOKEN);}
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 87 "hl/src//H5LTanalyze.l"
+#line 86 "hl/src//H5LTanalyze.l"
{return hid(H5T_IEEE_F32LE_TOKEN);}
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 88 "hl/src//H5LTanalyze.l"
+#line 87 "hl/src//H5LTanalyze.l"
{return hid(H5T_IEEE_F64BE_TOKEN);}
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 89 "hl/src//H5LTanalyze.l"
+#line 88 "hl/src//H5LTanalyze.l"
{return hid(H5T_IEEE_F64LE_TOKEN);}
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 90 "hl/src//H5LTanalyze.l"
+#line 89 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_FLOAT_TOKEN);}
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 91 "hl/src//H5LTanalyze.l"
+#line 90 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_DOUBLE_TOKEN);}
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 92 "hl/src//H5LTanalyze.l"
+#line 91 "hl/src//H5LTanalyze.l"
{return hid(H5T_NATIVE_LDOUBLE_TOKEN);}
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 94 "hl/src//H5LTanalyze.l"
+#line 93 "hl/src//H5LTanalyze.l"
{return token(H5T_STRING_TOKEN);}
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 95 "hl/src//H5LTanalyze.l"
+#line 94 "hl/src//H5LTanalyze.l"
{return token(STRSIZE_TOKEN);}
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 96 "hl/src//H5LTanalyze.l"
+#line 95 "hl/src//H5LTanalyze.l"
{return token(STRPAD_TOKEN);}
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 97 "hl/src//H5LTanalyze.l"
+#line 96 "hl/src//H5LTanalyze.l"
{return token(CSET_TOKEN);}
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 98 "hl/src//H5LTanalyze.l"
+#line 97 "hl/src//H5LTanalyze.l"
{return token(CTYPE_TOKEN);}
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 99 "hl/src//H5LTanalyze.l"
+#line 98 "hl/src//H5LTanalyze.l"
{return token(H5T_STR_NULLTERM_TOKEN);}
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 100 "hl/src//H5LTanalyze.l"
+#line 99 "hl/src//H5LTanalyze.l"
{return token(H5T_STR_NULLPAD_TOKEN);}
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 101 "hl/src//H5LTanalyze.l"
+#line 100 "hl/src//H5LTanalyze.l"
{return token(H5T_STR_SPACEPAD_TOKEN);}
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 102 "hl/src//H5LTanalyze.l"
+#line 101 "hl/src//H5LTanalyze.l"
{return token(H5T_CSET_ASCII_TOKEN);}
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 103 "hl/src//H5LTanalyze.l"
+#line 102 "hl/src//H5LTanalyze.l"
{return token(H5T_CSET_UTF8_TOKEN);}
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 104 "hl/src//H5LTanalyze.l"
+#line 103 "hl/src//H5LTanalyze.l"
{return token(H5T_C_S1_TOKEN);}
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 105 "hl/src//H5LTanalyze.l"
+#line 104 "hl/src//H5LTanalyze.l"
{return token(H5T_FORTRAN_S1_TOKEN);}
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 106 "hl/src//H5LTanalyze.l"
+#line 105 "hl/src//H5LTanalyze.l"
{return token(H5T_VARIABLE_TOKEN);}
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 108 "hl/src//H5LTanalyze.l"
+#line 107 "hl/src//H5LTanalyze.l"
{return token(H5T_COMPOUND_TOKEN);}
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 109 "hl/src//H5LTanalyze.l"
+#line 108 "hl/src//H5LTanalyze.l"
{return token(H5T_ENUM_TOKEN);}
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 110 "hl/src//H5LTanalyze.l"
+#line 109 "hl/src//H5LTanalyze.l"
{return token(H5T_ARRAY_TOKEN);}
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 111 "hl/src//H5LTanalyze.l"
+#line 110 "hl/src//H5LTanalyze.l"
{return token(H5T_VLEN_TOKEN);}
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 113 "hl/src//H5LTanalyze.l"
+#line 112 "hl/src//H5LTanalyze.l"
{return token(H5T_OPAQUE_TOKEN);}
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 114 "hl/src//H5LTanalyze.l"
+#line 113 "hl/src//H5LTanalyze.l"
{return token(OPQ_SIZE_TOKEN);}
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 115 "hl/src//H5LTanalyze.l"
+#line 114 "hl/src//H5LTanalyze.l"
{return token(OPQ_TAG_TOKEN);}
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 117 "hl/src//H5LTanalyze.l"
+#line 116 "hl/src//H5LTanalyze.l"
{
- H5LTyylval.ival = HDatoi(yytext);
+ H5LTyylval.ival = atoi(yytext);
return NUMBER;
}
YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
-#line 122 "hl/src//H5LTanalyze.l"
+#line 121 "hl/src//H5LTanalyze.l"
{
H5LTyylval.sval = trim_quotes(yytext);
return STRING;
@@ -1495,46 +1495,46 @@ YY_RULE_SETUP
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 127 "hl/src//H5LTanalyze.l"
+#line 126 "hl/src//H5LTanalyze.l"
{return token('{');}
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 128 "hl/src//H5LTanalyze.l"
+#line 127 "hl/src//H5LTanalyze.l"
{return token('}');}
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 129 "hl/src//H5LTanalyze.l"
+#line 128 "hl/src//H5LTanalyze.l"
{return token('[');}
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 130 "hl/src//H5LTanalyze.l"
+#line 129 "hl/src//H5LTanalyze.l"
{return token(']');}
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 131 "hl/src//H5LTanalyze.l"
+#line 130 "hl/src//H5LTanalyze.l"
{return token(':');}
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 132 "hl/src//H5LTanalyze.l"
+#line 131 "hl/src//H5LTanalyze.l"
{return token(';');}
YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
-#line 133 "hl/src//H5LTanalyze.l"
+#line 132 "hl/src//H5LTanalyze.l"
;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 135 "hl/src//H5LTanalyze.l"
+#line 134 "hl/src//H5LTanalyze.l"
ECHO;
YY_BREAK
-#line 1508 "hl/src//H5LTanalyze.c"
+#line 1507 "hl/src//H5LTanalyze.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -2539,7 +2539,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 135 "hl/src//H5LTanalyze.l"
+#line 134 "hl/src//H5LTanalyze.l"
/* Allocate a copy of `quoted` with the double quote character at
@@ -2549,12 +2549,12 @@ void yyfree (void * ptr )
static char *
trim_quotes(const char *quoted)
{
- size_t len = HDstrlen(quoted);
+ size_t len = strlen(quoted);
char *trimmed;
- HDassert(quoted[0] == '"' && quoted[len - 1] == '"');
+ assert(quoted[0] == '"' && quoted[len - 1] == '"');
- trimmed = HDstrdup(quoted + 1);
+ trimmed = strdup(quoted + 1);
trimmed[len - 2] = '\0';
return trimmed;
@@ -2564,19 +2564,19 @@ static int my_yyinput(char *buf, int max_size)
{
int ret;
- HDmemcpy(buf, myinput, input_len);
+ memcpy(buf, myinput, input_len);
ret = (int)input_len;
return ret;
}
int H5LTyyerror(const char *msg)
{
- HDprintf("ERROR: %s before \"%s\".\n", msg, yytext);
+ printf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
}
int yywrap()
{
- return(1);
+ return 1;
}
diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l
index ab47410..58a6636 100644
--- a/hl/src/H5LTanalyze.l
+++ b/hl/src/H5LTanalyze.l
@@ -114,7 +114,7 @@ OPQ_SIZE {return token(OPQ_SIZE_TOKEN);}
OPQ_TAG {return token(OPQ_TAG_TOKEN);}
[0-9]+ {
- H5LTyylval.ival = HDatoi(yytext);
+ H5LTyylval.ival = atoi(yytext);
return NUMBER;
}
@@ -140,12 +140,12 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);}
static char *
trim_quotes(const char *quoted)
{
- size_t len = HDstrlen(quoted);
+ size_t len = strlen(quoted);
char *trimmed;
- HDassert(quoted[0] == '"' && quoted[len - 1] == '"');
+ assert(quoted[0] == '"' && quoted[len - 1] == '"');
- trimmed = HDstrdup(quoted + 1);
+ trimmed = strdup(quoted + 1);
trimmed[len - 2] = '\0';
return trimmed;
@@ -155,18 +155,18 @@ static int my_yyinput(char *buf, int max_size)
{
int ret;
- HDmemcpy(buf, myinput, input_len);
+ memcpy(buf, myinput, input_len);
ret = (int)input_len;
return ret;
}
int H5LTyyerror(const char *msg)
{
- HDprintf("ERROR: %s before \"%s\".\n", msg, yytext);
+ printf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
}
int yywrap()
{
- return(1);
+ return 1;
}
diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c
index fb12d2c..592b863 100644
--- a/hl/src/H5LTparse.c
+++ b/hl/src/H5LTparse.c
@@ -105,7 +105,7 @@
#define yychar H5LTyychar
/* First part of user prologue. */
-#line 20 "hl/src//H5LTparse.y"
+#line 19 "hl/src//H5LTparse.y"
#include <stdio.h>
#include <string.h>
@@ -121,8 +121,8 @@ extern int yyerror(const char *);
/*structure for compound type information*/
struct cmpd_info {
hid_t id; /*type ID*/
- hbool_t is_field; /*flag to lexer for compound member*/
- hbool_t first_memb; /*flag for first compound member*/
+ bool is_field; /*flag to lexer for compound member*/
+ bool first_memb; /*flag for first compound member*/
};
/*stack for nested compound type*/
@@ -138,7 +138,7 @@ static int csindex = -1; /*pointer to the top of compound stack*/
struct arr_info {
hsize_t dims[H5S_MAX_RANK]; /*size of each dimension, limited to 32 dimensions*/
unsigned ndims; /*number of dimensions*/
- hbool_t is_dim; /*flag to lexer for dimension*/
+ bool is_dim; /*flag to lexer for dimension*/
};
/*stack for nested array type*/
static struct arr_info arr_stack[STACK_SIZE];
@@ -146,12 +146,12 @@ static int asindex = -1; /*pointer to the top of array stack*/
static H5T_str_t str_pad; /*variable for string padding*/
static H5T_cset_t str_cset; /*variable for string character set*/
-static hbool_t is_variable = 0; /*variable for variable-length string*/
+static bool is_variable = 0; /*variable for variable-length string*/
static size_t str_size; /*variable for string size*/
static hid_t enum_id; /*type ID*/
-static hbool_t is_enum = 0; /*flag to lexer for enum type*/
-static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
+static bool is_enum = 0; /*flag to lexer for enum type*/
+static bool is_enum_memb = 0; /*flag to lexer for enum member*/
static char* enum_memb_symbol; /*enum member symbol string*/
@@ -682,16 +682,16 @@ static const yytype_int8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
- 0, 102, 102, 103, 105, 106, 107, 108, 110, 111,
- 112, 113, 114, 117, 118, 119, 120, 121, 122, 123,
- 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
- 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
- 146, 147, 148, 149, 150, 151, 152, 156, 155, 164,
- 165, 167, 167, 204, 212, 213, 216, 218, 218, 227,
- 228, 230, 231, 230, 238, 241, 248, 253, 245, 260,
- 262, 267, 274, 283, 290, 264, 314, 315, 317, 318,
- 319, 321, 322, 324, 325, 329, 328, 333, 334, 336,
- 336, 386, 388
+ 0, 101, 101, 102, 104, 105, 106, 107, 109, 110,
+ 111, 112, 113, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
+ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
+ 145, 146, 147, 148, 149, 150, 151, 155, 154, 163,
+ 164, 166, 166, 203, 211, 212, 215, 217, 217, 226,
+ 227, 229, 230, 229, 237, 240, 247, 252, 244, 259,
+ 261, 266, 273, 282, 289, 263, 313, 314, 316, 317,
+ 318, 320, 321, 323, 324, 328, 327, 332, 333, 335,
+ 335, 385, 387
};
#endif
@@ -1378,229 +1378,229 @@ yyreduce:
switch (yyn)
{
case 2: /* start: %empty */
-#line 102 "hl/src//H5LTparse.y"
+#line 101 "hl/src//H5LTparse.y"
{ memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ }
#line 1353 "hl/src//H5LTparse.c"
break;
case 3: /* start: ddl_type */
-#line 103 "hl/src//H5LTparse.y"
+#line 102 "hl/src//H5LTparse.y"
{ return (yyval.hid);}
#line 1359 "hl/src//H5LTparse.c"
break;
case 13: /* integer_type: H5T_STD_I8BE_TOKEN */
-#line 117 "hl/src//H5LTparse.y"
+#line 116 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I8BE); }
#line 1365 "hl/src//H5LTparse.c"
break;
case 14: /* integer_type: H5T_STD_I8LE_TOKEN */
-#line 118 "hl/src//H5LTparse.y"
+#line 117 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I8LE); }
#line 1371 "hl/src//H5LTparse.c"
break;
case 15: /* integer_type: H5T_STD_I16BE_TOKEN */
-#line 119 "hl/src//H5LTparse.y"
+#line 118 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I16BE); }
#line 1377 "hl/src//H5LTparse.c"
break;
case 16: /* integer_type: H5T_STD_I16LE_TOKEN */
-#line 120 "hl/src//H5LTparse.y"
+#line 119 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I16LE); }
#line 1383 "hl/src//H5LTparse.c"
break;
case 17: /* integer_type: H5T_STD_I32BE_TOKEN */
-#line 121 "hl/src//H5LTparse.y"
+#line 120 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I32BE); }
#line 1389 "hl/src//H5LTparse.c"
break;
case 18: /* integer_type: H5T_STD_I32LE_TOKEN */
-#line 122 "hl/src//H5LTparse.y"
+#line 121 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I32LE); }
#line 1395 "hl/src//H5LTparse.c"
break;
case 19: /* integer_type: H5T_STD_I64BE_TOKEN */
-#line 123 "hl/src//H5LTparse.y"
+#line 122 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I64BE); }
#line 1401 "hl/src//H5LTparse.c"
break;
case 20: /* integer_type: H5T_STD_I64LE_TOKEN */
-#line 124 "hl/src//H5LTparse.y"
+#line 123 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_I64LE); }
#line 1407 "hl/src//H5LTparse.c"
break;
case 21: /* integer_type: H5T_STD_U8BE_TOKEN */
-#line 125 "hl/src//H5LTparse.y"
+#line 124 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U8BE); }
#line 1413 "hl/src//H5LTparse.c"
break;
case 22: /* integer_type: H5T_STD_U8LE_TOKEN */
-#line 126 "hl/src//H5LTparse.y"
+#line 125 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U8LE); }
#line 1419 "hl/src//H5LTparse.c"
break;
case 23: /* integer_type: H5T_STD_U16BE_TOKEN */
-#line 127 "hl/src//H5LTparse.y"
+#line 126 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U16BE); }
#line 1425 "hl/src//H5LTparse.c"
break;
case 24: /* integer_type: H5T_STD_U16LE_TOKEN */
-#line 128 "hl/src//H5LTparse.y"
+#line 127 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U16LE); }
#line 1431 "hl/src//H5LTparse.c"
break;
case 25: /* integer_type: H5T_STD_U32BE_TOKEN */
-#line 129 "hl/src//H5LTparse.y"
+#line 128 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U32BE); }
#line 1437 "hl/src//H5LTparse.c"
break;
case 26: /* integer_type: H5T_STD_U32LE_TOKEN */
-#line 130 "hl/src//H5LTparse.y"
+#line 129 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U32LE); }
#line 1443 "hl/src//H5LTparse.c"
break;
case 27: /* integer_type: H5T_STD_U64BE_TOKEN */
-#line 131 "hl/src//H5LTparse.y"
+#line 130 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U64BE); }
#line 1449 "hl/src//H5LTparse.c"
break;
case 28: /* integer_type: H5T_STD_U64LE_TOKEN */
-#line 132 "hl/src//H5LTparse.y"
+#line 131 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_STD_U64LE); }
#line 1455 "hl/src//H5LTparse.c"
break;
case 29: /* integer_type: H5T_NATIVE_CHAR_TOKEN */
-#line 133 "hl/src//H5LTparse.y"
+#line 132 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); }
#line 1461 "hl/src//H5LTparse.c"
break;
case 30: /* integer_type: H5T_NATIVE_SCHAR_TOKEN */
-#line 134 "hl/src//H5LTparse.y"
+#line 133 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); }
#line 1467 "hl/src//H5LTparse.c"
break;
case 31: /* integer_type: H5T_NATIVE_UCHAR_TOKEN */
-#line 135 "hl/src//H5LTparse.y"
+#line 134 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); }
#line 1473 "hl/src//H5LTparse.c"
break;
case 32: /* integer_type: H5T_NATIVE_SHORT_TOKEN */
-#line 136 "hl/src//H5LTparse.y"
+#line 135 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); }
#line 1479 "hl/src//H5LTparse.c"
break;
case 33: /* integer_type: H5T_NATIVE_USHORT_TOKEN */
-#line 137 "hl/src//H5LTparse.y"
+#line 136 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); }
#line 1485 "hl/src//H5LTparse.c"
break;
case 34: /* integer_type: H5T_NATIVE_INT_TOKEN */
-#line 138 "hl/src//H5LTparse.y"
+#line 137 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); }
#line 1491 "hl/src//H5LTparse.c"
break;
case 35: /* integer_type: H5T_NATIVE_UINT_TOKEN */
-#line 139 "hl/src//H5LTparse.y"
+#line 138 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); }
#line 1497 "hl/src//H5LTparse.c"
break;
case 36: /* integer_type: H5T_NATIVE_LONG_TOKEN */
-#line 140 "hl/src//H5LTparse.y"
+#line 139 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); }
#line 1503 "hl/src//H5LTparse.c"
break;
case 37: /* integer_type: H5T_NATIVE_ULONG_TOKEN */
-#line 141 "hl/src//H5LTparse.y"
+#line 140 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); }
#line 1509 "hl/src//H5LTparse.c"
break;
case 38: /* integer_type: H5T_NATIVE_LLONG_TOKEN */
-#line 142 "hl/src//H5LTparse.y"
+#line 141 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); }
#line 1515 "hl/src//H5LTparse.c"
break;
case 39: /* integer_type: H5T_NATIVE_ULLONG_TOKEN */
-#line 143 "hl/src//H5LTparse.y"
+#line 142 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); }
#line 1521 "hl/src//H5LTparse.c"
break;
case 40: /* fp_type: H5T_IEEE_F32BE_TOKEN */
-#line 146 "hl/src//H5LTparse.y"
+#line 145 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); }
#line 1527 "hl/src//H5LTparse.c"
break;
case 41: /* fp_type: H5T_IEEE_F32LE_TOKEN */
-#line 147 "hl/src//H5LTparse.y"
+#line 146 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); }
#line 1533 "hl/src//H5LTparse.c"
break;
case 42: /* fp_type: H5T_IEEE_F64BE_TOKEN */
-#line 148 "hl/src//H5LTparse.y"
+#line 147 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); }
#line 1539 "hl/src//H5LTparse.c"
break;
case 43: /* fp_type: H5T_IEEE_F64LE_TOKEN */
-#line 149 "hl/src//H5LTparse.y"
+#line 148 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); }
#line 1545 "hl/src//H5LTparse.c"
break;
case 44: /* fp_type: H5T_NATIVE_FLOAT_TOKEN */
-#line 150 "hl/src//H5LTparse.y"
+#line 149 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); }
#line 1551 "hl/src//H5LTparse.c"
break;
case 45: /* fp_type: H5T_NATIVE_DOUBLE_TOKEN */
-#line 151 "hl/src//H5LTparse.y"
+#line 150 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); }
#line 1557 "hl/src//H5LTparse.c"
break;
case 46: /* fp_type: H5T_NATIVE_LDOUBLE_TOKEN */
-#line 152 "hl/src//H5LTparse.y"
+#line 151 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); }
#line 1563 "hl/src//H5LTparse.c"
break;
case 47: /* $@1: %empty */
-#line 156 "hl/src//H5LTparse.y"
+#line 155 "hl/src//H5LTparse.y"
{ csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ }
#line 1569 "hl/src//H5LTparse.c"
break;
case 48: /* compound_type: H5T_COMPOUND_TOKEN $@1 '{' memb_list '}' */
-#line 158 "hl/src//H5LTparse.y"
+#line 157 "hl/src//H5LTparse.y"
{ (yyval.hid) = cmpd_stack[csindex].id;
cmpd_stack[csindex].id = 0;
cmpd_stack[csindex].first_memb = 1;
@@ -1610,13 +1610,13 @@ yyreduce:
break;
case 51: /* $@2: %empty */
-#line 167 "hl/src//H5LTparse.y"
+#line 166 "hl/src//H5LTparse.y"
{ cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ }
#line 1585 "hl/src//H5LTparse.c"
break;
case 52: /* memb_def: ddl_type $@2 field_name field_offset ';' */
-#line 169 "hl/src//H5LTparse.y"
+#line 168 "hl/src//H5LTparse.y"
{
size_t origin_size, new_size;
hid_t dtype_id = cmpd_stack[csindex].id;
@@ -1643,7 +1643,7 @@ yyreduce:
}
}
if((yyvsp[-2].sval)) {
- HDfree((yyvsp[-2].sval));
+ free((yyvsp[-2].sval));
(yyvsp[-2].sval) = NULL;
}
cmpd_stack[csindex].is_field = 0;
@@ -1655,35 +1655,35 @@ yyreduce:
break;
case 53: /* field_name: STRING */
-#line 205 "hl/src//H5LTparse.y"
+#line 204 "hl/src//H5LTparse.y"
{
- (yyval.sval) = HDstrdup(yylval.sval);
- HDfree(yylval.sval);
+ (yyval.sval) = strdup(yylval.sval);
+ free(yylval.sval);
yylval.sval = NULL;
}
#line 1634 "hl/src//H5LTparse.c"
break;
case 54: /* field_offset: %empty */
-#line 212 "hl/src//H5LTparse.y"
+#line 211 "hl/src//H5LTparse.y"
{ (yyval.ival) = 0; }
#line 1640 "hl/src//H5LTparse.c"
break;
case 55: /* field_offset: ':' offset */
-#line 214 "hl/src//H5LTparse.y"
+#line 213 "hl/src//H5LTparse.y"
{ (yyval.ival) = yylval.ival; }
#line 1646 "hl/src//H5LTparse.c"
break;
case 57: /* $@3: %empty */
-#line 218 "hl/src//H5LTparse.y"
+#line 217 "hl/src//H5LTparse.y"
{ asindex++; /*pushd onto the stack*/ }
#line 1652 "hl/src//H5LTparse.c"
break;
case 58: /* array_type: H5T_ARRAY_TOKEN $@3 '{' dim_list ddl_type '}' */
-#line 220 "hl/src//H5LTparse.y"
+#line 219 "hl/src//H5LTparse.y"
{
(yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims);
arr_stack[asindex].ndims = 0;
@@ -1694,13 +1694,13 @@ yyreduce:
break;
case 61: /* $@4: %empty */
-#line 230 "hl/src//H5LTparse.y"
+#line 229 "hl/src//H5LTparse.y"
{ arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ }
#line 1669 "hl/src//H5LTparse.c"
break;
case 62: /* $@5: %empty */
-#line 231 "hl/src//H5LTparse.y"
+#line 230 "hl/src//H5LTparse.y"
{ unsigned ndims = arr_stack[asindex].ndims;
arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival;
arr_stack[asindex].ndims++;
@@ -1710,13 +1710,13 @@ yyreduce:
break;
case 65: /* vlen_type: H5T_VLEN_TOKEN '{' ddl_type '}' */
-#line 242 "hl/src//H5LTparse.y"
+#line 241 "hl/src//H5LTparse.y"
{ (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); }
#line 1685 "hl/src//H5LTparse.c"
break;
case 66: /* @6: %empty */
-#line 248 "hl/src//H5LTparse.y"
+#line 247 "hl/src//H5LTparse.y"
{
size_t size = (size_t)yylval.ival;
(yyval.hid) = H5Tcreate(H5T_OPAQUE, size);
@@ -1725,23 +1725,23 @@ yyreduce:
break;
case 67: /* $@7: %empty */
-#line 253 "hl/src//H5LTparse.y"
+#line 252 "hl/src//H5LTparse.y"
{
H5Tset_tag((yyvsp[-3].hid), yylval.sval);
- HDfree(yylval.sval);
+ free(yylval.sval);
yylval.sval = NULL;
}
#line 1704 "hl/src//H5LTparse.c"
break;
case 68: /* opaque_type: H5T_OPAQUE_TOKEN '{' OPQ_SIZE_TOKEN opaque_size ';' @6 OPQ_TAG_TOKEN opaque_tag ';' $@7 '}' */
-#line 258 "hl/src//H5LTparse.y"
+#line 257 "hl/src//H5LTparse.y"
{ (yyval.hid) = (yyvsp[-5].hid); }
#line 1710 "hl/src//H5LTparse.c"
break;
case 71: /* $@8: %empty */
-#line 267 "hl/src//H5LTparse.y"
+#line 266 "hl/src//H5LTparse.y"
{
if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN)
is_variable = 1;
@@ -1752,7 +1752,7 @@ yyreduce:
break;
case 72: /* $@9: %empty */
-#line 274 "hl/src//H5LTparse.y"
+#line 273 "hl/src//H5LTparse.y"
{
if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN)
str_pad = H5T_STR_NULLTERM;
@@ -1765,7 +1765,7 @@ yyreduce:
break;
case 73: /* $@10: %empty */
-#line 283 "hl/src//H5LTparse.y"
+#line 282 "hl/src//H5LTparse.y"
{
if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN)
str_cset = H5T_CSET_ASCII;
@@ -1776,7 +1776,7 @@ yyreduce:
break;
case 74: /* @11: %empty */
-#line 290 "hl/src//H5LTparse.y"
+#line 289 "hl/src//H5LTparse.y"
{
if((yyvsp[-1].hid) == H5T_C_S1_TOKEN)
(yyval.hid) = H5Tcopy(H5T_C_S1);
@@ -1787,7 +1787,7 @@ yyreduce:
break;
case 75: /* string_type: H5T_STRING_TOKEN '{' STRSIZE_TOKEN strsize ';' $@8 STRPAD_TOKEN strpad ';' $@9 CSET_TOKEN cset ';' $@10 CTYPE_TOKEN ctype ';' @11 '}' */
-#line 297 "hl/src//H5LTparse.y"
+#line 296 "hl/src//H5LTparse.y"
{
hid_t str_id = (yyvsp[-1].hid);
@@ -1808,78 +1808,78 @@ yyreduce:
break;
case 76: /* strsize: H5T_VARIABLE_TOKEN */
-#line 314 "hl/src//H5LTparse.y"
+#line 313 "hl/src//H5LTparse.y"
{(yyval.ival) = H5T_VARIABLE_TOKEN;}
#line 1783 "hl/src//H5LTparse.c"
break;
case 78: /* strpad: H5T_STR_NULLTERM_TOKEN */
-#line 317 "hl/src//H5LTparse.y"
+#line 316 "hl/src//H5LTparse.y"
{(yyval.ival) = H5T_STR_NULLTERM_TOKEN;}
#line 1789 "hl/src//H5LTparse.c"
break;
case 79: /* strpad: H5T_STR_NULLPAD_TOKEN */
-#line 318 "hl/src//H5LTparse.y"
+#line 317 "hl/src//H5LTparse.y"
{(yyval.ival) = H5T_STR_NULLPAD_TOKEN;}
#line 1795 "hl/src//H5LTparse.c"
break;
case 80: /* strpad: H5T_STR_SPACEPAD_TOKEN */
-#line 319 "hl/src//H5LTparse.y"
+#line 318 "hl/src//H5LTparse.y"
{(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;}
#line 1801 "hl/src//H5LTparse.c"
break;
case 81: /* cset: H5T_CSET_ASCII_TOKEN */
-#line 321 "hl/src//H5LTparse.y"
+#line 320 "hl/src//H5LTparse.y"
{(yyval.ival) = H5T_CSET_ASCII_TOKEN;}
#line 1807 "hl/src//H5LTparse.c"
break;
case 82: /* cset: H5T_CSET_UTF8_TOKEN */
-#line 322 "hl/src//H5LTparse.y"
+#line 321 "hl/src//H5LTparse.y"
{(yyval.ival) = H5T_CSET_UTF8_TOKEN;}
#line 1813 "hl/src//H5LTparse.c"
break;
case 83: /* ctype: H5T_C_S1_TOKEN */
-#line 324 "hl/src//H5LTparse.y"
+#line 323 "hl/src//H5LTparse.y"
{(yyval.hid) = H5T_C_S1_TOKEN;}
#line 1819 "hl/src//H5LTparse.c"
break;
case 84: /* ctype: H5T_FORTRAN_S1_TOKEN */
-#line 325 "hl/src//H5LTparse.y"
+#line 324 "hl/src//H5LTparse.y"
{(yyval.hid) = H5T_FORTRAN_S1_TOKEN;}
#line 1825 "hl/src//H5LTparse.c"
break;
case 85: /* $@12: %empty */
-#line 329 "hl/src//H5LTparse.y"
+#line 328 "hl/src//H5LTparse.y"
{ is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); }
#line 1831 "hl/src//H5LTparse.c"
break;
case 86: /* enum_type: H5T_ENUM_TOKEN '{' integer_type ';' $@12 enum_list '}' */
-#line 331 "hl/src//H5LTparse.y"
+#line 330 "hl/src//H5LTparse.y"
{ is_enum = 0; /*reset*/ (yyval.hid) = enum_id; }
#line 1837 "hl/src//H5LTparse.c"
break;
case 89: /* $@13: %empty */
-#line 336 "hl/src//H5LTparse.y"
+#line 335 "hl/src//H5LTparse.y"
{
is_enum_memb = 1; /*indicate member of enum*/
- enum_memb_symbol = HDstrdup(yylval.sval);
- HDfree(yylval.sval);
+ enum_memb_symbol = strdup(yylval.sval);
+ free(yylval.sval);
yylval.sval = NULL;
}
#line 1848 "hl/src//H5LTparse.c"
break;
case 90: /* enum_def: enum_symbol $@13 enum_val ';' */
-#line 343 "hl/src//H5LTparse.y"
+#line 342 "hl/src//H5LTparse.y"
{
char char_val=(char)yylval.ival;
short short_val=(short)yylval.ival;
@@ -1916,7 +1916,7 @@ yyreduce:
}
is_enum_memb = 0;
- if(enum_memb_symbol) HDfree(enum_memb_symbol);
+ if(enum_memb_symbol) free(enum_memb_symbol);
}
H5Tclose(super);
diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h
index a96c51d..84c5fd0 100644
--- a/hl/src/H5LTparse.h
+++ b/hl/src/H5LTparse.h
@@ -118,7 +118,7 @@ extern int H5LTyydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
-#line 69 "hl/src//H5LTparse.y"
+#line 68 "hl/src//H5LTparse.y"
int ival; /*for integer token*/
char *sval; /*for name string*/
diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y
index 93e72a3..8621836 100644
--- a/hl/src/H5LTparse.y
+++ b/hl/src/H5LTparse.y
@@ -31,8 +31,8 @@ extern int yyerror(const char *);
/*structure for compound type information*/
struct cmpd_info {
hid_t id; /*type ID*/
- hbool_t is_field; /*flag to lexer for compound member*/
- hbool_t first_memb; /*flag for first compound member*/
+ bool is_field; /*flag to lexer for compound member*/
+ bool first_memb; /*flag for first compound member*/
};
/*stack for nested compound type*/
@@ -48,7 +48,7 @@ static int csindex = -1; /*pointer to the top of compound stack*/
struct arr_info {
hsize_t dims[H5S_MAX_RANK]; /*size of each dimension, limited to 32 dimensions*/
unsigned ndims; /*number of dimensions*/
- hbool_t is_dim; /*flag to lexer for dimension*/
+ bool is_dim; /*flag to lexer for dimension*/
};
/*stack for nested array type*/
static struct arr_info arr_stack[STACK_SIZE];
@@ -56,12 +56,12 @@ static int asindex = -1; /*pointer to the top of array stack*/
static H5T_str_t str_pad; /*variable for string padding*/
static H5T_cset_t str_cset; /*variable for string character set*/
-static hbool_t is_variable = 0; /*variable for variable-length string*/
+static bool is_variable = 0; /*variable for variable-length string*/
static size_t str_size; /*variable for string size*/
static hid_t enum_id; /*type ID*/
-static hbool_t is_enum = 0; /*flag to lexer for enum type*/
-static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
+static bool is_enum = 0; /*flag to lexer for enum type*/
+static bool is_enum_memb = 0; /*flag to lexer for enum member*/
static char* enum_memb_symbol; /*enum member symbol string*/
%}
@@ -191,7 +191,7 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le
}
}
if($<sval>3) {
- HDfree($<sval>3);
+ free($<sval>3);
$<sval>3 = NULL;
}
cmpd_stack[csindex].is_field = 0;
@@ -202,8 +202,8 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le
;
field_name : STRING
{
- $<sval>$ = HDstrdup(yylval.sval);
- HDfree(yylval.sval);
+ $<sval>$ = strdup(yylval.sval);
+ free(yylval.sval);
yylval.sval = NULL;
}
;
@@ -251,7 +251,7 @@ opaque_type : H5T_OPAQUE_TOKEN
OPQ_TAG_TOKEN opaque_tag ';'
{
H5Tset_tag($<hid>6, yylval.sval);
- HDfree(yylval.sval);
+ free(yylval.sval);
yylval.sval = NULL;
}
'}' { $<hid>$ = $<hid>6; }
@@ -334,8 +334,8 @@ enum_list :
;
enum_def : enum_symbol {
is_enum_memb = 1; /*indicate member of enum*/
- enum_memb_symbol = HDstrdup(yylval.sval);
- HDfree(yylval.sval);
+ enum_memb_symbol = strdup(yylval.sval);
+ free(yylval.sval);
yylval.sval = NULL;
}
enum_val ';'
@@ -375,7 +375,7 @@ enum_def : enum_symbol {
}
is_enum_memb = 0;
- if(enum_memb_symbol) HDfree(enum_memb_symbol);
+ if(enum_memb_symbol) free(enum_memb_symbol);
}
H5Tclose(super);
diff --git a/hl/src/H5LTprivate.h b/hl/src/H5LTprivate.h
index 346ede4..bea2e63 100644
--- a/hl/src/H5LTprivate.h
+++ b/hl/src/H5LTprivate.h
@@ -24,7 +24,7 @@ H5_HLDLL herr_t H5LT_set_attribute_numerical(hid_t loc_id, const char *obj_name,
size_t size, hid_t type_id, const void *data);
H5_HLDLL herr_t H5LT_set_attribute_string(hid_t dset_id, const char *name, const char *buf);
H5_HLDLL char *H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen,
- hbool_t no_user_buf);
+ bool no_user_buf);
H5_HLDLL hid_t H5LTyyparse(void);
#endif
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c
index 9d5d627..65cdce3 100644
--- a/hl/src/H5PT.c
+++ b/hl/src/H5PT.c
@@ -84,7 +84,7 @@ H5PTcreate(hid_t loc_id, const char *dset_name, hid_t dtype_id, hsize_t chunk_si
goto error;
/* Get memory for the table identifier */
- table = (htbl_t *)HDmalloc(sizeof(htbl_t));
+ table = (htbl_t *)malloc(sizeof(htbl_t));
if (table == NULL) {
goto error;
}
@@ -153,7 +153,7 @@ error:
if (table) {
if (table->type_id != H5I_INVALID_HID)
H5Tclose(table->type_id);
- HDfree(table);
+ free(table);
}
return ret_value;
@@ -203,7 +203,7 @@ H5PTcreate_fl(hid_t loc_id, const char *dset_name, hid_t dtype_id, hsize_t chunk
goto error;
/* Get memory for the table identifier */
- table = (htbl_t *)HDmalloc(sizeof(htbl_t));
+ table = (htbl_t *)malloc(sizeof(htbl_t));
if (table == NULL) {
goto error;
}
@@ -267,7 +267,7 @@ error:
if (table) {
if (table->type_id != H5I_INVALID_HID)
H5Tclose(table->type_id);
- HDfree(table);
+ free(table);
}
return ret_value;
@@ -310,7 +310,7 @@ H5PTopen(hid_t loc_id, const char *dset_name)
H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)H5PT_free_id)) < 0)
goto error;
- table = (htbl_t *)HDmalloc(sizeof(htbl_t));
+ table = (htbl_t *)malloc(sizeof(htbl_t));
if (table == NULL) {
goto error;
}
@@ -370,7 +370,7 @@ error:
H5Tclose(table->type_id);
if (table->dset_id != H5I_INVALID_HID)
H5Dclose(table->dset_id);
- HDfree(table);
+ free(table);
}
return ret_value;
@@ -387,7 +387,7 @@ error:
static herr_t
H5PT_free_id(void *id, void H5_ATTR_UNUSED **_ctx)
{
- HDfree(id);
+ free(id);
return SUCCEED;
}
@@ -422,7 +422,7 @@ H5PT_close(htbl_t *table)
if (H5Tclose(table->type_id) < 0)
goto error;
- HDfree(table);
+ free(table);
return SUCCEED;
@@ -432,7 +432,7 @@ error:
H5Dclose(table->dset_id);
H5Tclose(table->type_id);
H5E_END_TRY
- HDfree(table);
+ free(table);
}
return FAIL;
}
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index dd938bf..4049796 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -20,7 +20,7 @@
*-------------------------------------------------------------------------
*/
-static hbool_t H5TB_find_field(const char *field, const char *field_list);
+static bool H5TB_find_field(const char *field, const char *field_list);
static herr_t H5TB_attach_attributes(const char *table_title, hid_t loc_id, const char *dset_name,
hsize_t nfields, hid_t tid);
@@ -163,7 +163,7 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi
if (NULL == (member_name = H5Tget_member_name(mem_type_id, (unsigned)i)))
goto out;
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_NAME", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_NAME", (int)i);
/* attach the attribute */
if (H5LTset_attribute_string(loc_id, dset_name, attr_name, member_name) < 0)
@@ -185,7 +185,7 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi
goto out;
for (i = 0; i < nfields; i++) {
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
if ((attr_id = H5Acreate2(did, attr_name, field_types[i], sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -1229,9 +1229,9 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
if (H5TBget_table_info(loc_id, dset_name, &nfields, &ntotal_records) < 0)
goto out;
- if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
- if (NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
/* get field info */
@@ -1251,7 +1251,7 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
read_nrecords = ntotal_records - read_start;
if (read_nrecords) {
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)read_nrecords, src_size)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)read_nrecords, src_size)))
goto out;
/* read the records after the deleted one(s) */
@@ -1317,11 +1317,11 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
out:
if (tmp_buf)
- HDfree(tmp_buf);
+ free(tmp_buf);
if (src_offset)
- HDfree(src_offset);
+ free(src_offset);
if (src_sizes)
- HDfree(src_sizes);
+ free(src_sizes);
if (mem_type_id > 0)
if (H5Tclose(mem_type_id) < 0)
ret_val = -1;
@@ -1401,7 +1401,7 @@ H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
goto out;
read_nrecords = ntotal_records - start;
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)read_nrecords, type_size)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)read_nrecords, type_size)))
goto out;
/* read the records after the inserted one(s) */
@@ -1473,7 +1473,7 @@ H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
out:
if (tmp_buf)
- HDfree(tmp_buf);
+ free(tmp_buf);
if (sid > 0)
if (H5Sclose(sid) < 0)
ret_val = -1;
@@ -1543,9 +1543,9 @@ H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize
if (H5TBget_table_info(loc_id, dset_name1, &nfields, &ntotal_records) < 0)
goto out;
- if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
- if (NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
/* get field info */
@@ -1573,7 +1573,7 @@ H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize
if (0 == (type_size1 = H5Tget_size(tid)))
goto out;
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size1)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size1)))
goto out;
/* define a hyperslab in the dataset of the size of the records */
@@ -1601,11 +1601,11 @@ H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize
out:
if (tmp_buf)
- HDfree(tmp_buf);
+ free(tmp_buf);
if (src_offset)
- HDfree(src_offset);
+ free(src_offset);
if (src_sizes)
- HDfree(src_sizes);
+ free(src_sizes);
if (tid > 0)
if (H5Tclose(tid) < 0)
ret_val = -1;
@@ -1696,9 +1696,9 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
if (H5TBget_table_info(loc_id1, dset_name1, &nfields, &nrecords) < 0)
goto out;
- if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
- if (NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
/* get field info */
@@ -1773,7 +1773,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
goto out;
/* alloc fill value attribute buffer */
- if (NULL == (tmp_fill_buf = (unsigned char *)HDmalloc(type_size)))
+ if (NULL == (tmp_fill_buf = (unsigned char *)malloc(type_size)))
goto out;
/* get the fill value attributes */
@@ -1796,7 +1796,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
/* get the member offset */
member_offset = H5Tget_member_offset(tid_3, (unsigned)i);
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
if ((attr_id = H5Acreate2(did_3, attr_name, member_type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -1823,7 +1823,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
* read data from 1st table
*-------------------------------------------------------------------------
*/
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size)))
goto out;
/* define a hyperslab in the dataset of the size of the records */
@@ -1856,7 +1856,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
if (H5Sclose(m_sid) < 0)
goto out;
m_sid = H5I_INVALID_HID;
- HDfree(tmp_buf);
+ free(tmp_buf);
tmp_buf = NULL;
/*-------------------------------------------------------------------------
@@ -1889,7 +1889,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
*-------------------------------------------------------------------------
*/
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size)))
goto out;
/* define a hyperslab in the dataset of the size of the records */
@@ -1919,13 +1919,13 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
out:
if (tmp_buf)
- HDfree(tmp_buf);
+ free(tmp_buf);
if (tmp_fill_buf)
- HDfree(tmp_fill_buf);
+ free(tmp_fill_buf);
if (src_offset)
- HDfree(src_offset);
+ free(src_offset);
if (src_sizes)
- HDfree(src_sizes);
+ free(src_sizes);
if (member_type_id > 0)
if (H5Tclose(member_type_id) < 0)
ret_val = -1;
@@ -2035,7 +2035,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
char *member_name = NULL;
unsigned char *tmp_buf = NULL;
unsigned char *tmp_fill_buf = NULL;
- hbool_t inserted;
+ bool inserted;
herr_t ret_val = -1;
/* check the arguments */
@@ -2087,7 +2087,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
goto out;
/* alloc fill value attribute buffer */
- if (NULL == (tmp_fill_buf = (unsigned char *)HDmalloc(total_size)))
+ if (NULL == (tmp_fill_buf = (unsigned char *)malloc(total_size)))
goto out;
/* get the fill value attributes */
@@ -2108,7 +2108,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
goto out;
curr_offset = 0;
- inserted = FALSE;
+ inserted = false;
/* insert the old fields, counting with the new one */
for (i = 0; i < nfields + 1; i++) {
@@ -2129,7 +2129,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
curr_offset += new_member_size;
- inserted = TRUE;
+ inserted = true;
} /* end if */
else {
/* get the member name */
@@ -2188,7 +2188,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
*-------------------------------------------------------------------------
*/
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, (size_t)total_size)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size)))
goto out;
/* define a hyperslab in the dataset of the size of the records */
@@ -2296,7 +2296,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
/* get the member offset */
member_offset = H5Tget_member_offset(tid_3, (unsigned)i);
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
if ((attr_id = H5Acreate2(did_3, attr_name, member_type_id, sid_3, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -2319,7 +2319,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
*-------------------------------------------------------------------------
*/
if (fill_data) {
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)(nfields - 1));
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)(nfields - 1));
/* get the member type */
if ((member_type_id = H5Tget_member_type(tid_3, (unsigned)nfields - 1)) < 0)
@@ -2346,9 +2346,9 @@ out:
if (member_name)
H5free_memory(member_name);
if (tmp_buf)
- HDfree(tmp_buf);
+ free(tmp_buf);
if (tmp_fill_buf)
- HDfree(tmp_fill_buf);
+ free(tmp_fill_buf);
if (preserve_id > 0)
if (H5Pclose(preserve_id) < 0)
ret_val = -1;
@@ -2448,7 +2448,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
char *member_name = NULL;
unsigned char *tmp_buf = NULL;
unsigned char *tmp_fill_buf = NULL;
- htri_t has_fill = FALSE;
+ htri_t has_fill = false;
herr_t ret_val = -1;
/* check the arguments */
@@ -2544,7 +2544,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
curr_offset = 0;
/* alloc fill value attribute buffer */
- if (NULL == (tmp_fill_buf = (unsigned char *)HDmalloc((size_t)type_size2)))
+ if (NULL == (tmp_fill_buf = (unsigned char *)malloc((size_t)type_size2)))
goto out;
/*-------------------------------------------------------------------------
@@ -2581,7 +2581,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
*-------------------------------------------------------------------------
*/
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
/* check if we have the _FILL attribute */
if ((has_fill = H5Aexists(did_1, attr_name)) < 0)
@@ -2653,7 +2653,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
if (H5Tinsert(read_type_id, member_name, (size_t)0, member_type_id) < 0)
goto out;
- if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, member_size)))
+ if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, member_size)))
goto out;
/* read */
@@ -2698,7 +2698,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
goto out;
write_type_id = H5I_INVALID_HID;
- HDfree(tmp_buf);
+ free(tmp_buf);
tmp_buf = NULL;
} /* end if */
@@ -2758,7 +2758,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
/* get the member offset */
member_offset = H5Tget_member_offset(tid_3, (unsigned)i);
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
if ((attr_id = H5Acreate2(did_3, attr_name, member_type_id, sid_1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -2788,9 +2788,9 @@ out:
if (member_name)
H5free_memory(member_name);
if (tmp_fill_buf)
- HDfree(tmp_fill_buf);
+ free(tmp_fill_buf);
if (tmp_buf)
- HDfree(tmp_buf);
+ free(tmp_buf);
if (attr_id > 0)
if (H5Aclose(attr_id) < 0)
ret_val = -1;
@@ -2878,7 +2878,7 @@ H5TBAget_title(hid_t loc_id, char *table_title)
*
* Purpose: Read the table attribute fill values
*
- * Return: Success: TRUE/FALSE, Failure: -1
+ * Return: Success: true/false, Failure: -1
*
* Programmer: Pedro Vicente
*
@@ -2896,7 +2896,7 @@ H5TBAget_fill(hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char
hsize_t i;
size_t *src_offset = NULL;
char attr_name[255];
- htri_t has_fill = FALSE;
+ htri_t has_fill = false;
htri_t ret_val = -1;
/* check the arguments */
@@ -2907,7 +2907,7 @@ H5TBAget_fill(hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char
if (H5TBget_table_info(loc_id, dset_name, &nfields, &nrecords) < 0)
goto out;
- if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t))))
+ if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t))))
goto out;
/* get field info */
@@ -2915,7 +2915,7 @@ H5TBAget_fill(hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char
goto out;
for (i = 0; i < nfields; i++) {
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_FILL", (int)i);
/* Check if we have the _FILL attribute */
if ((has_fill = H5Aexists(dset_id, attr_name)) < 0)
@@ -2931,7 +2931,7 @@ H5TBAget_fill(hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char
out:
if (src_offset)
- HDfree(src_offset);
+ free(src_offset);
return ret_val;
} /* end H5TBAget_fill() */
@@ -3150,7 +3150,7 @@ out:
*
* Purpose: Find a string field
*
- * Return: Success: TRUE/FALSE, Failure: N/A
+ * Return: Success: true/false, Failure: N/A
*
* Programmer: Pedro Vicente
*
@@ -3158,7 +3158,7 @@ out:
*
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE static hbool_t
+H5_ATTR_PURE static bool
H5TB_find_field(const char *field, const char *field_list)
{
const char *start = field_list;
@@ -3166,22 +3166,22 @@ H5TB_find_field(const char *field, const char *field_list)
/* check the arguments */
if (field == NULL)
- return FALSE;
+ return false;
if (field_list == NULL)
- return FALSE;
+ return false;
- while ((end = HDstrstr(start, ",")) != 0) {
+ while ((end = strstr(start, ",")) != 0) {
ptrdiff_t count = end - start;
- if (HDstrncmp(start, field, (size_t)count) == 0 && (size_t)count == HDstrlen(field))
- return TRUE;
+ if (strncmp(start, field, (size_t)count) == 0 && (size_t)count == strlen(field))
+ return true;
start = end + 1;
} /* end while */
- if (HDstrncmp(start, field, HDstrlen(field)) == 0)
- return TRUE;
+ if (strncmp(start, field, strlen(field)) == 0)
+ return true;
- return FALSE;
+ return false;
} /* end H5TB_find_field() */
/*-------------------------------------------------------------------------
@@ -3228,7 +3228,7 @@ H5TB_attach_attributes(const char *table_title, hid_t loc_id, const char *dset_n
if (NULL == (member_name = H5Tget_member_name(tid, (unsigned)i)))
goto out;
- HDsnprintf(attr_name, sizeof(attr_name), "FIELD_%d_NAME", (int)i);
+ snprintf(attr_name, sizeof(attr_name), "FIELD_%d_NAME", (int)i);
/* attach the attribute */
if (H5LTset_attribute_string(loc_id, dset_name, attr_name, member_name) < 0)
@@ -3279,11 +3279,11 @@ H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const si
if (H5TBget_table_info(loc_id, dset_name, &nfields, NULL) < 0)
goto out;
- if (NULL == (fnames = (char **)HDcalloc(sizeof(char *), (size_t)nfields)))
+ if (NULL == (fnames = (char **)calloc(sizeof(char *), (size_t)nfields)))
goto out;
for (i = 0; i < nfields; i++)
- if (NULL == (fnames[i] = (char *)HDmalloc(HLTB_MAX_FIELD_LEN)))
+ if (NULL == (fnames[i] = (char *)malloc(HLTB_MAX_FIELD_LEN)))
goto out;
/* get field info */
@@ -3321,8 +3321,8 @@ out:
if (fnames) {
for (i = 0; i < nfields; i++)
if (fnames[i])
- HDfree(fnames[i]);
- HDfree(fnames);
+ free(fnames[i]);
+ free(fnames);
} /* end if */
if (mtype_id > 0)
if (H5Tclose(mtype_id) < 0)
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index 7b45694..438a35a 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -79,12 +79,12 @@ main(int argc, char **argv)
char filename[65];
if (argc < 2 || !argv[0] || !argv[1]) {
- HDprintf("Usage: gen_test [le | be]\n");
+ printf("Usage: gen_test [le | be]\n");
return 1;
}
if (argv[1] && (strcmp("le", argv[1]) != 0) && (strcmp("be", argv[1]) != 0)) {
- HDprintf("Usage: gen_test [le | be]\n");
+ printf("Usage: gen_test [le | be]\n");
return 1;
}
@@ -104,11 +104,11 @@ main(int argc, char **argv)
if (nerrors)
goto error;
- HDprintf("Dimension scales file generation passed.\n");
+ printf("Dimension scales file generation passed.\n");
return 0;
error:
- HDprintf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n", nerrors);
+ printf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n", nerrors);
return 1;
}
@@ -192,11 +192,11 @@ test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx)
if (H5DSis_attached(did, dsid, idx) == 0) {
if (H5DSattach_scale(did, dsid, idx) >= 0) {
if (H5DSis_attached(did, dsid, idx) > 0) {
- /* HDprintf(" scale attached "); */
+ /* printf(" scale attached "); */
ret_value = SUCCEED;
}
else if (H5DSis_attached(did, dsid, idx) == 0) {
- HDprintf(" scale not attached ");
+ printf(" scale not attached ");
}
}
}
@@ -260,13 +260,13 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if (H5DSis_attached(did, dsid, idx) == 1) {
if ((name_len = H5DSget_scale_name(dsid, NULL, (size_t)0)) > 0) {
- name_out = (char *)HDmalloc((size_t)name_len * sizeof(char));
+ name_out = (char *)malloc((size_t)name_len * sizeof(char));
if (name_out != NULL) {
if (H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) {
if (strcmp(scalename, name_out) == 0) {
ret_value = SUCCEED;
}
- HDfree(name_out);
+ free(name_out);
name_out = NULL;
}
}
diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c
index 8eacf55..7eefd5c 100644
--- a/hl/test/gen_test_ld.c
+++ b/hl/test/gen_test_ld.c
@@ -103,7 +103,7 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m
goto done;
/* Set up dataset's creation properties */
- if (!HDstrcmp(dname, DSET_NONE))
+ if (!strcmp(dname, DSET_NONE))
dcpl = H5P_DEFAULT;
else {
hsize_t chunk_dims[H5S_MAX_RANK]; /* Dimension sizes for chunks */
@@ -116,11 +116,11 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m
goto done;
} /* end else */
- if (!HDstrcmp(dname, DSET_ALLOC_LATE)) {
+ if (!strcmp(dname, DSET_ALLOC_LATE)) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0)
goto done;
} /* end if */
- else if (!HDstrcmp(dname, DSET_ALLOC_EARLY)) {
+ else if (!strcmp(dname, DSET_ALLOC_EARLY)) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto done;
} /* end if */
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index f3df26a..2faa492 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -29,13 +29,13 @@
/* Macros used in HL tests */
#define HL_TESTING2(WHAT) \
do { \
- HDprintf("Testing %-62s", WHAT); \
- HDfflush(stdout); \
+ printf("Testing %-62s", WHAT); \
+ fflush(stdout); \
} while (0)
#define HL_TESTING3(WHAT) \
do { \
- HDprintf("Testing %-62s", WHAT); \
- HDfflush(stdout); \
+ printf("Testing %-62s", WHAT); \
+ fflush(stdout); \
} while (0)
/* Implements verbose 'assert' with 'goto error' exit */
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 9792441..f85ed81 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -214,11 +214,11 @@ main(void)
if (nerrors)
goto error;
- HDprintf("All dimension scales tests passed.\n");
+ printf("All dimension scales tests passed.\n");
return 0;
error:
- HDprintf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -245,7 +245,7 @@ create_test_file(const char *fileext)
{
char filename[65];
- HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
+ snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
}
@@ -255,7 +255,7 @@ open_test_file(const char *fileext)
{
char filename[65];
- HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
+ snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
}
@@ -284,7 +284,7 @@ create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
char s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 120, 120, 120};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_char(fid, name, rank, dims, NULL) >= 0) {
@@ -338,7 +338,7 @@ create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
short s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 140, 140, 140};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_short(fid, name, rank, dims, NULL) >= 0) {
@@ -387,7 +387,7 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
int s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_int(fid, name, rank, dims, NULL) >= 0) {
@@ -497,7 +497,7 @@ create_float_dataset(hid_t fid, const char *dsidx, int fulldims)
float s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_float(fid, name, rank, dims, NULL) >= 0) {
@@ -533,14 +533,14 @@ create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -560,14 +560,14 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -575,7 +575,7 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -595,14 +595,14 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -610,7 +610,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -618,7 +618,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -638,14 +638,14 @@ create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -665,14 +665,14 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -680,7 +680,7 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -700,14 +700,14 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -715,7 +715,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -723,7 +723,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -742,14 +742,14 @@ create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -769,14 +769,14 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -784,7 +784,7 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -804,14 +804,14 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -819,7 +819,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -827,7 +827,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -847,14 +847,14 @@ create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -874,14 +874,14 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -889,7 +889,7 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -909,14 +909,14 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -924,7 +924,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -932,7 +932,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -952,14 +952,14 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -967,7 +967,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -975,7 +975,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -983,7 +983,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s4_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0)
@@ -1003,14 +1003,14 @@ create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -1030,14 +1030,14 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -1045,7 +1045,7 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -1065,14 +1065,14 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -1080,7 +1080,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -1088,7 +1088,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -1111,7 +1111,7 @@ test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx)
ret_value = SUCCEED;
}
else if (H5DSis_attached(did, dsid, idx) == 0) {
- HDprintf(" scale not attached ");
+ printf(" scale not attached ");
}
}
}
@@ -1175,13 +1175,13 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if (H5DSis_attached(did, dsid, idx) == 1) {
if ((name_len = H5DSget_scale_name(dsid, NULL, (size_t)0)) > 0) {
- name_out = (char *)HDmalloc(((size_t)name_len + 1) * sizeof(char));
+ name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char));
if (name_out != NULL) {
if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) >= 0) {
- if (HDstrncmp(scalename, name_out, (size_t)name_len) == 0) {
+ if (strncmp(scalename, name_out, (size_t)name_len) == 0) {
ret_value = SUCCEED;
}
- HDfree(name_out);
+ free(name_out);
name_out = NULL;
}
}
@@ -1219,14 +1219,14 @@ test_detachscales(void)
/* make datasets; they are three dimensional*/
for (i = 0; i < 2; i++) {
- HDsnprintf(dname, sizeof(dname), "D%d", i);
+ snprintf(dname, sizeof(dname), "D%d", i);
if (H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
}
/* create datasets and make them dim. scales */
for (i = 0; i < 4; i++) {
- HDsnprintf(dname, sizeof(dname), "DS%d", i);
+ snprintf(dname, sizeof(dname), "DS%d", i);
if (H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
@@ -1234,7 +1234,7 @@ test_detachscales(void)
two scales attached */
if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i = 0; i < 4; i++) {
- HDsnprintf(dname, sizeof(dname), "DS%d", i);
+ snprintf(dname, sizeof(dname), "DS%d", i);
if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, (unsigned int)i % 3) < 0)
@@ -1251,7 +1251,7 @@ test_detachscales(void)
/* attach scales to the second dataset */
if ((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) {
for (i = 0; i < 3; i++) {
- HDsnprintf(dname, sizeof(dname), "DS%d", i);
+ snprintf(dname, sizeof(dname), "DS%d", i);
if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, (unsigned int)i) < 0)
@@ -1272,7 +1272,7 @@ test_detachscales(void)
goto out;
for (i = 0; i < 2; i++) {
- HDsnprintf(dname, sizeof(dname), "D%d", i);
+ snprintf(dname, sizeof(dname), "D%d", i);
if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, (unsigned int)0) < 0)
@@ -1302,7 +1302,7 @@ test_detachscales(void)
sure that attribute "DIMENSION_LIST" doesn't exist anymore */
if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i = 1; i < 4; i++) {
- HDsnprintf(dname, sizeof(dname), "DS%d", i);
+ snprintf(dname, sizeof(dname), "DS%d", i);
if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, (unsigned int)i % 3) < 0)
@@ -1346,7 +1346,7 @@ test_char_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
HL_TESTING2("test_char_attachscales");
@@ -1358,15 +1358,15 @@ test_char_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
@@ -1402,7 +1402,7 @@ test_short_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
HL_TESTING2("test_short_attachscales");
@@ -1414,39 +1414,39 @@ test_short_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
@@ -1482,7 +1482,7 @@ test_int_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
HL_TESTING2("test_int_attachscales");
@@ -1494,23 +1494,23 @@ test_int_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
@@ -1546,7 +1546,7 @@ test_long_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
HL_TESTING2("test_long_attachscales");
@@ -1558,19 +1558,19 @@ test_long_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM3) < 0)
goto out;
@@ -1606,7 +1606,7 @@ test_duplicatelong_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
HL_TESTING2("test_duplicatelong_attachscales");
@@ -1618,19 +1618,19 @@ test_duplicatelong_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM3) < 0)
goto out;
@@ -1666,7 +1666,7 @@ test_float_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
HL_TESTING2("test_float_attachscales");
@@ -1678,23 +1678,23 @@ test_float_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
@@ -1731,7 +1731,7 @@ test_numberofscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
HL_TESTING2("test_numberofscales");
@@ -1757,7 +1757,7 @@ test_numberofscales(const char *fileext)
else
goto out;
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b");
/* make a dataset */
if (create_int_dataset(fid, "b", 1) < 0)
@@ -1765,7 +1765,7 @@ test_numberofscales(const char *fileext)
/* make a DS dataset for the first dimension */
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
@@ -1814,31 +1814,31 @@ test_char_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set char scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
+ snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
@@ -1878,79 +1878,79 @@ test_short_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set short scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
@@ -1990,47 +1990,47 @@ test_int_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set int scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
@@ -2070,39 +2070,39 @@ test_long_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set long scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM3) < 0)
goto out;
@@ -2142,39 +2142,39 @@ test_samelong_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set same long scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM3) < 0)
goto out;
@@ -2214,47 +2214,47 @@ test_float_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set float scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
@@ -2371,7 +2371,7 @@ test_simple(void)
char snames[3];
int i, j;
- HDprintf("Testing API functions\n");
+ printf("Testing API functions\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -2983,10 +2983,10 @@ test_simple(void)
if ((sid = H5Screate_simple(rank, dims, NULL)) < 0)
goto out;
for (i = 0; i < 5; i++) {
- HDsnprintf(dname, sizeof(dname), "dset_%d", i);
+ snprintf(dname, sizeof(dname), "dset_%d", i);
if ((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- HDsnprintf(sname, sizeof(sname), "ds_%d", i);
+ snprintf(sname, sizeof(sname), "ds_%d", i);
if ((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (H5DSset_scale(dsid, "scale") < 0)
@@ -3003,11 +3003,11 @@ test_simple(void)
*/
for (i = 0; i < 5; i++) {
- HDsnprintf(dname, sizeof(dname), "dset_%d", i);
+ snprintf(dname, sizeof(dname), "dset_%d", i);
if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for (j = 0; j < 5; j++) {
- HDsnprintf(sname, sizeof(sname), "ds_%d", j);
+ snprintf(sname, sizeof(sname), "ds_%d", j);
if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, DIM0) < 0)
@@ -3025,11 +3025,11 @@ test_simple(void)
*/
for (i = 0; i < 5; i++) {
- HDsnprintf(dname, sizeof(dname), "dset_%d", i);
+ snprintf(dname, sizeof(dname), "dset_%d", i);
if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for (j = 0; j < 5; j++) {
- HDsnprintf(sname, sizeof(sname), "ds_%d", j);
+ snprintf(sname, sizeof(sname), "ds_%d", j);
if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, DIM0) < 0)
@@ -3047,11 +3047,11 @@ test_simple(void)
*/
for (i = 0; i < 5; i++) {
- HDsnprintf(dname, sizeof(dname), "dset_%d", i);
+ snprintf(dname, sizeof(dname), "dset_%d", i);
if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for (j = 0; j < 5; j++) {
- HDsnprintf(sname, sizeof(sname), "ds_%d", j);
+ snprintf(sname, sizeof(sname), "ds_%d", j);
if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, DIM0) < 0)
@@ -3145,9 +3145,9 @@ test_simple(void)
goto out;
if (H5DSget_label(did, DIM1, dim1_label, sizeof(dim1_label)) < 0)
goto out;
- if (HDstrncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0)
+ if (strncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0)
goto out;
- if (HDstrncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0)
+ if (strncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0)
goto out;
/*-------------------------------------------------------------------------
@@ -3161,24 +3161,24 @@ test_simple(void)
goto out;
/* allocate */
- dim0_labeld = (char *)HDmalloc((size_t)dim0_label_size * sizeof(char));
- dim1_labeld = (char *)HDmalloc((size_t)dim1_label_size * sizeof(char));
+ dim0_labeld = (char *)malloc((size_t)dim0_label_size * sizeof(char));
+ dim1_labeld = (char *)malloc((size_t)dim1_label_size * sizeof(char));
if (dim0_labeld == NULL || dim1_labeld == NULL)
goto out;
if (H5DSget_label(did, DIM0, dim0_labeld, (size_t)dim0_label_size) < 0)
goto out;
if (H5DSget_label(did, DIM1, dim1_labeld, (size_t)dim1_label_size) < 0)
goto out;
- if (HDstrncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0)
+ if (strncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0)
goto out;
- if (HDstrncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0)
+ if (strncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0)
goto out;
if (dim0_labeld) {
- HDfree(dim0_labeld);
+ free(dim0_labeld);
dim0_labeld = NULL;
}
if (dim1_labeld) {
- HDfree(dim1_labeld);
+ free(dim1_labeld);
dim1_labeld = NULL;
}
@@ -3191,9 +3191,9 @@ test_simple(void)
goto out;
if (H5DSget_label(did, DIM1, dim1_labels, sizeof(dim1_labels)) < 0)
goto out;
- if (HDstrncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0)
+ if (strncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0)
goto out;
- if (HDstrncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0)
+ if (strncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0)
goto out;
if (H5Dclose(did))
goto out;
@@ -3225,7 +3225,7 @@ test_simple(void)
goto out;
/* allocate a buffer */
- name_out = (char *)HDmalloc(((size_t)name_len + 1) * sizeof(char));
+ name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char));
if (name_out == NULL)
goto out;
@@ -3233,10 +3233,10 @@ test_simple(void)
if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) < 0)
goto out;
- if (HDstrncmp("Latitude set 0", name_out, (size_t)name_len) != 0)
+ if (strncmp("Latitude set 0", name_out, (size_t)name_len) != 0)
goto out;
if (name_out) {
- HDfree(name_out);
+ free(name_out);
name_out = NULL;
}
@@ -3249,7 +3249,7 @@ test_simple(void)
if (H5DSget_scale_name(dsid, sname, sizeof(sname)) < 0)
goto out;
- if (HDstrncmp("Latitude set 0", sname, sizeof(sname)) != 0)
+ if (strncmp("Latitude set 0", sname, sizeof(sname)) != 0)
goto out;
/*-------------------------------------------------------------------------
@@ -3261,7 +3261,7 @@ test_simple(void)
if (H5DSget_scale_name(dsid, snames, sizeof(snames)) < 0)
goto out;
- if (HDstrncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0)
+ if (strncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0)
goto out;
if (H5Dclose(dsid))
goto out;
@@ -3497,7 +3497,7 @@ test_simple(void)
goto out;
break;
default:
- HDassert(0);
+ assert(0);
break;
} /*switch*/
} /*for*/
@@ -3627,7 +3627,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
goto out;
if (nelmts) {
- buf = (char *)HDmalloc(((size_t)nelmts * size));
+ buf = (char *)malloc(((size_t)nelmts * size));
if (buf == NULL)
goto out;
if (H5Dread(scale_id, mtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
@@ -3635,7 +3635,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
for (i = 0; i < nelmts; i++) {
if (buf[i] != data[i]) {
- HDprintf("read and write buffers differ\n");
+ printf("read and write buffers differ\n");
goto out;
}
}
@@ -3649,7 +3649,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
if (H5Tclose(mtid) < 0)
goto out;
if (buf)
- HDfree(buf);
+ free(buf);
return ret;
@@ -3661,7 +3661,7 @@ out:
H5Tclose(tid);
H5Tclose(mtid);
if (buf) {
- HDfree(buf);
+ free(buf);
}
}
H5E_END_TRY
@@ -3839,7 +3839,7 @@ test_errors(void)
hid_t sidds = -1; /* space ID */
hsize_t pal_dims[] = {9, 3};
- HDprintf("Testing error conditions\n");
+ printf("Testing error conditions\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -4213,7 +4213,7 @@ test_iterators(void)
char dname[30]; /* dataset name */
int i;
- HDprintf("Testing iterators\n");
+ printf("Testing iterators\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -4291,7 +4291,7 @@ test_iterators(void)
for (i = 0; i < 100; i++) {
/* make a DS */
- HDsnprintf(dname, sizeof(dname), "ds_%d", i);
+ snprintf(dname, sizeof(dname), "ds_%d", i);
if (H5LTmake_dataset_int(fid, dname, rankds, s1_dim, NULL) < 0)
goto out;
/* open */
@@ -4403,7 +4403,7 @@ test_rank(void)
float buff[1] = {1};
int i;
- HDprintf("Testing ranks\n");
+ printf("Testing ranks\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -4441,7 +4441,7 @@ test_rank(void)
goto out;
for (i = 0; i < 3; i++) {
- HDsnprintf(name, sizeof(name), "ds_a_%d", i);
+ snprintf(name, sizeof(name), "ds_a_%d", i);
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, (unsigned)i) < 0)
@@ -4468,7 +4468,7 @@ test_rank(void)
goto out;
for (i = 0; i < 3; i++) {
- HDsnprintf(name, sizeof(name), "ds_a_%d", i);
+ snprintf(name, sizeof(name), "ds_a_%d", i);
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, (unsigned)i) < 0)
@@ -4494,7 +4494,7 @@ test_rank(void)
goto out;
for (i = 0; i < 3; i++) {
- HDsnprintf(name, sizeof(name), "ds_a_%d", i);
+ snprintf(name, sizeof(name), "ds_a_%d", i);
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
goto out;
if (H5DSset_scale(dsid, name) < 0)
@@ -4511,9 +4511,9 @@ test_rank(void)
goto out;
if (H5DSget_label(did, (unsigned)i, namel, sizeof(namel)) < 0)
goto out;
- if (HDstrncmp(name, names, sizeof(names)) != 0)
+ if (strncmp(name, names, sizeof(names)) != 0)
goto out;
- if (HDstrncmp(name, namel, sizeof(namel)) != 0)
+ if (strncmp(name, namel, sizeof(namel)) != 0)
goto out;
}
@@ -4610,7 +4610,7 @@ test_types(void)
const char *s1_str = "ABC";
const char *s2_str = "ABCD";
- HDprintf("Testing scales with several datatypes\n");
+ printf("Testing scales with several datatypes\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -4788,7 +4788,7 @@ test_data(void)
hsize_t londims[1]; /* array to hold dimensions */
float fill = -99; /* fill value */
- HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n");
+ printf("Testing reading ASCII data and generate HDF5 data with scales\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -4818,7 +4818,7 @@ test_data(void)
if (H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0)
goto out;
- HDfree(latbuf);
+ free(latbuf);
latbuf = NULL;
/* read the longitude */
@@ -4829,7 +4829,7 @@ test_data(void)
if (H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0)
goto out;
- HDfree(lonbuf);
+ free(lonbuf);
lonbuf = NULL;
/* make a dataset for the data. a fill value is set */
@@ -4849,7 +4849,7 @@ test_data(void)
if (H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0)
goto out;
- HDfree(vals);
+ free(vals);
vals = NULL;
if (H5Dclose(did) < 0)
@@ -4924,11 +4924,11 @@ out:
H5_FAILED();
if (latbuf)
- HDfree(latbuf);
+ free(latbuf);
if (lonbuf)
- HDfree(lonbuf);
+ free(lonbuf);
if (vals)
- HDfree(vals);
+ free(vals);
return FAIL;
}
@@ -4957,44 +4957,44 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
const char *data_file = H5_get_srcdir_filename(fname);
/* read first data file */
- f = HDfopen(data_file, "r");
+ f = fopen(data_file, "r");
if (f == NULL) {
- HDprintf("Could not open file %s\n", data_file);
+ printf("Could not open file %s\n", data_file);
return -1;
}
for (i = 0, nelms = 1; i < ndims; i++) {
- if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) {
- HDprintf("fscanf error in file %s\n", data_file);
- HDfclose(f);
+ if (fscanf(f, "%s %u", str, &j) && ferror(f)) {
+ printf("fscanf error in file %s\n", data_file);
+ fclose(f);
return -1;
} /* end if */
- if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s\n", data_file);
- HDfclose(f);
+ if (fscanf(f, "%d", &n) < 0 && ferror(f)) {
+ printf("fscanf error in file %s\n", data_file);
+ fclose(f);
return -1;
} /* end if */
dims[i] = (hsize_t)n;
nelms *= (size_t)n;
}
- *buf = (float *)HDmalloc(nelms * sizeof(float));
+ *buf = (float *)malloc(nelms * sizeof(float));
if (*buf == NULL) {
- HDprintf("memory allocation failed\n");
- HDfclose(f);
+ printf("memory allocation failed\n");
+ fclose(f);
return -1;
}
for (j = 0; j < nelms; j++) {
- if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s\n", data_file);
- HDfclose(f);
+ if (fscanf(f, "%f", &val) < 0 && ferror(f)) {
+ printf("fscanf error in file %s\n", data_file);
+ fclose(f);
return -1;
} /* end if */
(*buf)[j] = val;
}
- HDfclose(f);
+ fclose(f);
return 1;
}
@@ -5018,7 +5018,7 @@ test_errors2(void)
int nscales; /* number of scales in DIM */
int count; /* visitor data */
- HDprintf("Testing parameter errors\n");
+ printf("Testing parameter errors\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -5100,7 +5100,7 @@ test_errors2(void)
goto out;
if ((label_len = H5DSget_label(did, 0, NULL, 0)) < 0)
goto out;
- if (label_len != HDstrlen("label"))
+ if (label_len != strlen("label"))
goto out;
if (H5DSget_label(did, 0, lbuf, sizeof(lbuf)) < 0)
goto out;
diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c
index b287d25..9b67348 100644
--- a/hl/test/test_dset_append.c
+++ b/hl/test/test_dset_append.c
@@ -251,7 +251,7 @@ test_dataset_append_rows_columns(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -387,7 +387,7 @@ test_dataset_append_rows(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -524,7 +524,7 @@ test_dataset_append_columns(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -687,7 +687,7 @@ test_dataset_append_BUG1(hid_t fid)
if (buf[i][j] != rbuf[i][j])
TEST_ERROR;
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -850,7 +850,7 @@ test_dataset_append_BUG2(hid_t fid)
if (buf[i][j] != rbuf[i][j])
TEST_ERROR;
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -1009,7 +1009,7 @@ test_dataset_append_less(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -1166,7 +1166,7 @@ test_dataset_append_vary(hid_t fid)
TEST_ERROR;
/* Clear the dataset */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 0a10e36..9cb7f45 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -76,27 +76,27 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
VERIFY(nflags > 0, "The number of flag combinations must be greater than 0");
/* allocate array of flags for open images */
- if (NULL == (input_flags = (unsigned *)HDmalloc(sizeof(unsigned) * open_images)))
+ if (NULL == (input_flags = (unsigned *)malloc(sizeof(unsigned) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array of pointers for each of the open images */
- if (NULL == (buf_ptr = (void **)HDmalloc(sizeof(void *) * open_images)))
+ if (NULL == (buf_ptr = (void **)malloc(sizeof(void *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the name of each of the open images */
- if (NULL == (filename = (char **)HDcalloc(1, sizeof(char *) * open_images)))
+ if (NULL == (filename = (char **)calloc(1, sizeof(char *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the size of each of the open images */
- if (NULL == (buf_size = (ssize_t *)HDmalloc(sizeof(ssize_t) * open_images)))
+ if (NULL == (buf_size = (ssize_t *)malloc(sizeof(ssize_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the file identifiers */
- if (NULL == (file_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
+ if (NULL == (file_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the dataset identifiers */
- if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
+ if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
HL_TESTING2("get file images");
@@ -109,12 +109,12 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
/* allocate name buffer for image i */
size_t filenamelength = sizeof(char) * 32;
- filename[i] = (char *)HDmalloc(filenamelength);
+ filename[i] = (char *)malloc(filenamelength);
if (!filename[i])
- FAIL_PUTS_ERROR("HDmalloc() failed");
+ FAIL_PUTS_ERROR("malloc() failed");
/* create file name */
- HDsnprintf(filename[i], filenamelength, "image_file%d.h5", (int)i);
+ snprintf(filename[i], filenamelength, "image_file%d.h5", (int)i);
/* create file */
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -169,7 +169,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
FAIL_PUTS_ERROR("H5Fget_file_image() failed");
/* allocate buffer for the file image i */
- if (NULL == (buf_ptr[i] = (void *)HDmalloc((size_t)buf_size[i])))
+ if (NULL == (buf_ptr[i] = (void *)malloc((size_t)buf_size[i])))
FAIL_PUTS_ERROR("malloc() failed");
/* buffer for file image 2 is filled with counter data (non-valid image) */
@@ -233,28 +233,28 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
*/
if (input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW && !(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY)) {
- void *tmp_ptr = HDmalloc((size_t)buf_size[i]);
+ void *tmp_ptr = malloc((size_t)buf_size[i]);
if (!tmp_ptr)
FAIL_PUTS_ERROR("buffer allocation failed");
/* Copy vfd buffer to a temporary buffer */
- HDmemcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]);
+ memcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]);
/* Clear status_flags in the superblock for the vfd buffer: file locking is using status_flags
*/
- HDmemset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0,
- (size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1);
+ memset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0,
+ (size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1);
/* Does the comparison */
- if (HDmemcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
+ if (memcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
FAIL_PUTS_ERROR("comparison of TMP vfd and user buffer failed");
/* Free the temporary buffer */
if (tmp_ptr)
- HDfree(tmp_ptr);
+ free(tmp_ptr);
}
else {
/* test whether the contents of the user buffer and driver buffer */
/* are equal. */
- if (HDmemcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
+ if (memcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
FAIL_PUTS_ERROR("comparison of vfd and user buffer failed");
}
} /* end else */
@@ -268,7 +268,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
for (i = 0; i < open_images; i++) {
/* if opening the file image failed, continue next iteration */
if (file_id[i] < 0) {
- HDassert(i == 2);
+ assert(i == 2);
continue;
} /* end if */
@@ -324,7 +324,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
for (i = 0; i < open_images; i++) {
/* if opening the file image failed, continue next iteration */
if (file_id[i] < 0) {
- HDassert(i == 2);
+ assert(i == 2);
continue;
} /* end if */
@@ -508,20 +508,20 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
if (!(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY) ||
(input_flags[i] & H5LT_FILE_IMAGE_DONT_RELEASE)) {
VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL");
- HDfree(buf_ptr[i]);
+ free(buf_ptr[i]);
} /* end if */
} /* end for */
/* release temporary working buffers */
for (i = 0; i < open_images; i++)
- HDfree(filename[i]);
- HDfree(filename);
- HDfree(file_id);
- HDfree(dset_id);
- HDfree(buf_ptr);
- HDfree(buf_size);
- HDfree(input_flags);
+ free(filename[i]);
+ free(filename);
+ free(file_id);
+ free(dset_id);
+ free(buf_ptr);
+ free(buf_size);
+ free(input_flags);
PASSED();
@@ -532,14 +532,14 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
error:
if (filename) {
for (i = 0; i < open_images; i++)
- HDfree(filename[i]);
- HDfree(filename);
+ free(filename[i]);
+ free(filename);
}
- HDfree(file_id);
- HDfree(dset_id);
- HDfree(buf_ptr);
- HDfree(buf_size);
- HDfree(input_flags);
+ free(file_id);
+ free(dset_id);
+ free(buf_ptr);
+ free(buf_size);
+ free(input_flags);
H5_FAILED();
return -1;
@@ -572,10 +572,10 @@ main(void)
if (nerrors)
goto error;
- HDprintf("File image tests passed.\n");
+ printf("File image tests passed.\n");
return 0;
error:
- HDprintf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c
index 2610c33..3d26f7e 100644
--- a/hl/test/test_h5do_compat.c
+++ b/hl/test/test_h5do_compat.c
@@ -192,7 +192,7 @@ test_direct_chunk_read(hid_t did)
TEST_ERROR;
/* Read the raw chunk back */
- HDmemset(chunk_data, 0, CHUNK_NX * sizeof(int));
+ memset(chunk_data, 0, CHUNK_NX * sizeof(int));
filter_mask = UINT_MAX;
offset[0] = (hsize_t)i * CHUNK_NX;
if (H5DOread_chunk(did, H5P_DEFAULT, offset, &filter_mask, chunk_data) < 0)
@@ -247,8 +247,8 @@ main(void)
{
#ifdef H5_NO_DEPRECATED_SYMBOLS
- HDputs("Direct chunk read/write wrapper tests SKIPPED.");
- HDputs("(Backward compatibility not configured)");
+ puts("Direct chunk read/write wrapper tests SKIPPED.");
+ puts("(Backward compatibility not configured)");
return EXIT_SUCCESS;
#else
@@ -275,11 +275,11 @@ main(void)
if (nerrors)
goto error;
- HDputs("All direct chunk read/write wrapper tests passed.");
+ puts("All direct chunk read/write wrapper tests passed.");
return EXIT_SUCCESS;
error:
- HDputs("*** TESTS FAILED ***");
+ puts("*** TESTS FAILED ***");
return EXIT_FAILURE;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end main() */
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index 8a67883..b9f290e 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -71,11 +71,11 @@ main(void)
if (nerrors)
goto error;
- HDprintf("All image tests passed.\n");
+ printf("All image tests passed.\n");
return 0;
error:
- HDprintf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -111,14 +111,14 @@ test_simple(void)
hsize_t pal_dims_out[2]; /* palette dimensions */
/* Allocate image buffers */
- buf1 = (unsigned char *)HDmalloc(WIDTH * HEIGHT);
- HDassert(buf1);
- buf2 = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3);
- HDassert(buf2);
- buf1_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT);
- HDassert(buf1_out);
- buf2_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3);
- HDassert(buf2_out);
+ buf1 = (unsigned char *)malloc(WIDTH * HEIGHT);
+ assert(buf1);
+ buf2 = (unsigned char *)malloc(WIDTH * HEIGHT * 3);
+ assert(buf2);
+ buf1_out = (unsigned char *)malloc(WIDTH * HEIGHT);
+ assert(buf1_out);
+ buf2_out = (unsigned char *)malloc(WIDTH * HEIGHT * 3);
+ assert(buf2_out);
/* create an image */
space = WIDTH * HEIGHT / PAL_ENTRIES;
@@ -274,13 +274,13 @@ test_simple(void)
*/
if (buf1)
- HDfree(buf1);
+ free(buf1);
if (buf2)
- HDfree(buf2);
+ free(buf2);
if (buf1_out)
- HDfree(buf1_out);
+ free(buf1_out);
if (buf2_out)
- HDfree(buf2_out);
+ free(buf2_out);
/* Close the file. */
if (H5Fclose(fid) < 0)
@@ -293,13 +293,13 @@ test_simple(void)
/* error zone, gracefully close */
out:
if (buf1)
- HDfree(buf1);
+ free(buf1);
if (buf2)
- HDfree(buf2);
+ free(buf2);
if (buf1_out)
- HDfree(buf1_out);
+ free(buf1_out);
if (buf2_out)
- HDfree(buf2_out);
+ free(buf2_out);
H5E_BEGIN_TRY
{
H5Fclose(fid);
@@ -329,7 +329,7 @@ test_data(void)
if ((fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- HDprintf("Testing read ascii image data and generate images\n");
+ printf("Testing read ascii image data and generate images\n");
/*-------------------------------------------------------------------------
* read 8bit image data
@@ -480,7 +480,7 @@ test_data(void)
goto out;
/* Release memory buffer */
- HDfree(image_data);
+ free(image_data);
return 0;
@@ -488,7 +488,7 @@ test_data(void)
out:
/* Release memory buffer */
if (image_data)
- HDfree(image_data);
+ free(image_data);
H5E_BEGIN_TRY
{
@@ -531,16 +531,16 @@ test_generate(void)
if ((fid = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- HDprintf("Testing read and process data and make indexed images\n");
+ printf("Testing read and process data and make indexed images\n");
/*-------------------------------------------------------------------------
* read data; the file data format is described below
*-------------------------------------------------------------------------
*/
- f = HDfopen(data_file, "r");
+ f = fopen(data_file, "r");
if (f == NULL) {
- HDprintf("Could not find file %s. Try set $srcdir \n", data_file);
+ printf("Could not find file %s. Try set $srcdir \n", data_file);
goto out;
}
@@ -579,12 +579,12 @@ test_generate(void)
!
*/
- if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -606,21 +606,21 @@ test_generate(void)
if (n_elements > INT_MAX / (int)sizeof(float))
goto out;
- data = (float *)HDmalloc((size_t)n_elements * sizeof(float));
+ data = (float *)malloc((size_t)n_elements * sizeof(float));
if (NULL == data)
goto out;
- image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char));
+ image_data = (unsigned char *)malloc((size_t)n_elements * sizeof(unsigned char));
if (NULL == image_data)
goto out;
for (i = 0; i < n_elements; i++) {
- if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%f ", &value) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
data[i] = value;
}
- HDfclose(f);
+ fclose(f);
f = NULL;
/*-------------------------------------------------------------------------
@@ -712,8 +712,8 @@ test_generate(void)
goto out;
/* Release memory buffers */
- HDfree(data);
- HDfree(image_data);
+ free(data);
+ free(image_data);
/* Indicate success */
return 0;
@@ -722,9 +722,9 @@ test_generate(void)
out:
/* Release memory buffers */
if (data)
- HDfree(data);
+ free(data);
if (image_data)
- HDfree(image_data);
+ free(image_data);
H5E_BEGIN_TRY
{
@@ -732,7 +732,7 @@ out:
}
H5E_END_TRY
if (f)
- HDfclose(f);
+ fclose(f);
H5_FAILED();
return retval;
}
@@ -773,38 +773,38 @@ read_data(const char *fname, /*IN*/
*-------------------------------------------------------------------------
*/
- if (NULL == (f = HDfopen(data_file, "r"))) {
- HDprintf("Could not open file %s. Try set $srcdir \n", data_file);
+ if (NULL == (f = fopen(data_file, "r"))) {
+ printf("Could not open file %s. Try set $srcdir \n", data_file);
goto out;
}
- if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%s", str) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &color_planes) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%s", str) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &h) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%s", str) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &w) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -825,10 +825,10 @@ read_data(const char *fname, /*IN*/
/* Release the buffer, if it was previously allocated */
if (image_data)
- HDfree(image_data);
+ free(image_data);
/* Allocate the image data buffer */
- image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char));
+ image_data = (unsigned char *)malloc((size_t)n_elements * sizeof(unsigned char));
if (NULL == image_data)
goto out;
@@ -837,8 +837,8 @@ read_data(const char *fname, /*IN*/
/* Read data elements */
for (i = 0; i < n_elements; i++) {
- if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &n) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
image_data[i] = (unsigned char)n;
@@ -849,7 +849,7 @@ read_data(const char *fname, /*IN*/
out:
if (f)
- HDfclose(f);
+ fclose(f);
return ret_val;
} /* end read_data() */
@@ -889,40 +889,40 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
return -1;
/* open the input file */
- if (!(file = HDfopen(data_file, "r"))) {
- HDprintf("Could not open file %s. Try set $srcdir \n", data_file);
+ if (!(file = fopen(data_file, "r"))) {
+ printf("Could not open file %s. Try set $srcdir \n", data_file);
return -1;
}
/* read the file ident string */
- if (HDfgets(buffer, sizeof(buffer), file) == NULL) {
- HDfclose(file);
+ if (fgets(buffer, sizeof(buffer), file) == NULL) {
+ fclose(file);
return -1;
}
/* ensure it matches the palette file ident string */
- if (HDstrncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
- HDstrncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) {
- HDfclose(file);
+ if (strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
+ strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) {
+ fclose(file);
return -1;
}
/* read the version string */
- if (HDfgets(buffer, sizeof(buffer), file) == NULL) {
- HDfclose(file);
+ if (fgets(buffer, sizeof(buffer), file) == NULL) {
+ fclose(file);
return -1;
}
/* ensure it matches the palette file version string */
- if (HDstrncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
- HDstrncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) {
- HDfclose(file);
+ if (strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
+ strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) {
+ fclose(file);
return -1;
}
/* read the number of colors */
- if (HDfgets(buffer, sizeof(buffer), file) == NULL) {
- HDfclose(file);
+ if (fgets(buffer, sizeof(buffer), file) == NULL) {
+ fclose(file);
return -1;
}
@@ -930,27 +930,27 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
check for missing version or number of colors
in this case it reads the first entry
*/
- if (HDstrlen(buffer) > 4) {
- HDfclose(file);
+ if (strlen(buffer) > 4) {
+ fclose(file);
return -1;
}
- if (HDsscanf(buffer, "%u", &nentries) != 1) {
- HDfclose(file);
+ if (sscanf(buffer, "%u", &nentries) != 1) {
+ fclose(file);
return -1;
}
/* ensure there are a sensible number of colors in the palette */
if ((nentries > 256) || (nentries > palette_size)) {
- HDfclose(file);
+ fclose(file);
return (-1);
}
/* read the palette entries */
for (u = 0; u < nentries; u++) {
/* extract the red, green and blue color components. */
- if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
- HDfclose(file);
+ if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
+ fclose(file);
return -1;
}
/* store this palette entry */
@@ -960,7 +960,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
}
/* close file */
- HDfclose(file);
+ fclose(file);
return (int)nentries;
}
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 78af519..b0579d5 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -1037,10 +1037,10 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
/* Loop through different variations of extending the dataset */
for (i = 0; i < ONE_NTESTS; i++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ memset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ memset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]);
@@ -1049,27 +1049,27 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
FAIL_STACK_ERROR;
/* Initialize data */
- if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
FAIL_STACK_ERROR;
} /* end if */
- else if (!HDstrcmp(dname, DSET_ONE)) {
+ else if (!strcmp(dname, DSET_ONE)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
FAIL_STACK_ERROR;
} /* end if */
/* There are changes in dimension sizes */
if (one_tests[i] > 0) {
- if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) {
if (fields) {
- if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
+ if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
TEST_ERROR;
for (j = 0; j < one_tests[i]; j++)
VERIFY_ELMTS_VALID1(vbuf1[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end if */
- else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) {
+ else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0)
TEST_ERROR;
@@ -1248,10 +1248,10 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* Loop through different variations of extending the dataset */
for (i = 0; i < TWO_NTESTS; i++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ memset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ memset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]);
ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]);
@@ -1261,11 +1261,11 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
FAIL_STACK_ERROR;
/* Initialize data */
- if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if (!strcmp(dname, DSET_CMPD_TWO)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
FAIL_STACK_ERROR;
} /* end if */
- else if (!HDstrcmp(dname, DSET_TWO)) {
+ else if (!strcmp(dname, DSET_TWO)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
FAIL_STACK_ERROR;
} /* end else-if */
@@ -1274,16 +1274,16 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* There are changes in dimension sizes */
if (two_tests[i][0] > 0 || two_tests[i][1] > 0) {
- if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if (!strcmp(dname, DSET_CMPD_TWO)) {
if (fields) {
- if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
+ if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
TEST_ERROR;
if (verify_elmts_two(TWO_CMPD_VALID1, ext_dims, prev_dims, vbuf1, cbuf) < 0)
TEST_ERROR;
} /* end if */
- else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) {
+ else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0)
TEST_ERROR;
@@ -1351,19 +1351,19 @@ main(void)
int nerrors = 0;
/* Set up temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
- if (NULL == (ibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
+ if (NULL == (ibuf = (int *)malloc(sizeof(int) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (iibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
+ if (NULL == (iibuf = (int *)malloc(sizeof(int) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (cbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
+ if (NULL == (cbuf = (set_t *)malloc(sizeof(set_t) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (ccbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
+ if (NULL == (ccbuf = (set_t *)malloc(sizeof(set_t) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (vbuf1 = (test_valid_fields1 *)HDmalloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE)))
+ if (NULL == (vbuf1 = (test_valid_fields1 *)malloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (vbuf2 = (test_valid_fields2 *)HDmalloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE)))
+ if (NULL == (vbuf2 = (test_valid_fields2 *)malloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
/*
@@ -1415,17 +1415,17 @@ main(void)
/* Free temporary buffers */
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (iibuf)
- HDfree(iibuf);
+ free(iibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
if (ccbuf)
- HDfree(ccbuf);
+ free(ccbuf);
if (vbuf1)
- HDfree(vbuf1);
+ free(vbuf1);
if (vbuf2)
- HDfree(vbuf2);
+ free(vbuf2);
/* check for errors */
if (nerrors)
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index cf139d9..9bbad45 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -345,7 +345,7 @@ test_dsets(void)
if (H5LTread_dataset_string(file_id, DSET7_NAME, data_string_out) < 0)
goto out;
- if (HDstrcmp(data_string_in, data_string_out) != 0)
+ if (strcmp(data_string_in, data_string_out) != 0)
goto out;
/*-------------------------------------------------------------------------
@@ -521,7 +521,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
if (H5LTget_attribute_string(loc_id, obj_name, ATTR1_NAME, attr_str_out) < 0)
return -1;
- if (HDstrcmp(attr_str_in, attr_str_out) != 0) {
+ if (strcmp(attr_str_in, attr_str_out) != 0) {
return -1;
}
@@ -1038,26 +1038,26 @@ make_attributes(hid_t loc_id, const char *obj_name)
HL_TESTING2("H5LTget_attribute_info");
- if (NULL == (dims_out = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)rank_out)))
+ if (NULL == (dims_out = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)rank_out)))
return -1;
if (H5LTget_attribute_info(loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0) {
- HDfree(dims_out);
+ free(dims_out);
return -1;
}
for (i = 0; i < rank_out; i++) {
if (dims_out[i] != 5) {
- HDfree(dims_out);
+ free(dims_out);
return -1;
}
}
if (type_class != H5T_INTEGER) {
- HDfree(dims_out);
+ free(dims_out);
return -1;
}
- HDfree(dims_out);
+ free(dims_out);
PASSED();
@@ -1092,17 +1092,17 @@ test_integers(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) {
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_STD_I8BE") != 0) {
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1150,17 +1150,17 @@ test_fps(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) {
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_IEEE_F32BE") != 0) {
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1221,19 +1221,19 @@ test_strings(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET "
- "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET "
+ "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1256,62 +1256,62 @@ test_strings(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n "
- "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n "
+ "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
/* Length of the character buffer is larger then needed */
str_len = str_len + 10;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrncmp(dt_str,
- "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
- "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
- str_len - 1) != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strncmp(dt_str,
+ "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
+ "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
+ str_len - 1) != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
/* Length of the character buffer is smaller then needed */
str_len = 21;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
/* check the truncated string */
- if (HDstrlen(dt_str) != str_len - 1)
+ if (strlen(dt_str) != str_len - 1)
goto out;
- str_len = HDstrlen(dt_str);
- if (HDstrncmp(dt_str,
- "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
- "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
- str_len) != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ str_len = strlen(dt_str);
+ if (strncmp(dt_str,
+ "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
+ "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
+ str_len) != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1321,7 +1321,7 @@ test_strings(void)
out:
if (dt_str)
- HDfree(dt_str);
+ free(dt_str);
H5_FAILED();
return -1;
@@ -1358,21 +1358,20 @@ test_opaques(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(
- dt_str,
- "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") !=
+ if (strcmp(dt_str,
+ "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") !=
0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1421,7 +1420,7 @@ test_enums(void)
if (H5Tenum_nameof(dtype, &value1, name1, size) < 0)
goto out;
- if (HDstrcmp(name1, "BLUE") != 0)
+ if (strcmp(name1, "BLUE") != 0)
goto out;
if (H5Tenum_valueof(dtype, name2, &value2) < 0)
@@ -1438,22 +1437,22 @@ test_enums(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str,
- "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" "
- " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) {
+ if (strcmp(dt_str,
+ "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" "
+ " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1502,18 +1501,18 @@ test_variables(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1564,21 +1563,21 @@ test_arrays(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n "
- " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE "
- "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n "
+ " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE "
+ "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1625,19 +1624,19 @@ test_compounds(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE "
- "\"two_field\" : 6;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE "
+ "\"two_field\" : 6;\n }") != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1651,7 +1650,7 @@ test_compounds(void)
if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "i16_field") != 0) {
+ if (strcmp(memb_name, "i16_field") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1729,7 +1728,7 @@ test_compound_bug(void)
if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "sub") != 0) {
+ if (strcmp(memb_name, "sub") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1738,13 +1737,13 @@ test_compound_bug(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1765,8 +1764,8 @@ test_compound_bug(void)
if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "desc____________________________________________________________________________"
- "_____________") != 0) {
+ if (strcmp(memb_name, "desc____________________________________________________________________________"
+ "_____________") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1775,14 +1774,14 @@ test_compound_bug(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1813,9 +1812,9 @@ test_complicated_compound(void)
HL_TESTING3(" text for complicated compound types");
/* Open input file */
- fp = HDfopen(filename, "r");
+ fp = fopen(filename, "r");
if (fp == NULL) {
- HDprintf("Could not find file %s. Try set $srcdir \n", filename);
+ printf("Could not find file %s. Try set $srcdir \n", filename);
goto out;
}
@@ -1823,23 +1822,23 @@ test_complicated_compound(void)
* Library has convenient function getline() but isn't available on
* all machines.
*/
- if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL)
+ if ((line = (char *)calloc(size, sizeof(char))) == NULL)
goto out;
- if (HDfgets(line, (int)size, fp) == NULL)
+ if (fgets(line, (int)size, fp) == NULL)
goto out;
- while (HDstrlen(line) == size - 1) {
+ while (strlen(line) == size - 1) {
size *= 2;
if (line)
- HDfree(line);
- if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL)
+ free(line);
+ if ((line = (char *)calloc(size, sizeof(char))) == NULL)
goto out;
if (HDfseek(fp, 0L, SEEK_SET) != 0)
goto out;
- if (HDfgets(line, (int)size, fp) == NULL)
+ if (fgets(line, (int)size, fp) == NULL)
goto out;
}
- HDfclose(fp);
+ fclose(fp);
fp = NULL;
if ((dtype = H5LTtext_to_dtype(line, H5LT_DDL)) < 0)
@@ -1857,7 +1856,7 @@ test_complicated_compound(void)
goto out;
if (line)
- HDfree(line);
+ free(line);
PASSED();
return 0;
@@ -1865,9 +1864,9 @@ test_complicated_compound(void)
out:
if (line)
- HDfree(line);
+ free(line);
if (fp)
- HDfclose(fp);
+ fclose(fp);
H5_FAILED();
return -1;
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 3bfba6e..8baa38c 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -58,7 +58,7 @@ static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10
static int
cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf)
{
- if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
+ if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) {
return FAIL;
@@ -168,7 +168,7 @@ test_create_close(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
@@ -445,7 +445,7 @@ test_big_table(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Create a new table */
table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1);
@@ -519,7 +519,7 @@ test_opaque(hid_t fid)
if ((part_t = H5Tcreate(H5T_OPAQUE, sizeof(particle_t))) < 0)
return FAIL;
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Tag the opaque datatype */
if (H5Tset_tag(part_t, "Opaque Particle") < 0)
@@ -595,7 +595,7 @@ test_compress(void)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Create a new table with compression level 8 */
table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8);
@@ -620,7 +620,7 @@ test_compress(void)
TEST_ERROR;
/* Read particles to ensure that all of them were written correctly */
- HDmemset(readPart, 0, sizeof(readPart));
+ memset(readPart, 0, sizeof(readPart));
for (c = 0; c < BIG_TABLE_SIZE; c++) {
err = H5PTget_next(table, (size_t)1, readPart);
if (err < 0)
@@ -982,7 +982,7 @@ main(void)
/* create a file using default properties */
fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- HDputs("Testing packet table");
+ puts("Testing packet table");
/* Test packet table with fixed length */
if (test_packet_table(fid) < 0)
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 1d6195d..99a5dbe 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -68,9 +68,9 @@ test_VLof_atomic(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -109,7 +109,7 @@ test_VLof_atomic(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -120,8 +120,8 @@ test_VLof_atomic(void)
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- HDprintf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- HDprintf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -188,9 +188,9 @@ test_VLof_comptype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(VLcomp_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -246,7 +246,7 @@ test_VLof_comptype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -257,16 +257,16 @@ test_VLof_comptype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
- HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n",
- __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n",
+ __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
continue;
} /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv]) {
- HDfprintf(
- stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv,
- (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
+ fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n",
+ vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv,
+ (int)((unsigned int *)readBuf[uu].p)[vv]);
continue;
} /* write value != read value */
}
@@ -344,16 +344,16 @@ test_compound_VL_VLtype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].u = uu * 10;
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
- writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ writeBuf[uu].v.p = malloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++) {
- t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
+ t1->p = malloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + L2_INCM;
@@ -418,7 +418,7 @@ test_compound_VL_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -429,34 +429,34 @@ test_compound_VL_VLtype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
- HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
- writeBuf[uu].u, uu, readBuf[uu].u);
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
+ writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
- HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
- (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
+ (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
- HDfprintf(stderr,
- "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n",
- __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
+ fprintf(stderr,
+ "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n",
+ __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0;
(size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
- __LINE__, uu, vv, t1->len, t2->len);
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
+ __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww]) {
- HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
- ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
+ ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -527,16 +527,16 @@ test_VLof_VLtype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++) {
- t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
+ t1->p = malloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + 1;
@@ -582,7 +582,7 @@ test_VLof_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -652,10 +652,10 @@ verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value)
ret = SUCCEED;
else {
char lenthtype[20];
- HDstrcpy(lenthtype, "fixed-length");
+ strcpy(lenthtype, "fixed-length");
if (expected_value == 1)
- HDstrcpy(lenthtype, "variable-length");
- HDfprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
+ strcpy(lenthtype, "variable-length");
+ fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
ret = FAIL;
}
@@ -969,7 +969,7 @@ error: /* An error has occurred. Clean up and exit. */
*-------------------------------------------------------------------------
*/
static herr_t
-verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type)
+verify_accessors(hid_t fid, const char *table_name, bool uses_vlen_type)
{
hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
hid_t dset_id = H5I_INVALID_HID; /* Dataset associated with the pt */
@@ -990,7 +990,7 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type)
*buf = '\0';
if ((name_size = H5Iget_name(dset_id, (char *)buf, NAME_BUF_SIZE)) < 0)
goto error;
- VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match");
+ VERIFY(strcmp(buf, table_name), "Names of dataset and packet table don't match");
/* Get the packet table's datatype ID */
if ((dtype_id = H5PTget_type(ptable)) < 0)
@@ -1006,11 +1006,11 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type)
* expected_value passed in, then print the error message.
*/
char lenthtype[20];
- if (uses_vlen_type == TRUE)
- HDstrcpy(lenthtype, "variable-length");
+ if (uses_vlen_type == true)
+ strcpy(lenthtype, "variable-length");
else
- HDstrcpy(lenthtype, "fixed-length");
- HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype);
+ strcpy(lenthtype, "fixed-length");
+ fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype);
goto error;
}
@@ -1050,11 +1050,11 @@ test_accessors(void)
if (fid < 0)
goto error;
- ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE);
+ ret = verify_accessors(fid, PT_VLEN_ATOMIC, true);
if (ret < 0)
goto error;
- ret = verify_accessors(fid, PT_FIXED_LEN, FALSE);
+ ret = verify_accessors(fid, PT_FIXED_LEN, false);
if (ret < 0)
goto error;
@@ -1103,9 +1103,9 @@ testfl_VLof_atomic(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -1144,7 +1144,7 @@ testfl_VLof_atomic(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1155,8 +1155,8 @@ testfl_VLof_atomic(void)
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- HDprintf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- HDprintf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -1223,9 +1223,9 @@ testfl_VLof_comptype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(VLcomp_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -1281,7 +1281,7 @@ testfl_VLof_comptype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1292,16 +1292,15 @@ testfl_VLof_comptype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
- HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",
- __LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",
+ __LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
continue;
} /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv]) {
- HDfprintf(stderr,
- "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv,
- ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
+ fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n",
+ vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
continue;
} /* write value != read value */
}
@@ -1379,16 +1378,16 @@ testfl_compound_VL_VLtype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].u = uu * 10;
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
- writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ writeBuf[uu].v.p = malloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++) {
- t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
+ t1->p = malloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + L2_INCM;
@@ -1453,7 +1452,7 @@ testfl_compound_VL_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1464,34 +1463,34 @@ testfl_compound_VL_VLtype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
- HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
- writeBuf[uu].u, uu, readBuf[uu].u);
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
+ writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
- HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
- (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
+ (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
- HDfprintf(stderr,
- "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n",
- __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
+ fprintf(stderr,
+ "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n",
+ __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0;
(size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
- __LINE__, uu, vv, t1->len, t2->len);
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
+ __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww]) {
- HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
- ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
+ ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -1562,16 +1561,16 @@ testfl_VLof_VLtype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++) {
- t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
+ t1->p = malloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + 1;
@@ -1617,7 +1616,7 @@ testfl_VLof_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1683,7 +1682,7 @@ test_packet_table_with_varlen(void)
if (H5Fclose(fid) < 0)
return FAIL;
- HDputs("Testing packet table with various variable-length datatypes");
+ puts("Testing packet table with various variable-length datatypes");
/* If any test fails, move on to subsequent test, but status will indicate
there is a failure. */
@@ -1731,7 +1730,7 @@ test_packet_table_with_varlen(void)
if (H5Fclose(fid) < 0)
return FAIL;
- HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
+ puts("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
/* If any test fails, move on to subsequent test, but status will indicate
there is a failure. */
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 7bef41d..c475e7f 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -136,8 +136,8 @@ h5file_open(const char *fname, unsigned flags)
/* open */
if ((fid = H5Fopen(data_file, flags, H5P_DEFAULT)) < 0) {
- HDfprintf(stderr, "Error: Cannot open file <%s>\n", data_file);
- HDexit(1);
+ fprintf(stderr, "Error: Cannot open file <%s>\n", data_file);
+ exit(1);
}
return fid;
@@ -150,14 +150,14 @@ h5file_open(const char *fname, unsigned flags)
static int
cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf)
{
- if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
+ if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) {
- HDfprintf(stderr, "read and write buffers have differences\n");
- HDfprintf(stderr, "%s %ld %f %f %d\n", rbuf[i].name, rbuf[i].longi, (double)rbuf[i].pressure,
- rbuf[i].temperature, rbuf[i].lati);
- HDfprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure,
- wbuf[j].temperature, wbuf[j].lati);
+ fprintf(stderr, "read and write buffers have differences\n");
+ fprintf(stderr, "%s %ld %f %f %d\n", rbuf[i].name, rbuf[i].longi, (double)rbuf[i].pressure,
+ rbuf[i].temperature, rbuf[i].lati);
+ fprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure,
+ wbuf[j].temperature, wbuf[j].lati);
return -1;
}
return 0;
@@ -477,9 +477,9 @@ test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
if (do_write)
- HDstrcpy(tname, "table2");
+ strcpy(tname, "table2");
else
- HDstrcpy(tname, "table1");
+ strcpy(tname, "table1");
rstart = 0;
rrecords = 8;
@@ -617,7 +617,7 @@ test_table(hid_t fid, int do_write)
wbufd[i].longi = wbuf[i].longi;
wbufd[i].pressure = wbuf[i].pressure;
wbufd[i].temperature = wbuf[i].temperature;
- HDstrcpy(wbufd[i].name, wbuf[i].name);
+ strcpy(wbufd[i].name, wbuf[i].name);
}
if (H5TBmake_table(TITLE, fid, "table3", FIELDS, RECORDS, type_size_mem, field_names, field_offset,
@@ -1023,10 +1023,9 @@ test_table(hid_t fid, int do_write)
if (rbuf[i].lati != position_in[i - NRECORDS_ADD + 1].lati ||
rbuf[i].longi != position_in[i - NRECORDS_ADD + 1].longi ||
!H5_FLT_ABS_EQUAL(rbuf[i].pressure, pressure_in[i - NRECORDS_ADD + 1])) {
- HDfprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure,
- rbuf[i].lati);
- HDfprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i],
- position_in[i].lati);
+ fprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure, rbuf[i].lati);
+ fprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i],
+ position_in[i].lati);
goto out;
}
}
@@ -1131,7 +1130,7 @@ test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) {
goto out;
}
@@ -1139,7 +1138,7 @@ test_table(hid_t fid, int do_write)
/* reset buffer */
for (i = 0; i < NRECORDS; i++) {
- HDstrcpy(namepre_out[i].name, "\0");
+ strcpy(namepre_out[i].name, "\0");
namepre_out[i].pressure = -1;
}
@@ -1156,7 +1155,7 @@ test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for (i = 0; i < 3; i++) {
hsize_t iistart = start;
- if ((HDstrcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart + i].pressure)) {
goto out;
}
@@ -1319,7 +1318,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) {
goto out;
}
@@ -1327,7 +1326,7 @@ test_table(hid_t fid, int do_write)
/* reset buffer */
for (i = 0; i < NRECORDS; i++) {
- HDstrcpy(namepre_out[i].name, "\0");
+ strcpy(namepre_out[i].name, "\0");
namepre_out[i].pressure = -1;
}
@@ -1348,7 +1347,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for (i = 0; i < 3; i++) {
int iistart = (int)start;
- if ((HDstrcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart + (int)i].pressure)) {
goto out;
}
@@ -1384,7 +1383,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati ||
+ if ((strcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi || !H5_FLT_ABS_EQUAL(rbuf2[i].pressure, wbuf[i].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf2[i].temperature, wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i]) {
@@ -1420,7 +1419,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati ||
+ if ((strcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
!H5_DBL_ABS_EQUAL(rbuf3[i].temperature, wbuf[i].temperature)) {
goto out;
@@ -1464,9 +1463,9 @@ test_table(hid_t fid, int do_write)
HL_TESTING2("getting field info");
/* allocate */
- names_out = (char **)HDmalloc(sizeof(char *) * (size_t)NFIELDS);
+ names_out = (char **)malloc(sizeof(char *) * (size_t)NFIELDS);
for (i = 0; i < NFIELDS; i++) {
- names_out[i] = (char *)HDmalloc(sizeof(char) * 255);
+ names_out[i] = (char *)malloc(sizeof(char) * 255);
}
/* Get field info */
@@ -1474,16 +1473,16 @@ test_table(hid_t fid, int do_write)
goto out;
for (i = 0; i < NFIELDS; i++) {
- if ((HDstrcmp(field_names[i], names_out[i]) != 0)) {
+ if ((strcmp(field_names[i], names_out[i]) != 0)) {
goto out;
}
}
/* release */
for (i = 0; i < NFIELDS; i++) {
- HDfree(names_out[i]);
+ free(names_out[i]);
}
- HDfree(names_out);
+ free(names_out);
PASSED();
@@ -1516,7 +1515,7 @@ main(void)
/* create a file using default properties */
fid = H5Fcreate("test_table.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- HDputs("Testing table with file creation mode (read/write in native architecture):");
+ puts("Testing table with file creation mode (read/write in native architecture):");
/* test, do write */
if (test_table(fid, 1) < 0)
@@ -1529,7 +1528,7 @@ main(void)
* test2: open a file written in test1 on a big-endian machine
*-------------------------------------------------------------------------
*/
- HDputs("Testing table with file open mode (read big-endian data):");
+ puts("Testing table with file open mode (read big-endian data):");
fid = h5file_open(TEST_FILE_BE, flags);
@@ -1544,7 +1543,7 @@ main(void)
* test3: open a file written in test1 on a little-endian machine
*-------------------------------------------------------------------------
*/
- HDputs("Testing table with file open mode (read little-endian data):");
+ puts("Testing table with file open mode (read little-endian data):");
fid = h5file_open(TEST_FILE_LE, flags);
@@ -1559,7 +1558,7 @@ main(void)
* test4: open a file written in test1 on the Cray T3 machine
*-------------------------------------------------------------------------
*/
- HDputs("Testing table with file open mode (read Cray data):");
+ puts("Testing table with file open mode (read Cray data):");
fid = h5file_open(TEST_FILE_CRAY, flags);
diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c
index 8805c80..120e42e 100644
--- a/hl/tools/gif2h5/hdf2gif.c
+++ b/hl/tools/gif2h5/hdf2gif.c
@@ -46,7 +46,7 @@ static void
leave(int ret)
{
h5tools_close();
- HDexit(ret);
+ exit(ret);
}
static FILE *fpGif = NULL;
diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c
index 97abbc6..443a759 100644
--- a/hl/tools/h5watch/extend_dset.c
+++ b/hl/tools/h5watch/extend_dset.c
@@ -85,9 +85,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
set_t *cbuf = NULL; /* buffer for storing retrieved elements (compound) */
/* Allocate memory */
- if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int))))
+ if (NULL == (ibuf = (int *)calloc(TEST_BUF_SIZE, sizeof(int))))
goto error;
- if (NULL == (cbuf = (set_t *)HDcalloc(TEST_BUF_SIZE, sizeof(set_t))))
+ if (NULL == (cbuf = (set_t *)calloc(TEST_BUF_SIZE, sizeof(set_t))))
goto error;
/* Create a copy of file access property list */
@@ -146,9 +146,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
num_elmts *= (unsigned)ext_dims[i];
/* Compound type */
- if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if (!strcmp(dname, DSET_CMPD_TWO)) {
- HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
for (i = 0; i < num_elmts; i++) {
cbuf[i].field1 = action1;
cbuf[i].field2.a = action1;
@@ -166,7 +166,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
goto error;
}
else { /* Integer type */
- HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
for (i = 0; i < num_elmts; i++)
ibuf[i] = action1;
@@ -189,9 +189,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
goto error;
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return SUCCEED;
@@ -204,9 +204,9 @@ error:
H5E_END_TRY
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return FAIL;
@@ -239,9 +239,9 @@ extend_dset_one(const char *file, char *dname, int action)
set_t *cbuf = NULL; /* buffer for storing retrieved elements (compound) */
/* Allocate memory */
- if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int))))
+ if (NULL == (ibuf = (int *)calloc(TEST_BUF_SIZE, sizeof(int))))
goto error;
- if (NULL == (cbuf = (set_t *)HDcalloc(TEST_BUF_SIZE, sizeof(set_t))))
+ if (NULL == (cbuf = (set_t *)calloc(TEST_BUF_SIZE, sizeof(set_t))))
goto error;
/* Create a copy of file access property list */
@@ -305,9 +305,9 @@ extend_dset_one(const char *file, char *dname, int action)
/* Initialize data for the extended region of the dataset */
/* Compound type */
- if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) {
- HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
for (i = 0; i < action; i++) {
cbuf[i].field1 = i + 1;
cbuf[i].field2.a = i + 2;
@@ -328,7 +328,7 @@ extend_dset_one(const char *file, char *dname, int action)
}
else { /* Integer type */
- HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
for (i = 0; i < action; i++)
ibuf[i] = (int)i;
@@ -358,9 +358,9 @@ extend_dset_one(const char *file, char *dname, int action)
goto error;
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return SUCCEED;
@@ -375,9 +375,9 @@ error:
H5E_END_TRY
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return FAIL;
} /* end extend_dset_one() */
@@ -398,40 +398,40 @@ main(int argc, char *argv[])
int action1, action2;
if (argc != 5) {
- HDfprintf(stderr, "Should have file name, dataset name, and the extended amount...\n");
+ fprintf(stderr, "Should have file name, dataset name, and the extended amount...\n");
goto error;
} /* end if */
/* Get the dataset name to be extended */
fname = HDstrdup(argv[1]);
dname = HDstrdup(argv[2]);
- action1 = HDatoi(argv[3]);
- action2 = HDatoi(argv[4]);
+ action1 = atoi(argv[3]);
+ action2 = atoi(argv[4]);
- if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) {
if (extend_dset_one(fname, dname, action1) < 0)
goto error;
}
- else if (!HDstrcmp(dname, DSET_ONE) || !HDstrcmp(dname, DSET_ALLOC_LATE) ||
- !HDstrcmp(dname, DSET_ALLOC_EARLY)) {
+ else if (!strcmp(dname, DSET_ONE) || !strcmp(dname, DSET_ALLOC_LATE) ||
+ !strcmp(dname, DSET_ALLOC_EARLY)) {
if (extend_dset_one(fname, dname, action1) < 0)
goto error;
}
- else if (!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) {
+ else if (!strcmp(dname, DSET_TWO) || !strcmp(dname, DSET_CMPD_TWO)) {
if (extend_dset_two(fname, dname, action1, action2) < 0)
goto error;
}
else {
- HDfprintf(stdout, "Dataset cannot be extended...\n");
+ fprintf(stdout, "Dataset cannot be extended...\n");
goto error;
} /* end if-else */
- HDexit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
error:
if (dname)
- HDfree(dname);
+ free(dname);
if (fname)
- HDfree(fname);
- HDexit(EXIT_FAILURE);
+ free(fname);
+ exit(EXIT_FAILURE);
} /* end main() */
diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c
index 102ff93..d2c0d90 100644
--- a/hl/tools/h5watch/h5watch.c
+++ b/hl/tools/h5watch/h5watch.c
@@ -32,15 +32,15 @@ static char *g_list_of_fields = NULL; /* command line input for "li
static char *g_dup_fields = NULL; /* copy of "list_of_fields" */
static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */
-static hbool_t g_monitor_size_only = FALSE; /* monitor changes in dataset dimension sizes */
+static bool g_monitor_size_only = false; /* monitor changes in dataset dimension sizes */
static unsigned g_polling_interval = 1; /* polling interval to check appended data */
-static hbool_t g_label = FALSE; /* label compound values */
+static bool g_label = false; /* label compound values */
static int g_display_width = 80; /* output width in characters */
-static hbool_t g_simple_output = FALSE; /* make output more machine-readable */
+static bool g_simple_output = false; /* make output more machine-readable */
static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file if somehow file is unstable */
-static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */
-static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */
+static bool g_display_hex = false; /* display data in hexadecimal format : LATER */
+static bool g_user_interrupt = false; /* Flag to indicate that user interrupted execution */
static herr_t doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank);
static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block,
@@ -121,11 +121,11 @@ doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank)
subset.block.data[i] = block[i];
} /* end for */
- HDmemset(&ctx, 0, sizeof(ctx));
+ memset(&ctx, 0, sizeof(ctx));
ctx.sset = &subset;
/* Set to all default values and then override */
- HDmemset(&info, 0, sizeof info);
+ memset(&info, 0, sizeof info);
if (g_simple_output) {
info.idx_fmt = "";
@@ -192,14 +192,14 @@ doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank)
if (g_display_hex) {
/* Print all data in hexadecimal format if the `-x' or `--hexdump'
* command line switch was given. */
- info.raw = TRUE;
+ info.raw = true;
} /* end if */
/* Print the values. */
if ((ret_value = h5tools_dump_dset(stdout, &info, &ctx, did)) < 0)
error_msg("unable to print data\n");
- HDfprintf(stdout, "\n");
+ fprintf(stdout, "\n");
return ret_value;
@@ -292,7 +292,7 @@ monitor_dataset(hid_t fid, char *dsetname)
hsize_t cur_dims[H5S_MAX_RANK]; /* previous dataspace dimensions */
herr_t ret_value = SUCCEED; /* return value */
- HDfprintf(stdout, "Monitoring dataset %s...\n", dsetname);
+ fprintf(stdout, "Monitoring dataset %s...\n", dsetname);
/* Open the dataset for minitoring */
if ((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) {
@@ -312,7 +312,7 @@ monitor_dataset(hid_t fid, char *dsetname)
ret_value = FAIL;
goto done;
}
- HDfflush(stdout);
+ fflush(stdout);
/* Loop until an error occurs or the user interrupts execution */
while (!g_user_interrupt) {
@@ -339,14 +339,13 @@ monitor_dataset(hid_t fid, char *dsetname)
if (i != ndims) {
/* Printing changes in dimension sizes */
for (u = 0; u < ndims; u++) {
- HDfprintf(stdout, "dimension %d: %" PRIuHSIZE "->%" PRIuHSIZE "", u, prev_dims[u],
- cur_dims[u]);
+ fprintf(stdout, "dimension %d: %" PRIuHSIZE "->%" PRIuHSIZE "", u, prev_dims[u], cur_dims[u]);
if (cur_dims[u] > prev_dims[u])
- HDfprintf(stdout, " (increases)\n");
+ fprintf(stdout, " (increases)\n");
else if (cur_dims[u] < prev_dims[u])
- HDfprintf(stdout, " (decreases)\n");
+ fprintf(stdout, " (decreases)\n");
else
- HDfprintf(stdout, " (unchanged)\n");
+ fprintf(stdout, " (unchanged)\n");
}
/* Printing elements appended to the dataset if there is */
@@ -360,7 +359,7 @@ monitor_dataset(hid_t fid, char *dsetname)
/* Print the new appended data to the dataset */
if (cur_dims[u] > prev_dims[u]) {
- HDfprintf(stdout, " Data:\n");
+ fprintf(stdout, " Data:\n");
for (j = 0; j < ndims; j++) {
start[j] = 0;
@@ -374,17 +373,17 @@ monitor_dataset(hid_t fid, char *dsetname)
}
} /* end for */
}
- HDfflush(stdout);
+ fflush(stdout);
}
/* Save the current dimension sizes */
- HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t));
+ memcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t));
/* Sleep before next monitor */
HDsleep(g_polling_interval);
} /* end while */
- HDfflush(stdout);
+ fflush(stdout);
done:
/* Closing */
@@ -415,7 +414,7 @@ process_cmpd_fields(hid_t fid, char *dsetname)
size_t len; /* number of comma-separated fields in "g_list_of_fields" */
herr_t ret_value = SUCCEED; /* Return value */
- HDassert(g_list_of_fields && *g_list_of_fields);
+ assert(g_list_of_fields && *g_list_of_fields);
/* Open the dataset */
if ((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) {
@@ -446,10 +445,10 @@ process_cmpd_fields(hid_t fid, char *dsetname)
}
/* Estimate the number of comma-separated fields in "g_list of_fields" */
- len = HDstrlen(g_list_of_fields) / 2 + 2;
+ len = strlen(g_list_of_fields) / 2 + 2;
/* Allocate memory for a list vector of H5LD_memb_t structures to store "g_list_of_fields" info */
- if ((g_listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))) == NULL) {
+ if ((g_listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *))) == NULL) {
error_msg("error in allocating memory for H5LD_memb_t\n");
ret_value = FAIL;
goto done;
@@ -496,7 +495,7 @@ check_dataset(hid_t fid, char *dsetname)
unsigned u; /* Local index variable */
hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */
hsize_t max_dims[H5S_MAX_RANK]; /* maximum size of dataspace dimensions */
- hbool_t unlim_max_dims = FALSE; /* whether dataset has unlimited or max. dimension setting */
+ bool unlim_max_dims = false; /* whether dataset has unlimited or max. dimension setting */
void *edata;
H5E_auto2_t func;
H5D_layout_t layout;
@@ -532,8 +531,8 @@ check_dataset(hid_t fid, char *dsetname)
goto done;
}
- HDmemset(cur_dims, 0, sizeof cur_dims);
- HDmemset(max_dims, 0, sizeof max_dims);
+ memset(cur_dims, 0, sizeof cur_dims);
+ memset(max_dims, 0, sizeof max_dims);
/* Get dataset's dataspace */
if ((sid = H5Dget_space(did)) < 0) {
@@ -552,7 +551,7 @@ check_dataset(hid_t fid, char *dsetname)
/* Check whether dataset has unlimited dimension or max. dimension setting */
for (u = 0; u < (unsigned)ndims; u++)
if (max_dims[u] == H5S_UNLIMITED || cur_dims[u] != max_dims[u]) {
- unlim_max_dims = TRUE;
+ unlim_max_dims = true;
break;
}
@@ -608,46 +607,46 @@ leave(int ret)
static void
usage(const char *prog)
{
- HDfflush(stdout);
- HDfprintf(stdout, "Usage: %s [OPTIONS] [OBJECT]\n", prog);
- HDfprintf(stdout, "\n");
- HDfprintf(stdout, " OPTIONS\n");
- HDfprintf(stdout, " --help Print a usage message and exit.\n");
- HDfprintf(stdout, " --version Print version number and exit.\n");
- HDfprintf(stdout, " --label Label members of compound typed dataset.\n");
- HDfprintf(stdout, " --simple Use a machine-readable output format.\n");
- HDfprintf(stdout, " --dim Monitor changes in size of dataset dimensions only.\n");
- HDfprintf(stdout, " --width=N Set the number of columns to N for output.\n");
- HDfprintf(stdout, " A value of 0 sets the number of columns to the\n");
- HDfprintf(stdout, " maximum (65535). The default width is 80 columns.\n");
- HDfprintf(stdout, " --polling=N Set the polling interval to N (in seconds) when the\n");
- HDfprintf(stdout,
- " dataset will be checked for appended data. The default\n");
- HDfprintf(stdout, " polling interval is 1.\n");
- HDfprintf(stdout, " --fields=<list_of_fields>\n");
- HDfprintf(stdout,
- " Display data for the fields specified in <list_of_fields>\n");
- HDfprintf(stdout, " for a compound data type. <list_of_fields> can be\n");
- HDfprintf(stdout, " specified as follows:\n");
- HDfprintf(stdout, " 1) A comma-separated list of field names in a\n");
- HDfprintf(stdout, " compound data type. \",\" is the separator\n");
- HDfprintf(stdout, " for field names while \".\" is the separator\n");
- HDfprintf(stdout, " for a nested field.\n");
- HDfprintf(stdout, " 2) A single field name in a compound data type.\n");
- HDfprintf(stdout, " Can use this option multiple times.\n");
- HDfprintf(stdout, " Note that backslash is the escape character to avoid\n");
- HDfprintf(stdout,
- " characters in field names that conflict with the tool's\n");
- HDfprintf(stdout, " separators.\n");
- HDfprintf(stdout, "\n");
- HDfprintf(stdout, " OBJECT is specified as [<filename>/<path_to_dataset>/<dsetname>]\n");
- HDfprintf(stdout, " <filename> Name of the HDF5 file. It may be preceded by path\n");
- HDfprintf(stdout, " separated by slashes to the specified HDF5 file.\n");
- HDfprintf(stdout, " <path_to_dataset> Path separated by slashes to the specified dataset\n");
- HDfprintf(stdout, " <dsetname> Name of the dataset\n");
- HDfprintf(stdout, "\n");
- HDfprintf(stdout,
- " User can end the h5watch process by ctrl-C (SIGINT) or kill the process (SIGTERM).\n");
+ fflush(stdout);
+ fprintf(stdout, "Usage: %s [OPTIONS] [OBJECT]\n", prog);
+ fprintf(stdout, "\n");
+ fprintf(stdout, " OPTIONS\n");
+ fprintf(stdout, " --help Print a usage message and exit.\n");
+ fprintf(stdout, " --version Print version number and exit.\n");
+ fprintf(stdout, " --label Label members of compound typed dataset.\n");
+ fprintf(stdout, " --simple Use a machine-readable output format.\n");
+ fprintf(stdout, " --dim Monitor changes in size of dataset dimensions only.\n");
+ fprintf(stdout, " --width=N Set the number of columns to N for output.\n");
+ fprintf(stdout, " A value of 0 sets the number of columns to the\n");
+ fprintf(stdout, " maximum (65535). The default width is 80 columns.\n");
+ fprintf(stdout, " --polling=N Set the polling interval to N (in seconds) when the\n");
+ fprintf(stdout,
+ " dataset will be checked for appended data. The default\n");
+ fprintf(stdout, " polling interval is 1.\n");
+ fprintf(stdout, " --fields=<list_of_fields>\n");
+ fprintf(stdout,
+ " Display data for the fields specified in <list_of_fields>\n");
+ fprintf(stdout, " for a compound data type. <list_of_fields> can be\n");
+ fprintf(stdout, " specified as follows:\n");
+ fprintf(stdout, " 1) A comma-separated list of field names in a\n");
+ fprintf(stdout, " compound data type. \",\" is the separator\n");
+ fprintf(stdout, " for field names while \".\" is the separator\n");
+ fprintf(stdout, " for a nested field.\n");
+ fprintf(stdout, " 2) A single field name in a compound data type.\n");
+ fprintf(stdout, " Can use this option multiple times.\n");
+ fprintf(stdout, " Note that backslash is the escape character to avoid\n");
+ fprintf(stdout,
+ " characters in field names that conflict with the tool's\n");
+ fprintf(stdout, " separators.\n");
+ fprintf(stdout, "\n");
+ fprintf(stdout, " OBJECT is specified as [<filename>/<path_to_dataset>/<dsetname>]\n");
+ fprintf(stdout, " <filename> Name of the HDF5 file. It may be preceded by path\n");
+ fprintf(stdout, " separated by slashes to the specified HDF5 file.\n");
+ fprintf(stdout, " <path_to_dataset> Path separated by slashes to the specified dataset\n");
+ fprintf(stdout, " <dsetname> Name of the dataset\n");
+ fprintf(stdout, "\n");
+ fprintf(stdout,
+ " User can end the h5watch process by ctrl-C (SIGINT) or kill the process (SIGTERM).\n");
} /* usage() */
@@ -698,15 +697,15 @@ parse_command_line(int argc, const char *const *argv)
break;
case 'd': /* --dim */
- g_monitor_size_only = TRUE;
+ g_monitor_size_only = true;
break;
case 'S': /* --simple */
- g_simple_output = TRUE;
+ g_simple_output = true;
break;
case 'l': /* --label */
- g_label = TRUE;
+ g_label = true;
break;
case 'p': /* --polling=N */
@@ -732,13 +731,13 @@ parse_command_line(int argc, const char *const *argv)
error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__);
leave(EXIT_FAILURE);
}
- if ((g_list_of_fields = (char *)HDrealloc(
- g_list_of_fields, HDstrlen(g_list_of_fields) + HDstrlen(str) + 2)) == NULL) {
+ if ((g_list_of_fields = (char *)realloc(g_list_of_fields, strlen(g_list_of_fields) +
+ strlen(str) + 2)) == NULL) {
error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__);
leave(EXIT_FAILURE);
}
- HDstrcat(g_list_of_fields, FIELD_SEP);
- HDstrcat(g_list_of_fields, str);
+ strcat(g_list_of_fields, FIELD_SEP);
+ strcat(g_list_of_fields, str);
}
break;
@@ -773,7 +772,7 @@ static void
catch_signal(int H5_ATTR_UNUSED signo)
{
/* Set the flag to get out of the main loop */
- g_user_interrupt = TRUE;
+ g_user_interrupt = true;
} /* catch_signal() */
/*-------------------------------------------------------------------------
@@ -864,17 +863,17 @@ main(int argc, char *argv[])
do {
while (fname && *fname) {
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl, FALSE, drivername,
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl, false, drivername,
sizeof drivername);
if (fid >= 0) {
- HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername);
+ fprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername);
break; /*success*/
} /* end if */
/* Shorten the file name; lengthen the object name */
x = dname;
- dname = HDstrrchr(fname, '/');
+ dname = strrchr(fname, '/');
if (x)
*x = '/';
if (!dname)
@@ -928,17 +927,17 @@ main(int argc, char *argv[])
done:
/* Free spaces */
if (fname)
- HDfree(fname);
+ free(fname);
if (dname)
- HDfree(dname);
+ free(dname);
if (g_list_of_fields)
- HDfree(g_list_of_fields);
+ free(g_list_of_fields);
if (g_listv) {
H5LD_clean_vector(g_listv);
- HDfree(g_listv);
+ free(g_listv);
}
if (g_dup_fields)
- HDfree(g_dup_fields);
+ free(g_dup_fields);
/* Close the file access property list */
if (fapl >= 0 && H5Pclose(fapl) < 0) {
diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c
index 5b8cf07..ef47926 100644
--- a/hl/tools/h5watch/h5watchgentest.c
+++ b/hl/tools/h5watch/h5watchgentest.c
@@ -103,7 +103,7 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m
goto done;
/* Set up dataset's creation properties */
- if (!HDstrcmp(dname, DSET_NONE))
+ if (!strcmp(dname, DSET_NONE))
dcpl = H5P_DEFAULT;
else {
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
@@ -114,11 +114,11 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m
goto done;
} /* end else */
- if (!HDstrcmp(dname, DSET_ALLOC_LATE)) {
+ if (!strcmp(dname, DSET_ALLOC_LATE)) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0)
goto done;
}
- else if (!HDstrcmp(dname, DSET_ALLOC_EARLY)) {
+ else if (!strcmp(dname, DSET_ALLOC_EARLY)) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto done;
} /* end if-else */
@@ -172,14 +172,14 @@ main(void)
/* Create a copy of file access property list */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- HDexit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
/* Set to use the latest library format */
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- HDexit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
/* Create a file with the latest format */
if ((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
/* Initialization for one-dimensional dataset */
cur_dims[0] = ONE_DIMS0;
@@ -341,7 +341,7 @@ main(void)
if (H5Fclose(fid) < 0)
goto done;
- HDexit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
done:
H5E_BEGIN_TRY
@@ -356,5 +356,5 @@ done:
H5Fclose(fid);
H5E_END_TRY
- HDexit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
} /* end main() */