From e286b6e706b28330a64115c13c11ae832536b857 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 27 Jul 2023 16:38:50 -0700 Subject: Sync high-level library with develop (#3298) --- hl/src/H5DO.c | 6 +- hl/src/H5DS.c | 72 +++--- hl/src/H5IM.c | 14 +- hl/src/H5LD.c | 47 ++-- hl/src/H5LT.c | 246 +++++++++++---------- hl/src/H5LTanalyze.c | 148 ++++++------- hl/src/H5LTanalyze.l | 14 +- hl/src/H5LTparse.c | 174 +++++++-------- hl/src/H5LTparse.h | 2 +- hl/src/H5LTparse.y | 26 +-- hl/src/H5LTprivate.h | 2 +- hl/src/H5TB.c | 52 ++--- hl/test/gen_test_ds.c | 10 +- hl/test/gen_test_ld.c | 6 +- hl/test/h5hltest.h | 8 +- hl/test/test_ds.c | 450 +++++++++++++++++++------------------- hl/test/test_dset_append.c | 16 +- hl/test/test_file_image.c | 12 +- hl/test/test_h5do_compat.c | 12 +- hl/test/test_image.c | 72 +++--- hl/test/test_ld.c | 57 ++--- hl/test/test_lite.c | 79 ++++--- hl/test/test_packet.c | 4 +- hl/test/test_packet_vlen.c | 40 ++-- hl/test/test_table.c | 36 +-- hl/tools/gif2h5/decompress.c | 4 +- hl/tools/gif2h5/hdf2gif.c | 2 +- hl/tools/h5watch/extend_dset.c | 12 +- hl/tools/h5watch/h5watch.c | 46 ++-- hl/tools/h5watch/h5watchgentest.c | 6 +- 30 files changed, 835 insertions(+), 840 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 #include #include @@ -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 #include @@ -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($3) { - HDfree($3); + free($3); $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 { - $$ = HDstrdup(yylval.sval); - HDfree(yylval.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($6, yylval.sval); - HDfree(yylval.sval); + free(yylval.sval); yylval.sval = NULL; } '}' { $$ = $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) diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index 27a98e7..438a35a 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -336,7 +336,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -400,7 +400,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -480,7 +480,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -561,7 +561,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -609,7 +609,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c index 8eacf55..7eefd5c 100644 --- a/hl/test/gen_test_ld.c +++ b/hl/test/gen_test_ld.c @@ -103,7 +103,7 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m goto done; /* Set up dataset's creation properties */ - if (!HDstrcmp(dname, DSET_NONE)) + if (!strcmp(dname, DSET_NONE)) dcpl = H5P_DEFAULT; else { hsize_t chunk_dims[H5S_MAX_RANK]; /* Dimension sizes for chunks */ @@ -116,11 +116,11 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m goto done; } /* end else */ - if (!HDstrcmp(dname, DSET_ALLOC_LATE)) { + if (!strcmp(dname, DSET_ALLOC_LATE)) { if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto done; } /* end if */ - else if (!HDstrcmp(dname, DSET_ALLOC_EARLY)) { + else if (!strcmp(dname, DSET_ALLOC_EARLY)) { if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto done; } /* end if */ diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index 6f31050..3d58ed6 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -27,13 +27,13 @@ /* Macros used in HL tests */ #define HL_TESTING2(WHAT) \ do { \ - HDprintf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + printf("Testing %-62s", WHAT); \ + fflush(stdout); \ } while (0) #define HL_TESTING3(WHAT) \ do { \ - HDprintf("Testing %-62s", WHAT); \ - HDfflush(stdout); \ + printf("Testing %-62s", WHAT); \ + fflush(stdout); \ } while (0) /* Implements verbose 'assert' with 'goto error' exit */ diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 3d31786..f85ed81 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -245,7 +245,7 @@ create_test_file(const char *fileext) { char filename[65]; - HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); + snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); } @@ -255,7 +255,7 @@ open_test_file(const char *fileext) { char filename[65]; - HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); + snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -284,7 +284,7 @@ create_char_dataset(hid_t fid, const char *dsidx, int fulldims) char s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 120, 120, 120}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_char(fid, name, rank, dims, NULL) >= 0) { @@ -338,7 +338,7 @@ create_short_dataset(hid_t fid, const char *dsidx, int fulldims) short s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 140, 140, 140}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_short(fid, name, rank, dims, NULL) >= 0) { @@ -387,7 +387,7 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_int(fid, name, rank, dims, NULL) >= 0) { @@ -497,7 +497,7 @@ create_float_dataset(hid_t fid, const char *dsidx, int fulldims) float s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300}; char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if (H5LTmake_dataset_float(fid, name, rank, dims, NULL) >= 0) { @@ -533,14 +533,14 @@ create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -560,14 +560,14 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -575,7 +575,7 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -595,14 +595,14 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -610,7 +610,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -618,7 +618,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -638,14 +638,14 @@ create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -665,14 +665,14 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -680,7 +680,7 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -700,14 +700,14 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -715,7 +715,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -723,7 +723,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -742,14 +742,14 @@ create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -769,14 +769,14 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -784,7 +784,7 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -804,14 +804,14 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -819,7 +819,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -827,7 +827,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -847,14 +847,14 @@ create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -874,14 +874,14 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -889,7 +889,7 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -909,14 +909,14 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -924,7 +924,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -932,7 +932,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -952,14 +952,14 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -967,7 +967,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -975,7 +975,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -983,7 +983,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di } if (s4_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0) @@ -1003,14 +1003,14 @@ create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -1030,14 +1030,14 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -1045,7 +1045,7 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -1065,14 +1065,14 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d { char name[64]; - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if (s1_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) @@ -1080,7 +1080,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s2_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) @@ -1088,7 +1088,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d } if (s3_wbuf != NULL) { - HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0) @@ -1178,7 +1178,7 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char)); if (name_out != NULL) { if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) >= 0) { - if (HDstrncmp(scalename, name_out, (size_t)name_len) == 0) { + if (strncmp(scalename, name_out, (size_t)name_len) == 0) { ret_value = SUCCEED; } free(name_out); @@ -1219,14 +1219,14 @@ test_detachscales(void) /* make datasets; they are three dimensional*/ for (i = 0; i < 2; i++) { - HDsnprintf(dname, sizeof(dname), "D%d", i); + snprintf(dname, sizeof(dname), "D%d", i); if (H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0) goto out; } /* create datasets and make them dim. scales */ for (i = 0; i < 4; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if (H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0) goto out; } @@ -1234,7 +1234,7 @@ test_detachscales(void) two scales attached */ if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { for (i = 0; i < 4; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, (unsigned int)i % 3) < 0) @@ -1251,7 +1251,7 @@ test_detachscales(void) /* attach scales to the second dataset */ if ((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) { for (i = 0; i < 3; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, (unsigned int)i) < 0) @@ -1272,7 +1272,7 @@ test_detachscales(void) goto out; for (i = 0; i < 2; i++) { - HDsnprintf(dname, sizeof(dname), "D%d", i); + snprintf(dname, sizeof(dname), "D%d", i); if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, (unsigned int)0) < 0) @@ -1302,7 +1302,7 @@ test_detachscales(void) sure that attribute "DIMENSION_LIST" doesn't exist anymore */ if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { for (i = 1; i < 4; i++) { - HDsnprintf(dname, sizeof(dname), "DS%d", i); + snprintf(dname, sizeof(dname), "DS%d", i); if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, (unsigned int)i % 3) < 0) @@ -1331,7 +1331,7 @@ out: H5Dclose(dsid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1346,7 +1346,7 @@ test_char_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); HL_TESTING2("test_char_attachscales"); @@ -1358,15 +1358,15 @@ test_char_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1387,7 +1387,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1402,7 +1402,7 @@ test_short_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); HL_TESTING2("test_short_attachscales"); @@ -1414,39 +1414,39 @@ test_short_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1467,7 +1467,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1482,7 +1482,7 @@ test_int_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); HL_TESTING2("test_int_attachscales"); @@ -1494,23 +1494,23 @@ test_int_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1531,7 +1531,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1546,7 +1546,7 @@ test_long_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); HL_TESTING2("test_long_attachscales"); @@ -1558,19 +1558,19 @@ test_long_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1591,7 +1591,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1606,7 +1606,7 @@ test_duplicatelong_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); HL_TESTING2("test_duplicatelong_attachscales"); @@ -1618,19 +1618,19 @@ test_duplicatelong_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if (test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1651,7 +1651,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1666,7 +1666,7 @@ test_float_attachscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); HL_TESTING2("test_float_attachscales"); @@ -1678,23 +1678,23 @@ test_float_attachscales(const char *fileext) goto out; if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); if (test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1715,7 +1715,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1731,7 +1731,7 @@ test_numberofscales(const char *fileext) char dsname[32]; char scalename[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); HL_TESTING2("test_numberofscales"); @@ -1757,7 +1757,7 @@ test_numberofscales(const char *fileext) else goto out; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b"); /* make a dataset */ if (create_int_dataset(fid, "b", 1) < 0) @@ -1765,7 +1765,7 @@ test_numberofscales(const char *fileext) /* make a DS dataset for the first dimension */ if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b"); if (test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; @@ -1798,7 +1798,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1814,31 +1814,31 @@ test_char_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set char scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); + snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1862,7 +1862,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1878,79 +1878,79 @@ test_short_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set short scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); + snprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1974,7 +1974,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -1990,47 +1990,47 @@ test_int_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set int scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); + snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2054,7 +2054,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -2070,39 +2070,39 @@ test_long_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set long scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2126,7 +2126,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -2142,39 +2142,39 @@ test_samelong_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set same long scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); - HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + snprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al"); if (test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2198,7 +2198,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -2214,47 +2214,47 @@ test_float_scalenames(const char *fileext) char scalename[32]; char name[32]; - HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); + snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); if ((fid = open_test_file(fileext)) < 0) goto out; HL_TESTING2("set float scale/cmp scale name"); if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); - HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af"); + snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); + snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af"); if (test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2278,7 +2278,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -2327,7 +2327,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); @@ -2983,10 +2983,10 @@ test_simple(void) if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto out; for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - HDsnprintf(sname, sizeof(sname), "ds_%d", i); + snprintf(sname, sizeof(sname), "ds_%d", i); if ((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5DSset_scale(dsid, "scale") < 0) @@ -3003,11 +3003,11 @@ test_simple(void) */ for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for (j = 0; j < 5; j++) { - HDsnprintf(sname, sizeof(sname), "ds_%d", j); + snprintf(sname, sizeof(sname), "ds_%d", j); if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, DIM0) < 0) @@ -3025,11 +3025,11 @@ test_simple(void) */ for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for (j = 0; j < 5; j++) { - HDsnprintf(sname, sizeof(sname), "ds_%d", j); + snprintf(sname, sizeof(sname), "ds_%d", j); if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, DIM0) < 0) @@ -3047,11 +3047,11 @@ test_simple(void) */ for (i = 0; i < 5; i++) { - HDsnprintf(dname, sizeof(dname), "dset_%d", i); + snprintf(dname, sizeof(dname), "dset_%d", i); if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for (j = 0; j < 5; j++) { - HDsnprintf(sname, sizeof(sname), "ds_%d", j); + snprintf(sname, sizeof(sname), "ds_%d", j); if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, DIM0) < 0) @@ -3145,9 +3145,9 @@ test_simple(void) goto out; if (H5DSget_label(did, DIM1, dim1_label, sizeof(dim1_label)) < 0) goto out; - if (HDstrncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0) + if (strncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0) goto out; - if (HDstrncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0) + if (strncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0) goto out; /*------------------------------------------------------------------------- @@ -3169,9 +3169,9 @@ test_simple(void) goto out; if (H5DSget_label(did, DIM1, dim1_labeld, (size_t)dim1_label_size) < 0) goto out; - if (HDstrncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0) + if (strncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0) goto out; - if (HDstrncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0) + if (strncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0) goto out; if (dim0_labeld) { free(dim0_labeld); @@ -3191,9 +3191,9 @@ test_simple(void) goto out; if (H5DSget_label(did, DIM1, dim1_labels, sizeof(dim1_labels)) < 0) goto out; - if (HDstrncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0) + if (strncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0) goto out; - if (HDstrncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0) + if (strncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0) goto out; if (H5Dclose(did)) goto out; @@ -3233,7 +3233,7 @@ test_simple(void) if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) < 0) goto out; - if (HDstrncmp("Latitude set 0", name_out, (size_t)name_len) != 0) + if (strncmp("Latitude set 0", name_out, (size_t)name_len) != 0) goto out; if (name_out) { free(name_out); @@ -3249,7 +3249,7 @@ test_simple(void) if (H5DSget_scale_name(dsid, sname, sizeof(sname)) < 0) goto out; - if (HDstrncmp("Latitude set 0", sname, sizeof(sname)) != 0) + if (strncmp("Latitude set 0", sname, sizeof(sname)) != 0) goto out; /*------------------------------------------------------------------------- @@ -3261,7 +3261,7 @@ test_simple(void) if (H5DSget_scale_name(dsid, snames, sizeof(snames)) < 0) goto out; - if (HDstrncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0) + if (strncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0) goto out; if (H5Dclose(dsid)) goto out; @@ -3530,7 +3530,7 @@ out: H5Sclose(sid); H5Gclose(gid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -3664,7 +3664,7 @@ out: free(buf); } } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -3749,7 +3749,7 @@ out: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -4189,7 +4189,7 @@ out: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -4291,7 +4291,7 @@ test_iterators(void) for (i = 0; i < 100; i++) { /* make a DS */ - HDsnprintf(dname, sizeof(dname), "ds_%d", i); + snprintf(dname, sizeof(dname), "ds_%d", i); if (H5LTmake_dataset_int(fid, dname, rankds, s1_dim, NULL) < 0) goto out; /* open */ @@ -4374,7 +4374,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -4441,7 +4441,7 @@ test_rank(void) goto out; for (i = 0; i < 3; i++) { - HDsnprintf(name, sizeof(name), "ds_a_%d", i); + snprintf(name, sizeof(name), "ds_a_%d", i); if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) goto out; if (H5DSattach_scale(did, dsid, (unsigned)i) < 0) @@ -4468,7 +4468,7 @@ test_rank(void) goto out; for (i = 0; i < 3; i++) { - HDsnprintf(name, sizeof(name), "ds_a_%d", i); + snprintf(name, sizeof(name), "ds_a_%d", i); if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) goto out; if (H5DSdetach_scale(did, dsid, (unsigned)i) < 0) @@ -4494,7 +4494,7 @@ test_rank(void) goto out; for (i = 0; i < 3; i++) { - HDsnprintf(name, sizeof(name), "ds_a_%d", i); + snprintf(name, sizeof(name), "ds_a_%d", i); if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) goto out; if (H5DSset_scale(dsid, name) < 0) @@ -4511,9 +4511,9 @@ test_rank(void) goto out; if (H5DSget_label(did, (unsigned)i, namel, sizeof(namel)) < 0) goto out; - if (HDstrncmp(name, names, sizeof(names)) != 0) + if (strncmp(name, names, sizeof(names)) != 0) goto out; - if (HDstrncmp(name, namel, sizeof(namel)) != 0) + if (strncmp(name, namel, sizeof(namel)) != 0) goto out; } @@ -4583,7 +4583,7 @@ out: H5Sclose(sid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -4762,7 +4762,7 @@ out: H5Dclose(dsid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -4920,7 +4920,7 @@ out: H5Dclose(dsid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); if (latbuf) @@ -4964,14 +4964,14 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) } for (i = 0, nelms = 1; i < ndims; i++) { - if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) { + if (fscanf(f, "%s %u", str, &j) && ferror(f)) { printf("fscanf error in file %s\n", data_file); - HDfclose(f); + fclose(f); return -1; } /* end if */ - if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { + if (fscanf(f, "%d", &n) < 0 && ferror(f)) { printf("fscanf error in file %s\n", data_file); - HDfclose(f); + fclose(f); return -1; } /* end if */ dims[i] = (hsize_t)n; @@ -4982,19 +4982,19 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) if (*buf == NULL) { printf("memory allocation failed\n"); - HDfclose(f); + fclose(f); return -1; } for (j = 0; j < nelms; j++) { - if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) { + if (fscanf(f, "%f", &val) < 0 && ferror(f)) { printf("fscanf error in file %s\n", data_file); - HDfclose(f); + fclose(f); return -1; } /* end if */ (*buf)[j] = val; } - HDfclose(f); + fclose(f); return 1; } @@ -5100,7 +5100,7 @@ test_errors2(void) goto out; if ((label_len = H5DSget_label(did, 0, NULL, 0)) < 0) goto out; - if (label_len != HDstrlen("label")) + if (label_len != strlen("label")) goto out; if (H5DSget_label(did, 0, lbuf, sizeof(lbuf)) < 0) goto out; @@ -5187,7 +5187,7 @@ out: H5Dclose(dsid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -5428,7 +5428,7 @@ out: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index d6f103e..4b07582 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -120,7 +120,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_notset() */ @@ -292,7 +292,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_rows_columns() */ @@ -426,7 +426,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_rows() */ @@ -561,7 +561,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_columns() */ @@ -722,7 +722,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_BUG1() */ @@ -883,7 +883,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_BUG2() */ @@ -1040,7 +1040,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_less() */ @@ -1195,7 +1195,7 @@ error: H5Dclose(did); H5Pclose(ffapl); } - H5E_END_TRY; + H5E_END_TRY return 1; } /* test_dataset_append_vary() */ diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index e7d830b..9cb7f45 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -114,7 +114,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) FAIL_PUTS_ERROR("malloc() failed"); /* create file name */ - HDsnprintf(filename[i], filenamelength, "image_file%d.h5", (int)i); + snprintf(filename[i], filenamelength, "image_file%d.h5", (int)i); /* create file */ if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -335,7 +335,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) { status1 = H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); } - H5E_END_TRY; + H5E_END_TRY VERIFY(status1 < 0, "H5Dwrite() should have failed"); @@ -344,7 +344,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) { status1 = H5Dset_extent(dset_id[i], dims4); } - H5E_END_TRY; + H5E_END_TRY VERIFY(status1 < 0, "H5Dset_extent() should have failed"); @@ -353,7 +353,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) { status1 = H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data4); } - H5E_END_TRY; + H5E_END_TRY VERIFY(status1 < 0, "H5Dwrite() should have failed"); @@ -408,13 +408,13 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) status2 = H5Fflush(file_id[i], H5F_SCOPE_GLOBAL); VERIFY(status1 < 0 || status2 < 0, "writing and flushing attr should have failed"); - } H5E_END_TRY; + } H5E_END_TRY /* close attr and attr_space -- expect errors on close */ H5E_BEGIN_TRY { H5Sclose(attr_space_id); H5Aclose(attr_id); - } H5E_END_TRY; + } H5E_END_TRY #endif if (H5Dclose(dset_id[i]) < 0) FAIL_PUTS_ERROR("H5Dclose() failed"); diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c index bf48e9b..3d26f7e 100644 --- a/hl/test/test_h5do_compat.c +++ b/hl/test/test_h5do_compat.c @@ -84,7 +84,7 @@ error: H5Sclose(sid); H5Pclose(dcpl_id); } - H5E_END_TRY; + H5E_END_TRY return H5I_INVALID_HID; @@ -223,7 +223,7 @@ error: H5Sclose(mem_sid); H5Sclose(file_sid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return 1; @@ -247,8 +247,8 @@ main(void) { #ifdef H5_NO_DEPRECATED_SYMBOLS - HDputs("Direct chunk read/write wrapper tests SKIPPED."); - HDputs("(Backward compatibility not configured)"); + puts("Direct chunk read/write wrapper tests SKIPPED."); + puts("(Backward compatibility not configured)"); return EXIT_SUCCESS; #else @@ -275,11 +275,11 @@ main(void) if (nerrors) goto error; - HDputs("All direct chunk read/write wrapper tests passed."); + puts("All direct chunk read/write wrapper tests passed."); return EXIT_SUCCESS; error: - HDputs("*** TESTS FAILED ***"); + puts("*** TESTS FAILED ***"); return EXIT_FAILURE; #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end main() */ diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 6541ef5..b9f290e 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -304,7 +304,7 @@ out: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; } @@ -494,7 +494,7 @@ out: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY H5_FAILED(); return FAIL; @@ -579,11 +579,11 @@ test_generate(void) ! */ - if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) { + if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) { + if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -614,13 +614,13 @@ test_generate(void) goto out; for (i = 0; i < n_elements; i++) { - if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) { + if (fscanf(f, "%f ", &value) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ data[i] = value; } - HDfclose(f); + fclose(f); f = NULL; /*------------------------------------------------------------------------- @@ -730,9 +730,9 @@ out: { H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (f) - HDfclose(f); + fclose(f); H5_FAILED(); return retval; } @@ -778,32 +778,32 @@ read_data(const char *fname, /*IN*/ goto out; } - if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { + if (fscanf(f, "%s", str) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) { + if (fscanf(f, "%d", &color_planes) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { + if (fscanf(f, "%s", str) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) { + if (fscanf(f, "%d", &h) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { + if (fscanf(f, "%s", str) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) { + if (fscanf(f, "%d", &w) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -837,7 +837,7 @@ read_data(const char *fname, /*IN*/ /* Read data elements */ for (i = 0; i < n_elements; i++) { - if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { + if (fscanf(f, "%d", &n) < 0 && ferror(f)) { printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -849,7 +849,7 @@ read_data(const char *fname, /*IN*/ out: if (f) - HDfclose(f); + fclose(f); return ret_val; } /* end read_data() */ @@ -895,34 +895,34 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) } /* read the file ident string */ - if (HDfgets(buffer, sizeof(buffer), file) == NULL) { - HDfclose(file); + if (fgets(buffer, sizeof(buffer), file) == NULL) { + fclose(file); return -1; } /* ensure it matches the palette file ident string */ - if (HDstrncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && - HDstrncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) { - HDfclose(file); + if (strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && + strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) { + fclose(file); return -1; } /* read the version string */ - if (HDfgets(buffer, sizeof(buffer), file) == NULL) { - HDfclose(file); + if (fgets(buffer, sizeof(buffer), file) == NULL) { + fclose(file); return -1; } /* ensure it matches the palette file version string */ - if (HDstrncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && - HDstrncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) { - HDfclose(file); + if (strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && + strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) { + fclose(file); return -1; } /* read the number of colors */ - if (HDfgets(buffer, sizeof(buffer), file) == NULL) { - HDfclose(file); + if (fgets(buffer, sizeof(buffer), file) == NULL) { + fclose(file); return -1; } @@ -930,27 +930,27 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) check for missing version or number of colors in this case it reads the first entry */ - if (HDstrlen(buffer) > 4) { - HDfclose(file); + if (strlen(buffer) > 4) { + fclose(file); return -1; } - if (HDsscanf(buffer, "%u", &nentries) != 1) { - HDfclose(file); + if (sscanf(buffer, "%u", &nentries) != 1) { + fclose(file); return -1; } /* ensure there are a sensible number of colors in the palette */ if ((nentries > 256) || (nentries > palette_size)) { - HDfclose(file); + fclose(file); return (-1); } /* read the palette entries */ for (u = 0; u < nentries; u++) { /* extract the red, green and blue color components. */ - if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) { - HDfclose(file); + if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) { + fclose(file); return -1; } /* store this palette entry */ @@ -960,7 +960,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) } /* close file */ - HDfclose(file); + fclose(file); return (int)nentries; } diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 64bf09f..b0579d5 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -52,7 +52,7 @@ * Varies from 10->13; 10->9, 10->10, 10->1, 10->11 */ #define ONE_NTESTS 5 -int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}; +static int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}; /* * Test variations (retained original) for two-dimensional dataset: @@ -61,7 +61,8 @@ int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}; * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10} */ #define TWO_NTESTS 9 -int two_tests[TWO_NTESTS][2] = {{2, 2}, {2, -1}, {2, 0}, {-1, 2}, {-1, -1}, {-1, 0}, {0, 2}, {0, -1}, {0, 0}}; +static int two_tests[TWO_NTESTS][2] = {{2, 2}, {2, -1}, {2, 0}, {-1, 2}, {-1, -1}, + {-1, 0}, {0, 2}, {0, -1}, {0, 0}}; /* Verify that the two input values are the same */ #define VERIFY_EQUAL(_x, _y) \ @@ -210,12 +211,12 @@ typedef struct test_valid_fields2 { /* Temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */ #define TEST_BUF_SIZE 100 -int *iibuf; /* buffer for storing retrieved elements */ -int *ibuf; /* buffer for storing retrieved elements (integer) */ -set_t *cbuf; /* buffer for storing retrieved elements (compound) */ -set_t *ccbuf; /* buffer for storing retrieved elements (compound) */ -test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */ -test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */ +static int *iibuf; /* buffer for storing retrieved elements */ +static int *ibuf; /* buffer for storing retrieved elements (integer) */ +static set_t *cbuf; /* buffer for storing retrieved elements (compound) */ +static set_t *ccbuf; /* buffer for storing retrieved elements (compound) */ +static test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */ +static test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */ /* ********************************************************************************* @@ -255,7 +256,7 @@ test_LD_dims_params(const char *file) { ret = H5LDget_dset_dims(invalid_id, one_cur_dims); } - H5E_END_TRY; + H5E_END_TRY VERIFY_EQUAL(ret, FAIL) /* @@ -267,7 +268,7 @@ test_LD_dims_params(const char *file) { ret = H5LDget_dset_dims(did, NULL); } - H5E_END_TRY; + H5E_END_TRY VERIFY_EQUAL(ret, FAIL) if (H5Dclose(did) < 0) FAIL_STACK_ERROR; @@ -336,7 +337,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* test_LD_dims_params() */ @@ -481,7 +482,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* test_LD_dims() */ @@ -545,7 +546,7 @@ test_LD_size(const char *file) { dsize = H5LDget_dset_type_size(invalid_id, NULL); } - H5E_END_TRY; + H5E_END_TRY VERIFY_EQUAL(dsize, 0) /* @@ -822,7 +823,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* test_LD_size() */ @@ -928,7 +929,7 @@ test_LD_elmts_invalid(const char *file) { ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf); } - H5E_END_TRY; + H5E_END_TRY VERIFY_EQUAL(ret, FAIL) /* Open dataset: DSET_CMPD */ @@ -964,7 +965,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* test_LD_elmts_invalid() */ @@ -1048,27 +1049,27 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields) FAIL_STACK_ERROR; /* Initialize data */ - if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) FAIL_STACK_ERROR; } /* end if */ - else if (!HDstrcmp(dname, DSET_ONE)) { + else if (!strcmp(dname, DSET_ONE)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) FAIL_STACK_ERROR; } /* end if */ /* There are changes in dimension sizes */ if (one_tests[i] > 0) { - if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) { if (fields) { - if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) { + if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0) TEST_ERROR; for (j = 0; j < one_tests[i]; j++) VERIFY_ELMTS_VALID1(vbuf1[j], cbuf[prev_dims[0] + (hsize_t)j]) } /* end if */ - else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) { + else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0) TEST_ERROR; @@ -1122,7 +1123,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* test_LD_elmts_one() */ @@ -1260,11 +1261,11 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields) FAIL_STACK_ERROR; /* Initialize data */ - if (!HDstrcmp(dname, DSET_CMPD_TWO)) { + if (!strcmp(dname, DSET_CMPD_TWO)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) FAIL_STACK_ERROR; } /* end if */ - else if (!HDstrcmp(dname, DSET_TWO)) { + else if (!strcmp(dname, DSET_TWO)) { if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) FAIL_STACK_ERROR; } /* end else-if */ @@ -1273,16 +1274,16 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields) /* There are changes in dimension sizes */ if (two_tests[i][0] > 0 || two_tests[i][1] > 0) { - if (!HDstrcmp(dname, DSET_CMPD_TWO)) { + if (!strcmp(dname, DSET_CMPD_TWO)) { if (fields) { - if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) { + if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0) TEST_ERROR; if (verify_elmts_two(TWO_CMPD_VALID1, ext_dims, prev_dims, vbuf1, cbuf) < 0) TEST_ERROR; } /* end if */ - else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) { + else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) { /* Retrieve the elmemts in BUF */ if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0) TEST_ERROR; @@ -1336,7 +1337,7 @@ error: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return (-1); } /* test_LD_elmts_two() */ diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 6ff3134..9bbad45 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -345,7 +345,7 @@ test_dsets(void) if (H5LTread_dataset_string(file_id, DSET7_NAME, data_string_out) < 0) goto out; - if (HDstrcmp(data_string_in, data_string_out) != 0) + if (strcmp(data_string_in, data_string_out) != 0) goto out; /*------------------------------------------------------------------------- @@ -521,7 +521,7 @@ make_attributes(hid_t loc_id, const char *obj_name) if (H5LTget_attribute_string(loc_id, obj_name, ATTR1_NAME, attr_str_out) < 0) return -1; - if (HDstrcmp(attr_str_in, attr_str_out) != 0) { + if (strcmp(attr_str_in, attr_str_out) != 0) { return -1; } @@ -1098,7 +1098,7 @@ test_integers(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) { + if (strcmp(dt_str, "H5T_STD_I8BE") != 0) { free(dt_str); goto out; } @@ -1156,7 +1156,7 @@ test_fps(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) { + if (strcmp(dt_str, "H5T_IEEE_F32BE") != 0) { free(dt_str); goto out; } @@ -1227,8 +1227,8 @@ test_strings(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { + if (strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1262,8 +1262,8 @@ test_strings(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " - "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { + if (strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " + "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1279,10 +1279,10 @@ test_strings(void) free(dt_str); goto out; } - if (HDstrncmp(dt_str, - "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len - 1) != 0) { + if (strncmp(dt_str, + "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", + str_len - 1) != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1299,13 +1299,13 @@ test_strings(void) goto out; } /* check the truncated string */ - if (HDstrlen(dt_str) != str_len - 1) + if (strlen(dt_str) != str_len - 1) goto out; - str_len = HDstrlen(dt_str); - if (HDstrncmp(dt_str, - "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len) != 0) { + str_len = strlen(dt_str); + if (strncmp(dt_str, + "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", + str_len) != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1364,9 +1364,8 @@ test_opaques(void) free(dt_str); goto out; } - if (HDstrcmp( - dt_str, - "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != + if (strcmp(dt_str, + "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); @@ -1421,7 +1420,7 @@ test_enums(void) if (H5Tenum_nameof(dtype, &value1, name1, size) < 0) goto out; - if (HDstrcmp(name1, "BLUE") != 0) + if (strcmp(name1, "BLUE") != 0) goto out; if (H5Tenum_valueof(dtype, name2, &value2) < 0) @@ -1444,9 +1443,9 @@ test_enums(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, - "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " - " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { + if (strcmp(dt_str, + "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " + " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); @@ -1508,7 +1507,7 @@ test_variables(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { + if (strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1570,9 +1569,9 @@ test_arrays(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " - " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " - "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { + if (strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " + " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " + "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1631,8 +1630,8 @@ test_compounds(void) free(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " - "\"two_field\" : 6;\n }") != 0) { + if (strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " + "\"two_field\" : 6;\n }") != 0) { printf("dt=\n%s\n", dt_str); free(dt_str); goto out; @@ -1651,7 +1650,7 @@ test_compounds(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "i16_field") != 0) { + if (strcmp(memb_name, "i16_field") != 0) { H5free_memory(memb_name); goto out; } @@ -1729,7 +1728,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; - if (HDstrcmp(memb_name, "sub") != 0) { + if (strcmp(memb_name, "sub") != 0) { H5free_memory(memb_name); goto out; } @@ -1765,8 +1764,8 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "desc____________________________________________________________________________" - "_____________") != 0) { + if (strcmp(memb_name, "desc____________________________________________________________________________" + "_____________") != 0) { H5free_memory(memb_name); goto out; } @@ -1825,9 +1824,9 @@ test_complicated_compound(void) */ if ((line = (char *)calloc(size, sizeof(char))) == NULL) goto out; - if (HDfgets(line, (int)size, fp) == NULL) + if (fgets(line, (int)size, fp) == NULL) goto out; - while (HDstrlen(line) == size - 1) { + while (strlen(line) == size - 1) { size *= 2; if (line) free(line); @@ -1835,11 +1834,11 @@ test_complicated_compound(void) goto out; if (HDfseek(fp, 0L, SEEK_SET) != 0) goto out; - if (HDfgets(line, (int)size, fp) == NULL) + if (fgets(line, (int)size, fp) == NULL) goto out; } - HDfclose(fp); + fclose(fp); fp = NULL; if ((dtype = H5LTtext_to_dtype(line, H5LT_DDL)) < 0) @@ -1867,7 +1866,7 @@ out: if (line) free(line); if (fp) - HDfclose(fp); + fclose(fp); H5_FAILED(); return -1; diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index d4af45e..8baa38c 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -58,7 +58,7 @@ static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10 static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf) { - if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || + if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) || !H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) { return FAIL; @@ -982,7 +982,7 @@ main(void) /* create a file using default properties */ fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDputs("Testing packet table"); + puts("Testing packet table"); /* Test packet table with fixed length */ if (test_packet_table(fid) < 0) diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index bf95859..99a5dbe 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -109,7 +109,7 @@ test_VLof_atomic(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -246,7 +246,7 @@ test_VLof_comptype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -418,7 +418,7 @@ test_compound_VL_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -582,7 +582,7 @@ test_VLof_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -652,9 +652,9 @@ verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value) ret = SUCCEED; else { char lenthtype[20]; - HDstrcpy(lenthtype, "fixed-length"); + strcpy(lenthtype, "fixed-length"); if (expected_value == 1) - HDstrcpy(lenthtype, "variable-length"); + strcpy(lenthtype, "variable-length"); fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); ret = FAIL; } @@ -763,7 +763,7 @@ error: /* An error has occurred. Clean up and exit. */ */ #define ATTR_RANK 1 #define ATTR_DIM 3 -int attr_data[ATTR_DIM] = {256, 11945, -22107}; /* values to be written to attr */ +static int attr_data[ATTR_DIM] = {256, 11945, -22107}; /* values to be written to attr */ static int adding_attribute(hid_t fid, const char *table_name, const char *attr_name) @@ -969,7 +969,7 @@ error: /* An error has occurred. Clean up and exit. */ *------------------------------------------------------------------------- */ static herr_t -verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) +verify_accessors(hid_t fid, const char *table_name, bool uses_vlen_type) { hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */ hid_t dset_id = H5I_INVALID_HID; /* Dataset associated with the pt */ @@ -990,7 +990,7 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) *buf = '\0'; if ((name_size = H5Iget_name(dset_id, (char *)buf, NAME_BUF_SIZE)) < 0) goto error; - VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match"); + VERIFY(strcmp(buf, table_name), "Names of dataset and packet table don't match"); /* Get the packet table's datatype ID */ if ((dtype_id = H5PTget_type(ptable)) < 0) @@ -1006,10 +1006,10 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) * expected_value passed in, then print the error message. */ char lenthtype[20]; - if (uses_vlen_type == TRUE) - HDstrcpy(lenthtype, "variable-length"); + if (uses_vlen_type == true) + strcpy(lenthtype, "variable-length"); else - HDstrcpy(lenthtype, "fixed-length"); + strcpy(lenthtype, "fixed-length"); fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); goto error; } @@ -1050,11 +1050,11 @@ test_accessors(void) if (fid < 0) goto error; - ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE); + ret = verify_accessors(fid, PT_VLEN_ATOMIC, true); if (ret < 0) goto error; - ret = verify_accessors(fid, PT_FIXED_LEN, FALSE); + ret = verify_accessors(fid, PT_FIXED_LEN, false); if (ret < 0) goto error; @@ -1144,7 +1144,7 @@ testfl_VLof_atomic(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1281,7 +1281,7 @@ testfl_VLof_comptype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1452,7 +1452,7 @@ testfl_compound_VL_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1616,7 +1616,7 @@ testfl_VLof_VLtype(void) if (ret < 0) goto error; - HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); + snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS); VERIFY(count == NRECORDS, msg); /* Read all five packets back */ @@ -1682,7 +1682,7 @@ test_packet_table_with_varlen(void) if (H5Fclose(fid) < 0) return FAIL; - HDputs("Testing packet table with various variable-length datatypes"); + puts("Testing packet table with various variable-length datatypes"); /* If any test fails, move on to subsequent test, but status will indicate there is a failure. */ @@ -1730,7 +1730,7 @@ test_packet_table_with_varlen(void) if (H5Fclose(fid) < 0) return FAIL; - HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl"); + puts("Testing packet table with various variable-length datatypes - H5PTcreate_fl"); /* If any test fails, move on to subsequent test, but status will indicate there is a failure. */ diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 06e07b8..c475e7f 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -150,7 +150,7 @@ h5file_open(const char *fname, unsigned flags) static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf) { - if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || + if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) || !H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) { fprintf(stderr, "read and write buffers have differences\n"); @@ -477,9 +477,9 @@ test_table(hid_t fid, int do_write) *------------------------------------------------------------------------- */ if (do_write) - HDstrcpy(tname, "table2"); + strcpy(tname, "table2"); else - HDstrcpy(tname, "table1"); + strcpy(tname, "table1"); rstart = 0; rrecords = 8; @@ -617,7 +617,7 @@ test_table(hid_t fid, int do_write) wbufd[i].longi = wbuf[i].longi; wbufd[i].pressure = wbuf[i].pressure; wbufd[i].temperature = wbuf[i].temperature; - HDstrcpy(wbufd[i].name, wbuf[i].name); + strcpy(wbufd[i].name, wbuf[i].name); } if (H5TBmake_table(TITLE, fid, "table3", FIELDS, RECORDS, type_size_mem, field_names, field_offset, @@ -823,7 +823,7 @@ test_table(hid_t fid, int do_write) nrecords = 3; if (H5TBdelete_record(fid, "table", start, nrecords) < 0) goto out; - ; + /* Get table info */ if (H5TBget_table_info(fid, "table", &nfields_out, &nrecords_out) < 0) goto out; @@ -1130,7 +1130,7 @@ test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) || + if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) { goto out; } @@ -1138,7 +1138,7 @@ test_table(hid_t fid, int do_write) /* reset buffer */ for (i = 0; i < NRECORDS; i++) { - HDstrcpy(namepre_out[i].name, "\0"); + strcpy(namepre_out[i].name, "\0"); namepre_out[i].pressure = -1; } @@ -1155,7 +1155,7 @@ test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for (i = 0; i < 3; i++) { hsize_t iistart = start; - if ((HDstrcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) || + if ((strcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart + i].pressure)) { goto out; } @@ -1318,7 +1318,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) || + if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) { goto out; } @@ -1326,7 +1326,7 @@ test_table(hid_t fid, int do_write) /* reset buffer */ for (i = 0; i < NRECORDS; i++) { - HDstrcpy(namepre_out[i].name, "\0"); + strcpy(namepre_out[i].name, "\0"); namepre_out[i].pressure = -1; } @@ -1347,7 +1347,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for (i = 0; i < 3; i++) { int iistart = (int)start; - if ((HDstrcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) || + if ((strcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) || !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart + (int)i].pressure)) { goto out; } @@ -1383,7 +1383,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati || + if ((strcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati || rbuf2[i].longi != wbuf[i].longi || !H5_FLT_ABS_EQUAL(rbuf2[i].pressure, wbuf[i].pressure) || !H5_DBL_ABS_EQUAL(rbuf2[i].temperature, wbuf[i].temperature) || rbuf2[i].new_field != buf_new[i]) { @@ -1419,7 +1419,7 @@ test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for (i = 0; i < NRECORDS; i++) { - if ((HDstrcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati || + if ((strcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati || rbuf3[i].longi != wbuf[i].longi || !H5_DBL_ABS_EQUAL(rbuf3[i].temperature, wbuf[i].temperature)) { goto out; @@ -1473,7 +1473,7 @@ test_table(hid_t fid, int do_write) goto out; for (i = 0; i < NFIELDS; i++) { - if ((HDstrcmp(field_names[i], names_out[i]) != 0)) { + if ((strcmp(field_names[i], names_out[i]) != 0)) { goto out; } } @@ -1515,7 +1515,7 @@ main(void) /* create a file using default properties */ fid = H5Fcreate("test_table.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDputs("Testing table with file creation mode (read/write in native architecture):"); + puts("Testing table with file creation mode (read/write in native architecture):"); /* test, do write */ if (test_table(fid, 1) < 0) @@ -1528,7 +1528,7 @@ main(void) * test2: open a file written in test1 on a big-endian machine *------------------------------------------------------------------------- */ - HDputs("Testing table with file open mode (read big-endian data):"); + puts("Testing table with file open mode (read big-endian data):"); fid = h5file_open(TEST_FILE_BE, flags); @@ -1543,7 +1543,7 @@ main(void) * test3: open a file written in test1 on a little-endian machine *------------------------------------------------------------------------- */ - HDputs("Testing table with file open mode (read little-endian data):"); + puts("Testing table with file open mode (read little-endian data):"); fid = h5file_open(TEST_FILE_LE, flags); @@ -1558,7 +1558,7 @@ main(void) * test4: open a file written in test1 on the Cray T3 machine *------------------------------------------------------------------------- */ - HDputs("Testing table with file open mode (read Cray data):"); + puts("Testing table with file open mode (read Cray data):"); fid = h5file_open(TEST_FILE_CRAY, flags); diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c index dabadf5..e87a60c 100644 --- a/hl/tools/gif2h5/decompress.c +++ b/hl/tools/gif2h5/decompress.c @@ -54,8 +54,8 @@ GIFBYTE *Raster; /* The raster data stream, unblocked */ /* The hash table used by the decompressor */ -int *Prefix; -int *Suffix; +static int *Prefix; +static int *Suffix; /* An output array used by the decompressor */ diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 6b33b81..120e42e 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -49,7 +49,7 @@ leave(int ret) exit(ret); } -FILE *fpGif = NULL; +static FILE *fpGif = NULL; int main(int argc, char **argv) { diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 59c5eb7..443a759 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -146,7 +146,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) num_elmts *= (unsigned)ext_dims[i]; /* Compound type */ - if (!HDstrcmp(dname, DSET_CMPD_TWO)) { + if (!strcmp(dname, DSET_CMPD_TWO)) { memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); for (i = 0; i < num_elmts; i++) { @@ -305,7 +305,7 @@ extend_dset_one(const char *file, char *dname, int action) /* Initialize data for the extended region of the dataset */ /* Compound type */ - if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) { memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); for (i = 0; i < action; i++) { @@ -408,16 +408,16 @@ main(int argc, char *argv[]) action1 = atoi(argv[3]); action2 = atoi(argv[4]); - if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) { if (extend_dset_one(fname, dname, action1) < 0) goto error; } - else if (!HDstrcmp(dname, DSET_ONE) || !HDstrcmp(dname, DSET_ALLOC_LATE) || - !HDstrcmp(dname, DSET_ALLOC_EARLY)) { + else if (!strcmp(dname, DSET_ONE) || !strcmp(dname, DSET_ALLOC_LATE) || + !strcmp(dname, DSET_ALLOC_EARLY)) { if (extend_dset_one(fname, dname, action1) < 0) goto error; } - else if (!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) { + else if (!strcmp(dname, DSET_TWO) || !strcmp(dname, DSET_CMPD_TWO)) { if (extend_dset_two(fname, dname, action1, action2) < 0) goto error; } diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 1b6bfba..876b5d5 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -27,20 +27,20 @@ * This tool uses H5LD_memb_t data structure declared in H5LDprivate.h */ -const char *progname = "h5watch"; /* tool name */ +static const char *progname = "h5watch"; /* tool name */ static char *g_list_of_fields = NULL; /* command line input for "list_of_fields" */ static char *g_dup_fields = NULL; /* copy of "list_of_fields" */ static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */ -static hbool_t g_monitor_size_only = FALSE; /* monitor changes in dataset dimension sizes */ +static bool g_monitor_size_only = false; /* monitor changes in dataset dimension sizes */ static unsigned g_polling_interval = 1; /* polling interval to check appended data */ -static hbool_t g_label = FALSE; /* label compound values */ +static bool g_label = false; /* label compound values */ static int g_display_width = 80; /* output width in characters */ -static hbool_t g_simple_output = FALSE; /* make output more machine-readable */ +static bool g_simple_output = false; /* make output more machine-readable */ static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file if somehow file is unstable */ -static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ -static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */ +static bool g_display_hex = false; /* display data in hexadecimal format : LATER */ +static bool g_user_interrupt = false; /* Flag to indicate that user interrupted execution */ static herr_t doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank); static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block, @@ -190,7 +190,7 @@ doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank) if (g_display_hex) { /* Print all data in hexadecimal format if the `-x' or `--hexdump' * command line switch was given. */ - info.raw = TRUE; + info.raw = true; } /* end if */ /* Print the values. */ @@ -437,7 +437,7 @@ process_cmpd_fields(hid_t fid, char *dsetname) } /* Estimate the number of comma-separated fields in "g_list of_fields" */ - len = HDstrlen(g_list_of_fields) / 2 + 2; + len = strlen(g_list_of_fields) / 2 + 2; /* Allocate memory for a list vector of H5LD_memb_t structures to store "g_list_of_fields" info */ if ((g_listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *))) == NULL) { @@ -485,7 +485,7 @@ check_dataset(hid_t fid, char *dsetname) unsigned u; /* Local index variable */ hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */ hsize_t max_dims[H5S_MAX_RANK]; /* maximum size of dataspace dimensions */ - hbool_t unlim_max_dims = FALSE; /* whether dataset has unlimited or max. dimension setting */ + bool unlim_max_dims = false; /* whether dataset has unlimited or max. dimension setting */ void *edata; H5E_auto2_t func; H5D_layout_t layout; @@ -541,7 +541,7 @@ check_dataset(hid_t fid, char *dsetname) /* Check whether dataset has unlimited dimension or max. dimension setting */ for (u = 0; u < (unsigned)ndims; u++) if (max_dims[u] == H5S_UNLIMITED || cur_dims[u] != max_dims[u]) { - unlim_max_dims = TRUE; + unlim_max_dims = true; break; } @@ -673,7 +673,7 @@ parse_command_line(int argc, const char *const *argv) break; case 'w': /* --width=N */ - g_display_width = (int)HDstrtol(H5_optarg, NULL, 0); + g_display_width = (int)strtol(H5_optarg, NULL, 0); if (g_display_width < 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -681,20 +681,20 @@ parse_command_line(int argc, const char *const *argv) break; case 'd': /* --dim */ - g_monitor_size_only = TRUE; + g_monitor_size_only = true; break; case 'S': /* --simple */ - g_simple_output = TRUE; + g_simple_output = true; break; case 'l': /* --label */ - g_label = TRUE; + g_label = true; break; case 'p': /* --polling=N */ - /* g_polling_interval = HDstrtod(H5_optarg, NULL); */ - if ((tmp = (int)HDstrtol(H5_optarg, NULL, 10)) <= 0) { + /* g_polling_interval = strtod(H5_optarg, NULL); */ + if ((tmp = (int)strtol(H5_optarg, NULL, 10)) <= 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); } @@ -715,13 +715,13 @@ parse_command_line(int argc, const char *const *argv) error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } - if ((g_list_of_fields = (char *)realloc( - g_list_of_fields, HDstrlen(g_list_of_fields) + HDstrlen(str) + 2)) == NULL) { + if ((g_list_of_fields = (char *)realloc(g_list_of_fields, strlen(g_list_of_fields) + + strlen(str) + 2)) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } - HDstrcat(g_list_of_fields, FIELD_SEP); - HDstrcat(g_list_of_fields, str); + strcat(g_list_of_fields, FIELD_SEP); + strcat(g_list_of_fields, str); } break; @@ -754,7 +754,7 @@ static void catch_signal(int H5_ATTR_UNUSED signo) { /* Set the flag to get out of the main loop */ - g_user_interrupt = TRUE; + g_user_interrupt = true; } /* catch_signal() */ /*------------------------------------------------------------------------- @@ -843,7 +843,7 @@ main(int argc, char *argv[]) do { while (fname && *fname) { - fid = h5tools_fopen(fname, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl, FALSE, drivername, + fid = h5tools_fopen(fname, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl, false, drivername, sizeof drivername); if (fid >= 0) { @@ -853,7 +853,7 @@ main(int argc, char *argv[]) /* Shorten the file name; lengthen the object name */ x = dname; - dname = HDstrrchr(fname, '/'); + dname = strrchr(fname, '/'); if (x) *x = '/'; if (!dname) diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 9fda9be..ef47926 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -103,7 +103,7 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m goto done; /* Set up dataset's creation properties */ - if (!HDstrcmp(dname, DSET_NONE)) + if (!strcmp(dname, DSET_NONE)) dcpl = H5P_DEFAULT; else { if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -114,11 +114,11 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m goto done; } /* end else */ - if (!HDstrcmp(dname, DSET_ALLOC_LATE)) { + if (!strcmp(dname, DSET_ALLOC_LATE)) { if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto done; } - else if (!HDstrcmp(dname, DSET_ALLOC_EARLY)) { + else if (!strcmp(dname, DSET_ALLOC_EARLY)) { if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto done; } /* end if-else */ -- cgit v0.12