diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-09-15 22:13:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 22:13:18 (GMT) |
commit | 44a00ef876ad3e1922847e93feac57c479217fbe (patch) | |
tree | 5e9fc677913a06a71eba1342633f92e93bd07a6c /tools | |
parent | 59a90368cdb696205bdf15040d1a48b4f69af97f (diff) | |
download | hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.zip hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.tar.gz hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.tar.bz2 |
Strip HD prefix from string/char C API calls (#3540)
* Strip HD prefix from string/char C API calls
* HD(f)(put|get)(s|c)
* HDstr*
* HDv*printf
* HD(s)(print|scan)f
* HDperror
But NOT:
* HDstrcase*
* HDvasprintf
* HDstrtok_r
* HDstrndup
As those are not C99 and have portability work-around
implementations. They will be handled later.
* Fix th5_system.c screwup
Diffstat (limited to 'tools')
60 files changed, 1078 insertions, 1078 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index b607197..924f9f3 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -183,7 +183,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) while (NULL != exclude_path_ptr) { /* if exclude path is in group, exclude its members as well */ if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { - ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, HDstrlen(exclude_path_ptr->obj_path)); + ret_cmp = strncmp(exclude_path_ptr->obj_path, path, strlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) { /* found matching members */ size_t len_grp; @@ -192,7 +192,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) * This verifies if “/grp1/dset1” is only under “/grp1”, but * not under “/grp1xxx/” group. */ - len_grp = HDstrlen(exclude_path_ptr->obj_path); + len_grp = strlen(exclude_path_ptr->obj_path); if (path[len_grp] == '/') { /* belong to excluded group! */ ret_value = 1; @@ -202,7 +202,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) } /* exclude target is not group, just exclude the object */ else { - ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); + ret_cmp = strcmp(exclude_path_ptr->obj_path, path); if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ ret_value = 1; @@ -247,7 +247,7 @@ is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) while (NULL != exclude_ptr) { /* if exclude path is in group, exclude its members as well */ if (exclude_ptr->obj_type == H5TRAV_TYPE_GROUP) { - ret_cmp = HDstrncmp(exclude_ptr->obj_path, path, HDstrlen(exclude_ptr->obj_path)); + ret_cmp = strncmp(exclude_ptr->obj_path, path, strlen(exclude_ptr->obj_path)); if (ret_cmp == 0) { /* found matching members */ size_t len_grp; @@ -256,7 +256,7 @@ is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) * This verifies if “/grp1/dset1” is only under “/grp1”, but * not under “/grp1xxx/” group. */ - len_grp = HDstrlen(exclude_ptr->obj_path); + len_grp = strlen(exclude_ptr->obj_path); if (path[len_grp] == '/') { /* belong to excluded group! */ ret_value = 1; @@ -266,7 +266,7 @@ is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) } /* exclude target is not group, just exclude the object */ else { - ret_cmp = HDstrcmp(exclude_ptr->obj_path, path); + ret_cmp = strcmp(exclude_ptr->obj_path, path); if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ ret_value = 1; @@ -368,11 +368,11 @@ build_match_list(const char *objname1, trav_info_t *info1, const char *objname2, H5TOOLS_DEBUG("objname1 = %s objname2 = %s ", objname1, objname2); /* if obj1 is not root */ - if (HDstrcmp(objname1, "/") != 0) - path1_offset = HDstrlen(objname1); + if (strcmp(objname1, "/") != 0) + path1_offset = strlen(objname1); /* if obj2 is not root */ - if (HDstrcmp(objname2, "/") != 0) - path2_offset = HDstrlen(objname2); + if (strcmp(objname2, "/") != 0) + path2_offset = strlen(objname2); /*-------------------------------------------------- * build the list @@ -384,7 +384,7 @@ build_match_list(const char *objname1, trav_info_t *info1, const char *objname2, type2_l = info2->paths[curr2].type; /* criteria is string compare */ - cmp = HDstrcmp(path1_lp, path2_lp); + cmp = strcmp(path1_lp, path2_lp); if (cmp == 0) { if (!is_exclude_path(path1_lp, type1_l, opts)) { infile[0] = 1; @@ -703,47 +703,47 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* if any object is specified */ if (objname1) { /* make the given object1 fullpath, start with "/" */ - if (HDstrncmp(objname1, "/", 1) != 0) { + if (strncmp(objname1, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (asprintf(&obj1fullname, "/%s", objname1) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj1fullname = (char *)malloc(HDstrlen(objname1) + 2)) == NULL) + if ((obj1fullname = (char *)malloc(strlen(objname1) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); - HDstrcpy(obj1fullname, "/"); - HDstrcat(obj1fullname, objname1); + strcpy(obj1fullname, "/"); + strcat(obj1fullname, objname1); #endif /* H5_HAVE_ASPRINTF */ } else - obj1fullname = HDstrdup(objname1); + obj1fullname = strdup(objname1); H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname); /* make the given object2 fullpath, start with "/" */ - if (HDstrncmp(objname2, "/", 1) != 0) { + if (strncmp(objname2, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (asprintf(&obj2fullname, "/%s", objname2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj2fullname = (char *)malloc(HDstrlen(objname2) + 2)) == NULL) + if ((obj2fullname = (char *)malloc(strlen(objname2) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); - HDstrcpy(obj2fullname, "/"); - HDstrcat(obj2fullname, objname2); + strcpy(obj2fullname, "/"); + strcat(obj2fullname, objname2); #endif /* H5_HAVE_ASPRINTF */ } else - obj2fullname = HDstrdup(objname2); + obj2fullname = strdup(objname2); H5TOOLS_DEBUG("obj2fullname = %s", obj2fullname); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ H5TOOLS_DEBUG("h5diff check if obj1=%s is root, group, single object or symlink", obj1fullname); - if (!HDstrcmp(obj1fullname, "/")) { + if (!strcmp(obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } else { @@ -793,7 +793,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char * check if obj2 is root, group, single object or symlink */ H5TOOLS_DEBUG("h5diff check if obj2=%s is root, group, single object or symlink", obj2fullname); - if (!HDstrcmp(obj2fullname, "/")) { + if (!strcmp(obj2fullname, "/")) { obj2type = H5TRAV_TYPE_GROUP; } else { @@ -843,9 +843,9 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char else { H5TOOLS_DEBUG("h5diff no object specified"); /* set root group */ - obj1fullname = (char *)HDstrdup("/"); + obj1fullname = (char *)strdup("/"); obj1type = H5TRAV_TYPE_GROUP; - obj2fullname = (char *)HDstrdup("/"); + obj2fullname = (char *)strdup("/"); obj2type = H5TRAV_TYPE_GROUP; } @@ -996,13 +996,13 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char if (g_Parallel) { int i; - if ((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { + if ((strlen(fname1) > MAX_FILENAME) || (strlen(fname2) > MAX_FILENAME)) { fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ - HDstrcpy(filenames[0], fname1); - HDstrcpy(filenames[1], fname2); + strcpy(filenames[0], fname1); + strcpy(filenames[1], fname2); /* Alert the worker tasks that there's going to be work. */ for (i = 1; i < g_nTasks; i++) @@ -1028,7 +1028,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char parallel_print("\n"); /* if given objects is group under root */ - if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0) + if (strcmp(obj1fullname, "/") != 0 || strcmp(obj2fullname, "/") != 0) parallel_print("group1 group2\n"); else parallel_print("file1 file2\n"); @@ -1126,9 +1126,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, * if not root, prepare object name to be pre-appended to group path to * make full path */ - if (HDstrcmp(grp1, "/") != 0) + if (strcmp(grp1, "/") != 0) grp1_path = grp1; - if (HDstrcmp(grp2, "/") != 0) + if (strcmp(grp2, "/") != 0) grp2_path = grp2; /*------------------------------------------------------------------------- @@ -1186,13 +1186,13 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj1_fullpath = (char *)malloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj1_fullpath = (char *)malloc(strlen(grp1_path) + strlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } else { - HDstrcpy(obj1_fullpath, grp1_path); - HDstrcat(obj1_fullpath, table->objs[i].name); + strcpy(obj1_fullpath, grp1_path); + strcat(obj1_fullpath, table->objs[i].name); } #endif /* H5_HAVE_ASPRINTF */ H5TOOLS_DEBUG("diff_match path1 - %s", obj1_fullpath); @@ -1204,22 +1204,22 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj2_fullpath = (char *)malloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj2_fullpath = (char *)malloc(strlen(grp2_path) + strlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } else { - HDstrcpy(obj2_fullpath, grp2_path); - HDstrcat(obj2_fullpath, table->objs[i].name); + strcpy(obj2_fullpath, grp2_path); + strcat(obj2_fullpath, table->objs[i].name); } #endif /* H5_HAVE_ASPRINTF */ H5TOOLS_DEBUG("diff_match path2 - %s", obj2_fullpath); /* get index to figure out type of the object in file1 */ - while (info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) + while (info1->paths[idx1].path && (strcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) idx1++; /* get index to figure out type of the object in file2 */ - while (info2->paths[idx2].path && (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) + while (info2->paths[idx2].path && (strcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) idx2++; /* Set argdata to pass other args into diff() */ @@ -1246,14 +1246,14 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, */ /*Set up args to pass to worker task. */ - if (HDstrlen(obj1_fullpath) > 255 || HDstrlen(obj2_fullpath) > 255) { + if (strlen(obj1_fullpath) > 255 || strlen(obj2_fullpath) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ /* set args struct to pass */ - HDstrcpy(args.name1, obj1_fullpath); - HDstrcpy(args.name2, obj2_fullpath); + strcpy(args.name1, obj1_fullpath); + strcpy(args.name2, obj2_fullpath); args.opts = *opts; args.argdata.type[0] = info1->paths[idx1].type; args.argdata.type[1] = info2->paths[idx2].type; @@ -1810,7 +1810,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ */ case H5TRAV_TYPE_LINK: { H5TOOLS_DEBUG("H5TRAV_TYPE_LINK 1:%s 2:%s ", path1, path2); - status = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); + status = strcmp(linkinfo1.trg_path, linkinfo2.trg_path); /* if the target link name is not same then the links are "different" */ nfound = (status != 0) ? 1 : 0; diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index dd76983..d8c9ac6 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -519,14 +519,14 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* Get pointer to first string */ s1 = *(char **)((void *)mem1); if (s1) - size1 = HDstrlen(s1); + size1 = strlen(s1); else size1 = 0; /* Get pointer to second string */ s2 = *(char **)((void *)mem2); if (s2) - size2 = HDstrlen(s2); + size2 = strlen(s2); else size2 = 0; } @@ -535,7 +535,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* Get pointer to first string */ s1 = (char *)mem1; if (s1) - size1 = HDstrlen(s1); + size1 = strlen(s1); else size1 = 0; @@ -545,7 +545,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* Get pointer to second string */ s2 = (char *)mem2; if (s2) - size2 = HDstrlen(s2); + size2 = strlen(s2); else size2 = 0; @@ -648,11 +648,11 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co */ err1 = H5Tenum_nameof(opts->m_tid, mem1, enum_name1, sizeof enum_name1); if (err1 < 0) - HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); + snprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); err2 = H5Tenum_nameof(opts->m_tid, mem2, enum_name2, sizeof enum_name2); if (err2 < 0) - HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); + snprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); /* One or more bad enum values */ if (err1 < 0 || err2 < 0) { @@ -669,7 +669,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co } else { /* Both enum values were valid */ - if (HDstrcmp(enum_name1, enum_name2) != 0) { + if (strcmp(enum_name1, enum_name2) != 0) { nfound = 1; opts->print_percentage = 0; print_pos(opts, elemtno, 0); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 12abd28..2521177 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -112,7 +112,7 @@ table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table) table->attrs[curr_val].exist[0] = exist[0]; table->attrs[curr_val].exist[1] = exist[1]; if (name) - table->attrs[curr_val].name = (char *)HDstrdup(name); + table->attrs[curr_val].name = (char *)strdup(name); table->nattrs++; } } @@ -186,7 +186,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name second attribute failed"); /* criteria is string compare */ - cmp = HDstrcmp(name1, name2); + cmp = strcmp(name1, name2); if (cmp == 0) { infile[0] = 1; @@ -384,19 +384,19 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2); if (name1) { - sz = HDstrlen(name1); + sz = strlen(name1); H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); if (sz > 0) { opts->obj_name[0] = (char *)malloc(sz + 1); - HDstrncpy(opts->obj_name[0], name1, sz + 1); + strncpy(opts->obj_name[0], name1, sz + 1); } } if (name2) { - sz = HDstrlen(name2); + sz = strlen(name2); H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); if (sz > 0) { opts->obj_name[1] = (char *)malloc(sz + 1); - HDstrncpy(opts->obj_name[1], name2, sz + 1); + strncpy(opts->obj_name[1], name2, sz + 1); } } H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); @@ -464,17 +464,17 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); if (name1) { - sz = HDstrlen(name1) + HDstrlen(path1) + 7; + sz = strlen(name1) + strlen(path1) + 7; H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); opts->obj_name[0] = (char *)calloc(sz + 1, sizeof(char)); - HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); + snprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); opts->obj_name[0][sz] = '\0'; } if (name2) { - sz = HDstrlen(name2) + HDstrlen(path2) + 7; + sz = strlen(name2) + strlen(path2) + 7; H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); opts->obj_name[1] = (char *)calloc(sz + 1, sizeof(char)); - HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); + snprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); opts->obj_name[1][sz] = '\0'; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 8ab9db1..3d4b25a 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -274,21 +274,21 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); opts->obj_name[0] = NULL; if (obj1_name) { - j = (int)HDstrlen(obj1_name); + j = (int)strlen(obj1_name); H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); if (j > 0) { opts->obj_name[0] = (char *)malloc((size_t)j + 1); - HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); + strncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); } } opts->obj_name[1] = NULL; if (obj2_name) { - j = (int)HDstrlen(obj2_name); + j = (int)strlen(obj2_name); H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); if (j > 0) { opts->obj_name[1] = (char *)malloc((size_t)j + 1); - HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); + strncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); } } @@ -431,9 +431,9 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n opts->obj_name[1] = NULL; if (obj1_name) - opts->obj_name[0] = HDstrdup(diff_basename(obj1_name)); + opts->obj_name[0] = strdup(diff_basename(obj1_name)); if (obj2_name) - opts->obj_name[1] = HDstrdup(diff_basename(obj2_name)); + opts->obj_name[1] = strdup(diff_basename(obj2_name)); H5TOOLS_DEBUG("obj_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); H5TOOLS_DEBUG("read/compare"); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index fc74a39..4641c93 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -190,7 +190,7 @@ diff_basename(const char *name) return NULL; /* Find the end of the base name */ - i = HDstrlen(name); + i = strlen(name); while (i > 0 && '/' == name[i - 1]) --i; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index c3bfbd6..36e304d 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -246,7 +246,7 @@ h5tools_set_data_output_file(const char *fname, int is_bin) if (rawdatastream && rawdatastream != stdout) { if (fclose(rawdatastream)) - HDperror("closing rawdatastream"); + perror("closing rawdatastream"); else rawdatastream = NULL; } @@ -294,7 +294,7 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) if (rawattrstream && rawattrstream != stdout) { if (fclose(rawattrstream)) - HDperror("closing rawattrstream"); + perror("closing rawattrstream"); else rawattrstream = NULL; } @@ -343,7 +343,7 @@ h5tools_set_input_file(const char *fname, int is_bin) if (rawinstream && rawinstream != stdin) { if (fclose(rawinstream)) - HDperror("closing rawinstream"); + perror("closing rawinstream"); else rawinstream = NULL; } @@ -391,7 +391,7 @@ h5tools_set_output_file(const char *fname, int is_bin) if (rawoutstream && rawoutstream != stdout) { if (fclose(rawoutstream)) - HDperror("closing rawoutstream"); + perror("closing rawoutstream"); else rawoutstream = NULL; } @@ -438,7 +438,7 @@ h5tools_set_error_file(const char *fname, int is_bin) if (rawerrorstream && rawerrorstream != stderr) { if (fclose(rawerrorstream)) - HDperror("closing rawerrorstream"); + perror("closing rawerrorstream"); else rawerrorstream = NULL; } @@ -485,12 +485,12 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) switch (vfd_info->type) { case VFD_BY_NAME: /* Determine which driver the user wants to open the file with */ - if (!HDstrcmp(vfd_info->u.name, drivernames[SEC2_VFD_IDX])) { + if (!strcmp(vfd_info->u.name, drivernames[SEC2_VFD_IDX])) { /* SEC2 Driver */ if (H5Pset_fapl_sec2(fapl_id) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[DIRECT_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[DIRECT_VFD_IDX])) { #ifdef H5_HAVE_DIRECT /* Direct Driver */ if (H5Pset_fapl_direct(fapl_id, 1024, 4096, 8 * 4096) < 0) @@ -499,14 +499,14 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[LOG_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[LOG_VFD_IDX])) { unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; /* Log Driver */ if (H5Pset_fapl_log(fapl_id, NULL, log_flags, (size_t)0) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_log failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[WINDOWS_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[WINDOWS_VFD_IDX])) { #ifdef H5_HAVE_WINDOWS /* There is no Windows VFD - use SEC2 */ if (H5Pset_fapl_sec2(fapl_id) < 0) @@ -515,17 +515,17 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[STDIO_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[STDIO_VFD_IDX])) { /* Stdio Driver */ if (H5Pset_fapl_stdio(fapl_id) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[CORE_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[CORE_VFD_IDX])) { /* Core Driver */ if (H5Pset_fapl_core(fapl_id, (size_t)H5_MB, true) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_core failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[FAMILY_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[FAMILY_VFD_IDX])) { /* FAMILY Driver */ /* Set member size to be 0 to indicate the current first member size * is the member size. @@ -533,17 +533,17 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) if (H5Pset_fapl_family(fapl_id, (hsize_t)0, H5P_DEFAULT) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[SPLIT_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[SPLIT_VFD_IDX])) { /* SPLIT Driver */ if (H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[MULTI_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[MULTI_VFD_IDX])) { /* MULTI Driver */ if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, true) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed"); } - else if (!HDstrcmp(vfd_info->u.name, drivernames[MPIO_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[MPIO_VFD_IDX])) { #ifdef H5_HAVE_PARALLEL int mpi_initialized, mpi_finalized; @@ -561,7 +561,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled"); #endif /* H5_HAVE_PARALLEL */ } - else if (!HDstrcmp(vfd_info->u.name, drivernames[ROS3_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid"); @@ -575,7 +575,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[HDFS_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid"); @@ -585,7 +585,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[SUBFILING_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[SUBFILING_VFD_IDX])) { #if defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_SUBFILING_VFD) int mpi_initialized, mpi_finalized; @@ -601,7 +601,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) H5TOOLS_GOTO_ERROR(FAIL, "The Subfiling VFD is not enabled"); #endif } - else if (!HDstrcmp(vfd_info->u.name, drivernames[ONION_VFD_IDX])) { + else if (!strcmp(vfd_info->u.name, drivernames[ONION_VFD_IDX])) { /* Onion driver */ if (!vfd_info->info) H5TOOLS_GOTO_ERROR(FAIL, "Onion VFD info is invalid"); @@ -676,10 +676,10 @@ h5tools_set_fapl_vol(hid_t fapl_id, h5tools_vol_info_t *vol_info) /* Check for VOL connectors that ship with the library, then try * registering by name if that fails. */ - if (!HDstrcmp(vol_info->u.name, H5VL_NATIVE_NAME)) { + if (!strcmp(vol_info->u.name, H5VL_NATIVE_NAME)) { connector_id = H5VL_NATIVE; } - else if (!HDstrcmp(vol_info->u.name, H5VL_PASSTHRU_NAME)) { + else if (!strcmp(vol_info->u.name, H5VL_PASSTHRU_NAME)) { connector_id = H5VL_PASSTHRU; } else { @@ -895,7 +895,7 @@ h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t driverna else driver_name = "unknown"; - HDstrncpy(drivername, driver_name, drivername_size); + strncpy(drivername, driver_name, drivername_size); drivername[drivername_size - 1] = '\0'; } @@ -1241,7 +1241,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context ctx->cur_column, info->idx_fmt, info->line_suf); if (ctx->cur_column) { PUTSTREAM(OPT(info->line_suf, ""), stream); - HDputc('\n', stream); + putc('\n', stream); PUTSTREAM(OPT(info->line_sep, ""), stream); } H5TOOLS_DEBUG("after CR elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); @@ -1334,7 +1334,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_ /* Terminate previous line, if any */ if (ctx->cur_column) { PUTSTREAM(OPT(info->line_suf, ""), stream); - HDputc('\n', stream); + putc('\n', stream); PUTSTREAM(OPT(info->line_sep, ""), stream); } @@ -1436,8 +1436,8 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * current location... */ if (info->line_multi_new == 1 && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) { + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one @@ -1445,8 +1445,8 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex */ ctx->need_prefix = true; } - else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) <= ncols) { + else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its @@ -1481,8 +1481,8 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * beginning of the line. */ if (info->line_multi_new == 1 && ctx->prev_multiline && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = true; H5TOOLS_DEBUG("ctx->need_prefix=%d", ctx->need_prefix); @@ -1500,7 +1500,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex * one-at a time. */ multiline = 0; - for (secnum = 0, multiline = 0; (section = HDstrtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { + for (secnum = 0, multiline = 0; (section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { /* * If the current section plus possible suffix and end-of-line * information would cause the output to wrap then we need to @@ -1510,8 +1510,8 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex /* * check for displaying prefix for each section */ - if ((ctx->cur_column + HDstrlen(section) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) + if ((ctx->cur_column + strlen(section) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1535,13 +1535,13 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex } else if ((local_elmt_counter || ctx->continuation) && secnum == 0) { PUTSTREAM(OPT(info->elmt_suf2, " "), stream); - ctx->cur_column += HDstrlen(OPT(info->elmt_suf2, " ")); + ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); } H5TOOLS_DEBUG("section=%s", section); /* Print the section */ PUTSTREAM(section, stream); - ctx->cur_column += HDstrlen(section); + ctx->cur_column += strlen(section); } ctx->prev_multiline = multiline; @@ -1597,8 +1597,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * current location... */ if (info->line_multi_new == 1 && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) { + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one @@ -1606,8 +1606,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools */ ctx->need_prefix = true; } - else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) <= ncols) { + else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its @@ -1638,8 +1638,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * beginning of the line. */ if (info->line_multi_new == 1 && ctx->prev_multiline && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) + (ctx->cur_column + h5tools_count_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = true; /* @@ -1655,7 +1655,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * one-at a time. */ multiline = 0; - for (secnum = 0, multiline = 0; (section = HDstrtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { + for (secnum = 0, multiline = 0; (section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { /* * If the current section plus possible suffix and end-of-line * information would cause the output to wrap then we need to @@ -1667,8 +1667,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools * this check to happen for the first line */ if ((!info->skip_first || local_elmt_counter) && - (ctx->cur_column + HDstrlen(section) + HDstrlen(OPT(info->elmt_suf2, " ")) + - HDstrlen(OPT(info->line_suf, ""))) > ncols) + (ctx->cur_column + strlen(section) + strlen(OPT(info->elmt_suf2, " ")) + + strlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1690,12 +1690,12 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools } else if ((local_elmt_counter || ctx->continuation) && secnum == 0) { PUTSTREAM(OPT(info->elmt_suf2, " "), stream); - ctx->cur_column += HDstrlen(OPT(info->elmt_suf2, " ")); + ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); } /* Print the section */ PUTSTREAM(section, stream); - ctx->cur_column += HDstrlen(section); + ctx->cur_column += strlen(section); } ctx->prev_multiline = multiline; @@ -1838,7 +1838,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t if (H5Tis_variable_str(tid)) { s = *(char **)((void *)mem); if (s != NULL) - size = HDstrlen(s); + size = strlen(s); else H5TOOLS_THROW((-1), "NULL string"); } @@ -2333,12 +2333,12 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char H5O_info2_t oinfo1, oinfo2; bool ret_val = false; - if (name1 && HDstrcmp(name1, ".") != 0) + if (name1 && strcmp(name1, ".") != 0) H5Oget_info_by_name3(loc_id1, name1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id1, &oinfo1, H5O_INFO_BASIC); - if (name2 && HDstrcmp(name2, ".") != 0) + if (name2 && strcmp(name2, ".") != 0) H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC); diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 9126500..b636806 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -40,7 +40,7 @@ #define PUTSTREAM(X, S) \ do { \ if (S != NULL) \ - HDfputs(X, S); \ + fputs(X, S); \ } while (0) /* diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 7c221f5..efaddee 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -391,12 +391,12 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format h5tools_print_datatype(stream, buffer, info, ctx, atype, true); ctx->indent_level--; - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); dimension_break = @@ -411,12 +411,12 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format h5tools_print_dataspace(buffer, region_space); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); dimension_break = @@ -765,12 +765,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_print_datatype(stream, buffer, info, ctx, dtype, true); ctx->indent_level--; - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); dimension_break = @@ -785,12 +785,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_print_dataspace(buffer, region_space); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); dimension_break = @@ -828,13 +828,13 @@ done: /* Render the dataend element begin */ h5tools_str_reset(buffer); - if (HDstrlen(h5tools_dump_header_format->datablockend)) { + if (strlen(h5tools_dump_header_format->datablockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datablockend); - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataend); dimension_break = h5tools_render_element(stream, &outputformat, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); @@ -1119,12 +1119,12 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_print_datatype(stream, buffer, info, ctx, dtype, true); ctx->indent_level--; - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); dimension_break = @@ -1139,12 +1139,12 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_print_dataspace(buffer, region_space); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); dimension_break = @@ -1183,13 +1183,13 @@ done: /* Render the dataend element begin */ h5tools_str_reset(buffer); - if (HDstrlen(h5tools_dump_header_format->datablockend)) { + if (strlen(h5tools_dump_header_format->datablockend)) { h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datablockend); - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataend); dimension_break = h5tools_render_element(stream, &outputformat, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); @@ -2807,7 +2807,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i h5tools_str_reset(buffer); h5tools_str_append(buffer, "\"%s\"", name[i]); - nchars = (int)HDstrlen(name[i]); + nchars = (int)strlen(name[i]); h5tools_str_append(buffer, "%*s ", MAX(0, 16 - nchars), ""); if (native < 0) { @@ -2891,12 +2891,12 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->datatypebegin, h5tools_dump_header_format->datatypeblockbegin); h5tools_print_datatype(stream, &buffer, info, ctx, type, true); - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2938,12 +2938,12 @@ h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_contex h5tools_print_dataspace(&buffer, type); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + if (strlen(h5tools_dump_header_format->dataspaceblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + if (strlen(h5tools_dump_header_format->dataspaceend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataspaceend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3154,7 +3154,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if (dcpl_id >= 0) nfilters = H5Pget_nfilters(dcpl_id); - HDstrcpy(f_name, "\0"); + strcpy(f_name, "\0"); /*------------------------------------------------------------------------- * STORAGE_LAYOUT @@ -3897,12 +3897,12 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { + if (strlen(h5tools_dump_header_format->attributeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -4478,13 +4478,13 @@ done: h5tools_simple_prefix(stream, &outputformat, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datablockend)) { + if (strlen(h5tools_dump_header_format->datablockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datablockend); - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->dataend)) + if (strlen(h5tools_dump_header_format->dataend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataend); h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -4496,12 +4496,12 @@ done: h5tools_simple_prefix(stream, &outputformat, ctx, (hsize_t)0, 0); h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->subsettingblockend)) { + if (strlen(h5tools_dump_header_format->subsettingblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingblockend); - if (HDstrlen(h5tools_dump_header_format->subsettingend)) + if (strlen(h5tools_dump_header_format->subsettingend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->subsettingend)) + if (strlen(h5tools_dump_header_format->subsettingend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingend); h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index e085c72..b564511 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -36,7 +36,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; char lib_str[256]; \ \ /* Initialize library version string for error class */ \ - HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); \ + snprintf(lib_str, sizeof(lib_str), "%d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); \ \ /* Create new HDF5 error stack for the tools to use */ \ if ((H5tools_ERR_STACK_g = H5Ecreate_stack()) < 0) \ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 1f58d95..a1466bc 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -180,10 +180,10 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token) { H5O_info2_t oi; - if ((thepath == NULL) || (HDstrlen(thepath) == 0)) + if ((thepath == NULL) || (strlen(thepath) == 0)) return -1; /* Allow lookups on the root group, even though it doesn't have any link info */ - if (HDstrcmp(thepath, "/") != 0) { + if (strcmp(thepath, "/") != 0) { H5L_info2_t li; /* Check for external link first, so we don't return the OID of an object in another file */ @@ -231,7 +231,7 @@ ref_path_table_put(const char *path, const H5O_token_t *token) return (-1); memcpy(&new_node->obj_token, token, sizeof(H5O_token_t)); - new_node->path = HDstrdup(path); + new_node->path = strdup(path); return (H5SL_insert(ref_path_table, new_node, &(new_node->obj_token))); } diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 507c6ef..5ef86fb 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -106,7 +106,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) if (!str->s || str->nalloc <= 0) h5tools_str_reset(str); - if (HDstrlen(fmt) == 0) + if (strlen(fmt) == 0) /* nothing to print */ return str->s; @@ -117,17 +117,17 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) size_t avail = str->nalloc - str->len; va_start(ap, fmt); - nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); + nchars = vsnprintf(str->s + str->len, avail, fmt, ap); va_end(ap); - /* Note: HDvsnprintf() behaves differently on Windows as Unix, when + /* Note: vsnprintf() behaves differently on Windows as Unix, when * buffer is smaller than source string. On Unix, this function * returns length of the source string and copy string up to the * buffer size with NULL at the end of the buffer. However on * Windows with the same condition, this function returns -1 and * doesn't add NULL at the end of the buffer. * Because of this different return results, the strlen of the new string - * is used to handle when HDvsnprintf() returns -1 on Windows due + * is used to handle when vsnprintf() returns -1 on Windows due * to lack of buffer size, so try one more time after realloc more * buffer size before return NULL. */ @@ -135,7 +135,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) /* failure, such as bad format */ return NULL; - if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s") != 0))) { + if ((size_t)nchars >= avail || (0 == nchars && (strcmp(fmt, "%s") != 0))) { /* Truncation return value as documented by C99, or zero return value with either of the * following conditions, each of which indicates that the proper C99 return value probably * should have been positive when the format string is @@ -230,14 +230,14 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) assert(fmt); /* If the format string is simply "%s" then don't bother doing anything */ - if (!HDstrcmp(fmt, "%s")) + if (!strcmp(fmt, "%s")) return str->s; /* * Save the input value if there is a `%' anywhere in FMT. Otherwise * don't bother because we don't need a temporary copy. */ - if (HDstrchr(fmt, '%')) { + if (strchr(fmt, '%')) { size_t n = sizeof(_temp); if (str->len - start + 1 > n) { n = str->len - start + 1; @@ -245,7 +245,7 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) assert(temp); } - HDstrncpy(temp, str->s + start, n - 1); + strncpy(temp, str->s + start, n - 1); temp[n - 1] = '\0'; } @@ -669,8 +669,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5TOOLS_START_DEBUG(" "); /* Build default formats for long long types */ if (!fmt_llong[0]) { - HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%lld"); - HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%llu"); + snprintf(fmt_llong, sizeof(fmt_llong), "%%lld"); + snprintf(fmt_ullong, sizeof(fmt_ullong), "%%llu"); } /* Append value depending on data type */ @@ -741,10 +741,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai quote = '\0'; if (H5Tis_variable_str(type)) { /* cp_vp is the pointer into the struct where a `char*' is stored. So we have - * to dereference the pointer to get the `char*' to pass to HDstrlen(). */ + * to dereference the pointer to get the `char*' to pass to strlen(). */ s = *(char **)((void *)cp_vp); if (s != NULL) - size = HDstrlen(s); + size = strlen(s); } else { s = cp_vp; @@ -1494,7 +1494,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) size_t i; const char *escape; char octal[8]; - size_t n = HDstrlen(s); + size_t n = strlen(s); for (i = 0; i < n; i++) { switch (s[i]) { @@ -1533,7 +1533,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) break; default: if (!isprint(s[i])) { - HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char)s[i]); + snprintf(octal, sizeof(octal), "\\%03o", (unsigned char)s[i]); escape = octal; } else @@ -1543,7 +1543,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) } if (escape) { - size_t esc_size = HDstrlen(escape); + size_t esc_size = strlen(escape); if (n + esc_size + 1 > size) /*would overflow*/ @@ -1601,26 +1601,26 @@ h5tools_str_replace(const char *string, const char *substr, const char *replacem char *head = NULL; if (substr == NULL || replacement == NULL) - return HDstrdup(string); - newstr = HDstrdup(string); + return strdup(string); + newstr = strdup(string); head = newstr; - while ((tok = HDstrstr(head, substr))) { + while ((tok = strstr(head, substr))) { char *oldstr; oldstr = newstr; - newstr = (char *)malloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); + newstr = (char *)malloc(strlen(oldstr) - strlen(substr) + strlen(replacement) + 1); if (newstr == NULL) { free(oldstr); return NULL; } memcpy(newstr, oldstr, (size_t)(tok - oldstr)); - memcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement)); - memcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr), - HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr)); - memset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1); + memcpy(newstr + (tok - oldstr), replacement, strlen(replacement)); + memcpy(newstr + (tok - oldstr) + strlen(replacement), tok + strlen(substr), + strlen(oldstr) - strlen(substr) - (size_t)(tok - oldstr)); + memset(newstr + strlen(oldstr) - strlen(substr) + strlen(replacement), 0, 1); /* move back head right after the last replacement */ - head = newstr + (tok - oldstr) + HDstrlen(replacement); + head = newstr + (tok - oldstr) + strlen(replacement); free(oldstr); } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 663d355..5820610 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -68,10 +68,10 @@ parallel_print(const char *format, ...) va_start(ap, format); if (!g_Parallel) - HDvprintf(format, ap); + vprintf(format, ap); else { if (overflow_file == NULL) /*no overflow has occurred yet */ { - bytes_written = HDvsnprintf(outBuff + outBuffOffset, OUTBUFF_SIZE - outBuffOffset, format, ap); + bytes_written = vsnprintf(outBuff + outBuffOffset, OUTBUFF_SIZE - outBuffOffset, format, ap); va_end(ap); va_start(ap, format); @@ -84,13 +84,13 @@ parallel_print(const char *format, ...) fprintf(rawerrorstream, "warning: could not create overflow file. Output may be truncated.\n"); else - bytes_written = HDvfprintf(overflow_file, format, ap); + bytes_written = vfprintf(overflow_file, format, ap); } else outBuffOffset += (unsigned)bytes_written; } else - bytes_written = HDvfprintf(overflow_file, format, ap); + bytes_written = vfprintf(overflow_file, format, ap); } va_end(ap); } @@ -114,7 +114,7 @@ error_msg(const char *fmt, ...) FLUSHSTREAM(rawdatastream); FLUSHSTREAM(rawoutstream); fprintf(rawerrorstream, "%s error: ", h5tools_getprogname()); - HDvfprintf(rawerrorstream, fmt, ap); + vfprintf(rawerrorstream, fmt, ap); va_end(ap); } @@ -138,7 +138,7 @@ warn_msg(const char *fmt, ...) FLUSHSTREAM(rawdatastream); FLUSHSTREAM(rawoutstream); fprintf(rawerrorstream, "%s warning: ", h5tools_getprogname()); - HDvfprintf(rawerrorstream, fmt, ap); + vfprintf(rawerrorstream, fmt, ap); va_end(ap); } @@ -241,10 +241,10 @@ parse_subset_params(const char *dset) H5TOOLS_START_DEBUG(" - dset:%s", dset); /* if dset name is quoted wait till after second quote to look for subset brackets */ if (*dset == '"') - q_dset = HDstrchr(dset, '"'); + q_dset = strchr(dset, '"'); else q_dset = dset; - if ((brace = HDstrrchr(q_dset, '[')) != NULL) { + if ((brace = strrchr(q_dset, '[')) != NULL) { *brace++ = '\0'; s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); @@ -388,8 +388,8 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char * /* create destination string */ - start++; /* advance past opening paren '(' */ - cpy = (char *)malloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */ + start++; /* advance past opening paren '(' */ + cpy = (char *)malloc(sizeof(char) * (strlen(start))); /* no +1; less '(' */ if (cpy == NULL) { ret_value = FAIL; goto done; @@ -699,7 +699,7 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see else { /* Use latest version of name */ free(found_obj->objname); - found_obj->objname = HDstrdup(name); + found_obj->objname = strdup(name); /* Mark named datatype as having valid name */ found_obj->recorded = true; @@ -785,7 +785,7 @@ add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, bool /* Set information about object */ memcpy(&table->objs[u].obj_token, obj_token, sizeof(H5O_token_t)); - table->objs[u].objname = HDstrdup(objname); + table->objs[u].objname = strdup(objname); table->objs[u].recorded = record; table->objs[u].displayed = 0; } @@ -843,7 +843,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t link_info->trg_type = H5O_TYPE_UNKNOWN; /* if path is root, return group type */ - if (!HDstrcmp(linkpath, "/")) { + if (!strcmp(linkpath, "/")) { link_info->trg_type = H5O_TYPE_GROUP; H5TOOLS_GOTO_DONE(2); } @@ -1188,50 +1188,50 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_ext_t *fa, const char **values) * fail if value would overflow */ if (*values[0] != '\0' && *values[1] != '\0') { - if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { + if (strlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { if (show_progress) { printf(" ERROR: aws_region value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->fa.aws_region, values[0], (HDstrlen(values[0]) + 1)); + memcpy(fa->fa.aws_region, values[0], (strlen(values[0]) + 1)); if (show_progress) { printf(" aws_region set\n"); } - if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { + if (strlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { if (show_progress) { printf(" ERROR: secret_id value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->fa.secret_id, values[1], (HDstrlen(values[1]) + 1)); + memcpy(fa->fa.secret_id, values[1], (strlen(values[1]) + 1)); if (show_progress) { printf(" secret_id set\n"); } - if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { + if (strlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { if (show_progress) { printf(" ERROR: secret_key value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->fa.secret_key, values[2], (HDstrlen(values[2]) + 1)); + memcpy(fa->fa.secret_key, values[2], (strlen(values[2]) + 1)); if (show_progress) { printf(" secret_key set\n"); } - if (HDstrlen(values[3]) > H5FD_ROS3_MAX_SECRET_TOK_LEN) { + if (strlen(values[3]) > H5FD_ROS3_MAX_SECRET_TOK_LEN) { if (show_progress) { printf(" ERROR: token value too long\n"); } ret_value = 0; goto done; } - memcpy(fa->token, values[3], (HDstrlen(values[3]) + 1)); + memcpy(fa->token, values[3], (strlen(values[3]) + 1)); if (show_progress) { printf(" token set\n"); } @@ -1288,22 +1288,22 @@ h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, H5FD_hdfs_fapl_t * WARNING: No error-checking is done on length of input strings... * Silent overflow is possible, albeit unlikely. */ - if (HDstrncmp(props[0], "", 1)) { - HDstrncpy(fapl_config_out->namenode_name, (const char *)props[0], HDstrlen(props[0])); + if (strncmp(props[0], "", 1)) { + strncpy(fapl_config_out->namenode_name, (const char *)props[0], strlen(props[0])); } - if (HDstrncmp(props[1], "", 1)) { + if (strncmp(props[1], "", 1)) { k = strtoul((const char *)props[1], NULL, 0); if (errno == ERANGE) H5TOOLS_GOTO_ERROR(FAIL, "supposed port number wasn't"); fapl_config_out->namenode_port = (int32_t)k; } - if (HDstrncmp(props[2], "", 1)) { - HDstrncpy(fapl_config_out->kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2])); + if (strncmp(props[2], "", 1)) { + strncpy(fapl_config_out->kerberos_ticket_cache, (const char *)props[2], strlen(props[2])); } - if (HDstrncmp(props[3], "", 1)) { - HDstrncpy(fapl_config_out->user_name, (const char *)props[3], HDstrlen(props[3])); + if (strncmp(props[3], "", 1)) { + strncpy(fapl_config_out->user_name, (const char *)props[3], strlen(props[3])); } - if (HDstrncmp(props[4], "", 1)) { + if (strncmp(props[4], "", 1)) { k = strtoul((const char *)props[4], NULL, 0); if (errno == ERANGE) H5TOOLS_GOTO_ERROR(FAIL, "supposed buffersize number wasn't"); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 438c705..017e062 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -126,7 +126,7 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path) /* Append it */ idx = visited->nused++; memcpy(&visited->objs[idx].token, token, sizeof(H5O_token_t)); - visited->objs[idx].path = HDstrdup(path); + visited->objs[idx].path = strdup(path); } /* end trav_token_add() */ /*------------------------------------------------------------------------- @@ -172,17 +172,17 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda /* Create the full path name for the link */ if (udata->is_absolute) { - size_t base_len = HDstrlen(udata->base_grp_name); + size_t base_len = strlen(udata->base_grp_name); size_t add_slash = base_len ? ((udata->base_grp_name)[base_len - 1] != '/') : 1; - size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1 + + size_t new_name_len = base_len + add_slash + strlen(path) + 1 + 3; /* Extra "+3" to quiet GCC warning - 2019/07/05, QAK */ if (NULL == (new_name = (char *)malloc(new_name_len))) return (H5_ITER_ERROR); if (add_slash) - HDsnprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); + snprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); else - HDsnprintf(new_name, new_name_len, "%s%s", udata->base_grp_name, path); + snprintf(new_name, new_name_len, "%s%s", udata->base_grp_name, path); full_name = new_name; } /* end if */ else @@ -326,7 +326,7 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) /* Append it */ idx = info->nused++; - info->paths[idx].path = HDstrdup(path); + info->paths[idx].path = strdup(path); info->paths[idx].type = obj_type; info->paths[idx].fileno = 0; @@ -349,7 +349,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) H5O_info2_t oinfo; size_t idx = info->nused - 1; - if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".") != 0) + if (info->paths[idx].path && strcmp(info->paths[idx].path, ".") != 0) H5Oget_info_by_name3(loc_id, info->paths[idx].path, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC); @@ -452,11 +452,11 @@ h5trav_getindex(const trav_info_t *info, const char *obj) /* Loop over all paths in 'info' struct, looking for object */ for (u = 0; u < info->nused; u++) { /* Check for object name having full path (with leading '/') */ - if (HDstrcmp(obj, info->paths[u].path) == 0) + if (strcmp(obj, info->paths[u].path) == 0) return ((ssize_t)u); /* Check for object name without leading '/' */ - if (HDstrcmp(obj, (info->paths[u].path + 1)) == 0) + if (strcmp(obj, (info->paths[u].path + 1)) == 0) return ((ssize_t)u); } /* end for */ @@ -611,11 +611,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) if (table) { for (i = 0; i < table->nobjs; i++) { /* Check for object name having full path (with leading '/') */ - if (HDstrcmp(name, table->objs[i].name) == 0) + if (strcmp(name, table->objs[i].name) == 0) return ((int)i); /* Check for object name without leading '/' */ - if (HDstrcmp(name, table->objs[i].name + 1) == 0) + if (strcmp(name, table->objs[i].name + 1) == 0) return ((int)i); /* search also in the list of links */ @@ -624,11 +624,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for (j = 0; j < table->objs[i].nlinks; j++) { /* Check for object name having full path (with leading '/') */ - if (HDstrcmp(name, table->objs[i].links[j].new_name) == 0) + if (strcmp(name, table->objs[i].links[j].new_name) == 0) return ((int)i); /* Check for object name without leading '/' */ - if (HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) + if (strcmp(name, table->objs[i].links[j].new_name + 1) == 0) return ((int)i); } /* end for */ } /* end if */ @@ -664,7 +664,7 @@ trav_table_add(trav_table_t *table, const char *path, const H5O_info2_t *oinfo) table->objs[new_obj].obj_token = H5O_TOKEN_UNDEF; table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(path); + table->objs[new_obj].name = (char *)strdup(path); table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; table->objs[new_obj].nlinks = 0; table->objs[new_obj].sizelinks = 0; @@ -694,7 +694,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char size_t n; /* already inserted? */ - if (HDstrcmp(table->objs[i].name, path) == 0) + if (strcmp(table->objs[i].name, path) == 0) return; /* allocate space if necessary */ @@ -706,7 +706,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char /* insert it */ n = table->objs[i].nlinks++; - table->objs[i].links[n].new_name = (char *)HDstrdup(path); + table->objs[i].links[n].new_name = (char *)strdup(path); return; } /* end if */ @@ -741,7 +741,7 @@ trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_ table->objs[new_obj].flags[0] = flags[0]; table->objs[new_obj].flags[1] = flags[1]; table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(name); + table->objs[new_obj].name = (char *)strdup(name); table->objs[new_obj].type = type; table->objs[new_obj].nlinks = 0; table->objs[new_obj].sizelinks = 0; @@ -1086,13 +1086,13 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->objs[idx].path = NULL; if (type == H5L_TYPE_EXTERNAL) { - if (NULL == (visited->objs[idx].file = HDstrdup(file))) { + if (NULL == (visited->objs[idx].file = strdup(file))) { visited->nused--; H5TOOLS_GOTO_ERROR(FAIL, "visited data structure name allocation failed"); } /* end if */ } /* end if */ - if (NULL == (visited->objs[idx].path = HDstrdup(path))) { + if (NULL == (visited->objs[idx].path = strdup(path))) { visited->nused--; if (visited->objs[idx].file) free(visited->objs[idx].file); @@ -1120,10 +1120,10 @@ symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, c for (u = 0; u < visited->nused; u++) { /* Check for symlink values already in array */ /* check type and path pair to distinguish between symbolic links */ - if ((visited->objs[u].type == type) && !HDstrcmp(visited->objs[u].path, path)) { + if ((visited->objs[u].type == type) && !strcmp(visited->objs[u].path, path)) { /* if external link, file need to be matched as well */ if (visited->objs[u].type == H5L_TYPE_EXTERNAL) - if (!HDstrcmp(visited->objs[u].file, file)) + if (!strcmp(visited->objs[u].file, file)) return (true); return (true); diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index ebbb57b..6f3c0a6 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -241,7 +241,7 @@ H5_GCC_CLANG_DIAG_OFF("format") *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(expected, actual, reason) \ - if (HDstrcmp((actual), (expected)) != 0) { \ + if (strcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -277,7 +277,7 @@ H5_GCC_CLANG_DIAG_OFF("format") *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(actual, expected, reason) \ - if (HDstrcmp((actual), (expected)) != 0) { \ + if (strcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -543,8 +543,8 @@ test_populate_ros3_fa(void) TESTING("programmatic ros3 fapl population"); #ifndef H5_HAVE_ROS3_VFD - HDputs(" -SKIP-"); - HDputs(" Read-Only S3 VFD not enabled"); + puts(" -SKIP-"); + puts(" Read-Only S3 VFD not enabled"); fflush(stdout); return 0; #else @@ -681,7 +681,7 @@ test_populate_ros3_fa(void) printf("region overflow\n"); } - assert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); + assert(strlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) @@ -754,7 +754,7 @@ test_populate_ros3_fa(void) printf("id overflow\n"); } - assert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); + assert(strlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) @@ -887,7 +887,7 @@ test_populate_ros3_fa(void) printf("key overflow\n"); } - assert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); + assert(strlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.fa.version, (char *)NULL) diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index f753867..ef7e36f 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -156,25 +156,25 @@ parse_flag(const char *s_flag, unsigned *flag) { unsigned fla = 0; - if (HDstrcmp(s_flag, "shallow") == 0) { + if (strcmp(s_flag, "shallow") == 0) { fla = H5O_COPY_SHALLOW_HIERARCHY_FLAG; } - else if (HDstrcmp(s_flag, "soft") == 0) { + else if (strcmp(s_flag, "soft") == 0) { fla = H5O_COPY_EXPAND_SOFT_LINK_FLAG; } - else if (HDstrcmp(s_flag, "ext") == 0) { + else if (strcmp(s_flag, "ext") == 0) { fla = H5O_COPY_EXPAND_EXT_LINK_FLAG; } - else if (HDstrcmp(s_flag, "ref") == 0) { + else if (strcmp(s_flag, "ref") == 0) { fla = H5O_COPY_EXPAND_REFERENCE_FLAG; } - else if (HDstrcmp(s_flag, "noattr") == 0) { + else if (strcmp(s_flag, "noattr") == 0) { fla = H5O_COPY_WITHOUT_ATTR_FLAG; } - else if (HDstrcmp(s_flag, "allflags") == 0) { + else if (strcmp(s_flag, "allflags") == 0) { fla = H5O_COPY_ALL; } - else if (HDstrcmp(s_flag, "nullmsg") == 0) { + else if (strcmp(s_flag, "nullmsg") == 0) { fla = H5O_COPY_PRESERVE_NULL_FLAG; } else { @@ -229,7 +229,7 @@ main(int argc, char *argv[]) while ((opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'd': - oname_dst = HDstrdup(H5_optarg); + oname_dst = strdup(H5_optarg); break; case 'f': @@ -238,7 +238,7 @@ main(int argc, char *argv[]) usage(); leave(EXIT_FAILURE); } - str_flag = HDstrdup(H5_optarg); + str_flag = strdup(H5_optarg); break; case 'h': @@ -247,11 +247,11 @@ main(int argc, char *argv[]) break; case 'i': - fname_src = HDstrdup(H5_optarg); + fname_src = strdup(H5_optarg); break; case 'o': - fname_dst = HDstrdup(H5_optarg); + fname_dst = strdup(H5_optarg); break; case 'p': @@ -259,7 +259,7 @@ main(int argc, char *argv[]) break; case 's': - oname_src = HDstrdup(H5_optarg); + oname_src = strdup(H5_optarg); break; case 'V': @@ -403,7 +403,7 @@ main(int argc, char *argv[]) /* error, if parent groups doesn't already exist in destination file */ size_t i, len; - len = HDstrlen(oname_dst); + len = strlen(oname_dst); /* check if all the parents groups exist. skip root group */ for (i = 1; i < len; i++) { @@ -411,7 +411,7 @@ main(int argc, char *argv[]) char *str_ptr; str_ptr = (char *)calloc(i + 1, sizeof(char)); - HDstrncpy(str_ptr, oname_dst, i); + strncpy(str_ptr, oname_dst, i); str_ptr[i] = '\0'; if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 0a3225b..c66311f 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -387,7 +387,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const } /* If file 1 uses the onion VFD, get the revision number */ - if (opts->vfd_info[0].u.name && !HDstrcmp(opts->vfd_info[0].u.name, "onion")) { + if (opts->vfd_info[0].u.name && !strcmp(opts->vfd_info[0].u.name, "onion")) { if (opts->vfd_info[0].info) { errno = 0; onion_fa_g_1.revision_num = strtoull(opts->vfd_info[0].info, NULL, 10); @@ -404,7 +404,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const } /* If file 2 uses the onion VFD, get the revision number */ - if (opts->vfd_info[1].u.name && !HDstrcmp(opts->vfd_info[1].u.name, "onion")) { + if (opts->vfd_info[1].u.name && !strcmp(opts->vfd_info[1].u.name, "onion")) { if (opts->vfd_info[1].info) { errno = 0; onion_fa_g_2.revision_num = strtoull(opts->vfd_info[1].info, NULL, 10); @@ -512,7 +512,7 @@ check_n_input(const char *str) unsigned i; char c; - for (i = 0; i < HDstrlen(str); i++) { + for (i = 0; i < strlen(str); i++) { c = str[i]; if (i == 0) { if (c < 49 || c > 57) /* ascii values between 1 and 9 */ @@ -541,7 +541,7 @@ check_p_input(const char *str) * the atof return value on a hexadecimal input is different * on some systems; we do a character check for this */ - if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') + if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; x = atof(str); @@ -568,7 +568,7 @@ check_d_input(const char *str) * the atof return value on a hexadecimal input is different * on some systems; we do a character check for this */ - if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') + if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; x = atof(str); diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index c5f97df..0f43261 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -246,8 +246,8 @@ print_manager_output(void) if (overflow_file) { int tmp; rewind(overflow_file); - while ((tmp = HDgetc(overflow_file)) >= 0) - HDputchar(tmp); + while ((tmp = getc(overflow_file)) >= 0) + putchar(tmp); fclose(overflow_file); overflow_file = NULL; } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index e11999d..a1a6de0 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -515,15 +515,15 @@ set_binary_form(const char *form) { int bform = -1; - if (HDstrcmp(form, "NATIVE") == 0 || HDstrcmp(form, "MEMORY") == 0) { + if (strcmp(form, "NATIVE") == 0 || strcmp(form, "MEMORY") == 0) { /* native form */ bform = 0; } - else if (HDstrcmp(form, "FILE") == 0) /* file type form */ + else if (strcmp(form, "FILE") == 0) /* file type form */ bform = 1; - else if (HDstrcmp(form, "LE") == 0) /* convert to little endian */ + else if (strcmp(form, "LE") == 0) /* convert to little endian */ bform = 2; - else if (HDstrcmp(form, "BE") == 0) /* convert to big endian */ + else if (strcmp(form, "BE") == 0) /* convert to big endian */ bform = 3; return bform; @@ -544,9 +544,9 @@ set_sort_by(const char *form) { H5_index_t idx_type = H5_INDEX_UNKNOWN; - if (HDstrcmp(form, "name") == 0) /* H5_INDEX_NAME */ + if (strcmp(form, "name") == 0) /* H5_INDEX_NAME */ idx_type = H5_INDEX_NAME; - else if (HDstrcmp(form, "creation_order") == 0) /* H5_INDEX_CRT_ORDER */ + else if (strcmp(form, "creation_order") == 0) /* H5_INDEX_CRT_ORDER */ idx_type = H5_INDEX_CRT_ORDER; return idx_type; @@ -567,9 +567,9 @@ set_sort_order(const char *form) { H5_iter_order_t iter_order = H5_ITER_UNKNOWN; - if (HDstrcmp(form, "ascending") == 0) /* H5_ITER_INC */ + if (strcmp(form, "ascending") == 0) /* H5_ITER_INC */ iter_order = H5_ITER_INC; - else if (HDstrcmp(form, "descending") == 0) /* H5_ITER_DEC */ + else if (strcmp(form, "descending") == 0) /* H5_ITER_DEC */ iter_order = H5_ITER_DEC; return iter_order; @@ -837,7 +837,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_paths; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = strdup(H5_optarg); break; } @@ -849,7 +849,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_attributes; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = strdup(H5_optarg); break; } @@ -861,7 +861,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_datasets; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = strdup(H5_optarg); if (!dump_opts.disable_compact_subset) hand[i].subset_info = parse_subset_params(hand[i].obj); last_dset = &hand[i]; @@ -876,12 +876,12 @@ parse_start: use_custom_vfd_g = true; #ifdef H5_HAVE_ROS3_VFD - if (0 == HDstrcmp(vfd_info_g.u.name, drivernames[ROS3_VFD_IDX])) + if (0 == strcmp(vfd_info_g.u.name, drivernames[ROS3_VFD_IDX])) if (!vfd_info_g.info) vfd_info_g.info = &ros3_fa_g; #endif #ifdef H5_HAVE_LIBHDFS - if (0 == HDstrcmp(vfd_info_g.u.name, drivernames[HDFS_VFD_IDX])) + if (0 == strcmp(vfd_info_g.u.name, drivernames[HDFS_VFD_IDX])) if (!vfd_info_g.info) vfd_info_g.info = &hdfs_fa_g; #endif @@ -893,7 +893,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_groups; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = strdup(H5_optarg); break; } @@ -905,7 +905,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_links; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = strdup(H5_optarg); break; } @@ -917,7 +917,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_datatypes; - hand[i].obj = HDstrdup(H5_optarg); + hand[i].obj = strdup(H5_optarg); break; } @@ -1053,7 +1053,7 @@ parse_start: usage(h5tools_getprogname()); goto error; } - if (HDstrcmp(H5_optarg, ":") == 0) + if (strcmp(H5_optarg, ":") == 0) xmlnsprefix = ""; else xmlnsprefix = H5_optarg; @@ -1234,10 +1234,10 @@ end_collect: } /* If the file uses the onion VFD, get the revision number */ - if (vfd_info_g.u.name && !HDstrcmp(vfd_info_g.u.name, "onion")) { + if (vfd_info_g.u.name && !strcmp(vfd_info_g.u.name, "onion")) { if (vfd_info_g.info) { - if (!HDstrcmp(vfd_info_g.info, "revision_count")) + if (!strcmp(vfd_info_g.info, "revision_count")) get_onion_revision_count = true; else { errno = 0; @@ -1373,7 +1373,7 @@ main(int argc, char *argv[]) } while (H5_optind < argc) { - fname = HDstrdup(argv[H5_optind++]); + fname = strdup(argv[H5_optind++]); /* A short cut to get the revision count of an onion file without opening the file */ if (get_onion_revision_count && H5FD_ONION == H5Pget_driver(fapl_id)) { @@ -1406,7 +1406,7 @@ main(int argc, char *argv[]) if (doxml_g) { /* initialize XML */ /* reset prefix! */ - HDstrcpy(prefix, ""); + strcpy(prefix, ""); /* make sure the URI is initialized to something */ if (xml_dtd_uri_g == NULL) { @@ -1419,7 +1419,7 @@ main(int argc, char *argv[]) } } else { - if (useschema_g && HDstrcmp(xmlnsprefix, "") != 0) { + if (useschema_g && strcmp(xmlnsprefix, "") != 0) { error_msg( "Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); h5tools_setstatus(EXIT_FAILURE); @@ -1462,7 +1462,7 @@ main(int argc, char *argv[]) /* alternative first element, depending on schema or DTD. */ if (useschema_g) { - if (HDstrcmp(xmlnsprefix, "") == 0) { + if (strcmp(xmlnsprefix, "") == 0) { PRINTSTREAM(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xsi:noNamespaceSchemaLocation=\"%s\">\n", @@ -1473,8 +1473,8 @@ main(int argc, char *argv[]) char *ns; char *indx; - ns = HDstrdup(xmlnsprefix); - indx = HDstrrchr(ns, (int)':'); + ns = strdup(xmlnsprefix); + indx = strrchr(ns, (int)':'); if (indx) *indx = '\0'; @@ -1633,7 +1633,7 @@ init_prefix(char **prfx, size_t prfx_len) void add_prefix(char **prfx, size_t *prfx_len, const char *name) { - size_t new_len = HDstrlen(*prfx) + HDstrlen(name) + 2; + size_t new_len = strlen(*prfx) + strlen(name) + 2; /* Check if we need more space */ if (*prfx_len <= new_len) { @@ -1642,5 +1642,5 @@ add_prefix(char **prfx, size_t *prfx_len, const char *name) } /* Append object name to prefix */ - HDstrcat(HDstrcat(*prfx, "/"), name); + strcat(strcat(*prfx, "/"), name); } /* end add_prefix */ diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 0c4e105..3b72faa 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -187,15 +187,15 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT outputformat = &string_dataformat; /* Build the object's path name */ - obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); + obj_path = (char *)malloc(strlen(prefix) + strlen(name) + 2); if (!obj_path) { ret = FAIL; goto done; } - HDstrcpy(obj_path, prefix); - HDstrcat(obj_path, "/"); - HDstrcat(obj_path, name); + strcpy(obj_path, prefix); + strcat(obj_path, "/"); + strcat(obj_path, name); if (linfo->type == H5L_TYPE_HARD) { H5O_info2_t oinfo; @@ -219,7 +219,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT char *old_prefix; /* Pointer to previous prefix */ /* Keep copy of prefix before iterating into group */ - old_prefix = HDstrdup(prefix); + old_prefix = strdup(prefix); if (old_prefix) { /* Append group name to prefix */ add_prefix(&prefix, &prefix_len, name); @@ -228,7 +228,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT dump_function_table->dump_group_function(obj, name); /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); + strcpy(prefix, old_prefix); free(old_prefix); } else @@ -278,13 +278,13 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -325,13 +325,13 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -426,12 +426,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->softlinkblockend)) { + if (strlen(h5tools_dump_header_format->softlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); - if (HDstrlen(h5tools_dump_header_format->softlinkend)) + if (strlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->softlinkend)) + if (strlen(h5tools_dump_header_format->softlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -500,12 +500,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->extlinkblockend)) { + if (strlen(h5tools_dump_header_format->extlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); - if (HDstrlen(h5tools_dump_header_format->extlinkend)) + if (strlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->extlinkend)) + if (strlen(h5tools_dump_header_format->extlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -541,12 +541,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT ctx.need_prefix = true; /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->udlinkblockend)) { + if (strlen(h5tools_dump_header_format->udlinkblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkblockend); - if (HDstrlen(h5tools_dump_header_format->udlinkend)) + if (strlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->udlinkend)) + if (strlen(h5tools_dump_header_format->udlinkend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -730,12 +730,12 @@ dump_named_datatype(hid_t tid, const char *name) done: /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + if (strlen(h5tools_dump_header_format->datatypeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) + if (strlen(h5tools_dump_header_format->datatypeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -825,7 +825,7 @@ dump_group(hid_t gid, const char *name) ctx.indent_level++; dump_indent += COL; - if (!HDstrcmp(name, "/") && unamedtype) { + if (!strcmp(name, "/") && unamedtype) { unsigned u; /* Local index variable */ /* dump unnamed type in root group */ @@ -837,7 +837,7 @@ dump_group(hid_t gid, const char *name) type = H5Dget_type(dset); H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str); - HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); + snprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); H5free_memory(obj_tok_str); dump_function_table->dump_named_datatype_function(type, type_name); @@ -885,12 +885,12 @@ dump_group(hid_t gid, const char *name) /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->groupblockend)) { + if (strlen(h5tools_dump_header_format->groupblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupblockend); - if (HDstrlen(h5tools_dump_header_format->groupend)) + if (strlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->groupend)) + if (strlen(h5tools_dump_header_format->groupend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1063,12 +1063,12 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1202,25 +1202,25 @@ dump_fcpl(hid_t fid) #ifdef SHOW_FILE_DRIVER if (H5FD_CORE == fdriver) - HDstrcpy(dname, "H5FD_CORE"); + strcpy(dname, "H5FD_CORE"); #ifdef H5_HAVE_DIRECT else if (H5FD_DIRECT == fdriver) - HDstrcpy(dname, "H5FD_DIRECT"); + strcpy(dname, "H5FD_DIRECT"); #endif else if (H5FD_FAMILY == fdriver) - HDstrcpy(dname, "H5FD_FAMILY"); + strcpy(dname, "H5FD_FAMILY"); else if (H5FD_LOG == fdriver) - HDstrcpy(dname, "H5FD_LOG"); + strcpy(dname, "H5FD_LOG"); else if (H5FD_MPIO == fdriver) - HDstrcpy(dname, "H5FD_MPIO"); + strcpy(dname, "H5FD_MPIO"); else if (H5FD_MULTI == fdriver) - HDstrcpy(dname, "H5FD_MULTI"); + strcpy(dname, "H5FD_MULTI"); else if (H5FD_SEC2 == fdriver) - HDstrcpy(dname, "H5FD_SEC2"); + strcpy(dname, "H5FD_SEC2"); else if (H5FD_STDIO == fdriver) - HDstrcpy(dname, "H5FD_STDIO"); + strcpy(dname, "H5FD_STDIO"); else - HDstrcpy(dname, "Unknown driver"); + strcpy(dname, "Unknown driver"); /* Take out this because the driver used can be different from the * standard output. */ @@ -1311,7 +1311,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a const char *buf = attr_data->path; const char *op_name = attr_data->op_name; - j = (int)HDstrlen(op_name) - 1; + j = (int)strlen(op_name) - 1; /* find the last / */ while (j >= 0) { if (op_name[j] == '/' && (j == 0 || (op_name[j - 1] != '\\'))) @@ -1326,12 +1326,12 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a ret = FAIL; } else { - if (HDstrcmp(attr_name, obj_op_name) == 0) { + if (strcmp(attr_name, obj_op_name) == 0) { size_t u, v, w; /* object name */ - u = HDstrlen(buf); - v = HDstrlen(op_name); + u = strlen(buf); + v = strlen(op_name); w = u + 1 + v + 1 + 2; obj_name = (char *)malloc(w); if (obj_name == NULL) { @@ -1343,16 +1343,16 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a memset(obj_name, '\0', w); if (op_name[0] != '/') { - HDstrncat(obj_name, buf, buffer_space); + strncat(obj_name, buf, buffer_space); buffer_space -= MIN(buffer_space, u); if (buf[u - 1] != '/') { - HDstrncat(obj_name, "/", buffer_space); + strncat(obj_name, "/", buffer_space); buffer_space -= MIN(buffer_space, 2); } } - HDstrncat(obj_name, op_name, buffer_space); + strncat(obj_name, op_name, buffer_space); buffer_space -= MIN(buffer_space, v); handle_attributes(oid, obj_name, NULL, 0, NULL); @@ -1377,7 +1377,7 @@ obj_search(const char *path, const H5O_info2_t *oi, const char H5_ATTR_UNUSED *a H5Aiterate_by_name(handle_data->fid, path, H5_INDEX_NAME, H5_ITER_INC, NULL, attr_search, (void *)&attr_data, H5P_DEFAULT); - if (HDstrcmp(path, op_name) == 0) { + if (strcmp(path, op_name) == 0) { switch (oi->type) { case H5O_TYPE_GROUP: handle_groups(handle_data->fid, path, NULL, 0, NULL); @@ -1412,7 +1412,7 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data) trav_handle_udata_t *handle_data = (trav_handle_udata_t *)_op_data; const char *op_name = handle_data->op_name; - search_len = HDstrlen(op_name); + search_len = strlen(op_name); if (search_len > 0 && op_name[0] != '/') k = 2; else @@ -1424,14 +1424,14 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data) } else { if (k == 2) { - HDstrcpy(search_name, "/"); - HDstrcat(search_name, op_name); + strcpy(search_name, "/"); + strcat(search_name, op_name); } else - HDstrcpy(search_name, op_name); + strcpy(search_name, op_name); search_name[search_len + k - 1] = '\0'; - if (HDstrcmp(path, search_name) == 0) { + if (strcmp(path, search_name) == 0) { switch (li->type) { case H5L_TYPE_SOFT: case H5L_TYPE_EXTERNAL: @@ -1530,7 +1530,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 h5tool_format_t string_dataformat; hsize_t curr_pos = 0; /* total data element position */ - j = (int)HDstrlen(attr) - 1; + j = (int)strlen(attr) - 1; obj_name = (char *)malloc((size_t)j + 2); if (obj_name == NULL) goto error; @@ -1544,9 +1544,9 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 /* object name */ if (j == -1) - HDstrcpy(obj_name, "/"); + strcpy(obj_name, "/"); else { - HDstrncpy(obj_name, attr, (size_t)j + 1); + strncpy(obj_name, attr, (size_t)j + 1); obj_name[j + 1] = '\0'; } /* end else */ @@ -1595,12 +1595,12 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 ctx.need_prefix = true; /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { + if (strlen(h5tools_dump_header_format->attributeblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->attributeend)) + if (strlen(h5tools_dump_header_format->attributeend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1849,14 +1849,14 @@ handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, c } } else { - size_t new_len = HDstrlen(group) + 1; + size_t new_len = strlen(group) + 1; if (prefix_len <= new_len) { prefix_len = new_len; prefix = (char *)realloc(prefix, prefix_len); } /* end if */ - HDstrcpy(prefix, group); + strcpy(prefix, group); dump_indent += COL; dump_group(gid, real_name); @@ -1978,10 +1978,10 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED *data, int pe, /* unnamed datatype */ H5Otoken_to_str(fid, &type_table->objs[idx].obj_token, &obj_tok_str); - HDsnprintf(name, sizeof(name), "/#%s", obj_tok_str); + snprintf(name, sizeof(name), "/#%s", obj_tok_str); H5free_memory(obj_tok_str); - if (!HDstrcmp(name, real_name)) + if (!strcmp(name, real_name)) break; } /* end if */ diff --git a/tools/src/h5dump/h5dump_defines.h b/tools/src/h5dump/h5dump_defines.h index 5f89178..f82dee5 100644 --- a/tools/src/h5dump/h5dump_defines.h +++ b/tools/src/h5dump/h5dump_defines.h @@ -32,12 +32,12 @@ #define end_obj(obj, end) \ do { \ - if (HDstrlen(end)) { \ + if (strlen(end)) { \ PRINTSTREAM(rawoutstream, "%s", end); \ - if (HDstrlen(obj)) \ + if (strlen(obj)) \ PRINTVALSTREAM(rawoutstream, " "); \ } \ - if (HDstrlen(obj)) \ + if (strlen(obj)) \ PRINTSTREAM(rawoutstream, "%s", obj); \ } while (0) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 64be328..93fc3b0 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -164,15 +164,15 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 outputformat = &string_dataformat; /* Build the object's path name */ - obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); + obj_path = (char *)malloc(strlen(prefix) + strlen(name) + 2); if (!obj_path) { ret = FAIL; goto done; } - HDstrcpy(obj_path, prefix); - HDstrcat(obj_path, "/"); - HDstrcat(obj_path, name); + strcpy(obj_path, prefix); + strcat(obj_path, "/"); + strcat(obj_path, name); if (linfo->type == H5L_TYPE_HARD) { H5O_info2_t oinfo; @@ -196,7 +196,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 char *old_prefix; /* Pointer to previous prefix */ /* Keep copy of prefix before iterating into group */ - if ((old_prefix = HDstrdup(prefix)) == NULL) { + if ((old_prefix = strdup(prefix)) == NULL) { error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; @@ -209,7 +209,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 dump_function_table->dump_group_function(obj, name); /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); + strcpy(prefix, old_prefix); free(old_prefix); } @@ -244,13 +244,13 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 /* Render the element */ h5tools_str_reset(&buffer); - if (HDstrlen(h5tools_dump_header_format->datasetblockend)) { + if (strlen(h5tools_dump_header_format->datasetblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, " "); } - if (HDstrlen(h5tools_dump_header_format->datasetend)) + if (strlen(h5tools_dump_header_format->datasetend)) h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -265,7 +265,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 else if (found_obj->displayed) { /* the XML version */ char *t_obj_path = xml_escape_the_name(obj_path); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix, "") ? prefix : "/"); + char *t_prefix = xml_escape_the_name(strcmp(prefix, "") ? prefix : "/"); char *t_name = xml_escape_the_name(name); char *t_objname = xml_escape_the_name(found_obj->objname); char dsetxid[100]; @@ -380,19 +380,19 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 char linkxid[100]; char parentxid[100]; char targetxid[100]; - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix, "") ? prefix : "/"); + char *t_prefix = xml_escape_the_name(strcmp(prefix, "") ? prefix : "/"); char *t_name = xml_escape_the_name(name); char *t_targbuf = xml_escape_the_name(targbuf); char *t_obj_path = xml_escape_the_name(obj_path); char *t_link_path; int res; - t_link_path = (char *)malloc(HDstrlen(prefix) + linfo->u.val_size + 1); + t_link_path = (char *)malloc(strlen(prefix) + linfo->u.val_size + 1); if (targbuf[0] == '/') - HDstrcpy(t_link_path, targbuf); + strcpy(t_link_path, targbuf); else { - HDstrcpy(t_link_path, prefix); - HDstrcat(HDstrcat(t_link_path, "/"), targbuf); + strcpy(t_link_path, prefix); + strcat(strcat(t_link_path, "/"), targbuf); } /* end else */ /* Create OBJ-XIDs for the parent and object */ @@ -481,7 +481,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 char linkxid[100]; char parentxid[100]; char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix, "") ? prefix : "/"); + char *t_prefix = xml_escape_the_name(strcmp(prefix, "") ? prefix : "/"); char *t_obj_path = xml_escape_the_name(obj_path); char *t_filename = xml_escape_the_name(filename); char *t_targname = xml_escape_the_name(targname); @@ -529,7 +529,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 char linkxid[100]; char parentxid[100]; char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix, "") ? prefix : "/"); + char *t_prefix = xml_escape_the_name(strcmp(prefix, "") ? prefix : "/"); char *t_obj_path = xml_escape_the_name(obj_path); /* Create OBJ-XIDs for the parent and object */ @@ -593,14 +593,14 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen lookup_ret = ref_path_table_lookup(str, &obj_token); if (lookup_ret < 0) { - if (HDstrlen(str) == 0) { + if (strlen(str) == 0) { lookup_ret = ref_path_table_lookup("/", &obj_token); if (lookup_ret < 0) { if (gen) { ref_path_table_gen_fake(str, &obj_token); H5Otoken_to_str(loc_id, &obj_token, &obj_tok_str); - HDsnprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str); + snprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str); H5free_memory(obj_tok_str); return 0; @@ -615,7 +615,7 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen ref_path_table_gen_fake(str, &obj_token); H5Otoken_to_str(loc_id, &obj_token, &obj_tok_str); - HDsnprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str); + snprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str); H5free_memory(obj_tok_str); return 0; @@ -627,7 +627,7 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen } H5Otoken_to_str(loc_id, &obj_token, &obj_tok_str); - HDsnprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str); + snprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str); H5free_memory(obj_tok_str); return 0; @@ -664,26 +664,26 @@ xml_escape_the_name(const char *str) return NULL; cp = str; - len = HDstrlen(str); + len = strlen(str); extra = 0; for (i = 0; i < len; i++) { if (*cp == '\"') - extra += (HDstrlen(quote) - 1); + extra += (strlen(quote) - 1); else if (*cp == '\'') - extra += (HDstrlen(apos) - 1); + extra += (strlen(apos) - 1); else if (*cp == '<') - extra += (HDstrlen(lt) - 1); + extra += (strlen(lt) - 1); else if (*cp == '>') - extra += (HDstrlen(gt) - 1); + extra += (strlen(gt) - 1); else if (*cp == '&') - extra += (HDstrlen(amp) - 1); + extra += (strlen(amp) - 1); cp++; } if (extra == 0) - return HDstrdup(str); + return strdup(str); cp = str; ncp_len = len + extra + 1; @@ -696,24 +696,24 @@ xml_escape_the_name(const char *str) size_t esc_len; if (*cp == '\'') { - HDstrncpy(ncp, apos, ncp_len); - esc_len = HDstrlen(apos); + strncpy(ncp, apos, ncp_len); + esc_len = strlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, ncp_len); - esc_len = HDstrlen(lt); + strncpy(ncp, lt, ncp_len); + esc_len = strlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, ncp_len); - esc_len = HDstrlen(gt); + strncpy(ncp, gt, ncp_len); + esc_len = strlen(gt); } else if (*cp == '\"') { - HDstrncpy(ncp, quote, ncp_len); - esc_len = HDstrlen(quote); + strncpy(ncp, quote, ncp_len); + esc_len = strlen(quote); } else if (*cp == '&') { - HDstrncpy(ncp, amp, ncp_len); - esc_len = HDstrlen(amp); + strncpy(ncp, amp, ncp_len); + esc_len = strlen(amp); } else { *ncp = *cp; @@ -755,7 +755,7 @@ xml_escape_the_string(const char *str, int slen) cp = str; if (slen < 0) - len = HDstrlen(str); + len = strlen(str); else len = (size_t)slen; @@ -767,13 +767,13 @@ xml_escape_the_string(const char *str, int slen) else if (*cp == '\"') extra++; else if (*cp == '\'') - extra += (HDstrlen(apos) - 1); + extra += (strlen(apos) - 1); else if (*cp == '<') - extra += (HDstrlen(lt) - 1); + extra += (strlen(lt) - 1); else if (*cp == '>') - extra += (HDstrlen(gt) - 1); + extra += (strlen(gt) - 1); else if (*cp == '&') - extra += (HDstrlen(amp) - 1); + extra += (strlen(amp) - 1); cp++; } @@ -800,20 +800,20 @@ xml_escape_the_string(const char *str, int slen) esc_len = 1; } else if (*cp == '\'') { - HDstrncpy(ncp, apos, ncp_len); - esc_len = HDstrlen(apos); + strncpy(ncp, apos, ncp_len); + esc_len = strlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, ncp_len); - esc_len = HDstrlen(lt); + strncpy(ncp, lt, ncp_len); + esc_len = strlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, ncp_len); - esc_len = HDstrlen(gt); + strncpy(ncp, gt, ncp_len); + esc_len = strlen(gt); } else if (*cp == '&') { - HDstrncpy(ncp, amp, ncp_len); - esc_len = HDstrlen(amp); + strncpy(ncp, amp, ncp_len); + esc_len = strlen(amp); } else { *ncp = *cp; @@ -2362,7 +2362,7 @@ xml_dump_named_datatype(hid_t type, const char *name) char *t_prefix = NULL; char *t_name = NULL; - tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); + tmp = (char *)malloc(strlen(prefix) + strlen(name) + 2); if (tmp == NULL) { indentation(dump_indent); error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); @@ -2370,9 +2370,9 @@ xml_dump_named_datatype(hid_t type, const char *name) goto done; } - HDstrcpy(tmp, prefix); - HDstrcat(tmp, "/"); - HDstrcat(tmp, name); + strcpy(tmp, prefix); + strcat(tmp, "/"); + strcat(tmp, name); /* setup */ memset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2406,7 +2406,7 @@ xml_dump_named_datatype(hid_t type, const char *name) xml_name_to_XID(type, tmp, dtxid, 100, 1); xml_name_to_XID(type, prefix, parentxid, 100, 1); - if (HDstrncmp(name, "#", (size_t)1) == 0) { + if (strncmp(name, "#", (size_t)1) == 0) { /* Special: this is an 'anonymous' NDT, deleted but still in use. We follow the dumper's undocumented practice, and @@ -2423,7 +2423,7 @@ xml_dump_named_datatype(hid_t type, const char *name) h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\">", - xmlnsprefix, name, dtxid, parentxid, HDstrcmp(prefix, "") ? t_prefix : "/"); + xmlnsprefix, name, dtxid, parentxid, strcmp(prefix, "") ? t_prefix : "/"); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); } @@ -2438,7 +2438,7 @@ xml_dump_named_datatype(hid_t type, const char *name) "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " "H5Path=\"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">", xmlnsprefix, t_name, dtxid, t_tmp, parentxid, - (HDstrcmp(prefix, "") ? t_prefix : "/")); + (strcmp(prefix, "") ? t_prefix : "/")); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -2617,12 +2617,12 @@ xml_dump_group(hid_t gid, const char *name) string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; - if (HDstrcmp(name, "/") == 0) { + if (strcmp(name, "/") == 0) { isRoot = 1; - tmp = HDstrdup("/"); + tmp = strdup("/"); } else { - tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); + tmp = (char *)malloc(strlen(prefix) + strlen(name) + 2); if (tmp == NULL) { indentation(dump_indent); error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); @@ -2630,11 +2630,11 @@ xml_dump_group(hid_t gid, const char *name) return; } - HDstrcpy(tmp, prefix); - par = HDstrdup(tmp); - cp = HDstrrchr(par, '/'); + strcpy(tmp, prefix); + par = strdup(tmp); + cp = strrchr(par, '/'); if (cp) { - if ((cp == par) && HDstrlen(par) > 1) + if ((cp == par) && strlen(par) > 1) *(cp + 1) = '\0'; else *cp = '\0'; @@ -2791,7 +2791,7 @@ xml_dump_group(hid_t gid, const char *name) type = H5Dget_type(dset); H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str); - HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); + snprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); H5free_memory(obj_tok_str); dump_function_table->dump_named_datatype_function(type, type_name); @@ -2884,7 +2884,7 @@ xml_dump_group(hid_t gid, const char *name) type = H5Dget_type(dset); H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str); - HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); + snprintf(type_name, sizeof(type_name), "#%s", obj_tok_str); H5free_memory(obj_tok_str); dump_function_table->dump_named_datatype_function(type, type_name); @@ -3181,10 +3181,10 @@ xml_print_strs(hid_t did, int source) if (is_vlstr) { onestring = *(char **)((void *)bp); if (onestring) - str_size = HDstrlen(onestring); + str_size = strlen(onestring); } else { - HDstrncpy(onestring, bp, tsiz); + strncpy(onestring, bp, tsiz); str_size = tsiz; } @@ -3773,7 +3773,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss char *rstr = (char *)malloc((size_t)100); char *pstr = (char *)malloc((size_t)100); - tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); + tmp = (char *)malloc(strlen(prefix) + strlen(name) + 2); if (tmp == NULL) { error_msg("buffer allocation failed\n"); h5tools_setstatus(EXIT_FAILURE); @@ -3782,9 +3782,9 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss return; } - HDstrcpy(tmp, prefix); - HDstrcat(tmp, "/"); - HDstrcat(tmp, name); + strcpy(tmp, prefix); + strcat(tmp, "/"); + strcat(tmp, name); /* setup */ memset(&buffer, 0, sizeof(h5tools_str_t)); diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 022cede..0ac4f3a 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -119,7 +119,7 @@ parse_command_line(int argc, const char *const *argv) case 'd': /* -d dname */ if (H5_optarg != NULL && *H5_optarg) - dname_g = HDstrdup(H5_optarg); + dname_g = strdup(H5_optarg); if (dname_g == NULL) { h5tools_setstatus(EXIT_FAILURE); error_msg("No dataset name `%s`\n", H5_optarg); @@ -152,7 +152,7 @@ parse_command_line(int argc, const char *const *argv) goto error; } - fname_g = HDstrdup(argv[H5_optind]); + fname_g = strdup(argv[H5_optind]); return 0; diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index af0f171..2d3574a 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -104,7 +104,7 @@ main(int argc, char *argv[]) if ((opt = (struct Options *)calloc(1, sizeof(struct Options))) == NULL) goto err; - if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { + if (argv[1] && (strcmp("-V", argv[1]) == 0)) { print_version(PROGRAMNAME); exit(EXIT_SUCCESS); } @@ -133,7 +133,7 @@ main(int argc, char *argv[]) case 1: /* counting input files */ if (opt->fcount < 29) { - (void)HDstrcpy(opt->infiles[opt->fcount].datafile, argv[i]); + (void)strcpy(opt->infiles[opt->fcount].datafile, argv[i]); in = &(opt->infiles[opt->fcount].in); opt->infiles[opt->fcount].config = 0; setDefaultValues(in, opt->fcount); @@ -150,7 +150,7 @@ main(int argc, char *argv[]) break; case 3: /* get configfile name */ - (void)HDstrcpy(opt->infiles[opt->fcount - 1].configfile, argv[i]); + (void)strcpy(opt->infiles[opt->fcount - 1].configfile, argv[i]); opt->infiles[opt->fcount - 1].config = 1; break; @@ -158,11 +158,11 @@ main(int argc, char *argv[]) break; case 5: /* get outfile found */ - if (HDstrlen(argv[i]) > MAX_PATH_NAME_LENGTH) { + if (strlen(argv[i]) > MAX_PATH_NAME_LENGTH) { (void)fprintf(stderr, err10, argv[i]); goto err; } - (void)HDstrcpy(opt->outfile, argv[i]); + (void)strcpy(opt->outfile, argv[i]); outfile_named = true; break; @@ -287,40 +287,40 @@ gtoken(char *s) * identify the token type */ if (s[0] == '-') { /* option name (or negative number) */ - len = HDstrlen(&s[1]); + len = strlen(&s[1]); switch (s[1]) { case 'o': - if (!HDstrncmp("outfile", &s[1], len)) + if (!strncmp("outfile", &s[1], len)) token = OPT_o; break; case 'c': - if (!HDstrncmp("config", &s[1], len)) + if (!strncmp("config", &s[1], len)) token = OPT_c; break; case 'h': - if (!HDstrncmp("help", &s[1], len)) + if (!strncmp("help", &s[1], len)) token = OPT_h; break; case 'd': - if (!HDstrncmp("dims", &s[1], len)) + if (!strncmp("dims", &s[1], len)) token = OPT_d; break; case 'p': - if (!HDstrncmp("path", &s[1], len)) + if (!strncmp("path", &s[1], len)) token = OPT_p; break; case 't': - if (!HDstrncmp("type", &s[1], len)) + if (!strncmp("type", &s[1], len)) token = OPT_t; break; case 's': - if (!HDstrncmp("size", &s[1], len)) + if (!strncmp("size", &s[1], len)) token = OPT_s; break; default: @@ -489,7 +489,7 @@ readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ in08 = (H5DT_INT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (HDfscanf(strm, "%hd", &temp16) != 1) { + if (fscanf(strm, "%hd", &temp16) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -521,7 +521,7 @@ readIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 0: /* TEXTIN */ for (i = 0; i < len; i++, in16++) { - if (HDfscanf(strm, "%hd", in16) != 1) { + if (fscanf(strm, "%hd", in16) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -558,7 +558,7 @@ readIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 0: /* TEXTIN */ for (i = 0; i < len; i++, in32++) { - if (HDfscanf(strm, "%d", in32) != 1) { + if (fscanf(strm, "%d", in32) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -594,7 +594,7 @@ readIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 0: /* TEXTIN */ for (i = 0; i < len; i++, in64++) { - if (HDfscanf(strm, "%s", buffer) < 1) { + if (fscanf(strm, "%s", buffer) < 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -660,7 +660,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ in08 = (H5DT_UINT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (HDfscanf(strm, "%hu", &temp16) != 1) { + if (fscanf(strm, "%hu", &temp16) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -689,7 +689,7 @@ readUIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in16++) { - if (HDfscanf(strm, "%hu", in16) != 1) { + if (fscanf(strm, "%hu", in16) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -725,7 +725,7 @@ readUIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in32++) { - if (HDfscanf(strm, "%u", in32) != 1) { + if (fscanf(strm, "%u", in32) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -761,7 +761,7 @@ readUIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in64++) { - if (HDfscanf(strm, "%s", buffer) < 1) { + if (fscanf(strm, "%s", buffer) < 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -826,7 +826,7 @@ readFloatData(FILE *strm, struct Input *in) switch (in->inputClass) { case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp32++) { - if (HDfscanf(strm, "%f", fp32) != 1) { + if (fscanf(strm, "%f", fp32) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -839,7 +839,7 @@ readFloatData(FILE *strm, struct Input *in) case 2: /*TEXTFPE */ for (i = 0; i < len; i++, fp32++) { - if (HDfscanf(strm, "%f", fp32) != 1) { + if (fscanf(strm, "%f", fp32) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -878,7 +878,7 @@ readFloatData(FILE *strm, struct Input *in) switch (in->inputClass) { case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp64++) { - if (HDfscanf(strm, "%lf", fp64) != 1) { + if (fscanf(strm, "%lf", fp64) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -891,7 +891,7 @@ readFloatData(FILE *strm, struct Input *in) case 2: /*TEXTFPE */ for (i = 0; i < len; i++, fp64++) { - if (HDfscanf(strm, "%lf", fp64) != 1) { + if (fscanf(strm, "%lf", fp64) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -964,7 +964,7 @@ processStrData(FILE *strm, struct Input *in, hid_t file_id) *------------------------------------------------------------------------- */ - while (EOF != (c = HDfgetc(strm))) + while (EOF != (c = fgetc(strm))) if (c == 10) /* eol */ nlines++; @@ -1029,7 +1029,7 @@ processStrData(FILE *strm, struct Input *in, hid_t file_id) line = 0; - while (EOF != (c = HDfgetc(strm))) { + while (EOF != (c = fgetc(strm))) { str[i] = (char)c; i++; @@ -1162,7 +1162,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) line = 0; j = 0; - while (HDfgets(str, sizeof(str), strm)) { + while (fgets(str, sizeof(str), strm)) { str1 = str; str2 = NULL; str3 = NULL; @@ -1173,24 +1173,24 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) str2 = strchr(str1, '"'); if (str2 != NULL) { #ifdef H5DEBUGIMPORT - printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2); #endif str2++; #ifdef H5DEBUGIMPORT - printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2); #endif str3 = strrchr(str2, '"'); if (str3 != NULL) { #ifdef H5DEBUGIMPORT - printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str3), str3); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str3), str3); #endif *str3 = '\0'; #ifdef H5DEBUGIMPORT - printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2); #endif - if (HDstrlen(str2) > 0) { + if (strlen(str2) > 0) { hid_t fspace_id; hsize_t start[1]; hsize_t count[1] = {1}; @@ -1461,18 +1461,18 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } - scanret = HDfscanf(strm, "%254s", key); - if ((scanret == 1) && !HDstrcmp("HDF5", key)) { + scanret = fscanf(strm, "%254s", key); + if ((scanret == 1) && !strcmp("HDF5", key)) { #ifdef H5DEBUGIMPORT int pndx; printf("\nh5dump file\n"); #endif in->h5dumpInput = 1; - scanret = HDfscanf(strm, "%254s", temp); /* filename */ - scanret = HDfscanf(strm, "%254s", temp); /* start bracket */ - scanret = HDfscanf(strm, "%254s", key); /* DATASET */ + scanret = fscanf(strm, "%254s", temp); /* filename */ + scanret = fscanf(strm, "%254s", temp); /* start bracket */ + scanret = fscanf(strm, "%254s", key); /* DATASET */ while (scanret == 1) { - if (!HDstrcmp("DATASET", key)) { /* PATH */ + if (!strcmp("DATASET", key)) { /* PATH */ #ifdef H5DEBUGIMPORT printf("h5dump DATASET key\n"); #endif @@ -1480,7 +1480,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)fprintf(stderr, err3a, infile); goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } @@ -1492,12 +1492,12 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } in->configOptionVector[PATH] = 1; - scanret = HDfscanf(strm, "%254s", temp); /* start bracket */ + scanret = fscanf(strm, "%254s", temp); /* start bracket */ #ifdef H5DEBUGIMPORT printf("h5dump DATASET %s found\n", temp); #endif - } /* if(!HDstrcmp("DATASET", key)) PATH */ - else if (!HDstrcmp("DATATYPE", key)) { /* INPUT-CLASS */ + } /* if(!strcmp("DATASET", key)) PATH */ + else if (!strcmp("DATATYPE", key)) { /* INPUT-CLASS */ #ifdef H5DEBUGIMPORT printf("h5dump DATATYPE key\n"); #endif @@ -1506,7 +1506,7 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } @@ -1542,27 +1542,27 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT printf("h5dump DATATYPE STRING found\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATATYPE STRING %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */ + if (fscanf(strm, "%254s", temp) != 1) { /* string properties */ (void)fprintf(stderr, "%s", err18); goto error; } while (get_next_prop) { - if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */ - if (HDfscanf(strm, "%254s", temp) != 1) { + if (!strcmp("STRSIZE", temp)) { /* STRSIZE */ + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err19); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATATYPE STRING STRSIZE %s found\n", temp); #endif - if (HDstrcmp("H5T_VARIABLE;", temp) != 0) { + if (strcmp("H5T_VARIABLE;", temp) != 0) { char *more = temp; ival = (int)strtol(more, &more, 10); if (getInputSize(in, ival) == -1) { @@ -1574,8 +1574,8 @@ processConfigurationFile(char *infile, struct Input *in) #endif } } - else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */ - if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */ + else if (!strcmp("STRPAD", temp)) { /* STRPAD */ + if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */ (void)fprintf(stderr, "%s", err18); goto error; } @@ -1583,8 +1583,8 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump DATATYPE STRING STRPAD %s found\n", temp); #endif } - else if (!HDstrcmp("CSET", key)) { /* CSET */ - if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */ + else if (!strcmp("CSET", key)) { /* CSET */ + if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */ (void)fprintf(stderr, "%s", err18); goto error; } @@ -1592,69 +1592,69 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump DATATYPE STRING CSET %s found\n", temp); #endif } - else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */ - if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */ + else if (!strcmp("CTYPE", temp)) { /* CTYPE */ + if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */ (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATATYPE STRING CTYPE %s found\n", temp); #endif - } /* if(!HDstrcmp("CSET", key)) */ - if (HDfscanf(strm, "%254s", temp) != 1) { + } /* if(!strcmp("CSET", key)) */ + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATATYPE STRING %s found\n", temp); #endif - if (!HDstrcmp("}", temp)) { /* end bracket */ + if (!strcmp("}", temp)) { /* end bracket */ get_next_prop = 0; } - } /* while (get_next_prop) */ - } /* if(kindex == 5) STRING */ - } /* else if(!HDstrcmp("DATATYPE", key)) INPUT-CLASS */ - else if (!HDstrcmp("DATASPACE", key)) { /* RANK and DIMENSIONS */ + } /* while (get_next_prop) */ + } /* if(kindex == 5) STRING */ + } /* else if(!strcmp("DATATYPE", key)) INPUT-CLASS */ + else if (!strcmp("DATASPACE", key)) { /* RANK and DIMENSIONS */ hsize_t temp_dims[MAX_NUM_DIMENSION]; #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE key\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } - if (!HDstrcmp("SCALAR", temp)) { /* SCALAR */ + if (!strcmp("SCALAR", temp)) { /* SCALAR */ in->rank = 0; - } /* if(!HDstrcmp("SCALAR", key)) */ - else if (!HDstrcmp("NULL", temp)) { /* NULL */ + } /* if(!strcmp("SCALAR", key)) */ + else if (!strcmp("NULL", temp)) { /* NULL */ (void)fprintf(stderr, err6b, infile); goto error; - } /* else if(!HDstrcmp("NULL", key)) */ - else if (!HDstrcmp("SIMPLE", temp)) { /* SIMPLE */ + } /* else if(!strcmp("NULL", key)) */ + else if (!strcmp("SIMPLE", temp)) { /* SIMPLE */ int icount = 0; #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE found\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (!HDstrcmp("(", temp)) { /* start paren */ + if (!strcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)fprintf(stderr, err16c, infile); goto error; } @@ -1664,14 +1664,14 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; temp_dims[icount] = strtoull(more, &more, 10); - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (!HDstrcmp(")", temp)) { /* end paren */ + if (!strcmp(")", temp)) { /* end paren */ in->rank = ++icount; in->configOptionVector[RANK] = 1; get_next_dim = 0; @@ -1703,38 +1703,38 @@ processConfigurationFile(char *infile, struct Input *in) printf("\n"); #endif in->configOptionVector[DIM] = 1; - } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!strcmp("(", key)) start paren */ else { (void)fprintf(stderr, err5b, infile); goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (!HDstrcmp("/", temp)) { /* / max dims */ + if (!strcmp("/", temp)) { /* / max dims */ if ((in->maxsizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (!HDstrcmp("(", temp)) { /* start paren */ + if (!strcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE process max dim values\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */ + if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */ (void)fprintf(stderr, err16c, infile); goto error; } @@ -1745,8 +1745,8 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE get max dim value\n"); #endif - if (!HDstrcmp("H5S_UNLIMITED", temp) || - !HDstrcmp("H5S_UNLIMITED,", temp)) { /* unlimited */ + if (!strcmp("H5S_UNLIMITED", temp) || + !strcmp("H5S_UNLIMITED,", temp)) { /* unlimited */ in->maxsizeOfDimension[i] = H5S_UNLIMITED; in->configOptionVector[EXTEND] = 1; } @@ -1754,14 +1754,14 @@ processConfigurationFile(char *infile, struct Input *in) char *more = temp; in->maxsizeOfDimension[i] = strtoull(more, &more, 10); } - if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */ (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (!HDstrcmp(")", temp)) { /* end paren */ + if (!strcmp(")", temp)) { /* end paren */ get_next_dim = 0; } else { /* comma */ @@ -1780,57 +1780,57 @@ processConfigurationFile(char *infile, struct Input *in) printf("\n"); printf("h5dump DATASPACE SIMPLE get max dim finished\n"); #endif - } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!strcmp("(", key)) start paren */ else { (void)fprintf(stderr, err16c, infile); goto error; } - scanret = HDfscanf(strm, "%254s", temp); /* end bracket */ + scanret = fscanf(strm, "%254s", temp); /* end bracket */ #ifdef H5DEBUGIMPORT printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - } /* if(!HDstrcmp("/", key)) max dims separator */ - } /* else if(!HDstrcmp("SIMPLE", key)) */ + } /* if(!strcmp("/", key)) max dims separator */ + } /* else if(!strcmp("SIMPLE", key)) */ else { (void)fprintf(stderr, err5b, infile); goto error; } - } /* else if(!HDstrcmp("DATASPACE", key)) RANK and DIMENSIONS */ - else if (!HDstrcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */ + } /* else if(!strcmp("DATASPACE", key)) RANK and DIMENSIONS */ + else if (!strcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */ #ifdef H5DEBUGIMPORT printf("h5dump STORAGE_LAYOUT key\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump STORAGE_LAYOUT %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */ + if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump STORAGE_LAYOUT %s found\n", temp); #endif - if (!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */ + if (!strcmp("CHUNKED", temp)) { /* CHUNKED */ if ((in->sizeOfChunk = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "Unable to allocate dynamic memory.\n"); goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif - if (!HDstrcmp("(", temp)) { /* start paren */ + if (!strcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int icount = 0; - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)fprintf(stderr, err16c, infile); goto error; } @@ -1840,14 +1840,14 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; in->sizeOfChunk[icount] = strtoull(more, &more, 10); - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif - if (!HDstrcmp(")", temp)) { /* end paren */ + if (!strcmp(")", temp)) { /* end paren */ in->configOptionVector[RANK] = 1; get_next_dim = 0; } @@ -1867,20 +1867,20 @@ processConfigurationFile(char *infile, struct Input *in) printf("\n"); #endif in->configOptionVector[DIM] = 1; - } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!strcmp("(", key)) start paren */ else { (void)fprintf(stderr, err5b, infile); goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */ + if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif - if (!HDstrcmp("SIZE", temp)) { /* SIZE */ - if (HDfscanf(strm, "%d", (&ival)) != 1) { + if (!strcmp("SIZE", temp)) { /* SIZE */ + if (fscanf(strm, "%d", (&ival)) != 1) { (void)fprintf(stderr, "%s", err19); goto error; } @@ -1888,8 +1888,8 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival); #endif } - while (HDstrcmp("}", temp) != 0) { - if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ + while (strcmp("}", temp) != 0) { + if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)fprintf(stderr, "%s", err18); goto error; } @@ -1898,52 +1898,52 @@ processConfigurationFile(char *infile, struct Input *in) #endif } in->configOptionVector[CHUNK] = 1; - } /* if(!HDstrcmp("CHUNKED", key)) CHUNKED */ - } /* else if(!HDstrcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */ - else if (!HDstrcmp("FILTERS", key)) { /* FILTERS */ + } /* if(!strcmp("CHUNKED", key)) CHUNKED */ + } /* else if(!strcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */ + else if (!strcmp("FILTERS", key)) { /* FILTERS */ #ifdef H5DEBUGIMPORT printf("h5dump FILTERS key\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump FILTERS %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump FILTERS %s found\n", temp); #endif - if (!HDstrcmp("COMPRESSION", temp)) { /* COMPRESSION */ + if (!strcmp("COMPRESSION", temp)) { /* COMPRESSION */ #ifdef H5DEBUGIMPORT printf("h5dump FILTERS COMPRESSION found\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */ + if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */ (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */ (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */ + if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */ (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif - if (HDfscanf(strm, "%d", (&ival)) != 1) { + if (fscanf(strm, "%d", (&ival)) != 1) { (void)fprintf(stderr, "%s", err19); goto error; } @@ -1951,7 +1951,7 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival); #endif in->compressionParam = ival; - if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)fprintf(stderr, "%s", err18); goto error; } @@ -1961,19 +1961,19 @@ processConfigurationFile(char *infile, struct Input *in) in->compressionType = 0; /* ONLY GZIP supported */ in->configOptionVector[COMPRESS] = 1; } - else if (!HDstrcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */ + else if (!strcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */ #ifdef H5DEBUGIMPORT printf("h5dump FILTERS CONTIGUOUS found\n"); #endif in->configOptionVector[COMPRESS] = 0; } - else if (!HDstrcmp("NONE", temp)) { /* NONE */ + else if (!strcmp("NONE", temp)) { /* NONE */ #ifdef H5DEBUGIMPORT printf("h5dump FILTERS NONE found\n"); #endif in->configOptionVector[COMPRESS] = 0; } - if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)fprintf(stderr, "%s", err18); goto error; } @@ -1981,20 +1981,20 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump FILTERS %s found\n", temp); #endif } - else if (!HDstrcmp("SUBSET", key)) { /* reduce dimensions */ + else if (!strcmp("SUBSET", key)) { /* reduce dimensions */ hsize_t temp_dims[MAX_NUM_DIMENSION]; int get_next_prop = 1; #ifdef H5DEBUGIMPORT printf("h5dump SUBSET key\n"); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)fprintf(stderr, err20, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump SUBSET %s found\n", temp); #endif - if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */ + if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */ (void)fprintf(stderr, "%s", err18); goto error; } @@ -2002,20 +2002,20 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump SUBSET %s found\n", temp); #endif while (get_next_prop) { - if (!HDstrcmp("COUNT", temp)) { /* COUNT */ + if (!strcmp("COUNT", temp)) { /* COUNT */ int icount = 0; - if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump SUBSET %s found\n", temp); #endif - if (!HDstrcmp("(", temp)) { /* start paren */ + if (!strcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)fprintf(stderr, err16c, infile); goto error; } @@ -2025,14 +2025,14 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; temp_dims[icount] = strtoull(more, &more, 10); - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump SUBSET COUNT %s found\n", temp); #endif - if (!HDstrcmp(");", temp)) { /* end paren */ + if (!strcmp(");", temp)) { /* end paren */ in->rank = ++icount; in->configOptionVector[RANK] = 1; get_next_dim = 0; @@ -2056,22 +2056,22 @@ processConfigurationFile(char *infile, struct Input *in) printf("\n"); #endif in->configOptionVector[DIM] = 1; - } /* if(!HDstrcmp("(", key)) start paren */ - } /* if(!HDstrcmp("COUNT", temp)) COUNT */ - if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */ + } /* if(!strcmp("(", key)) start paren */ + } /* if(!strcmp("COUNT", temp)) COUNT */ + if (!strcmp("BLOCK", temp)) { /* BLOCK */ int icount = 0; - if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump SUBSET %s found\n", temp); #endif - if (!HDstrcmp("(", temp)) { /* start paren */ + if (!strcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)fprintf(stderr, err16c, infile); goto error; } @@ -2081,14 +2081,14 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; temp_dims[icount] = strtoull(more, &more, 10); - if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump SUBSET BLOCK %s found\n", temp); #endif - if (!HDstrcmp(");", temp)) { /* end paren */ + if (!strcmp(");", temp)) { /* end paren */ in->rank = ++icount; in->configOptionVector[RANK] = 1; get_next_dim = 0; @@ -2112,28 +2112,28 @@ processConfigurationFile(char *infile, struct Input *in) printf("\n"); #endif in->configOptionVector[DIM] = 1; - } /* if(!HDstrcmp("(", key)) start paren */ - } /* if(!HDstrcmp("BLOCK", temp)) BLOCK */ - if (HDfscanf(strm, "%254s", temp) != 1) { + } /* if(!strcmp("(", key)) start paren */ + } /* if(!strcmp("BLOCK", temp)) BLOCK */ + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT printf("h5dump SUBSET %s found\n", temp); #endif - if (!HDstrcmp("}", temp)) { /* end bracket */ + if (!strcmp("}", temp)) { /* end bracket */ get_next_prop = 0; } - } /* while (get_next_prop) */ - } /* else if(!HDstrcmp("SUBSET", key)) */ - else if (!HDstrcmp("DATA", key)) { /* FINISHED */ + } /* while (get_next_prop) */ + } /* else if(!strcmp("SUBSET", key)) */ + else if (!strcmp("DATA", key)) { /* FINISHED */ #ifdef H5DEBUGIMPORT printf("h5dump DATA key\n"); #endif scanret = 0; break; } - scanret = HDfscanf(strm, "%254s", key); + scanret = fscanf(strm, "%254s", key); } #ifdef H5DEBUGIMPORT printf("h5dump path"); @@ -2174,7 +2174,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)fprintf(stderr, err3a, infile); goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } @@ -2191,7 +2191,7 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err18); goto error; } @@ -2218,7 +2218,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)fprintf(stderr, err5a, infile); goto error; } - if (HDfscanf(strm, "%254d", (&ival)) != 1) { + if (fscanf(strm, "%254d", (&ival)) != 1) { (void)fprintf(stderr, "%s", err19); goto error; } @@ -2415,7 +2415,7 @@ processConfigurationFile(char *infile, struct Input *in) default: break; } - scanret = HDfscanf(strm, "%254s", key); + scanret = fscanf(strm, "%254s", key); } /* @@ -2505,7 +2505,7 @@ mapKeywordToIndex(char *key) int i; for (i = 0; i < NUM_KEYS; i++) - if (!HDstrcmp(keytable[i], key)) + if (!strcmp(keytable[i], key)) return i; return -1; } @@ -2518,22 +2518,22 @@ parsePathInfo(struct path_info *path, char *temp) int i = 0; const char *err1 = "Path string larger than MAX_PATH_NAME_LENGTH.\n"; - token = HDstrtok(temp, delimiter); - if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { + token = strtok(temp, delimiter); + if (strlen(token) >= MAX_PATH_NAME_LENGTH) { (void)fprintf(stderr, "%s", err1); return (-1); } - HDstrcpy(path->group[i++], token); + strcpy(path->group[i++], token); while (1) { - token = HDstrtok(NULL, delimiter); + token = strtok(NULL, delimiter); if (token == NULL) break; - if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { + if (strlen(token) >= MAX_PATH_NAME_LENGTH) { (void)fprintf(stderr, "%s", err1); return (-1); } - HDstrcpy(path->group[i++], token); + strcpy(path->group[i++], token); } path->count = i; return (0); @@ -2548,12 +2548,12 @@ parseDimensions(struct Input *in, char *strm) int i = 0; const char *err1 = "Unable to allocate dynamic memory.\n"; - HDstrncpy(temp, strm, sizeof(temp)); + strncpy(temp, strm, sizeof(temp)); temp[sizeof(temp) - 1] = '\0'; - HDstrtok(temp, delimiter); + strtok(temp, delimiter); while (1) { - token = HDstrtok(NULL, delimiter); + token = strtok(NULL, delimiter); if (token == NULL) break; i++; @@ -2565,12 +2565,12 @@ parseDimensions(struct Input *in, char *strm) } i = 0; - HDstrncpy(temp, strm, sizeof(temp)); + strncpy(temp, strm, sizeof(temp)); temp[sizeof(temp) - 1] = '\0'; - in->sizeOfDimension[i++] = strtoull(HDstrtok(temp, delimiter), NULL, BASE_10); + in->sizeOfDimension[i++] = strtoull(strtok(temp, delimiter), NULL, BASE_10); while (1) { - token = HDstrtok(NULL, delimiter); + token = strtok(NULL, delimiter); if (token == NULL) break; in->sizeOfDimension[i++] = strtoull(token, NULL, BASE_10); @@ -2586,7 +2586,7 @@ getOutputClass(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output class.\n"; - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -2606,7 +2606,7 @@ OutputClassStrToInt(char *temp) int i; char classKeywordTable[3][15] = {"IN", "FP", "UIN"}; for (i = 0; i < 3; i++) - if (!HDstrcmp(classKeywordTable[i], temp)) + if (!strcmp(classKeywordTable[i], temp)) return i; return -1; @@ -2621,7 +2621,7 @@ getOutputSize(struct Input *in, FILE *strm) const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for output size.\n"; - if (HDfscanf(strm, "%d", (&ival)) != 1) { + if (fscanf(strm, "%d", (&ival)) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -2658,7 +2658,7 @@ getInputClassType(struct Input *in, char *buffer) const char *err2 = "Invalid value for output architecture.\n"; const char *err3 = "Invalid value for input byte-order.\n"; - if (!HDstrcmp(buffer, "H5T_STD_I8BE")) { + if (!strcmp(buffer, "H5T_STD_I8BE")) { in->inputSize = 8; in->configOptionVector[INPUT_SIZE] = 1; @@ -2679,7 +2679,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I8LE")) { + else if (!strcmp(buffer, "H5T_STD_I8LE")) { in->inputSize = 8; in->configOptionVector[INPUT_SIZE] = 1; @@ -2700,7 +2700,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I16BE")) { + else if (!strcmp(buffer, "H5T_STD_I16BE")) { in->inputSize = 16; in->configOptionVector[INPUT_SIZE] = 1; @@ -2721,7 +2721,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I16LE")) { + else if (!strcmp(buffer, "H5T_STD_I16LE")) { in->inputSize = 16; in->configOptionVector[INPUT_SIZE] = 1; @@ -2742,7 +2742,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I32BE")) { + else if (!strcmp(buffer, "H5T_STD_I32BE")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -2763,7 +2763,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I32LE")) { + else if (!strcmp(buffer, "H5T_STD_I32LE")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -2784,7 +2784,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I64BE")) { + else if (!strcmp(buffer, "H5T_STD_I64BE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -2805,7 +2805,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_I64LE")) { + else if (!strcmp(buffer, "H5T_STD_I64LE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -2826,7 +2826,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_STD_U8BE")) { + else if (!strcmp(buffer, "H5T_STD_U8BE")) { in->inputSize = 8; in->configOptionVector[INPUT_SIZE] = 1; @@ -2847,7 +2847,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U8LE")) { + else if (!strcmp(buffer, "H5T_STD_U8LE")) { in->inputSize = 8; in->configOptionVector[INPUT_SIZE] = 1; @@ -2868,7 +2868,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U16BE")) { + else if (!strcmp(buffer, "H5T_STD_U16BE")) { in->inputSize = 16; in->configOptionVector[INPUT_SIZE] = 1; @@ -2889,7 +2889,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U16LE")) { + else if (!strcmp(buffer, "H5T_STD_U16LE")) { in->inputSize = 16; in->configOptionVector[INPUT_SIZE] = 1; @@ -2910,7 +2910,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U32BE")) { + else if (!strcmp(buffer, "H5T_STD_U32BE")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -2931,7 +2931,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U32LE")) { + else if (!strcmp(buffer, "H5T_STD_U32LE")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -2952,7 +2952,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U64BE")) { + else if (!strcmp(buffer, "H5T_STD_U64BE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -2973,7 +2973,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_STD_U64LE")) { + else if (!strcmp(buffer, "H5T_STD_U64LE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -2994,7 +2994,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_SCHAR")) { + else if (!strcmp(buffer, "H5T_NATIVE_SCHAR")) { in->inputSize = 8; in->configOptionVector[INPUT_SIZE] = 1; @@ -3006,7 +3006,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_UCHAR")) { + else if (!strcmp(buffer, "H5T_NATIVE_UCHAR")) { in->inputSize = 8; in->configOptionVector[INPUT_SIZE] = 1; @@ -3018,7 +3018,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_SHORT")) { + else if (!strcmp(buffer, "H5T_NATIVE_SHORT")) { in->inputSize = 16; in->configOptionVector[INPUT_SIZE] = 1; @@ -3030,7 +3030,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_USHORT")) { + else if (!strcmp(buffer, "H5T_NATIVE_USHORT")) { in->inputSize = 16; in->configOptionVector[INPUT_SIZE] = 1; @@ -3042,7 +3042,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_INT")) { + else if (!strcmp(buffer, "H5T_NATIVE_INT")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3054,7 +3054,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_UINT")) { + else if (!strcmp(buffer, "H5T_NATIVE_UINT")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3066,7 +3066,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_LONG")) { + else if (!strcmp(buffer, "H5T_NATIVE_LONG")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3078,7 +3078,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_ULONG")) { + else if (!strcmp(buffer, "H5T_NATIVE_ULONG")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3090,7 +3090,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_LLONG")) { + else if (!strcmp(buffer, "H5T_NATIVE_LLONG")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -3102,7 +3102,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 4; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_ULLONG")) { + else if (!strcmp(buffer, "H5T_NATIVE_ULLONG")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -3114,7 +3114,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 7; } - else if (!HDstrcmp(buffer, "H5T_IEEE_F32BE")) { + else if (!strcmp(buffer, "H5T_IEEE_F32BE")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3135,7 +3135,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_IEEE_F32LE")) { + else if (!strcmp(buffer, "H5T_IEEE_F32LE")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3156,7 +3156,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_IEEE_F64BE")) { + else if (!strcmp(buffer, "H5T_IEEE_F64BE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -3177,7 +3177,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_IEEE_F64LE")) { + else if (!strcmp(buffer, "H5T_IEEE_F64LE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -3198,19 +3198,19 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_VAX_F32")) { + else if (!strcmp(buffer, "H5T_VAX_F32")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_VAX_F64")) { + else if (!strcmp(buffer, "H5T_VAX_F64")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_FLOAT")) { + else if (!strcmp(buffer, "H5T_NATIVE_FLOAT")) { in->inputSize = 32; in->configOptionVector[INPUT_SIZE] = 1; @@ -3222,7 +3222,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_DOUBLE")) { + else if (!strcmp(buffer, "H5T_NATIVE_DOUBLE")) { in->inputSize = 64; in->configOptionVector[INPUT_SIZE] = 1; @@ -3234,7 +3234,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_NATIVE_LDOUBLE")) { + else if (!strcmp(buffer, "H5T_NATIVE_LDOUBLE")) { in->inputSize = H5_SIZEOF_LONG_DOUBLE; in->configOptionVector[INPUT_SIZE] = 1; @@ -3246,14 +3246,14 @@ getInputClassType(struct Input *in, char *buffer) kindex = 3; } - else if (!HDstrcmp(buffer, "H5T_TIME: not yet implemented")) { + else if (!strcmp(buffer, "H5T_TIME: not yet implemented")) { kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STRING")) { + else if (!strcmp(buffer, "H5T_STRING")) { kindex = 5; } /* case H5T_BITFIELD: */ - else if (!HDstrcmp(buffer, "H5T_STD_B8BE")) { + else if (!strcmp(buffer, "H5T_STD_B8BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3272,7 +3272,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B8LE")) { + else if (!strcmp(buffer, "H5T_STD_B8LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3291,7 +3291,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B16BE")) { + else if (!strcmp(buffer, "H5T_STD_B16BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3310,7 +3310,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B16LE")) { + else if (!strcmp(buffer, "H5T_STD_B16LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3329,7 +3329,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B32BE")) { + else if (!strcmp(buffer, "H5T_STD_B32BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3348,7 +3348,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B32LE")) { + else if (!strcmp(buffer, "H5T_STD_B32LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3367,7 +3367,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B64BE")) { + else if (!strcmp(buffer, "H5T_STD_B64BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3386,7 +3386,7 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } - else if (!HDstrcmp(buffer, "H5T_STD_B64LE")) { + else if (!strcmp(buffer, "H5T_STD_B64LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { (void)fprintf(stderr, "%s", err2); @@ -3406,27 +3406,27 @@ getInputClassType(struct Input *in, char *buffer) kindex = -1; } /* case H5T_OPAQUE: */ - else if (!HDstrcmp(buffer, "H5T_OPAQUE")) { + else if (!strcmp(buffer, "H5T_OPAQUE")) { kindex = -1; } /* case H5T_COMPOUND: */ - else if (!HDstrcmp(buffer, "H5T_COMPOUND")) { + else if (!strcmp(buffer, "H5T_COMPOUND")) { kindex = -1; } /* case H5T_REFERENCE: */ - else if (!HDstrcmp(buffer, "H5T_REFERENCE")) { + else if (!strcmp(buffer, "H5T_REFERENCE")) { kindex = -1; } /* case H5T_ENUM: */ - else if (!HDstrcmp(buffer, "H5T_ENUM")) { + else if (!strcmp(buffer, "H5T_ENUM")) { kindex = -1; } /* case H5T_VLEN: */ - else if (!HDstrcmp(buffer, "H5T_VLEN")) { + else if (!strcmp(buffer, "H5T_VLEN")) { kindex = -1; } /* case H5T_ARRAY: */ - else if (!HDstrcmp(buffer, "H5T_ARRAY")) { + else if (!strcmp(buffer, "H5T_ARRAY")) { kindex = -1; } @@ -3454,7 +3454,7 @@ InputClassStrToInt(char *temp) int i; char classKeywordTable[8][15] = {"TEXTIN", "TEXTFP", "TEXTFPE", "FP", "IN", "STR", "TEXTUIN", "UIN"}; for (i = 0; i < 8; i++) - if (!HDstrcmp(classKeywordTable[i], temp)) + if (!strcmp(classKeywordTable[i], temp)) return i; return -1; } @@ -3484,7 +3484,7 @@ getInputByteOrder(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for input byte-order.\n"; - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3506,7 +3506,7 @@ getRank(struct Input *in, FILE *strm) const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for rank.\n"; - if (HDfscanf(strm, "%d", (&ival)) != 1) { + if (fscanf(strm, "%d", (&ival)) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3535,7 +3535,7 @@ getDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (HDfscanf(strm, "%llu", (&ullval)) == 1) + while (fscanf(strm, "%llu", (&ullval)) == 1) in->sizeOfDimension[i++] = ullval; if (in->rank != i) { @@ -3561,7 +3561,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (HDfscanf(strm, "%llu", (&ullval)) == 1) + while (fscanf(strm, "%llu", (&ullval)) == 1) in->sizeOfChunk[i++] = ullval; if (in->rank != i) { @@ -3594,7 +3594,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (HDfscanf(strm, "%lld", (&llval)) == 1) { + while (fscanf(strm, "%lld", (&llval)) == 1) { if (llval == -1) in->maxsizeOfDimension[i++] = H5S_UNLIMITED; else @@ -3624,7 +3624,7 @@ getOutputArchitecture(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output architecture.\n"; - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3644,7 +3644,7 @@ OutputArchStrToInt(const char *temp) int i; char outputArchKeywordTable[8][15] = {"NATIVE", "STD", "IEEE", "INTEL", "CRAY", "MIPS", "ALPHA", "UNIX"}; for (i = 0; i < 8; i++) - if (!HDstrcmp(outputArchKeywordTable[i], temp)) + if (!strcmp(outputArchKeywordTable[i], temp)) return i; return -1; } @@ -3657,7 +3657,7 @@ getOutputByteOrder(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output byte-order.\n"; - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3677,7 +3677,7 @@ OutputByteOrderStrToInt(const char *temp) int i; char outputByteOrderKeywordTable[2][15] = {"BE", "LE"}; for (i = 0; i < 2; i++) - if (!HDstrcmp(outputByteOrderKeywordTable[i], temp)) + if (!strcmp(outputByteOrderKeywordTable[i], temp)) return i; return -1; } @@ -3690,7 +3690,7 @@ getCompressionType(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for compression.\n"; - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3713,7 +3713,7 @@ CompressionTypeStrToInt(char *temp) int i; char CompressionTypeKeywordTable[1][15] = {"GZIP"}; for (i = 0; i < 1; i++) - if (!HDstrcmp(CompressionTypeKeywordTable[i], temp)) + if (!strcmp(CompressionTypeKeywordTable[i], temp)) return i; return -1; } @@ -3732,7 +3732,7 @@ getCompressionParameter(struct Input *in, FILE *strm) switch (in->compressionType) { case 0: /* GZIP */ - if (HDfscanf(strm, "%d", (&ival)) != 1) { + if (fscanf(strm, "%d", (&ival)) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3757,14 +3757,14 @@ getExternalFilename(struct Input *in, FILE *strm) char temp[255]; const char *err1 = "Unable to get 'string' value.\n"; - if (HDfscanf(strm, "%254s", temp) != 1) { + if (fscanf(strm, "%254s", temp) != 1) { (void)fprintf(stderr, "%s", err1); return (-1); } - temp_len = HDstrlen(temp); + temp_len = strlen(temp); in->externFilename = (char *)malloc((temp_len + 1) * sizeof(char)); - (void)HDstrcpy(in->externFilename, temp); + (void)strcpy(in->externFilename, temp); in->externFilename[temp_len] = '\0'; return (0); } @@ -3785,10 +3785,10 @@ setDefaultValues(struct Input *in, int count) in->rank = 0; in->path.count = 1; - HDstrcpy(temp, "dataset"); - HDsnprintf(num, sizeof(num), "%d", count); - HDstrcat(temp, num); - HDstrcpy(in->path.group[0], temp); + strcpy(temp, "dataset"); + snprintf(num, sizeof(num), "%d", count); + strcat(temp, num); + strcpy(in->path.group[0], temp); in->outputArchitecture = 0; /* NATIVE */ in->outputByteOrder = -1; /* use default */ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index b5bf208..9fea8b8 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -111,13 +111,13 @@ parse_command_line(int argc, const char *const *argv) while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = HDstrdup(H5_optarg); + output_file = strdup(H5_optarg); break; case 'i': - input_file = HDstrdup(H5_optarg); + input_file = strdup(H5_optarg); break; case 'u': - ub_file = HDstrdup(H5_optarg); + ub_file = strdup(H5_optarg); break; case 'c': do_clobber = true; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 517cea4..b2d1e4d 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -98,19 +98,19 @@ parse_command_line(int argc, const char *const *argv) while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = HDstrdup(H5_optarg); + output_file = strdup(H5_optarg); if (output_file) h5tools_set_data_output_file(output_file, 1); break; case 'i': - input_file = HDstrdup(H5_optarg); + input_file = strdup(H5_optarg); if (input_file) h5tools_set_input_file(input_file, 1); break; case 'u': - ub_file = HDstrdup(H5_optarg); + ub_file = strdup(H5_optarg); if (ub_file) h5tools_set_output_file(ub_file, 1); else diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index fa9c565..ae002a3 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -361,7 +361,7 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, con int n; if (show_file_name_g) - HDsnprintf(fullname, sizeof(fullname), "%s/%s", iter->fname, oname + iter->name_start); + snprintf(fullname, sizeof(fullname), "%s/%s", iter->fname, oname + iter->name_start); else name = oname + iter->name_start; @@ -372,7 +372,7 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, con const char *last_sep; /* The location of the last group separator */ /* Find the last component of the path name */ - if (NULL == (last_sep = HDstrrchr(name, '/'))) + if (NULL == (last_sep = strrchr(name, '/'))) last_sep = name; else { last_sep++; @@ -1381,9 +1381,9 @@ dump_dataset_values(hid_t dset) } outputformat.arr_linebreak = 0; /* Floating point types should display full precision */ - HDsnprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG); + snprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG); outputformat.fmt_float = fmt_float; - HDsnprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG); + snprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG); outputformat.fmt_double = fmt_double; if (hexdump_g) { @@ -1397,7 +1397,7 @@ dump_dataset_values(hid_t dset) outputformat.ascii = true; outputformat.elmt_suf1 = ""; outputformat.elmt_suf2 = ""; - HDsnprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre); + snprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre); outputformat.line_pre = string_prefix; outputformat.line_suf = "\""; } @@ -1550,9 +1550,9 @@ dump_attribute_values(hid_t attr) } outputformat.arr_linebreak = 0; /* Floating point types should display full precision */ - HDsnprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG); + snprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG); outputformat.fmt_float = fmt_float; - HDsnprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG); + snprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG); outputformat.fmt_double = fmt_double; if (hexdump_g) { @@ -1566,7 +1566,7 @@ dump_attribute_values(hid_t attr) outputformat.ascii = true; outputformat.elmt_suf1 = ""; outputformat.elmt_suf2 = ""; - HDsnprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre); + snprintf(string_prefix, sizeof(string_prefix), "%s\"", outputformat.line_pre); outputformat.line_pre = string_prefix; outputformat.line_suf = "\""; } @@ -1995,7 +1995,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) filt_id = H5Pget_filter2(dcpl, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); f_name[sizeof(f_name) - 1] = '\0'; - HDsnprintf(s, sizeof(s), "Filter-%d:", i); + snprintf(s, sizeof(s), "Filter-%d:", i); h5tools_str_append(&buffer, " %-10s %s-%u %s {", s, (f_name[0] ? f_name : "method"), (unsigned)filt_id, ((filt_flags & H5Z_FLAG_OPTIONAL) ? "OPT" : "")); for (cd_num = 0; cd_num < cd_nelmts; cd_num++) @@ -2182,7 +2182,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi else tm = HDlocaltime(&(oinfo->mtime)); if (tm) { - HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); + strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " %-10s %s\n", "Modified:", buf); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, @@ -2700,88 +2700,88 @@ main(int argc, char *argv[]) /* Switches come before non-switch arguments */ for (argno = 1; argno < argc && '-' == argv[argno][0]; argno++) { - if (!HDstrcmp(argv[argno], "--")) { + if (!strcmp(argv[argno], "--")) { /* Last switch */ argno++; break; } - else if (!HDstrcmp(argv[argno], "--help")) { + else if (!strcmp(argv[argno], "--help")) { usage(); leave(EXIT_SUCCESS); } - else if (!HDstrcmp(argv[argno], "--address")) { + else if (!strcmp(argv[argno], "--address")) { address_g = true; } - else if (!HDstrcmp(argv[argno], "--data")) { + else if (!strcmp(argv[argno], "--data")) { data_g = true; } - else if (!HDstrcmp(argv[argno], "--enable-error-stack")) { + else if (!strcmp(argv[argno], "--enable-error-stack")) { enable_error_stack = 1; } - else if (!HDstrcmp(argv[argno], "--errors")) { + else if (!strcmp(argv[argno], "--errors")) { /* deprecated --errors */ enable_error_stack = 1; } - else if (!HDstrcmp(argv[argno], "--follow-symlinks")) { + else if (!strcmp(argv[argno], "--follow-symlinks")) { follow_symlink_g = true; } - else if (!HDstrcmp(argv[argno], "--no-dangling-links")) { + else if (!strcmp(argv[argno], "--no-dangling-links")) { no_dangling_link_g = true; } - else if (!HDstrcmp(argv[argno], "--external")) { + else if (!strcmp(argv[argno], "--external")) { follow_elink_g = true; } - else if (!HDstrcmp(argv[argno], "--full")) { + else if (!strcmp(argv[argno], "--full")) { fullname_g = true; } - else if (!HDstrcmp(argv[argno], "--group")) { + else if (!strcmp(argv[argno], "--group")) { grp_literal_g = true; } - else if (!HDstrcmp(argv[argno], "--label")) { + else if (!strcmp(argv[argno], "--label")) { label_g = true; } - else if (!HDstrcmp(argv[argno], "--recursive")) { + else if (!strcmp(argv[argno], "--recursive")) { recursive_g = true; fullname_g = true; } - else if (!HDstrcmp(argv[argno], "--simple")) { + else if (!strcmp(argv[argno], "--simple")) { simple_output_g = true; } - else if (!HDstrcmp(argv[argno], "--string")) { + else if (!strcmp(argv[argno], "--string")) { string_g = true; } - else if (!HDstrncmp(argv[argno], "--vol-value=", (size_t)12)) { + else if (!strncmp(argv[argno], "--vol-value=", (size_t)12)) { vol_info.type = VOL_BY_VALUE; vol_info.u.value = (H5VL_class_value_t)atoi(argv[argno] + 12); custom_vol_fapl = true; } - else if (!HDstrncmp(argv[argno], "--vol-name=", (size_t)11)) { + else if (!strncmp(argv[argno], "--vol-name=", (size_t)11)) { vol_info.type = VOL_BY_NAME; vol_info.u.name = argv[argno] + 11; custom_vol_fapl = true; } - else if (!HDstrncmp(argv[argno], "--vol-info=", (size_t)11)) { + else if (!strncmp(argv[argno], "--vol-info=", (size_t)11)) { vol_info.info_string = argv[argno] + 11; } - else if (!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) { + else if (!strncmp(argv[argno], "--vfd=", (size_t)6)) { vfd_info.type = VFD_BY_NAME; vfd_info.u.name = argv[argno] + 6; custom_vfd_fapl = true; } - else if (!HDstrncmp(argv[argno], "--vfd-value=", (size_t)12)) { + else if (!strncmp(argv[argno], "--vfd-value=", (size_t)12)) { vfd_info.type = VFD_BY_VALUE; vfd_info.u.value = (H5FD_class_value_t)atoi(argv[argno] + 12); custom_vfd_fapl = true; } - else if (!HDstrncmp(argv[argno], "--vfd-name=", (size_t)11)) { + else if (!strncmp(argv[argno], "--vfd-name=", (size_t)11)) { vfd_info.type = VFD_BY_NAME; vfd_info.u.name = argv[argno] + 11; custom_vfd_fapl = true; } - else if (!HDstrncmp(argv[argno], "--vfd-info=", (size_t)11)) { + else if (!strncmp(argv[argno], "--vfd-info=", (size_t)11)) { vfd_info.info = (const void *)(argv[argno] + 11); } - else if (!HDstrncmp(argv[argno], "--width=", (size_t)8)) { + else if (!strncmp(argv[argno], "--width=", (size_t)8)) { width_g = (int)strtol(argv[argno] + 8, &rest, 0); if (0 == width_g) @@ -2791,7 +2791,7 @@ main(int argc, char *argv[]) leave(EXIT_FAILURE); } } - else if (!HDstrcmp(argv[argno], "--width")) { + else if (!strcmp(argv[argno], "--width")) { if ((argno + 1) >= argc) { usage(); leave(EXIT_FAILURE); @@ -2805,17 +2805,17 @@ main(int argc, char *argv[]) leave(EXIT_FAILURE); } } - else if (!HDstrcmp(argv[argno], "--verbose")) { + else if (!strcmp(argv[argno], "--verbose")) { verbose_g++; } - else if (!HDstrcmp(argv[argno], "--version")) { + else if (!strcmp(argv[argno], "--version")) { print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); } - else if (!HDstrcmp(argv[argno], "--hexdump")) { + else if (!strcmp(argv[argno], "--hexdump")) { hexdump_g = true; } - else if (!HDstrncmp(argv[argno], "-w", (size_t)2)) { + else if (!strncmp(argv[argno], "-w", (size_t)2)) { if (argv[argno][2]) { s = argv[argno] + 2; } @@ -2836,7 +2836,7 @@ main(int argc, char *argv[]) leave(EXIT_FAILURE); } } - else if (!HDstrncmp(argv[argno], "--s3-cred=", (size_t)10)) { + else if (!strncmp(argv[argno], "--s3-cred=", (size_t)10)) { #ifdef H5_HAVE_ROS3_VFD char const *start = NULL; @@ -2863,7 +2863,7 @@ main(int argc, char *argv[]) leave(EXIT_FAILURE); #endif } - else if (!HDstrncmp(argv[argno], "--hdfs-attrs=", (size_t)13)) { + else if (!strncmp(argv[argno], "--hdfs-attrs=", (size_t)13)) { #ifdef H5_HAVE_LIBHDFS char const *start = NULL; @@ -2983,13 +2983,13 @@ main(int argc, char *argv[]) /* Setup a custom fapl for file accesses */ if (custom_vol_fapl || custom_vfd_fapl) { #ifdef H5_HAVE_ROS3_VFD - if (custom_vfd_fapl && (0 == HDstrcmp(vfd_info.u.name, drivernames[ROS3_VFD_IDX]))) { + if (custom_vfd_fapl && (0 == strcmp(vfd_info.u.name, drivernames[ROS3_VFD_IDX]))) { if (!vfd_info.info) vfd_info.info = &ros3_fa; } #endif #ifdef H5_HAVE_LIBHDFS - if (custom_vfd_fapl && (0 == HDstrcmp(vfd_info.u.name, drivernames[HDFS_VFD_IDX]))) { + if (custom_vfd_fapl && (0 == strcmp(vfd_info.u.name, drivernames[HDFS_VFD_IDX]))) { if (!vfd_info.info) vfd_info.info = &hdfs_fa; } @@ -3021,7 +3021,7 @@ main(int argc, char *argv[]) symlink_trav_t symlink_list; size_t u; - fname = HDstrdup(argv[argno++]); + fname = strdup(argv[argno++]); oname = NULL; file_id = H5I_INVALID_HID; @@ -3037,7 +3037,7 @@ main(int argc, char *argv[]) /* Shorten the file name; lengthen the object name */ x = oname; - oname = HDstrrchr(fname, '/'); + oname = strrchr(fname, '/'); if (x) *x = '/'; if (!oname) @@ -3055,10 +3055,10 @@ main(int argc, char *argv[]) /* Always use absolute paths to avoid confusion, keep track of where * to begin path name output */ *oname = '/'; - iter.base_len = HDstrlen(oname); + iter.base_len = strlen(oname); iter.base_len -= oname[iter.base_len - 1] == '/'; x = oname; - if (NULL == (oname = HDstrdup(oname))) { + if (NULL == (oname = strdup(oname))) { fprintf(rawerrorstream, "memory allocation failed\n"); leave(EXIT_FAILURE); } @@ -3090,7 +3090,7 @@ main(int argc, char *argv[]) symlink_list.objs = NULL; /* Check for root group as object name */ - if (HDstrcmp(oname, root_name) != 0) { + if (strcmp(oname, root_name) != 0) { /* Check the type of link given */ if (H5Lget_info2(file_id, oname, &li, H5P_DEFAULT) < 0) { hsize_t curr_pos = 0; /* total data element position */ diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c index 8830c82..c2131ac 100644 --- a/tools/src/h5perf/pio_engine.c +++ b/tools/src/h5perf/pio_engine.c @@ -278,7 +278,7 @@ do_pio(parameters param) /* Open file for write */ char base_name[256]; - HDsnprintf(base_name, sizeof(base_name), "#pio_tmp_%lu", nf); + snprintf(base_name, sizeof(base_name), "#pio_tmp_%lu", nf); pio_create_filename(iot, base_name, fname, FILENAME_MAX); if (pio_debug_level > 0) fprintf(output, "rank %d: data filename=%s\n", pio_mpi_rank_g, fname); @@ -431,11 +431,11 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, size); + strncpy(fullname, prefix, size); fullname[size - 1] = '\0'; } - if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { + if ((strlen(fullname) + strlen(base_name) + 1) < size) { /* Append the base_name with a slash first. Multiple slashes are * handled below. */ h5_stat_t buf; @@ -445,31 +445,31 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si if (HDmkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST) { /* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory. * Default to PREFIX's original prefix value. */ - HDstrcpy(fullname, prefix); + strcpy(fullname, prefix); } - HDstrcat(fullname, "/"); - HDstrcat(fullname, base_name); + strcat(fullname, "/"); + strcat(fullname, base_name); } else { /* Buffer is too small */ return NULL; } } - else if (HDstrlen(base_name) >= size) { + else if (strlen(base_name) >= size) { /* Buffer is too small */ return NULL; } else { - HDstrcpy(fullname, base_name); + strcpy(fullname, base_name); } /* Append a suffix */ if (suffix) { - if (HDstrlen(fullname) + HDstrlen(suffix) >= size) + if (strlen(fullname) + strlen(suffix) >= size) return NULL; - HDstrcat(fullname, suffix); + strcat(fullname, suffix); } /* Remove any double slashes in the filename */ @@ -887,7 +887,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby } /* end if */ } /* end else */ - HDsnprintf(dname, sizeof(dname), "Dataset_%ld", ndset); + snprintf(dname, sizeof(dname), "Dataset_%ld", ndset); h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, h5dcpl); if (h5ds_id < 0) { @@ -1862,7 +1862,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt break; case PHDF5: - HDsnprintf(dname, sizeof(dname), "Dataset_%ld", ndset); + snprintf(dname, sizeof(dname), "Dataset_%ld", ndset); h5ds_id = H5DOPEN(fd->h5fd, dname); if (h5ds_id < 0) { fprintf(stderr, "HDF5 Dataset open failed\n"); diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index f2b561c..232ac93 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -739,7 +739,7 @@ h5_set_info_object(void) if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) { char *next, *valp; - valp = envp = next = HDstrdup(envp); + valp = envp = next = strdup(envp); if (!valp) return 0; @@ -764,7 +764,7 @@ h5_set_info_object(void) if (*next == ';') ++next; - namep = HDstrncpy(key_val, valp, len); + namep = strncpy(key_val, valp, len); /* pass up any beginning whitespaces */ while (*namep && (*namep == ' ' || *namep == '\t')) @@ -774,13 +774,13 @@ h5_set_info_object(void) continue; /* was all white space, so move to next k/v pair */ /* eat up any ending white spaces */ - endp = &namep[HDstrlen(namep) - 1]; + endp = &namep[strlen(namep) - 1]; while (endp && (*endp == ' ' || *endp == '\t')) *endp-- = '\0'; /* find the '=' */ - valp = HDstrchr(namep, '='); + valp = strchr(namep, '='); if (valp != NULL) { /* it's a valid key/value pairing */ char *tmp_val = valp + 1; @@ -1049,7 +1049,7 @@ output_report(const char *fmt, ...) va_start(ap, fmt); H5_GCC_CLANG_DIAG_OFF("format-nonliteral") - HDvfprintf(output, fmt, ap); + vfprintf(output, fmt, ap); H5_GCC_CLANG_DIAG_ON("format-nonliteral") va_end(ap); } @@ -1072,7 +1072,7 @@ print_indent(int indent) indent *= TAB_SPACE; for (; indent > 0; --indent) - HDfputc(' ', output); + fputc(' ', output); } } @@ -1334,7 +1334,7 @@ parse_command_line(int argc, const char *const *argv) if (isalnum(*end) && i < 10) buf[i++] = *end; - if (HDstrlen(buf) > 1 || isdigit(buf[0])) { + if (strlen(buf) > 1 || isdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index 5c2b504..28f4eed 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -197,7 +197,7 @@ do_sio(parameters param, results *res) */ /* Open file for write */ - HDstrcpy(base_name, "#sio_tmp"); + strcpy(base_name, "#sio_tmp"); sio_create_filename(iot, base_name, fname, FILENAME_MAX, ¶m); if (sio_debug_level > 0) @@ -339,11 +339,11 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, size); + strncpy(fullname, prefix, size); fullname[size - 1] = '\0'; } - if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { + if ((strlen(fullname) + strlen(base_name) + 1) < size) { /* Append the base_name with a slash first. Multiple slashes are * handled below. */ h5_stat_t buf; @@ -353,11 +353,11 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si if (HDmkdir(fullname, 0755) < 0 && errno != EEXIST) { /* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory. * Default to PREFIX's original prefix value. */ - HDstrcpy(fullname, prefix); + strcpy(fullname, prefix); } - HDstrcat(fullname, "/"); - HDstrcat(fullname, base_name); + strcat(fullname, "/"); + strcat(fullname, base_name); } else { /* Buffer is too small */ @@ -369,15 +369,15 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si return NULL; } else { - HDstrcpy(fullname, base_name); + strcpy(fullname, base_name); } /* Append a suffix */ if (suffix) { - if (HDstrlen(fullname) + HDstrlen(suffix) >= size) + if (strlen(fullname) + strlen(suffix) >= size) return NULL; - HDstrcat(fullname, suffix); + strcat(fullname, suffix); } /* Remove any double slashes in the filename */ @@ -513,7 +513,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) } /* end if */ } /* end if */ - HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (unsigned long)parms->num_bytes); + snprintf(dname, sizeof(dname), "Dataset_%ld", (unsigned long)parms->num_bytes); h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT); @@ -836,7 +836,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) break; case HDF5: - HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (long)parms->num_bytes); + snprintf(dname, sizeof(dname), "Dataset_%ld", (long)parms->num_bytes); h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT); if (h5ds_id < 0) { fprintf(stderr, "HDF5 Dataset open failed\n"); @@ -1153,13 +1153,13 @@ set_vfd(parameters *param) memset(memb_name, 0, sizeof memb_name); memset(memb_addr, 0, sizeof memb_addr); - assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(strlen(multi_letters) == H5FD_MEM_NTYPES); if (NULL == (sv = calloc(1, sizeof(*sv)))) return -1; for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; - HDsnprintf(sv->arr[mt], 1024, "%%s-%c.h5", multi_letters[mt]); + snprintf(sv->arr[mt], 1024, "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv->arr[mt]; memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } @@ -1175,7 +1175,7 @@ set_vfd(parameters *param) hsize_t fam_size = 1 * 1024 * 1024; /*100 MB*/ /* Family of files, each 1MB and using the default driver */ - /* if ((val=HDstrtok(NULL, " \t\n\r"))) + /* if ((val=strtok(NULL, " \t\n\r"))) fam_size = (hsize_t)(strtod(val, NULL) * 1024*1024); */ if (H5Pset_fapl_family(my_fapl, fam_size, H5P_DEFAULT) < 0) return -1; @@ -1274,7 +1274,7 @@ do_cleanupfile(iotype iot, char *filename) if (driver == H5FD_FAMILY) { for (j = 0; /*void*/; j++) { H5_GCC_CLANG_DIAG_OFF("format-nonliteral") - HDsnprintf(temp, temp_sz, filename, j); + snprintf(temp, temp_sz, filename, j); H5_GCC_CLANG_DIAG_ON("format-nonliteral") if (HDaccess(temp, F_OK) < 0) @@ -1294,10 +1294,10 @@ do_cleanupfile(iotype iot, char *filename) } else if (driver == H5FD_MULTI) { H5FD_mem_t mt; - assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(strlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { - HDsnprintf(temp, temp_sz, "%s-%c.h5", filename, multi_letters[mt]); + snprintf(temp, temp_sz, "%s-%c.h5", filename, multi_letters[mt]); HDremove(temp); /*don't care if it fails*/ } } diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index bab8d97..ca3d5c0 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -203,7 +203,7 @@ main(int argc, char *argv[]) if (opts->output_file) { if ((output = fopen(opts->output_file, "w")) == NULL) { fprintf(stderr, "%s: cannot open output file\n", progname); - HDperror(opts->output_file); + perror(opts->output_file); goto finish; } } @@ -627,7 +627,7 @@ output_report(const char *fmt, ...) va_start(ap, fmt); H5_GCC_CLANG_DIAG_OFF("format-nonliteral") - HDvfprintf(output, fmt, ap); + vfprintf(output, fmt, ap); H5_GCC_CLANG_DIAG_ON("format-nonliteral") va_end(ap); } @@ -644,7 +644,7 @@ print_indent(int indent) indent *= TAB_SPACE; for (; indent > 0; --indent) - HDfputc(' ', output); + fputc(' ', output); } static void @@ -921,7 +921,7 @@ parse_command_line(int argc, const char *const *argv) if (isalnum(*end) && i < 10) buf[i++] = *end; - if (HDstrlen(buf) > 1 || isdigit(buf[0])) { + if (strlen(buf) > 1 || isdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index ef69510..942e266 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -725,7 +725,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti * and copy its attributes using that ID *------------------------------------------------------------------------- */ - if (HDstrcmp(travt->objs[i].name, "/") == 0) { + if (strcmp(travt->objs[i].name, "/") == 0) { if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Gopen2 failed"); } @@ -778,7 +778,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti /* check if filters were requested for individual objects */ if (options->op_tbl->objs) { for (u = 0; u < options->op_tbl->nelems; u++) { - if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) + if (strcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) for (ifil = 0; ifil < options->op_tbl->objs[ifil].nfilters; ifil++) { if (options->op_tbl->objs[u].filter[ifil].filtn > 0) req_filter = 1; @@ -1528,7 +1528,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ char f_objname[256]; /* filter objname */ int i; - HDstrcpy(strfilter, "\0"); + strcpy(strfilter, "\0"); /* get information about input filters */ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) @@ -1539,65 +1539,65 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ if ((filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_objname), f_objname, NULL)) < 0) { - HDstrcat(strfilter, "ERROR "); + strcat(strfilter, "ERROR "); continue; } switch (filtn) { case H5Z_FILTER_NONE: - HDstrcat(strfilter, "NONE "); + strcat(strfilter, "NONE "); break; case H5Z_FILTER_DEFLATE: - HDstrcat(strfilter, "GZIP "); + strcat(strfilter, "GZIP "); #if defined(PRINT_DEBUG) { unsigned level = cd_values[0]; - HDsnprintf(temp, sizeof(temp), "(%d)", level); - HDstrcat(strfilter, temp); + snprintf(temp, sizeof(temp), "(%d)", level); + strcat(strfilter, temp); } #endif break; case H5Z_FILTER_SZIP: - HDstrcat(strfilter, "SZIP "); + strcat(strfilter, "SZIP "); #if defined(PRINT_DEBUG) { unsigned options_mask = cd_values[0]; /* from dcpl, not filt*/ unsigned ppb = cd_values[1]; - HDsnprintf(temp, sizeof(temp), "(%d,", ppb); - HDstrcat(strfilter, temp); + snprintf(temp, sizeof(temp), "(%d,", ppb); + strcat(strfilter, temp); if (options_mask & H5_SZIP_EC_OPTION_MASK) - HDstrcpy(temp, "EC) "); + strcpy(temp, "EC) "); else if (options_mask & H5_SZIP_NN_OPTION_MASK) - HDstrcpy(temp, "NN) "); + strcpy(temp, "NN) "); } - HDstrcat(strfilter, temp); + strcat(strfilter, temp); #endif break; case H5Z_FILTER_SHUFFLE: - HDstrcat(strfilter, "SHUF "); + strcat(strfilter, "SHUF "); break; case H5Z_FILTER_FLETCHER32: - HDstrcat(strfilter, "FLET "); + strcat(strfilter, "FLET "); break; case H5Z_FILTER_NBIT: - HDstrcat(strfilter, "NBIT "); + strcat(strfilter, "NBIT "); break; case H5Z_FILTER_SCALEOFFSET: - HDstrcat(strfilter, "SCALEOFFSET "); + strcat(strfilter, "SCALEOFFSET "); break; default: - HDstrcat(strfilter, "UD "); + strcat(strfilter, "UD "); break; } /* end switch */ } /* end for each filter */ @@ -1610,10 +1610,10 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ else { char str[512], temp[512]; - HDstrcpy(str, "dset "); - HDstrcat(str, strfilter); - HDsnprintf(temp, sizeof(temp), " (%.3f:1)", ratio); - HDstrcat(str, temp); + strcpy(str, "dset "); + strcat(str, strfilter); + snprintf(temp, sizeof(temp), " (%.3f:1)", ratio); + strcat(str, temp); if (options->verbose == 2) printf(FORMAT_OBJ_TIME, str, read_time, write_time, objname); else diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 512e4fa..9669d0c 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -57,7 +57,7 @@ aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */ } objout->nfilters = nfilters; - HDstrcpy(objout->path, name); + strcpy(objout->path, name); if ((layout = H5Pget_layout(dcpl_id)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pget_layout failed"); @@ -92,7 +92,7 @@ aux_find_obj(const char *name, /* object name from traverse list */ unsigned int i; for (i = 0; i < options->op_tbl->nelems; i++) { - if (HDstrcmp(options->op_tbl->objs[i].path, name) == 0) { + if (strcmp(options->op_tbl->objs[i].path, name) == 0) { *obj = options->op_tbl->objs[i]; return (int)i; } @@ -104,7 +104,7 @@ aux_find_obj(const char *name, /* object name from traverse list */ if (pname[0] == '/') pname++; - if (HDstrcmp(pdest, pname) == 0) { + if (strcmp(pdest, pname) == 0) { *obj = options->op_tbl->objs[i]; return (int)i; } diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 13f0f19..afe0bc9 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -401,11 +401,11 @@ read_info(const char *filename, pack_opt_t *options) /* cycle until end of file reached */ while (1) { - if (EOF == HDfscanf(fp, "%9s", stype)) + if (EOF == fscanf(fp, "%9s", stype)) break; /* Info indicator must be for layout or filter */ - if (HDstrcmp(stype, "-l") != 0 && HDstrcmp(stype, "-f") != 0) { + if (strcmp(stype, "-l") != 0 && strcmp(stype, "-f") != 0) { error_msg("bad file format for %s", filename); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -416,7 +416,7 @@ read_info(const char *filename, pack_opt_t *options) i = 0; c = '0'; while (c != ' ') { - if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) { + if (fscanf(fp, "%c", &c) < 0 && ferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -428,7 +428,7 @@ read_info(const char *filename, pack_opt_t *options) c = '0'; /* go until end */ while (c != ' ') { - if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) { + if (fscanf(fp, "%c", &c) < 0 && ferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -442,7 +442,7 @@ read_info(const char *filename, pack_opt_t *options) } comp_info[i - 1] = '\0'; /*cut the last " */ - if (!HDstrcmp(stype, "-l")) { + if (!strcmp(stype, "-l")) { if (h5repack_addlayout(comp_info, options) == -1) { error_msg("could not add chunk option\n"); h5tools_setstatus(EXIT_FAILURE); @@ -482,9 +482,9 @@ set_sort_by(const char *form) { H5_index_t idx_type = H5_INDEX_UNKNOWN; - if (!HDstrcmp(form, "name")) + if (!strcmp(form, "name")) idx_type = H5_INDEX_NAME; - else if (!HDstrcmp(form, "creation_order")) + else if (!strcmp(form, "creation_order")) idx_type = H5_INDEX_CRT_ORDER; return idx_type; @@ -505,9 +505,9 @@ set_sort_order(const char *form) { H5_iter_order_t iter_order = H5_ITER_UNKNOWN; - if (!HDstrcmp(form, "ascending")) + if (!strcmp(form, "ascending")) iter_order = H5_ITER_INC; - else if (!HDstrcmp(form, "descending")) + else if (!strcmp(form, "descending")) iter_order = H5_ITER_DEC; return iter_order; @@ -669,7 +669,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case 's': { int idx = 0; int ssize = 0; - char *msgPtr = HDstrchr(H5_optarg, ':'); + char *msgPtr = strchr(H5_optarg, ':'); options->latest = true; /* must use latest format */ if (msgPtr == NULL) { ssize = atoi(H5_optarg); @@ -679,18 +679,18 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) else { char msgType[10]; - HDstrcpy(msgType, msgPtr + 1); + strcpy(msgType, msgPtr + 1); msgPtr[0] = '\0'; ssize = atoi(H5_optarg); - if (!HDstrncmp(msgType, "dspace", 6)) + if (!strncmp(msgType, "dspace", 6)) options->msg_size[0] = ssize; - else if (!HDstrncmp(msgType, "dtype", 5)) + else if (!strncmp(msgType, "dtype", 5)) options->msg_size[1] = ssize; - else if (!HDstrncmp(msgType, "fill", 4)) + else if (!strncmp(msgType, "fill", 4)) options->msg_size[2] = ssize; - else if (!HDstrncmp(msgType, "pline", 5)) + else if (!strncmp(msgType, "pline", 5)) options->msg_size[3] = ssize; - else if (!HDstrncmp(msgType, "attr", 4)) + else if (!strncmp(msgType, "attr", 4)) options->msg_size[4] = ssize; } } break; @@ -724,14 +724,14 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case 'S': { char strategy[MAX_NC_NAME]; - HDstrcpy(strategy, H5_optarg); - if (!HDstrcmp(strategy, "FSM_AGGR")) + strcpy(strategy, H5_optarg); + if (!strcmp(strategy, "FSM_AGGR")) options->fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; - else if (!HDstrcmp(strategy, "PAGE")) + else if (!strcmp(strategy, "PAGE")) options->fs_strategy = H5F_FSPACE_STRATEGY_PAGE; - else if (!HDstrcmp(strategy, "AGGR")) + else if (!strcmp(strategy, "AGGR")) options->fs_strategy = H5F_FSPACE_STRATEGY_AGGR; - else if (!HDstrcmp(strategy, "NONE")) + else if (!strcmp(strategy, "NONE")) options->fs_strategy = H5F_FSPACE_STRATEGY_NONE; else { error_msg("invalid file space management strategy `%s`\n", H5_optarg); @@ -865,7 +865,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) infile = argv[H5_optind]; outfile = argv[H5_optind + 1]; - if (!HDstrcmp(infile, outfile)) { + if (!strcmp(infile, outfile)) { error_msg("file names cannot be the same\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -887,7 +887,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) } /* If the input file uses the onion VFD, get the revision number */ - if (in_vfd_info.u.name && !HDstrcmp(in_vfd_info.u.name, "onion")) { + if (in_vfd_info.u.name && !strcmp(in_vfd_info.u.name, "onion")) { if (in_vfd_info.info) { errno = 0; onion_fa_in_g.revision_num = strtoull(in_vfd_info.info, NULL, 10); diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 8216e7a..8a9042d 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -28,7 +28,7 @@ init_packobject(pack_info_t *obj) { int j, k; - HDstrcpy(obj->path, "\0"); + strcpy(obj->path, "\0"); for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) { obj->filter[j].filtn = -1; obj->filter[j].cd_nelmts = CD_VALUES; @@ -196,7 +196,7 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pac /* linear table search */ for (i = 0; i < table->nelems; i++) { /*already on the table */ - if (HDstrcmp(obj_list[j].obj, table->objs[i].path) == 0) { + if (strcmp(obj_list[j].obj, table->objs[i].path) == 0) { /* already chunk info inserted for this one; exit */ if (table->objs[i].chunk.rank > 0) { H5TOOLS_INFO("chunk information already inserted for <%s>\n", obj_list[j].obj); @@ -215,7 +215,7 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pac /* keep the grow in a temp var */ I = table->nelems + added; added++; - HDstrcpy(table->objs[I].path, obj_list[j].obj); + strcpy(table->objs[I].path, obj_list[j].obj); aux_tblinsert_layout(table, I, pack); } /* cases where we have an already inserted name but there is a new name also @@ -223,11 +223,11 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pac -f dset1:GZIP=1 -l dset1,dset2:CHUNK=20x20 dset1 is already inserted, but dset2 must also be */ - else if (found && HDstrcmp(obj_list[j].obj, table->objs[i].path) != 0) { + else if (found && strcmp(obj_list[j].obj, table->objs[i].path) != 0) { /* keep the grow in a temp var */ I = table->nelems + added; added++; - HDstrcpy(table->objs[I].path, obj_list[j].obj); + strcpy(table->objs[I].path, obj_list[j].obj); aux_tblinsert_layout(table, I, pack); } } /* j */ @@ -238,7 +238,7 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pac for (j = 0; j < n_objs; j++) { I = table->nelems + added; added++; - HDstrcpy(table->objs[I].path, obj_list[j].obj); + strcpy(table->objs[I].path, obj_list[j].obj); aux_tblinsert_layout(table, I, pack); } } @@ -275,7 +275,7 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pa /* linear table search */ for (i = 0; i < table->nelems; i++) { /*already on the table */ - if (HDstrcmp(obj_list[j].obj, table->objs[i].path) == 0) { + if (strcmp(obj_list[j].obj, table->objs[i].path) == 0) { /* insert */ aux_tblinsert_filter(table, i, filt); found = true; @@ -287,7 +287,7 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pa /* keep the grow in a temp var */ I = table->nelems + added; added++; - HDstrcpy(table->objs[I].path, obj_list[j].obj); + strcpy(table->objs[I].path, obj_list[j].obj); aux_tblinsert_filter(table, I, filt); } /* cases where we have an already inserted name but there is a new name also @@ -295,11 +295,11 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pa -l dset1:CHUNK=20x20 -f dset1,dset2:GZIP=1 dset1 is already inserted, but dset2 must also be */ - else if (found && HDstrcmp(obj_list[j].obj, table->objs[i].path) != 0) { + else if (found && strcmp(obj_list[j].obj, table->objs[i].path) != 0) { /* keep the grow in a temp var */ I = table->nelems + added; added++; - HDstrcpy(table->objs[I].path, obj_list[j].obj); + strcpy(table->objs[I].path, obj_list[j].obj); aux_tblinsert_filter(table, I, filt); } } /* j */ @@ -311,7 +311,7 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pa for (j = 0; j < n_objs; j++) { I = table->nelems + added; added++; - HDstrcpy(table->objs[I].path, obj_list[j].obj); + strcpy(table->objs[I].path, obj_list[j].obj); aux_tblinsert_filter(table, I, filt); } } @@ -338,15 +338,15 @@ options_get_object(const char *path, pack_opttbl_t *table) for (i = 0; i < table->nelems; i++) { /* make full path (start with "/") to compare correctly */ - if (HDstrncmp(table->objs[i].path, "/", 1) != 0) { - HDstrcpy(tbl_path, "/"); - HDstrcat(tbl_path, table->objs[i].path); + if (strncmp(table->objs[i].path, "/", 1) != 0) { + strcpy(tbl_path, "/"); + strcat(tbl_path, table->objs[i].path); } else - HDstrcpy(tbl_path, table->objs[i].path); + strcpy(tbl_path, table->objs[i].path); /* found it */ - if (HDstrcmp(tbl_path, path) == 0) { + if (strcmp(tbl_path, path) == 0) { return (&table->objs[i]); } } diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index f88ba6f..0317ef7 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -41,7 +41,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t { size_t i, m, u; char c; - size_t len = HDstrlen(str); + size_t len = strlen(str); int f, k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; @@ -94,7 +94,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t else sobj[k + 1] = '\0'; - HDstrcpy(obj_list[n].obj, sobj); + strcpy(obj_list[n].obj, sobj); memset(sobj, 0, sizeof(sobj)); n++; k = -1; @@ -123,7 +123,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * example SZIP=8,NN *------------------------------------------------------------------------- */ - if (HDstrcmp(scomp, "SZIP") == 0) { + if (strcmp(scomp, "SZIP") == 0) { l = -1; /* mask index check */ for (m = 0, u = i + 1; u < len; u++, m++) { if (str[u] == ',') { @@ -146,9 +146,9 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t if (l == 2) { smask[l] = '\0'; i = len - 1; /* end */ - if (HDstrcmp(smask, "NN") == 0) + if (strcmp(smask, "NN") == 0) filt->cd_values[j++] = H5_SZIP_NN_OPTION_MASK; - else if (HDstrcmp(smask, "EC") == 0) + else if (strcmp(smask, "EC") == 0) filt->cd_values[j++] = H5_SZIP_EC_OPTION_MASK; else { error_msg("szip mask must be 'NN' or 'EC' \n"); @@ -173,7 +173,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * SOFF=3,DF *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "SOFF") == 0) { + else if (strcmp(scomp, "SOFF") == 0) { l = -1; /* mask index check */ for (m = 0, u = i + 1; u < len; u++, m++) { if (str[u] == ',') { @@ -196,9 +196,9 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t if (l == 2) { smask[l] = '\0'; i = len - 1; /* end */ - if (HDstrcmp(smask, "IN") == 0) + if (strcmp(smask, "IN") == 0) filt->cd_values[j++] = H5Z_SO_INT; - else if (HDstrcmp(smask, "DS") == H5Z_SO_FLOAT_DSCALE) + else if (strcmp(smask, "DS") == H5Z_SO_FLOAT_DSCALE) filt->cd_values[j++] = H5Z_SO_FLOAT_DSCALE; else { error_msg("scale type must be 'IN' or 'DS' \n"); @@ -216,7 +216,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * UD=307,0,1,9 *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "UD") == 0) { + else if (strcmp(scomp, "UD") == 0) { l = -1; /* filter number index check */ f = -1; /* filter flag index check */ p = -1; /* CD_VAL count check */ @@ -298,7 +298,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_NONE *------------------------------------------------------------------------- */ - if (HDstrcmp(scomp, "NONE") == 0) { + if (strcmp(scomp, "NONE") == 0) { filt->filtn = H5Z_FILTER_NONE; filt->cd_nelmts = 0; } @@ -307,7 +307,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_DEFLATE *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "GZIP") == 0) { + else if (strcmp(scomp, "GZIP") == 0) { filt->filtn = H5Z_FILTER_DEFLATE; filt->cd_nelmts = 1; if (no_param) { /*no more parameters, GZIP must have parameter */ @@ -322,7 +322,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_SZIP *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "SZIP") == 0) { + else if (strcmp(scomp, "SZIP") == 0) { filt->filtn = H5Z_FILTER_SZIP; filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SZIP must have parameter */ @@ -337,7 +337,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_SHUFFLE *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "SHUF") == 0) { + else if (strcmp(scomp, "SHUF") == 0) { filt->filtn = H5Z_FILTER_SHUFFLE; filt->cd_nelmts = 0; if (m > 0) { /*shuffle does not have parameter */ @@ -351,7 +351,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_FLETCHER32 *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "FLET") == 0) { + else if (strcmp(scomp, "FLET") == 0) { filt->filtn = H5Z_FILTER_FLETCHER32; filt->cd_nelmts = 0; if (m > 0) { /*shuffle does not have parameter */ @@ -365,7 +365,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_NBIT *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "NBIT") == 0) { + else if (strcmp(scomp, "NBIT") == 0) { filt->filtn = H5Z_FILTER_NBIT; filt->cd_nelmts = 0; if (m > 0) { /*nbit does not have parameter */ @@ -379,7 +379,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * H5Z_FILTER_SCALEOFFSET *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "SOFF") == 0) { + else if (strcmp(scomp, "SOFF") == 0) { filt->filtn = H5Z_FILTER_SCALEOFFSET; filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SOFF must have parameter */ @@ -393,7 +393,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * User Defined Filter *------------------------------------------------------------------------- */ - else if (HDstrcmp(scomp, "UD") == 0) { + else if (strcmp(scomp, "UD") == 0) { /* parameters does not match count */ if (filt->cd_nelmts != j) { if (obj_list) @@ -448,7 +448,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t error_msg("pixels_per_block is too large in <%s>\n", str); exit(EXIT_FAILURE); } - if ((HDstrcmp(smask, "NN") != 0) && (HDstrcmp(smask, "EC") != 0)) { + if ((strcmp(smask, "NN") != 0) && (strcmp(smask, "EC") != 0)) { if (obj_list) free(obj_list); error_msg("szip mask must be 'NN' or 'EC' \n"); @@ -486,7 +486,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about obj_list_t *obj_list = NULL; unsigned i, j, n; char c; - size_t len = HDstrlen(str); + size_t len = strlen(str); int k, end_obj = -1, c_index; char sobj[MAX_NC_NAME]; char sdim[10]; @@ -527,7 +527,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about sobj[k] = '\0'; else sobj[k + 1] = '\0'; - HDstrcpy(obj_list[n].obj, sobj); + strcpy(obj_list[n].obj, sobj); memset(sobj, 0, sizeof(sobj)); n++; k = -1; @@ -546,11 +546,11 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about for (j = (unsigned)(end_obj + 1), n = 0; n <= 5; j++, n++) { if (n == 5) { slayout[n] = '\0'; /*cut string */ - if (HDstrcmp(slayout, "COMPA") == 0) + if (strcmp(slayout, "COMPA") == 0) pack->layout = H5D_COMPACT; - else if (HDstrcmp(slayout, "CONTI") == 0) + else if (strcmp(slayout, "CONTI") == 0) pack->layout = H5D_CONTIGUOUS; - else if (HDstrcmp(slayout, "CHUNK") == 0) + else if (strcmp(slayout, "CHUNK") == 0) pack->layout = H5D_CHUNKED; else { error_msg("in parse layout, not a valid layout in <%s>\n", str); @@ -604,7 +604,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about else if (i == len - 1) { /*no more parameters */ sdim[k] = '\0'; k = 0; - if (HDstrcmp(sdim, "NONE") == 0) { + if (strcmp(sdim, "NONE") == 0) { pack->chunk.rank = -2; } else { diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index bb4e58a..15232e4 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -932,7 +932,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re /* Store object names */ for (u = 0; u < hand->obj_count; u++) - if (NULL == (hand->obj[u] = HDstrdup(H5_optarg))) { + if (NULL == (hand->obj[u] = strdup(H5_optarg))) { error_msg("unable to allocate memory for object name\n"); goto error; } /* end if */ @@ -1625,11 +1625,11 @@ main(int argc, char *argv[]) vfd_info.u.name = drivername; #ifdef H5_HAVE_ROS3_VFD - if (!HDstrcmp(drivername, drivernames[ROS3_VFD_IDX])) + if (!strcmp(drivername, drivernames[ROS3_VFD_IDX])) vfd_info.info = &ros3_fa; #endif #ifdef H5_HAVE_LIBHDFS - if (!HDstrcmp(drivername, drivernames[HDFS_VFD_IDX])) + if (!strcmp(drivername, drivernames[HDFS_VFD_IDX])) vfd_info.info = &hdfs_fa; #endif diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index d1ea0c3..31f7c17 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -167,7 +167,7 @@ parse_command_line(int argc, const char *const *argv) goto error; } /* end if */ - fname_g = HDstrdup(argv[H5_optind]); + fname_g = strdup(argv[H5_optind]); done: return (0); @@ -260,7 +260,7 @@ main(int argc, char *argv[]) } /* Duplicate the file name */ - fname = HDstrdup(fname_g); + fname = strdup(fname_g); /* Get a copy of the file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index c93d9c6..1bba419 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -262,7 +262,7 @@ main(int argc, char *argv[]) exit_value = 1; goto done; } /* end if */ - if (HDstrchr(argv[1], '%')) + if (strchr(argv[1], '%')) if (H5Pset_fapl_family(fapl, (hsize_t)0, H5P_DEFAULT) < 0) { fprintf(stderr, "cannot set file access property list\n"); exit_value = 1; @@ -772,15 +772,15 @@ main(int argc, char *argv[]) printf("%-*s ", VCOL, "Signature:"); for (u = 0; u < sizeof(sig); u++) { if (sig[u] > ' ' && sig[u] <= '~' && '\\' != sig[u]) - HDputchar(sig[u]); + putchar(sig[u]); else if ('\\' == sig[u]) { - HDputchar('\\'); - HDputchar('\\'); + putchar('\\'); + putchar('\\'); } else printf("\\%03o", sig[u]); } - HDputchar('\n'); + putchar('\n'); fprintf(stderr, "unknown signature\n"); exit_value = 4; diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c index c3c8bf0..42a5eaa 100644 --- a/tools/src/misc/h5delete.c +++ b/tools/src/misc/h5delete.c @@ -37,7 +37,7 @@ main(int argc, char *argv[]) switch (argc) { case 3: - if (HDstrcmp(argv[1], "-f") != 0) { + if (strcmp(argv[1], "-f") != 0) { usage(); return EXIT_FAILURE; } diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index baf3b9b..92e3042 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -228,7 +228,7 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) } /* Retrieve file name */ - options->fname = HDstrdup(argv[H5_optind]); + options->fname = strdup(argv[H5_optind]); H5_optind++; /* Check for group(s) to be created */ @@ -245,7 +245,7 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) /* Retrieve the group names */ curr_group = 0; while (H5_optind < argc) { - options->groups[curr_group] = HDstrdup(argv[H5_optind]); + options->groups[curr_group] = strdup(argv[H5_optind]); curr_group++; H5_optind++; } diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index 818a489..feb447f 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -177,7 +177,7 @@ main(int argc, char *argv[]) /* * Get the program name from argv[0]. Use only the last component. */ - if ((prog_name = HDstrrchr(argv[0], '/'))) + if ((prog_name = strrchr(argv[0], '/'))) prog_name++; else prog_name = argv[0]; @@ -186,20 +186,20 @@ main(int argc, char *argv[]) * Parse switches. */ while (argno < argc && '-' == argv[argno][0]) { - if (!HDstrcmp(argv[argno], "-v")) { + if (!strcmp(argv[argno], "-v")) { verbose = true; argno++; } - else if (!HDstrcmp(argv[argno], "-V")) { + else if (!strcmp(argv[argno], "-V")) { printf("This is %s version %u.%u release %u\n", prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); exit(EXIT_SUCCESS); } - else if (!HDstrcmp(argv[argno], "-family_to_sec2")) { + else if (!strcmp(argv[argno], "-family_to_sec2")) { family_to_single = true; argno++; } - else if (!HDstrcmp(argv[argno], "-family_to_single")) { + else if (!strcmp(argv[argno], "-family_to_single")) { family_to_single = true; argno++; } @@ -227,16 +227,16 @@ main(int argc, char *argv[]) if (argno >= argc) usage(prog_name); src_gen_name = argv[argno++]; - HDsnprintf(src_name, NAMELEN, src_gen_name, src_membno); + snprintf(src_name, NAMELEN, src_gen_name, src_membno); src_is_family = strcmp(src_name, src_gen_name); if ((src = HDopen(src_name, O_RDONLY)) < 0) { - HDperror(src_name); + perror(src_name); exit(EXIT_FAILURE); } if (HDfstat(src, &sb) < 0) { - HDperror("fstat"); + perror("fstat"); exit(EXIT_FAILURE); } src_size = src_act_size = sb.st_size; @@ -249,11 +249,11 @@ main(int argc, char *argv[]) if (argno >= argc) usage(prog_name); dst_gen_name = argv[argno++]; - HDsnprintf(dst_name, NAMELEN, dst_gen_name, dst_membno); - dst_is_family = HDstrcmp(dst_name, dst_gen_name); + snprintf(dst_name, NAMELEN, dst_gen_name, dst_membno); + dst_is_family = strcmp(dst_name, dst_gen_name); if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { - HDperror(dst_name); + perror(dst_name); exit(EXIT_FAILURE); } if (verbose) @@ -283,7 +283,7 @@ main(int argc, char *argv[]) else if (src_offset < src_act_size) { n = (size_t)MIN((off_t)n, src_act_size - src_offset); if ((nio = HDread(src, buf, n)) < 0) { - HDperror("read"); + perror("read"); exit(EXIT_FAILURE); } else if ((size_t)nio != n) { @@ -309,11 +309,11 @@ main(int argc, char *argv[]) */ if (need_write) { if (need_seek && HDlseek(dst, dst_offset, SEEK_SET) < 0) { - HDperror("HDlseek"); + perror("HDlseek"); exit(EXIT_FAILURE); } if ((nio = HDwrite(dst, buf, n)) < 0) { - HDperror("write"); + perror("write"); exit(EXIT_FAILURE); } else if ((size_t)nio != n) { @@ -341,17 +341,17 @@ main(int argc, char *argv[]) dst_offset = dst_offset + (off_t)n; break; } - HDsnprintf(src_name, NAMELEN, src_gen_name, ++src_membno); + snprintf(src_name, NAMELEN, src_gen_name, ++src_membno); if ((src = HDopen(src_name, O_RDONLY)) < 0 && ENOENT == errno) { dst_offset = dst_offset + (off_t)n; break; } else if (src < 0) { - HDperror(src_name); + perror(src_name); exit(EXIT_FAILURE); } if (HDfstat(src, &sb) < 0) { - HDperror("fstat"); + perror("fstat"); exit(EXIT_FAILURE); } src_act_size = sb.st_size; @@ -372,26 +372,26 @@ main(int argc, char *argv[]) if (dst_is_family && dst_offset == dst_size) { if (0 == dst_membno) { if (HDlseek(dst, dst_size - 1, SEEK_SET) < 0) { - HDperror("HDHDlseek"); + perror("HDHDlseek"); exit(EXIT_FAILURE); } if (HDread(dst, buf, 1) < 0) { - HDperror("read"); + perror("read"); exit(EXIT_FAILURE); } if (HDlseek(dst, dst_size - 1, SEEK_SET) < 0) { - HDperror("HDlseek"); + perror("HDlseek"); exit(EXIT_FAILURE); } if (HDwrite(dst, buf, 1) < 0) { - HDperror("write"); + perror("write"); exit(EXIT_FAILURE); } } HDclose(dst); - HDsnprintf(dst_name, NAMELEN, dst_gen_name, ++dst_membno); + snprintf(dst_name, NAMELEN, dst_gen_name, ++dst_membno); if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { - HDperror(dst_name); + perror(dst_name); exit(EXIT_FAILURE); } dst_offset = 0; @@ -408,19 +408,19 @@ main(int argc, char *argv[]) */ if (need_seek) { if (HDlseek(dst, dst_offset - 1, SEEK_SET) < 0) { - HDperror("HDlseek"); + perror("HDlseek"); exit(EXIT_FAILURE); } if (HDread(dst, buf, 1) < 0) { - HDperror("read"); + perror("read"); exit(EXIT_FAILURE); } if (HDlseek(dst, dst_offset - 1, SEEK_SET) < 0) { - HDperror("HDlseek"); + perror("HDlseek"); exit(EXIT_FAILURE); } if (HDwrite(dst, buf, 1) < 0) { - HDperror("write"); + perror("write"); exit(EXIT_FAILURE); } } @@ -429,7 +429,7 @@ main(int argc, char *argv[]) /* Modify family driver information saved in superblock through private property. * These private properties are for this tool only. */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - HDperror("H5Pcreate"); + perror("H5Pcreate"); exit(EXIT_FAILURE); } @@ -439,7 +439,7 @@ main(int argc, char *argv[]) * the library to ignore the family driver information saved in the superblock. */ if (H5Pset(fapl, H5F_ACS_FAMILY_TO_SINGLE_NAME, &family_to_single) < 0) { - HDperror("H5Pset"); + perror("H5Pset"); exit(EXIT_FAILURE); } } @@ -448,14 +448,14 @@ main(int argc, char *argv[]) * library to save the new member size(specified in command line) in superblock. * This private property is for this tool only. */ if (H5Pset_fapl_family(fapl, H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0) { - HDperror("H5Pset_fapl_family"); + perror("H5Pset_fapl_family"); exit(EXIT_FAILURE); } /* Set the property of the new member size as hsize_t */ hdsize = (hsize_t)dst_size; if (H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) { - HDperror("H5Pset"); + perror("H5Pset"); exit(EXIT_FAILURE); } } @@ -476,13 +476,13 @@ main(int argc, char *argv[]) if (file >= 0) { if (H5Fclose(file) < 0) { - HDperror("H5Fclose"); + perror("H5Fclose"); exit(EXIT_FAILURE); } /* end if */ } /* end if */ if (H5Pclose(fapl) < 0) { - HDperror("H5Pclose"); + perror("H5Pclose"); exit(EXIT_FAILURE); } /* end if */ diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 06bd2a9..e595dd3 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -333,16 +333,16 @@ onion_filepaths_init(const char *basename) if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; - if (NULL == (paths->canon = HDstrdup(basename))) + if (NULL == (paths->canon = strdup(basename))) goto error; if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; - HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); + snprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; - HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); + snprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); return paths; @@ -4262,35 +4262,35 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new comp9_buf.str_vlen = comp9_buf.str_vlen_repeat = vlen_str_buf; /* copy fixlen string data to compound buffers */ - HDstrcpy(comp1_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp1_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp1_buf.str_fixlen, fixlen_str_buf); + strcpy(comp1_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp2_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp2_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp2_buf.str_fixlen, fixlen_str_buf); + strcpy(comp2_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp3_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp3_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp3_buf.str_fixlen, fixlen_str_buf); + strcpy(comp3_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp3_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp3_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp3_buf.str_fixlen, fixlen_str_buf); + strcpy(comp3_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp4_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp4_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp4_buf.str_fixlen, fixlen_str_buf); + strcpy(comp4_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp5_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp5_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp5_buf.str_fixlen, fixlen_str_buf); + strcpy(comp5_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp6_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp6_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp6_buf.str_fixlen, fixlen_str_buf); + strcpy(comp6_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp7_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp7_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp7_buf.str_fixlen, fixlen_str_buf); + strcpy(comp7_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp8_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp8_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp8_buf.str_fixlen, fixlen_str_buf); + strcpy(comp8_buf.str_fixlen_repeat, fixlen_str_buf); - HDstrcpy(comp9_buf.str_fixlen, fixlen_str_buf); - HDstrcpy(comp9_buf.str_fixlen_repeat, fixlen_str_buf); + strcpy(comp9_buf.str_fixlen, fixlen_str_buf); + strcpy(comp9_buf.str_fixlen_repeat, fixlen_str_buf); /* copy vlen string array data to compound buffers */ for (i = 0; i < VLEN_STR_ARRY_DIM; i++) { @@ -4307,32 +4307,32 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new /* copy fixlen string attay data to compound buffers */ for (i = 0; i < FIXLEN_STR_ARRY_DIM; i++) { - HDstrcpy(comp1_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp1_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp1_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp1_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp2_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp2_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp2_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp2_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp3_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp3_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp3_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp3_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp4_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp4_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp4_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp4_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp5_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp5_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp5_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp5_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp6_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp6_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp6_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp6_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp7_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp7_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp7_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp7_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp8_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp8_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp8_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp8_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); - HDstrcpy(comp9_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); - HDstrcpy(comp9_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); + strcpy(comp9_buf.str_array_fixlen[i], fixlen_str_array_buf[i]); + strcpy(comp9_buf.str_fixlen_array_again[i], fixlen_str_array_buf[i]); } /* int data */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 1b4b85c..ddbd3af 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -588,7 +588,7 @@ gent_attribute(void) dims[0] = 24; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - HDsnprintf(buf, sizeof(buf), "attribute of root group"); + snprintf(buf, sizeof(buf), "attribute of root group"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -963,7 +963,7 @@ gent_udlink(void) /* This ud link will dangle, but that's okay */ fid = H5Fcreate(FILE54, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); H5Lcreate_ud(fid, "udlink1", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - HDstrcpy(buf, "foo"); + strcpy(buf, "foo"); H5Lcreate_ud(fid, "udlink2", (H5L_type_t)MY_LINKCLASS, buf, 4, H5P_DEFAULT, H5P_DEFAULT); H5Fclose(fid); @@ -1386,7 +1386,7 @@ gent_all(void) dims[0] = 10; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - HDsnprintf(buf, sizeof(buf), "abcdefghi"); + snprintf(buf, sizeof(buf), "abcdefghi"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1422,7 +1422,7 @@ gent_all(void) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - HDsnprintf(buf, sizeof(buf), "1st attribute of dset1.1.1"); + snprintf(buf, sizeof(buf), "1st attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1430,7 +1430,7 @@ gent_all(void) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - HDsnprintf(buf, sizeof(buf), "2nd attribute of dset1.1.1"); + snprintf(buf, sizeof(buf), "2nd attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1629,7 +1629,7 @@ gent_many(void) dims[0] = 10; space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT); - HDsnprintf(buf, sizeof(buf), "abcdefghi"); + snprintf(buf, sizeof(buf), "abcdefghi"); H5Awrite(attr, H5T_NATIVE_CHAR, buf); H5Sclose(space2); H5Aclose(attr); @@ -1894,7 +1894,7 @@ gent_str(void) for (l = 0; l < 10; l++) comp1[i][j].a[k][l] = (l + j + k) * (l + j + k); for (k = 0; k < 12; k++) - HDstrcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); + strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); } dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1967,9 +1967,9 @@ gent_str2(void) dims[0] = 3; space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT); - HDsnprintf(&(buf2[0 * LENSTR2]), LENSTR2, "0123456789"); - HDsnprintf(&(buf2[1 * LENSTR2]), LENSTR2, "abcdefghij"); - HDsnprintf(&(buf2[2 * LENSTR2]), LENSTR2, "ABCDEFGHIJ"); + snprintf(&(buf2[0 * LENSTR2]), LENSTR2, "0123456789"); + snprintf(&(buf2[1 * LENSTR2]), LENSTR2, "abcdefghij"); + snprintf(&(buf2[2 * LENSTR2]), LENSTR2, "ABCDEFGHIJ"); H5Awrite(attr, fxdlenstr2, buf2); H5Sclose(space2); H5Tclose(fxdlenstr2); @@ -1981,8 +1981,8 @@ gent_str2(void) for (i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLTERM of", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); + snprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLTERM of", i); + H5Tset_size(memtype, strlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } @@ -1994,8 +1994,8 @@ gent_str2(void) for (i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLTERM of string array", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); + snprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLTERM of string array", i); + H5Tset_size(memtype, strlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } @@ -2013,8 +2013,8 @@ gent_str2(void) for (i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLPAD of", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); + snprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLPAD of", i); + H5Tset_size(memtype, strlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } @@ -2026,8 +2026,8 @@ gent_str2(void) for (i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLPAD of string array", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); + snprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLPAD of string array", i); + H5Tset_size(memtype, strlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } @@ -2045,8 +2045,8 @@ gent_str2(void) for (i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_SPACEPAD of", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); + snprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_SPACEPAD of", i); + H5Tset_size(memtype, strlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } @@ -2058,8 +2058,8 @@ gent_str2(void) for (i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_SPACEPAD of string array", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); + snprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_SPACEPAD of string array", i); + H5Tset_size(memtype, strlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); } @@ -3790,7 +3790,7 @@ gent_split_file(void) root = H5Gopen2(fid, "/", H5P_DEFAULT); atype = H5Tcopy(H5T_C_S1); - H5Tset_size(atype, HDstrlen(meta) + 1); + H5Tset_size(atype, strlen(meta) + 1); H5Tset_strpad(atype, H5T_STR_NULLTERM); dims[0] = 1; @@ -3879,12 +3879,12 @@ gent_multi(void) memset(memb_name, 0, sizeof memb_name); memset(memb_addr, 0, sizeof memb_addr); - assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(strlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; memb_map[mt] = mt; - HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); + sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); @@ -3928,7 +3928,7 @@ gent_large_objname(void) group = H5Gcreate2(fid, "this_is_a_large_group_name", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for (i = 0; i < 50; ++i) { - HDsnprintf(grp_name, sizeof(grp_name), "this_is_a_large_group_name%d", i); + snprintf(grp_name, sizeof(grp_name), "this_is_a_large_group_name%d", i); group2 = H5Gcreate2(group, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group2); } @@ -3999,7 +3999,7 @@ gent_char(void) hid_t sid1; /* Dataspace ID */ hsize_t dims1[1]; - dims1[0] = HDstrlen(wdata); + dims1[0] = strlen(wdata); /* Create file */ fid1 = H5Fcreate(FILE39, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10877,10 +10877,10 @@ gent_compound_complex2(void) /* Set up first nested compound */ buf[i].d.nested_a = (double)i; - HDstrcpy(buf[i].d.nested_string, "This is a test string."); + strcpy(buf[i].d.nested_string, "This is a test string."); for (j = 0; j < 4; j++) - HDstrcpy(buf[i].d.nested_string_array[j], "String test"); + strcpy(buf[i].d.nested_string_array[j], "String test"); /* Set up multiple nested compound */ buf[i].e.a = (float)i; @@ -10892,9 +10892,9 @@ gent_compound_complex2(void) buf[i].e.b.multiple_nested_d[j] = (long)(j - i * 10); } - HDstrcpy(buf[i].e.c.further_nested_string, "1234567890"); + strcpy(buf[i].e.c.further_nested_string, "1234567890"); for (j = 0; j < 4; j++) - HDstrcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY"); + strcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY"); for (j = 0; j < 10; j++) { buf[i].e.c.deep_nest.deep_nested_short[j] = (short)(j + i * 10); @@ -11346,16 +11346,16 @@ onion_filepaths_init(const char *basename) if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; - if (NULL == (paths->canon = HDstrdup(basename))) + if (NULL == (paths->canon = strdup(basename))) goto error; if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; - HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); + snprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; - HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); + snprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); return paths; diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index 51309f6..7adc33d 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -55,8 +55,8 @@ main(int argc, char *argv[]) } /* end if */ /* Duplicate the file name & dataset name */ - fname = HDstrdup(argv[1]); - dname = HDstrdup(argv[2]); + fname = strdup(argv[1]); + dname = strdup(argv[2]); /* Try opening the file */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, false, NULL, (size_t)0)) < 0) { diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index ff0f02e..06d6088 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -799,8 +799,8 @@ main(void) memset(filename, 0, sizeof(filename)); if (!new_format) - HDstrcat(filename, "old_"); - HDstrcat(filename, FILENAME[i]); + strcat(filename, "old_"); + strcat(filename, FILENAME[i]); gen_ext(filename, new_format, i); } /* end for */ diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 003c343..b11fe10 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -68,9 +68,9 @@ main(void) volatile uint32_t ibyte = 0x01234567; /* 0 for big endian, 1 for little endian. */ if ((*((volatile uint8_t *)(&ibyte))) == 0x67) - HDstrcpy(machine_order, "LE"); + strcpy(machine_order, "LE"); else - HDstrcpy(machine_order, "BE"); + strcpy(machine_order, "BE"); /* * initialize the row, column, and plane vectors diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index b90ddeb..8878a69 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -59,7 +59,7 @@ parse_command_line(int argc, const char *const *argv) while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'c': - nbytes = HDstrdup(H5_optarg); + nbytes = strdup(H5_optarg); break; case '?': default: @@ -105,10 +105,10 @@ main(int argc, char *argv[]) goto error; } /* end if */ - filename = HDstrdup(argv[H5_optind]); + filename = strdup(argv[H5_optind]); size = 0; - if (EOF == (res = HDsscanf(nbytes, "%u", &size))) { + if (EOF == (res = sscanf(nbytes, "%u", &size))) { /* fail */ error_msg("missing file name\n"); usage(h5tools_getprogname()); diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index d3b7388..0ab29c3 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -151,7 +151,7 @@ gent_ub(const char *filename, size_t ub_size, size_t ub_fill) goto error; if ((attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if (HDsnprintf(buf, sizeof(buf), "abcdefghi") < 0) + if (snprintf(buf, sizeof(buf), "abcdefghi") < 0) goto error; if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0) goto error; @@ -205,7 +205,7 @@ gent_ub(const char *filename, size_t ub_size, size_t ub_fill) goto error; if ((attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if (HDsnprintf(buf, sizeof(buf), "1st attribute of dset1.1.1") < 0) + if (snprintf(buf, sizeof(buf), "1st attribute of dset1.1.1") < 0) goto error; if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0) goto error; @@ -219,7 +219,7 @@ gent_ub(const char *filename, size_t ub_size, size_t ub_fill) goto error; if ((attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - if (HDsnprintf(buf, sizeof(buf), "2nd attribute of dset1.1.1") < 0) + if (snprintf(buf, sizeof(buf), "2nd attribute of dset1.1.1") < 0) goto error; if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0) goto error; @@ -412,7 +412,7 @@ main(void) if (gent_ub(FILE7, 0, 0) < 0) goto error; - if (gent_ub(FILE8, 512, HDstrlen(pattern)) < 0) + if (gent_ub(FILE8, 512, strlen(pattern)) < 0) goto error; if (gent_ub(FILE9, 1024, 513) < 0) goto error; diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index 501ecc5..61ea896 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -124,7 +124,7 @@ main(int argc, char *argv[]) goto done; } - ifname = HDstrdup(argv[H5_optind]); + ifname = strdup(argv[H5_optind]); testval = H5Fis_accessible(ifname, H5P_DEFAULT); diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index 203581d..688ee69 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -115,7 +115,7 @@ set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_fil return -1; for (i = 0; i < n_external_files; i++) { - if (HDsnprintf(name, MAX_NAME_SIZE, "%s_ex-%u.dat", filename, i) >= MAX_NAME_SIZE) + if (snprintf(name, MAX_NAME_SIZE, "%s_ex-%u.dat", filename, i) >= MAX_NAME_SIZE) return -1; if (H5Pset_external(dcpl, name, 0, n_elts_per_file * elt_size) < 0) @@ -140,7 +140,7 @@ make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize_t hid_t space_id = H5I_INVALID_HID; int ret_value = 0; - if (HDsnprintf(filename, MAX_NAME_SIZE, "%s%s.h5", basename, (NULL != ext) ? "_ex" : "") >= MAX_NAME_SIZE) + if (snprintf(filename, MAX_NAME_SIZE, "%s%s.h5", basename, (NULL != ext) ? "_ex" : "") >= MAX_NAME_SIZE) H5REPACKGENTEST_OOPS; if (NULL != ext) { diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 6fa2d8d..98d5362 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3186,7 +3186,7 @@ make_early(void) goto out; if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; - HDsnprintf(name, sizeof(name), "%d", i); + snprintf(name, sizeof(name), "%d", i); if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5Tclose(tid) < 0) @@ -3210,7 +3210,7 @@ make_early(void) for (i = 0; i < iter; i++) { if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; - HDsnprintf(name, sizeof(name), "%d", i); + snprintf(name, sizeof(name), "%d", i); if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5Tclose(tid) < 0) @@ -3269,7 +3269,7 @@ make_layout(hid_t loc_id) *------------------------------------------------------------------------- */ for (i = 0; i < 4; i++) { - HDsnprintf(name, sizeof(name), "dset%d", i + 1); + snprintf(name, sizeof(name), "dset%d", i + 1); if (write_dset(loc_id, RANK, dims, name, H5T_NATIVE_INT, buf) < 0) goto error; } diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c index 44428fe..787c2e1 100644 --- a/tools/test/h5stat/h5stat_gentest.c +++ b/tools/test/h5stat/h5stat_gentest.c @@ -87,7 +87,7 @@ gen_newgrat_file(const char *fname) /* Create NUM_GRPS groups in the root group */ for (i = 1; i <= NUM_GRPS; i++) { - HDsnprintf(name, sizeof(name), "%s%d", GROUP_NAME, i); + snprintf(name, sizeof(name), "%s%d", GROUP_NAME, i); if ((gid = H5Gcreate2(fid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if (H5Gclose(gid) < 0) @@ -108,7 +108,7 @@ gen_newgrat_file(const char *fname) /* Create NUM_ATTRS for the dataset */ for (i = 1; i <= NUM_ATTRS; i++) { - HDsnprintf(attrname, sizeof(attrname), "%s%d", ATTR_NAME, i); + snprintf(attrname, sizeof(attrname), "%s%d", ATTR_NAME, i); if ((attr_id = H5Acreate2(did, attrname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if (H5Aclose(attr_id) < 0) @@ -210,7 +210,7 @@ gen_threshold_file(const char *fname) /* Create 11 attributes for the dataset */ for (i = 1; i <= (THRES_NUM + 1); i++) { - HDsnprintf(name, sizeof(name), "%s%d", THRES_ATTR_NAME, i); + snprintf(name, sizeof(name), "%s%d", THRES_ATTR_NAME, i); if ((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if (H5Aclose(attr_id) < 0) @@ -239,7 +239,7 @@ gen_threshold_file(const char *fname) /* Create 10 attributes for the 2-D dataset */ for (i = 1; i <= THRES_NUM; i++) { - HDsnprintf(name, sizeof(name), "%s%d", THRES_ATTR_NAME, i); + snprintf(name, sizeof(name), "%s%d", THRES_ATTR_NAME, i); if ((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if (H5Aclose(attr_id) < 0) @@ -263,7 +263,7 @@ gen_threshold_file(const char *fname) /* Create 10 1-D datasets with non-zero dimension size for the group */ for (i = 1; i <= THRES_NUM; i++) { /* set up dataset name */ - HDsnprintf(name, sizeof(name), "%s%d", THRES_DSET_NAME, i); + snprintf(name, sizeof(name), "%s%d", THRES_DSET_NAME, i); /* Create the dataset */ if ((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -285,7 +285,7 @@ gen_threshold_file(const char *fname) /* Create 25 attributes for the group */ for (i = 1; i <= THRES_NUM_25; i++) { /* Set up attribute name */ - HDsnprintf(name, sizeof(name), "%s%d", THRES_ATTR_GRP_NAME, i); + snprintf(name, sizeof(name), "%s%d", THRES_ATTR_GRP_NAME, i); /* Create the attribute */ if ((attr_id = H5Acreate2(gid, name, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -307,7 +307,7 @@ gen_threshold_file(const char *fname) /* Create 9 1-D datasets with non-zero dimension size for the group */ for (i = 1; i < THRES_NUM; i++) { /* set up dataset name */ - HDsnprintf(name, sizeof(name), "%s%d", THRES_DSET_NAME, i); + snprintf(name, sizeof(name), "%s%d", THRES_DSET_NAME, i); /* Create the dataset */ if ((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/tools/test/misc/clear_open_chk.c b/tools/test/misc/clear_open_chk.c index bcf9a42..8abd4e5 100644 --- a/tools/test/misc/clear_open_chk.c +++ b/tools/test/misc/clear_open_chk.c @@ -47,7 +47,7 @@ main(int argc, char *argv[]) } /* Get the file name */ - fname = HDstrdup(argv[1]); + fname = strdup(argv[1]); /* Try opening the file */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, false, NULL, (size_t)0)) < 0) { diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 1698f4a..dd4c88d 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -421,7 +421,7 @@ main(void) if ((my_fapl = H5Pcopy(fapl2)) < 0) goto error; /* Create the file */ - HDsnprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[0]); + snprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[0]); if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) goto error; @@ -446,7 +446,7 @@ main(void) goto error; /* Create the file */ - HDsnprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[1]); + snprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[1]); if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) goto error; diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index 24d0581..7756914 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -103,7 +103,7 @@ main(int argc, char *argv[]) } if (strlen(fname) <= 0) - HDsnprintf(fname, sizeof(fname), FNAME); + snprintf(fname, sizeof(fname), FNAME); create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows, (hsize_t)dim0, (hsize_t)chunk, vlen, z, l); @@ -322,7 +322,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); add_attrs(fid, 0); - HDsnprintf(name, sizeof(name), "a cmp ds of %d rows", nrows); + snprintf(name, sizeof(name), "a cmp ds of %d rows", nrows); did = H5Dcreate(fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large); add_attrs(did, 0); @@ -342,7 +342,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz add_attrs(gid1, 0); for (i = 0; i < ngrps; i++) { /* create sub groups */ - HDsnprintf(name, sizeof(name), "g%02d", i); + snprintf(name, sizeof(name), "g%02d", i); gid2 = H5Gcreate(gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (i < 10) add_attrs(gid2, 0); @@ -355,14 +355,14 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz add_attrs(gid1, 0); for (j = 0; j < ndsets; j += 12) { /* 1 add a null dataset */ - HDsnprintf(name, sizeof(name), "%05d null dataset", j); + snprintf(name, sizeof(name), "%05d null dataset", j); did = H5Dcreate(gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (!j) add_attrs(did, j); H5Dclose(did); /* 2 add scalar int point */ - HDsnprintf(name, sizeof(name), "%05d scalar int point", j); + snprintf(name, sizeof(name), "%05d scalar int point", j); did = H5Dcreate(gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j); if (!j) @@ -370,7 +370,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 3 scalar vlen string */ - HDsnprintf(name, sizeof(name), "%05d scalar vlen string", j); + snprintf(name, sizeof(name), "%05d scalar vlen string", j); did = H5Dcreate(gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]); if (!j) @@ -378,7 +378,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 4 add fixed-length float array */ - HDsnprintf(name, sizeof(name), "%05d fixed-length float array", j); + snprintf(name, sizeof(name), "%05d fixed-length float array", j); did = H5Dcreate(gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a); if (!j) @@ -386,7 +386,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 5 add fixed-length strings */ - HDsnprintf(name, sizeof(name), "%05d fixed-length strings", j); + snprintf(name, sizeof(name), "%05d fixed-length strings", j); did = H5Dcreate(gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str); if (!j) @@ -394,7 +394,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 6 add compound data */ - HDsnprintf(name, sizeof(name), "%05d compound data", j); + snprintf(name, sizeof(name), "%05d compound data", j); did = H5Dcreate(gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp); if (!j) @@ -402,7 +402,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 7 add 2D double */ - HDsnprintf(name, sizeof(name), "%05d 2D double", j); + snprintf(name, sizeof(name), "%05d 2D double", j); strcpy(tmp_name1, name); did = H5Dcreate(gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]); @@ -411,7 +411,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 8 add 1D int array */ - HDsnprintf(name, sizeof(name), "%05d 1D int array", j); + snprintf(name, sizeof(name), "%05d 1D int array", j); did = H5Dcreate(gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int); if (!j) @@ -419,7 +419,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 9 add vlen int array */ - HDsnprintf(name, sizeof(name), "%05d vlen int array", j); + snprintf(name, sizeof(name), "%05d vlen int array", j); strcpy(tmp_name2, name); did = H5Dcreate(gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i); @@ -428,7 +428,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Dclose(did); /* 10 add vlen strings */ - HDsnprintf(name, sizeof(name), "%05d vlen strings", j); + snprintf(name, sizeof(name), "%05d vlen strings", j); strcpy(tmp_name3, name); did = H5Dcreate(gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); H5Dwrite(did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s); @@ -439,7 +439,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz /* 11 add object refs */ H5Rcreate(&buf_ref[0], gid1, ".", H5R_OBJECT, (hid_t)-1); H5Rcreate(&buf_ref[1], gid1, tmp_name3, H5R_OBJECT, (hid_t)-1); - HDsnprintf(name, sizeof(name), "%05d obj refs", j); + snprintf(name, sizeof(name), "%05d obj refs", j); did = H5Dcreate(gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref); if (!j) @@ -454,7 +454,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz H5Sselect_hyperslab(sid_1d, H5S_SELECT_SET, &start, &stride, &count, NULL); H5Rcreate(&buf_reg_ref[1], gid1, tmp_name2, H5R_DATASET_REGION, sid_1d); H5Sselect_none(sid_1d); - HDsnprintf(name, sizeof(name), "%05d region refs", j); + snprintf(name, sizeof(name), "%05d region refs", j); did = H5Dcreate(gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref); if (!j) @@ -570,11 +570,11 @@ add_attrs(hid_t oid, int idx) /* 1 scalar point */ sid = H5Screate(H5S_SCALAR); - HDsnprintf(name, sizeof(name), "%05d scalar int", idx); + snprintf(name, sizeof(name), "%05d scalar int", idx); nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i); - HDsnprintf(name, sizeof(name), "%05d scalar ulong", idx); + snprintf(name, sizeof(name), "%05d scalar ulong", idx); nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l); - HDsnprintf(name, sizeof(name), "%05d scalar str", idx); + snprintf(name, sizeof(name), "%05d scalar str", idx); tid = H5Tcopy(H5T_C_S1); H5Tset_size(tid, H5T_VARIABLE); nattrs += add_attr(oid, name, tid, sid, &s[2]); @@ -584,24 +584,24 @@ add_attrs(hid_t oid, int idx) /* 4 single point */ sid = H5Screate_simple(1, dims1, NULL); H5Rcreate(&ref, oid, ".", H5R_OBJECT, (hid_t)-1); - HDsnprintf(name, sizeof(name), "%05d single float", idx); + snprintf(name, sizeof(name), "%05d single float", idx); nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f); - HDsnprintf(name, sizeof(name), "%05d single double", idx); + snprintf(name, sizeof(name), "%05d single double", idx); nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d); - HDsnprintf(name, sizeof(name), "%05d single obj_ref", idx); + snprintf(name, sizeof(name), "%05d single obj_ref", idx); nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref); H5Sclose(sid); /* 7 fixed length 1D array */ sid = H5Screate_simple(1, dims1, NULL); tid = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dims2); - HDsnprintf(name, sizeof(name), "%05d array float", idx); + snprintf(name, sizeof(name), "%05d array float", idx); nattrs += add_attr(oid, name, tid, sid, &f_array[0]); H5Tclose(tid); tid = H5Tcopy(H5T_C_S1); H5Tset_size(tid, strlen(s[0]) + 1); tid1 = H5Tarray_create(tid, 1, dims2); - HDsnprintf(name, sizeof(name), "%05d array str", idx); + snprintf(name, sizeof(name), "%05d array str", idx); nattrs += add_attr(oid, name, tid1, sid, s); H5Tclose(tid1); H5Tclose(tid); @@ -610,7 +610,7 @@ add_attrs(hid_t oid, int idx) /* 9 fixed length 2D int arrays */ sid = H5Screate_simple(1, dims2, NULL); tid = H5Tarray_create(H5T_NATIVE_INT, 2, dims3); - HDsnprintf(name, sizeof(name), "%05d array int 2D", idx); + snprintf(name, sizeof(name), "%05d array int 2D", idx); nattrs += add_attr(oid, name, tid, sid, int3d[0][0]); H5Tclose(tid); H5Sclose(sid); @@ -619,12 +619,12 @@ add_attrs(hid_t oid, int idx) sid = H5Screate_simple(1, dims2, NULL); tid = H5Tcopy(H5T_C_S1); H5Tset_size(tid, H5T_VARIABLE); - HDsnprintf(name, sizeof(name), "%05d vlen strings", idx); + snprintf(name, sizeof(name), "%05d vlen strings", idx); nattrs += add_attr(oid, name, tid, sid, s_vlen); H5Tclose(tid); tid = H5Tvlen_create(H5T_NATIVE_INT); ; - HDsnprintf(name, sizeof(name), "%05d vlen int array", idx); + snprintf(name, sizeof(name), "%05d vlen int array", idx); nattrs += add_attr(oid, name, tid, sid, i_vlen); H5Tclose(tid); H5Sclose(sid); @@ -638,7 +638,7 @@ add_attrs(hid_t oid, int idx) offset += sizeof(H5T_NATIVE_INT); H5Tinsert(tid, "City", offset, tid1); offset += sizeof(char *); - HDsnprintf(name, sizeof(name), "%05d compound data", idx); + snprintf(name, sizeof(name), "%05d compound data", idx); nattrs += add_attr(oid, name, tid, sid, cmp_data); H5Tclose(tid1); H5Tclose(tid); diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index 9f0eee1..a4a4ab1 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -34,11 +34,11 @@ main(void) /* Set up data array */ if (NULL == (buf_data = (int *)calloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { - HDperror("calloc"); + perror("calloc"); exit(EXIT_FAILURE); } if (NULL == (buf = (int **)calloc(FAMILY_NUMBER, sizeof(buf_data)))) { - HDperror("calloc"); + perror("calloc"); exit(EXIT_FAILURE); } for (i = 0; i < FAMILY_NUMBER; i++) @@ -46,28 +46,28 @@ main(void) /* Set property list and file name for FAMILY driver */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - HDperror("H5Pcreate"); + perror("H5Pcreate"); exit(EXIT_FAILURE); } if (H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) { - HDperror("H5Pset_fapl_family"); + perror("H5Pset_fapl_family"); exit(EXIT_FAILURE); } if ((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { - HDperror("H5Fcreate"); + perror("H5Fcreate"); exit(EXIT_FAILURE); } /* Create and write dataset */ if ((space = H5Screate_simple(2, dims, NULL)) < 0) { - HDperror("H5Screate_simple"); + perror("H5Screate_simple"); exit(EXIT_FAILURE); } if ((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDperror("H5Dcreate2"); + perror("H5Dcreate2"); exit(EXIT_FAILURE); } @@ -76,34 +76,34 @@ main(void) buf[i][j] = i * 10000 + j; if (H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0) { - HDperror("H5Dwrite"); + perror("H5Dwrite"); exit(EXIT_FAILURE); } if (H5Sclose(space) < 0) { - HDperror("H5Sclose"); + perror("H5Sclose"); exit(EXIT_FAILURE); } if (H5Dclose(dset) < 0) { - HDperror("H5Dclose"); + perror("H5Dclose"); exit(EXIT_FAILURE); } if (H5Pclose(fapl) < 0) { - HDperror("H5Pclose"); + perror("H5Pclose"); exit(EXIT_FAILURE); } if (H5Fclose(file) < 0) { - HDperror("H5Fclose"); + perror("H5Fclose"); exit(EXIT_FAILURE); } free(buf); free(buf_data); - HDputs(" PASSED"); + puts(" PASSED"); fflush(stdout); return EXIT_SUCCESS; diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index 805b30b..2387be4 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -53,12 +53,12 @@ main(void) printf("%-70s", "Testing alignment in compound datatypes"); - HDstrcpy(string5, "Hi!"); + strcpy(string5, "Hi!"); HDunlink(fname); fil = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fil < 0) { - HDputs("*FAILED*"); + puts("*FAILED*"); return 1; } @@ -125,7 +125,7 @@ main(void) data = (char *)malloc(H5Tget_size(fix)); if (!data) { - HDperror("malloc() failed"); + perror("malloc() failed"); HDabort(); } @@ -138,7 +138,7 @@ main(void) out: if (error < 0) { result = 1; - HDputs("*FAILED - HDF5 library error*"); + puts("*FAILED - HDF5 library error*"); } else if (!(H5_FLT_ABS_EQUAL(fok[0], fptr[0])) || !(H5_FLT_ABS_EQUAL(fok[1], fptr[1])) || !(H5_FLT_ABS_EQUAL(fnok[0], fptr[2])) || !(H5_FLT_ABS_EQUAL(fnok[1], fptr[3]))) { @@ -179,10 +179,10 @@ out: " %6f = %f\n", (double)fok[0], (double)fptr[0], (double)fok[1], (double)fptr[1], (double)fnok[0], (double)fptr[2], (double)fnok[1], (double)fptr[3]); - HDputs("*FAILED - compound type alignmnent problem*"); + puts("*FAILED - compound type alignmnent problem*"); } else { - HDputs(" PASSED"); + puts(" PASSED"); } if (data) diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index bc15fdf..a0dd294 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -158,7 +158,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "fill raw"); for (u = 0; u < nwrite; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); memset(the_data, 0xAA, (size_t)(size[0] * size[1])); } @@ -166,7 +166,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("fill raw", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, @@ -181,7 +181,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "fill hdf5"); for (u = 0; u < nread; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert(status >= 0); @@ -190,7 +190,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("fill hdf5", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, @@ -205,7 +205,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "out raw"); for (u = 0; u < nwrite; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); assert(0 == offset); @@ -216,7 +216,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("out raw", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, @@ -231,7 +231,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "out hdf5"); for (u = 0; u < nwrite; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); status = H5Dwrite(dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data); assert(status >= 0); @@ -240,7 +240,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("out hdf5", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, @@ -255,7 +255,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "in raw"); for (u = 0; u < nread; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); assert(0 == offset); @@ -266,7 +266,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("in raw", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, @@ -281,7 +281,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "in hdf5"); for (u = 0; u < nread; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert(status >= 0); @@ -290,7 +290,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("in hdf5", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, @@ -310,7 +310,7 @@ main(void) t_start = H5_get_time(); fprintf(stderr, HEADING, "in hdf5 partial"); for (u = 0; u < nread; u++) { - HDputc(PROGRESS, stderr); + putc(PROGRESS, stderr); fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert(status >= 0); @@ -319,7 +319,7 @@ main(void) getrusage(RUSAGE_SELF, &r_stop); #endif t_stop = H5_get_time(); - HDputc('\n', stderr); + putc('\n', stderr); print_stats("in hdf5 partial", #ifdef H5_HAVE_GETRUSAGE &r_start, &r_stop, diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index 6762f7c..4f1863d 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -280,7 +280,7 @@ create_dsets(hid_t file) * Create a dataset using the default dataset creation properties. */ for (i = 0; i < NUM_DSETS; i++) { - HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i); + snprintf(dset_name, sizeof(dset_name), "dataset %d", i); if ((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; @@ -337,14 +337,14 @@ create_attrs_1(void) * Create all(user specifies the number) attributes for each dataset */ for (i = 0; i < NUM_DSETS; i++) { - HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i); + snprintf(dset_name, sizeof(dset_name), "dataset %d", i); open_t.start = retrieve_time(); if ((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0) goto error; perf(&open_t, open_t.start, retrieve_time()); for (j = 0; j < NUM_ATTRS; j++) { - HDsnprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j); + snprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j); attr_t.start = retrieve_time(); if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -433,7 +433,7 @@ create_attrs_2(void) * Create all(user specifies the number) attributes for each new dataset */ for (i = 0; i < NUM_DSETS; i++) { - HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i); + snprintf(dset_name, sizeof(dset_name), "dataset %d", i); create_t.start = retrieve_time(); if ((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -441,7 +441,7 @@ create_attrs_2(void) perf(&create_t, create_t.start, retrieve_time()); for (j = 0; j < NUM_ATTRS; j++) { - HDsnprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j); + snprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j); attr_t.start = retrieve_time(); if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -539,14 +539,14 @@ create_attrs_3(void) for (i = 0; i < loop_num; i++) { for (j = 0; j < NUM_DSETS; j++) { - HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", j); + snprintf(dset_name, sizeof(dset_name), "dataset %d", j); open_t.start = retrieve_time(); if ((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0) goto error; perf(&open_t, open_t.start, retrieve_time()); for (k = 0; k < BATCH_ATTRS; k++) { - HDsnprintf(attr_name, sizeof(attr_name), "some attrs for each dset %d %d", i, k); + snprintf(attr_name, sizeof(attr_name), "some attrs for each dset %d %d", i, k); attr_t.start = retrieve_time(); if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 61bb6c0..85c41a1 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -85,7 +85,7 @@ error(const char *fmt, ...) va_start(ap, fmt); fprintf(stderr, "%s: error: ", prog); H5_GCC_CLANG_DIAG_OFF("format-nonliteral") - HDvfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); H5_GCC_CLANG_DIAG_ON("format-nonliteral") fprintf(stderr, "\n"); va_end(ap); @@ -140,7 +140,7 @@ write_file(Bytef *source, uLongf sourceLen) int rc = (int)HDwrite(output, d_ptr, (size_t)d_len); if (rc == -1) - error(HDstrerror(errno)); + error(strerror(errno)); if (rc == (int)d_len) break; @@ -207,19 +207,19 @@ get_unique_name(void) if (prefix) /* 2 = 1 for '/' + 1 for null terminator */ - filename = (char *)malloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); + filename = (char *)malloc(strlen(prefix) + strlen(ZIP_PERF_FILE) + 2); else - filename = (char *)malloc(HDstrlen(ZIP_PERF_FILE) + 1); + filename = (char *)malloc(strlen(ZIP_PERF_FILE) + 1); if (!filename) error("out of memory"); filename[0] = 0; if (prefix) { - HDstrcpy(filename, prefix); - HDstrcat(filename, "/"); + strcpy(filename, prefix); + strcat(filename, "/"); } - HDstrcat(filename, ZIP_PERF_FILE); + strcat(filename, ZIP_PERF_FILE); } /* @@ -316,13 +316,13 @@ fill_with_random_data(Bytef *src, uLongf src_len) fprintf(stdout, "Using /dev/urandom for random data\n"); if (fd < 0) - error(HDstrerror(errno)); + error(strerror(errno)); for (;;) { ssize_t rc = HDread(fd, buf, src_len); if (rc == -1) - error(HDstrerror(errno)); + error(strerror(errno)); if (rc == (ssize_t)len) break; @@ -391,7 +391,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long output = HDopen(filename, O_RDWR | O_CREAT, S_IRWXU); if (output == -1) - error(HDstrerror(errno)); + error(strerror(errno)); for (i = 0; i <= iters; ++i) { Bytef *s_ptr = src; @@ -402,7 +402,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long ssize_t rc = HDwrite(output, s_ptr, s_len); if (rc == -1) - error(HDstrerror(errno)); + error(strerror(errno)); if (rc == (ssize_t)s_len) break; @@ -427,7 +427,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long output = HDopen(filename, O_RDWR | O_CREAT, S_IRWXU); if (output == -1) - error(HDstrerror(errno)); + error(strerror(errno)); report_once_flag = 1; HDgettimeofday(&timer_start, NULL); |