summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-28 11:42:41 (GMT)
committerGitHub <noreply@github.com>2023-07-28 11:42:41 (GMT)
commitf563c2b926445f7a975553bc7742a38f42d3b6f4 (patch)
treefd21684ce4e86bd32d945ba1bd3d8065dbcf194f /tools/src/h5repack
parentfe4b1c572841fff38a6b9422ea63d345ccfa96bf (diff)
downloadhdf5-f563c2b926445f7a975553bc7742a38f42d3b6f4.zip
hdf5-f563c2b926445f7a975553bc7742a38f42d3b6f4.tar.gz
hdf5-f563c2b926445f7a975553bc7742a38f42d3b6f4.tar.bz2
Sync tools with develop (#3301)
Diffstat (limited to 'tools/src/h5repack')
-rw-r--r--tools/src/h5repack/h5repack.c4
-rw-r--r--tools/src/h5repack/h5repack_copy.c6
-rw-r--r--tools/src/h5repack/h5repack_main.c34
-rw-r--r--tools/src/h5repack/h5repack_parse.c26
-rw-r--r--tools/src/h5repack/h5repack_refs.c30
-rw-r--r--tools/src/h5repack/h5repack_verify.c4
6 files changed, 52 insertions, 52 deletions
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index 0ced980..7849e29 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -575,7 +575,7 @@ done:
H5Tclose(ftype_id);
H5Aclose(attr_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
return ret_value;
} /* end copy_attr() */
@@ -884,7 +884,7 @@ done:
H5Dclose(did);
H5Fclose(fid);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (travt)
trav_table_free(travt);
return ret_value;
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 172ba26..0f270c5 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -390,7 +390,7 @@ done:
H5Fclose(fidout);
H5Fclose(fidin);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
if (travt)
trav_table_free(travt);
@@ -1455,7 +1455,7 @@ done:
{
named_datatype_free(&named_dt_head, 1);
}
- H5E_END_TRY;
+ H5E_END_TRY
}
/* free link info path */
@@ -1480,7 +1480,7 @@ done:
H5Tclose(type_in);
H5Tclose(type_out);
}
- H5E_END_TRY;
+ H5E_END_TRY
/* free */
if (buf != NULL)
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 0621c7a..85bc15d 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -21,10 +21,10 @@ static int parse_command_line(int argc, const char *const *argv, pack_opt_t *op
static void leave(int ret) H5_ATTR_NORETURN;
/* module-scoped variables */
-static int has_i = 0;
-static int has_o = 0;
-const char *infile = NULL;
-const char *outfile = NULL;
+static int has_i = 0;
+static int has_o = 0;
+static const char *infile = NULL;
+static const char *outfile = NULL;
/*
* Command-line options: The user can specify short or long-named
@@ -415,26 +415,26 @@ read_info(const char *filename, pack_opt_t *options)
i = 0;
c = '0';
while (c != ' ') {
- if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
goto done;
}
- if (HDfeof(fp))
+ if (feof(fp))
break;
}
c = '0';
/* go until end */
while (c != ' ') {
- if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && ferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
goto done;
}
comp_info[i++] = c;
- if (HDfeof(fp))
+ if (feof(fp))
break;
if (c == 10 /*eol*/)
break;
@@ -461,7 +461,7 @@ read_info(const char *filename, pack_opt_t *options)
done:
if (fp)
- HDfclose(fp);
+ fclose(fp);
return ret_value;
}
@@ -597,7 +597,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options)
break;
case 'm':
- options->min_comp = HDstrtoull(H5_optarg, NULL, 0);
+ options->min_comp = strtoull(H5_optarg, NULL, 0);
if ((int)options->min_comp <= 0) {
error_msg("invalid minimum compress size <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
@@ -699,19 +699,19 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options)
break;
case 'b':
- options->ublock_size = (hsize_t)HDatol(H5_optarg);
+ options->ublock_size = (hsize_t)atol(H5_optarg);
break;
case 'M':
- options->meta_block_size = (hsize_t)HDatol(H5_optarg);
+ options->meta_block_size = (hsize_t)atol(H5_optarg);
break;
case 't':
- options->threshold = (hsize_t)HDatol(H5_optarg);
+ options->threshold = (hsize_t)atol(H5_optarg);
break;
case 'a':
- options->alignment = HDstrtoull(H5_optarg, NULL, 0);
+ options->alignment = strtoull(H5_optarg, NULL, 0);
if (options->alignment < 1) {
error_msg("invalid alignment size `%s`\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
@@ -751,14 +751,14 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options)
break;
case 'T':
- options->fs_threshold = HDatol(H5_optarg);
+ options->fs_threshold = atol(H5_optarg);
if (options->fs_threshold == 0)
/* To distinguish the "specified" zero value */
options->fs_threshold = -1;
break;
case 'G':
- options->fs_pagesize = HDstrtoll(H5_optarg, NULL, 0);
+ options->fs_pagesize = strtoll(H5_optarg, NULL, 0);
if (options->fs_pagesize == 0)
/* To distinguish the "specified" zero value */
options->fs_pagesize = -1;
@@ -889,7 +889,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options)
if (in_vfd_info.u.name && !HDstrcmp(in_vfd_info.u.name, "onion")) {
if (in_vfd_info.info) {
errno = 0;
- onion_fa_in_g.revision_num = HDstrtoull(in_vfd_info.info, NULL, 10);
+ onion_fa_in_g.revision_num = strtoull(in_vfd_info.info, NULL, 10);
if (errno == ERANGE) {
printf("Invalid onion revision specified for the input file\n");
usage(h5tools_getprogname());
diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c
index f6c3d71..f88ba6f 100644
--- a/tools/src/h5repack/h5repack_parse.c
+++ b/tools/src/h5repack/h5repack_parse.c
@@ -132,7 +132,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t
u++; /* skip ',' */
}
c = str[u];
- if (!HDisdigit(c) && l == -1) {
+ if (!isdigit(c) && l == -1) {
if (obj_list)
free(obj_list);
error_msg("compression parameter not digit in <%s>\n", str);
@@ -182,7 +182,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t
u++; /* skip ',' */
}
c = str[u];
- if (!HDisdigit(c) && l == -1) {
+ if (!isdigit(c) && l == -1) {
if (obj_list)
free(obj_list);
error_msg("compression parameter is not a digit in <%s>\n", str);
@@ -228,27 +228,27 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t
l = 0;
}
else if (f == -1) {
- filt->filt_flag = (unsigned)HDstrtoul(stype, NULL, 0);
+ filt->filt_flag = (unsigned)strtoul(stype, NULL, 0);
f = 0;
}
else if (p == -1) {
- filt->cd_nelmts = HDstrtoull(stype, NULL, 0);
+ filt->cd_nelmts = strtoull(stype, NULL, 0);
p = 0;
}
else {
- filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0);
+ filt->cd_values[j++] = (unsigned)strtoul(stype, NULL, 0);
}
q = 0;
u++; /* skip ',' */
}
c = str[u];
- if (!HDisdigit(c) && l == -1) {
+ if (!isdigit(c) && l == -1) {
if (obj_list)
free(obj_list);
error_msg("filter number parameter is not a digit in <%s>\n", str);
exit(EXIT_FAILURE);
}
- else if (!HDisdigit(c) && f == -1) {
+ else if (!isdigit(c) && f == -1) {
if (obj_list)
free(obj_list);
error_msg("filter flag parameter is not a digit in <%s>\n", str);
@@ -267,7 +267,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t
/* here we could have 1 or 2 digits */
for (m = 0, u = i + 1; u < len; u++, m++) {
c = str[u];
- if (!HDisdigit(c)) {
+ if (!isdigit(c)) {
if (obj_list)
free(obj_list);
error_msg("compression parameter is not a digit in <%s>\n", str);
@@ -279,7 +279,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t
stype[m] = '\0';
} /*if */
- filt->cd_values[j++] = (unsigned)HDstrtoul(stype, NULL, 0);
+ filt->cd_values[j++] = (unsigned)strtoul(stype, NULL, 0);
if (filt->cd_nelmts == 0)
j = 0;
i += m; /* jump */
@@ -457,7 +457,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t
break;
default:
break;
- };
+ }
return obj_list;
}
@@ -581,7 +581,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about
sdim[k] = c;
k++; /*increment sdim index */
- if (!HDisdigit(c) && c != 'x' && c != 'N' && c != 'O' && c != 'N' && c != 'E') {
+ if (!isdigit(c) && c != 'x' && c != 'N' && c != 'O' && c != 'N' && c != 'E') {
if (obj_list)
free(obj_list);
error_msg("in parse layout, <%s> Not a valid character in <%s>\n", sdim, str);
@@ -592,7 +592,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about
if (c == 'x') {
sdim[k - 1] = '\0';
k = 0;
- pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0);
+ pack->chunk.chunk_lengths[c_index] = strtoull(sdim, NULL, 0);
if (pack->chunk.chunk_lengths[c_index] == 0) {
if (obj_list)
free(obj_list);
@@ -608,7 +608,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about
pack->chunk.rank = -2;
}
else {
- pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0);
+ pack->chunk.chunk_lengths[c_index] = strtoull(sdim, NULL, 0);
if (pack->chunk.chunk_lengths[c_index] == 0) {
if (obj_list)
free(obj_list);
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index 171b335..ce4a5cf 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -156,7 +156,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (buf == NULL) {
printf("cannot read into memory\n");
H5TOOLS_GOTO_ERROR((-1), "malloc failed");
- } /* end if */
+ }
if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
@@ -164,7 +164,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (refbuf == NULL) {
printf("cannot allocate memory\n");
H5TOOLS_GOTO_ERROR((-1), "calloc failed");
- } /* end if */
+ }
for (u = 0; u < nelmts; u++) {
H5E_BEGIN_TRY
{
@@ -172,7 +172,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
H5Rdereference2(dset_in, H5P_DEFAULT, H5R_OBJECT, &buf[u])) < 0)
continue;
}
- H5E_END_TRY;
+ H5E_END_TRY
/* get the name. a valid name could only occur
* in the second traversal of the file
@@ -238,7 +238,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (buf == NULL) {
printf("cannot read into memory\n");
H5TOOLS_GOTO_ERROR((-1), "malloc failed");
- } /* end if */
+ }
if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
@@ -251,7 +251,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (refbuf == NULL) {
printf("cannot allocate memory\n");
H5TOOLS_GOTO_ERROR((-1), "calloc failed");
- } /* end if */
+ }
for (u = 0; u < nelmts; u++) {
H5E_BEGIN_TRY
@@ -260,7 +260,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
&buf[u])) < 0)
continue;
}
- H5E_END_TRY;
+ H5E_END_TRY
/* get the name. a valid name could only occur
* in the second traversal of the file
@@ -408,7 +408,7 @@ done:
H5Tclose(type_in);
named_datatype_free(&named_dt_head, 1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return ret_value;
}
@@ -602,7 +602,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
if (buf == NULL) {
printf("cannot read into memory\n");
H5TOOLS_GOTO_ERROR((-1), "malloc failed");
- } /* end if */
+ }
if (H5Aread(attr_id, mtype_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Aread failed");
@@ -610,7 +610,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
if (refbuf == NULL) {
printf("cannot allocate memory\n");
H5TOOLS_GOTO_ERROR((-1), "calloc failed");
- } /* end if */
+ }
for (i = 0; i < (unsigned)nelmts; i++)
if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout,
@@ -624,7 +624,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
if (buf == NULL) {
printf("cannot read into memory\n");
H5TOOLS_GOTO_ERROR((-1), "malloc failed");
- } /* end if */
+ }
if (H5Aread(attr_id, mtype_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Aread failed");
@@ -636,7 +636,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
if (refbuf == NULL) {
printf("cannot allocate memory\n");
H5TOOLS_GOTO_ERROR((-1), "calloc failed");
- } /* end if */
+ }
for (i = 0; i < (unsigned)nelmts; i++)
if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout,
@@ -652,7 +652,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
if (buf == NULL) {
printf("cannot read into memory\n");
H5TOOLS_GOTO_ERROR((-1), "malloc failed");
- } /* end if */
+ }
if (H5Aread(attr_id, mtype_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Aread failed");
@@ -694,7 +694,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
if (buf == NULL) {
printf("cannot read into memory\n");
H5TOOLS_GOTO_ERROR((-1), "malloc failed");
- } /* end if */
+ }
if (H5Aread(attr_id, mtype_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Aread failed");
@@ -794,7 +794,7 @@ done:
H5Aclose(attr_id);
H5Aclose(attr_out);
}
- H5E_END_TRY;
+ H5E_END_TRY
return ret_value;
}
@@ -875,7 +875,7 @@ done:
H5Sclose(space_id);
H5Oclose(ref_obj_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
return ret_value;
}
diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c
index bccf034..572aa48 100644
--- a/tools/src/h5repack/h5repack_verify.c
+++ b/tools/src/h5repack/h5repack_verify.c
@@ -286,7 +286,7 @@ done:
if (travt)
trav_table_free(travt);
}
- H5E_END_TRY;
+ H5E_END_TRY
return ret_value;
} /* h5repack_verify() */
@@ -475,7 +475,7 @@ done:
if (trav)
trav_table_free(trav);
}
- H5E_END_TRY;
+ H5E_END_TRY
return ret_value;
}