summaryrefslogtreecommitdiffstats
path: root/hl/src
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/src
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/src')
-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
13 files changed, 584 insertions, 584 deletions
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)