diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 23:38:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 23:38:50 (GMT) |
commit | e286b6e706b28330a64115c13c11ae832536b857 (patch) | |
tree | a7fdc80d328010b9c6671829f8b19ea433a4380c /hl/src | |
parent | 41a6b581aef055821796fc9d31f58778dc1c4197 (diff) | |
download | hdf5-e286b6e706b28330a64115c13c11ae832536b857.zip hdf5-e286b6e706b28330a64115c13c11ae832536b857.tar.gz hdf5-e286b6e706b28330a64115c13c11ae832536b857.tar.bz2 |
Sync high-level library with develop (#3298)
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5DO.c | 6 | ||||
-rw-r--r-- | hl/src/H5DS.c | 72 | ||||
-rw-r--r-- | hl/src/H5IM.c | 14 | ||||
-rw-r--r-- | hl/src/H5LD.c | 47 | ||||
-rw-r--r-- | hl/src/H5LT.c | 246 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.c | 148 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.l | 14 | ||||
-rw-r--r-- | hl/src/H5LTparse.c | 174 | ||||
-rw-r--r-- | hl/src/H5LTparse.h | 2 | ||||
-rw-r--r-- | hl/src/H5LTparse.y | 26 | ||||
-rw-r--r-- | hl/src/H5LTprivate.h | 2 | ||||
-rw-r--r-- | hl/src/H5TB.c | 52 |
12 files changed, 399 insertions, 404 deletions
diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 02dd002..bd03146 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -118,7 +118,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 */ @@ -129,7 +129,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 */ @@ -209,7 +209,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; } diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 29e417e..327c9c6 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); @@ -144,16 +144,16 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */ ds_list_t *dsbuf_w = NULL; /* array of "REFERENCE_LIST" attribute data to write when adding new reference to a dataset */ - hobj_ref_t ref_to_ds; /* reference to the DS */ - hobj_ref_t ref_j; /* iterator reference */ + hobj_ref_t ref_to_ds = HADDR_UNDEF; /* reference to the DS */ + hobj_ref_t ref_j; /* iterator reference */ /* Variables to be used when new references are used */ nds_list_t ndsl; - nds_list_t *ndsbuf = NULL; - nds_list_t *ndsbuf_w = NULL; - H5R_ref_t nref_to_ds; + nds_list_t *ndsbuf = NULL; + 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 */ @@ -163,7 +163,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 @@ -219,7 +219,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; /*------------------------------------------------------------------------- @@ -689,7 +689,7 @@ out: H5Tclose(ntid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -742,7 +742,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; @@ -1186,7 +1186,7 @@ out: buf = NULL; } } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -1231,7 +1231,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 @@ -1522,7 +1522,7 @@ out: H5Tclose(tid); H5Tclose(ntid); } - H5E_END_TRY; + H5E_END_TRY if (buf) { free(buf); @@ -1591,7 +1591,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 @@ -1680,7 +1680,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi if ((scale_id = H5Ropen_object(&nref, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; } - H5E_END_TRY; + H5E_END_TRY } else { /* get the reference */ @@ -1693,7 +1693,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi if ((scale_id = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &ref)) < 0) goto out; } - H5E_END_TRY; + H5E_END_TRY } /* set the return IDX OUT value at current scale index */ @@ -1745,7 +1745,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -1941,7 +1941,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -2038,7 +2038,7 @@ 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); @@ -2085,7 +2085,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -2199,7 +2199,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); return FAIL; @@ -2288,7 +2288,7 @@ 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; free(buf); @@ -2307,7 +2307,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY } return is_ds; } @@ -2420,7 +2420,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY if (buf) free(buf); @@ -2438,7 +2438,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; @@ -2450,7 +2450,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; } @@ -2477,12 +2477,12 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved) 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; free(buf); @@ -2499,7 +2499,7 @@ error: H5Tclose(tid); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY free(buf); diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 3308b71..42a5feb 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -90,13 +90,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; @@ -158,7 +158,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; @@ -261,13 +261,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]; @@ -1036,7 +1036,7 @@ H5IMis_image(hid_t loc_id, const char *dset_name) 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; @@ -1131,7 +1131,7 @@ H5IMis_palette(hid_t loc_id, const char *dset_name) 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; diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 90701b6..e618a66 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -148,10 +148,10 @@ 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 */ assert(listv); assert(fields); @@ -164,12 +164,12 @@ 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 *)calloc((size_t)1, sizeof(H5LD_memb_t)))) @@ -188,51 +188,48 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) switch (*fields_ptr) { case '\0': /* end of list */ if (gotmember) { /* getting something and end of "fields" */ - *cur++ = '\0'; - ; + *cur++ = '\0'; 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; case '.': /* nested field separator */ *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) */ @@ -300,7 +297,7 @@ done: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return (ret_value); } /* H5LD_get_dset_dims() */ @@ -351,7 +348,7 @@ 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; + len = (strlen(fields) / 2) + 2; if (NULL == (listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *)))) goto done; @@ -506,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 the vector of H5LD_memb_t pointers */ - len = (HDstrlen(fields) / 2) + 2; + len = (strlen(fields) / 2) + 2; if (NULL == (listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *)))) goto done; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 4250071..d48f240 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -507,7 +507,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -674,7 +674,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; @@ -712,7 +712,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -760,7 +760,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 */ @@ -804,7 +804,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) @@ -822,7 +822,7 @@ out: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end H5LTopen_file_image() */ @@ -1021,7 +1021,7 @@ out: H5Dclose(did); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1073,7 +1073,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1144,7 +1144,7 @@ out: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1179,7 +1179,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; @@ -1260,7 +1260,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; @@ -1720,7 +1720,6 @@ H5LTget_attribute_ndims(hid_t loc_id, const char *obj_name, const char *attr_nam /* End access to the attribute */ if (H5Aclose(attr_id)) goto out; - ; /* Close the object */ if (H5Oclose(obj_id) < 0) @@ -1839,7 +1838,7 @@ H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) goto out; } - input_len = HDstrlen(text); + input_len = strlen(text); myinput = HDstrdup(text); if ((type_id = H5LTyyparse()) < 0) { @@ -1866,7 +1865,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; @@ -1877,10 +1876,10 @@ 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; } @@ -1896,19 +1895,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 { @@ -1932,7 +1931,7 @@ 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]; @@ -1941,7 +1940,7 @@ indentation(size_t x, char *str, hbool_t no_u_buf, size_t *s_len) 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; @@ -1961,7 +1960,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 */ @@ -2020,7 +2019,7 @@ 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; memset(tmp_str, ' ', (size_t)MAX(3, 19 - nchars) + 1); @@ -2029,13 +2028,13 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) 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; } @@ -2104,7 +2103,7 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len) 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) free(text_str); text_str = NULL; @@ -2135,7 +2134,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]; @@ -2145,7 +2144,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; } @@ -2156,112 +2155,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; @@ -2289,16 +2288,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; @@ -2307,13 +2306,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; @@ -2322,11 +2321,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; @@ -2352,7 +2351,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; @@ -2371,7 +2370,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; @@ -2393,7 +2392,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; @@ -2413,14 +2412,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; @@ -2432,7 +2431,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; @@ -2442,12 +2441,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; @@ -2455,13 +2454,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; @@ -2469,7 +2468,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; @@ -2481,7 +2480,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; @@ -2504,7 +2503,7 @@ next: 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); @@ -2516,7 +2515,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; @@ -2528,7 +2527,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; @@ -2550,7 +2549,7 @@ next: if (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); @@ -2559,7 +2558,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; @@ -2573,7 +2572,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; @@ -2586,11 +2585,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; @@ -2610,7 +2609,7 @@ next: if (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); @@ -2619,7 +2618,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; @@ -2637,7 +2636,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++) { @@ -2672,14 +2671,14 @@ next: 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; } @@ -2688,30 +2687,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; @@ -3137,7 +3136,6 @@ H5LT_get_attribute_disk(hid_t loc_id, const char *attr_name, void *attr_out) if (H5Aclose(attr_id) < 0) return -1; - ; return 0; @@ -3181,7 +3179,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; @@ -3221,7 +3219,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -3237,7 +3235,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) { @@ -3252,17 +3250,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; } @@ -3277,18 +3275,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; @@ -3296,8 +3294,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; } @@ -3307,7 +3305,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 '/' */ @@ -3326,8 +3324,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; } diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 45e3c57..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,277 +1208,277 @@ 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 = atoi(yytext); return NUMBER; @@ -1487,7 +1487,7 @@ YY_RULE_SETUP 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; assert(quoted[0] == '"' && quoted[len - 1] == '"'); - trimmed = HDstrdup(quoted + 1); + trimmed = strdup(quoted + 1); trimmed[len - 2] = '\0'; return trimmed; @@ -2577,6 +2577,6 @@ int H5LTyyerror(const char *msg) 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 4386a7c..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; @@ -1655,9 +1655,9 @@ yyreduce: break; case 53: /* field_name: STRING */ -#line 205 "hl/src//H5LTparse.y" +#line 204 "hl/src//H5LTparse.y" { - (yyval.sval) = HDstrdup(yylval.sval); + (yyval.sval) = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } @@ -1665,25 +1665,25 @@ yyreduce: 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,7 +1725,7 @@ 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); free(yylval.sval); @@ -1735,13 +1735,13 @@ yyreduce: 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,70 +1808,70 @@ 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); + enum_memb_symbol = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } @@ -1879,7 +1879,7 @@ yyreduce: 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; 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/H5TB.c b/hl/src/H5TB.c index 6263ebb..e718605 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); @@ -155,7 +155,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) @@ -177,7 +177,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; @@ -1738,7 +1738,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; @@ -1973,7 +1973,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 */ @@ -2046,7 +2046,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++) { @@ -2067,7 +2067,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 */ @@ -2234,7 +2234,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; @@ -2257,7 +2257,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) @@ -2382,7 +2382,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 */ @@ -2515,7 +2515,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) @@ -2692,7 +2692,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; @@ -2808,7 +2808,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 * * Comments: * @@ -2822,7 +2822,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 */ @@ -2841,7 +2841,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) @@ -3068,11 +3068,11 @@ out: * * Purpose: Find a string field * - * Return: Success: TRUE/FALSE, Failure: N/A + * Return: Success: true/false, Failure: N/A * *------------------------------------------------------------------------- */ -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; @@ -3080,22 +3080,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() */ /*------------------------------------------------------------------------- @@ -3138,7 +3138,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) |