summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_main.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-09-15 22:13:18 (GMT)
committerGitHub <noreply@github.com>2023-09-15 22:13:18 (GMT)
commit44a00ef876ad3e1922847e93feac57c479217fbe (patch)
tree5e9fc677913a06a71eba1342633f92e93bd07a6c /tools/src/h5repack/h5repack_main.c
parent59a90368cdb696205bdf15040d1a48b4f69af97f (diff)
downloadhdf5-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/src/h5repack/h5repack_main.c')
-rw-r--r--tools/src/h5repack/h5repack_main.c46
1 files changed, 23 insertions, 23 deletions
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);