summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-29 15:19:31 (GMT)
committerGitHub <noreply@github.com>2023-06-29 15:19:31 (GMT)
commitfd56a593b7928da636b2494b25cd7478fed78c29 (patch)
treeb815098d8bcf67f4290d3ca74132ce793503b94e /tools
parent8aef67f0ae3e037df22c5319eb2eac8b95521b19 (diff)
downloadhdf5-fd56a593b7928da636b2494b25cd7478fed78c29.zip
hdf5-fd56a593b7928da636b2494b25cd7478fed78c29.tar.gz
hdf5-fd56a593b7928da636b2494b25cd7478fed78c29.tar.bz2
Remove HD from C std lib file ops (#3206)
* HDfclose * HDferror * HDfeof * HDfflush * HDfopen * HDfread * HDfwrite
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools.c38
-rw-r--r--tools/lib/h5tools.h2
-rw-r--r--tools/lib/h5tools_error.h6
-rw-r--r--tools/libtest/h5tools_test_utils.c2
-rw-r--r--tools/src/h5diff/ph5diff_main.c4
-rw-r--r--tools/src/h5import/h5import.c34
-rw-r--r--tools/src/h5jam/h5jam.c2
-rw-r--r--tools/src/h5jam/h5unjam.c12
-rw-r--r--tools/src/h5perf/pio_perf.c2
-rw-r--r--tools/src/h5perf/sio_perf.c4
-rw-r--r--tools/src/h5repack/h5repack_main.c12
-rw-r--r--tools/src/h5stat/h5stat.c2
-rw-r--r--tools/test/h5import/h5importtest.c82
-rw-r--r--tools/test/h5jam/getub.c2
-rw-r--r--tools/test/h5jam/tellub.c2
-rw-r--r--tools/test/misc/h5repart_gentest.c2
-rw-r--r--tools/test/misc/talign.c2
-rw-r--r--tools/test/perform/iopipe.c14
-rw-r--r--tools/test/perform/zip_perf.c2
19 files changed, 113 insertions, 113 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 50c6aae..30edd5f 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -245,7 +245,7 @@ h5tools_set_data_output_file(const char *fname, int is_bin)
* so that rawdatastream is changed only when succeeded */
if (rawdatastream && rawdatastream != stdout) {
- if (HDfclose(rawdatastream))
+ if (fclose(rawdatastream))
HDperror("closing rawdatastream");
else
rawdatastream = NULL;
@@ -255,13 +255,13 @@ h5tools_set_data_output_file(const char *fname, int is_bin)
if (fname != NULL) {
/* binary output */
if (is_bin) {
- if ((f = HDfopen(fname, "wb")) != NULL) {
+ if ((f = fopen(fname, "wb")) != NULL) {
rawdatastream = f;
retvalue = SUCCEED;
}
}
else {
- if ((f = HDfopen(fname, "w")) != NULL) {
+ if ((f = fopen(fname, "w")) != NULL) {
rawdatastream = f;
retvalue = SUCCEED;
}
@@ -293,7 +293,7 @@ h5tools_set_attr_output_file(const char *fname, int is_bin)
* so that rawattrstream is changed only when succeeded */
if (rawattrstream && rawattrstream != stdout) {
- if (HDfclose(rawattrstream))
+ if (fclose(rawattrstream))
HDperror("closing rawattrstream");
else
rawattrstream = NULL;
@@ -303,13 +303,13 @@ h5tools_set_attr_output_file(const char *fname, int is_bin)
if (fname != NULL) {
/* binary output */
if (is_bin) {
- if ((f = HDfopen(fname, "wb")) != NULL) {
+ if ((f = fopen(fname, "wb")) != NULL) {
rawattrstream = f;
retvalue = SUCCEED;
}
}
else {
- if ((f = HDfopen(fname, "w")) != NULL) {
+ if ((f = fopen(fname, "w")) != NULL) {
rawattrstream = f;
retvalue = SUCCEED;
}
@@ -342,7 +342,7 @@ h5tools_set_input_file(const char *fname, int is_bin)
* so that rawinstream is changed only when succeeded */
if (rawinstream && rawinstream != stdin) {
- if (HDfclose(rawinstream))
+ if (fclose(rawinstream))
HDperror("closing rawinstream");
else
rawinstream = NULL;
@@ -351,13 +351,13 @@ h5tools_set_input_file(const char *fname, int is_bin)
if (fname != NULL) {
/* binary output */
if (is_bin) {
- if ((f = HDfopen(fname, "rb")) != NULL) {
+ if ((f = fopen(fname, "rb")) != NULL) {
rawinstream = f;
retvalue = SUCCEED;
}
}
else {
- if ((f = HDfopen(fname, "r")) != NULL) {
+ if ((f = fopen(fname, "r")) != NULL) {
rawinstream = f;
retvalue = SUCCEED;
}
@@ -390,7 +390,7 @@ h5tools_set_output_file(const char *fname, int is_bin)
* so that rawoutstream is changed only when succeeded */
if (rawoutstream && rawoutstream != stdout) {
- if (HDfclose(rawoutstream))
+ if (fclose(rawoutstream))
HDperror("closing rawoutstream");
else
rawoutstream = NULL;
@@ -399,13 +399,13 @@ h5tools_set_output_file(const char *fname, int is_bin)
if (fname != NULL) {
/* binary output */
if (is_bin) {
- if ((f = HDfopen(fname, "wb")) != NULL) {
+ if ((f = fopen(fname, "wb")) != NULL) {
rawoutstream = f;
retvalue = SUCCEED;
}
}
else {
- if ((f = HDfopen(fname, "w")) != NULL) {
+ if ((f = fopen(fname, "w")) != NULL) {
rawoutstream = f;
retvalue = SUCCEED;
}
@@ -437,7 +437,7 @@ h5tools_set_error_file(const char *fname, int is_bin)
* so that rawerrorstream is changed only when succeeded */
if (rawerrorstream && rawerrorstream != stderr) {
- if (HDfclose(rawerrorstream))
+ if (fclose(rawerrorstream))
HDperror("closing rawerrorstream");
else
rawerrorstream = NULL;
@@ -447,13 +447,13 @@ h5tools_set_error_file(const char *fname, int is_bin)
if (fname != NULL) {
/* binary output */
if (is_bin) {
- if ((f = HDfopen(fname, "wb")) != NULL) {
+ if ((f = fopen(fname, "wb")) != NULL) {
rawerrorstream = f;
retvalue = SUCCEED;
}
}
else {
- if ((f = HDfopen(fname, "w")) != NULL) {
+ if ((f = fopen(fname, "w")) != NULL) {
rawerrorstream = f;
retvalue = SUCCEED;
}
@@ -1810,9 +1810,9 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
else
bytes_in = (size_t)block_index;
- bytes_wrote = HDfwrite(mem, 1, bytes_in, stream);
+ bytes_wrote = fwrite(mem, 1, bytes_in, stream);
- if (bytes_wrote != bytes_in || (0 == bytes_wrote && HDferror(stream)))
+ if (bytes_wrote != bytes_in || (0 == bytes_wrote && ferror(stream)))
H5TOOLS_THROW((-1), "fwrite failed");
block_index -= (hsize_t)bytes_wrote;
@@ -1843,7 +1843,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
}
for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char));
- if (1 != HDfwrite(&tempuchar, sizeof(unsigned char), 1, stream))
+ if (1 != fwrite(&tempuchar, sizeof(unsigned char), 1, stream))
H5TOOLS_THROW((-1), "fwrite failed");
} /* i */
} /* for (block_index = 0; block_index < block_nelmts; block_index++) */
@@ -1990,7 +1990,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
H5TOOLS_DEBUG("H5T_OPAQUE");
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char *)_mem) + block_index * size;
- if (size != HDfwrite(mem, sizeof(char), size, stream))
+ if (size != fwrite(mem, sizeof(char), size, stream))
H5TOOLS_THROW((-1), "fwrite failed");
} /* end for */
break;
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index 86fea01..bbe9554 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -33,7 +33,7 @@
/* Stream macros */
#define FLUSHSTREAM(S) \
if (S != NULL) \
- HDfflush(S)
+ fflush(S)
#define PRINTSTREAM(S, F, ...) \
if (S != NULL) \
fprintf(S, F, __VA_ARGS__)
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index 0e30cdf..4d0bef2 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -169,7 +169,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
fprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
- HDfflush(stderr); \
+ fflush(stderr); \
} while (0)
#define H5TOOLS_DEBUG(...) \
@@ -177,7 +177,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
fprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
- HDfflush(stderr); \
+ fflush(stderr); \
} while (0)
#define H5TOOLS_ENDDEBUG(...) \
@@ -186,7 +186,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
H5tools_INDENT_g -= 2; \
- HDfflush(stderr); \
+ fflush(stderr); \
} while (0)
#else
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index de8b3ef..7f49f97 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -616,7 +616,7 @@ test_populate_ros3_fa(void)
#ifndef H5_HAVE_ROS3_VFD
HDputs(" -SKIP-");
HDputs(" Read-Only S3 VFD not enabled");
- HDfflush(stdout);
+ fflush(stdout);
return 0;
#else
#if H5TOOLS_UTILS_TEST_DEBUG > 0
diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c
index a74be6b..85197d3 100644
--- a/tools/src/h5diff/ph5diff_main.c
+++ b/tools/src/h5diff/ph5diff_main.c
@@ -210,7 +210,7 @@ ph5diff_worker(int nID)
overflow_file = NULL;
}
- HDfflush(stdout);
+ fflush(stdout);
HDmemset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
@@ -263,7 +263,7 @@ print_manager_output(void)
overflow_file = NULL;
}
- HDfflush(stdout);
+ fflush(stdout);
HDmemset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
}
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index f5197f7..609e8e0 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -375,7 +375,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
*/
if (in->inputClass == 4 /* "IN" */ || in->inputClass == 3 /* "FP" */ || in->inputClass == 7 /* "UIN" */) {
- if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) {
+ if ((strm = fopen(infile, READ_OPEN_FLAGS)) == NULL) {
(void)fprintf(stderr, err1, infile);
goto error;
}
@@ -385,7 +385,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
else {
- if ((strm = HDfopen(infile, "r")) == NULL) {
+ if ((strm = fopen(infile, "r")) == NULL) {
(void)fprintf(stderr, err1, infile);
goto error;
}
@@ -459,7 +459,7 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
error:
if (strm)
- HDfclose(strm);
+ fclose(strm);
return retval;
}
@@ -502,7 +502,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
in08 = (H5DT_INT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (HDfread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) {
+ if (fread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -533,7 +533,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in16++) {
- if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) {
+ if (fread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -569,7 +569,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in32++) {
- if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) {
+ if (fread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -606,7 +606,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in64++) {
- if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) {
+ if (fread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -673,7 +673,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
in08 = (H5DT_UINT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (HDfread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) {
+ if (fread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -700,7 +700,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in16++) {
- if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) {
+ if (fread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -736,7 +736,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in32++) {
- if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) {
+ if (fread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -773,7 +773,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in64++) {
- if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) {
+ if (fread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -853,7 +853,7 @@ readFloatData(FILE *strm, struct Input *in)
case 3: /* FP */
bfp32 = (uint32_t *)in->data;
for (i = 0; i < len; i++, bfp32++) {
- if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) {
+ if (fread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -905,7 +905,7 @@ readFloatData(FILE *strm, struct Input *in)
case 3: /* FP */
bfp64 = (uint64_t *)in->data;
for (i = 0; i < len; i++, bfp64++) {
- if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) {
+ if (fread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) {
(void)fprintf(stderr, "%s", err1);
return (-1);
}
@@ -1462,7 +1462,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
in->inputArchitecture = 0; /* default to NATIVE */
- if ((strm = HDfopen(infile, "r")) == NULL) {
+ if ((strm = fopen(infile, "r")) == NULL) {
(void)fprintf(stderr, err1, infile);
goto error;
}
@@ -2442,7 +2442,7 @@ processConfigurationFile(char *infile, struct Input *in)
error:
if (strm)
- HDfclose(strm);
+ fclose(strm);
return retval;
}
@@ -4700,14 +4700,14 @@ process(struct Options *opt)
if (in->configOptionVector[EXTERNALSTORE] == 1) {
/* creating the external file if it doesn't exist */
- if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) {
+ if ((extfile = fopen(in->externFilename, "ab")) == NULL) {
(void)fprintf(stderr, "%s", err4);
H5Pclose(proplist);
H5Sclose(dataspace);
H5Fclose(file_id);
return (-1);
}
- HDfclose(extfile);
+ fclose(extfile);
H5Pset_external(proplist, in->externFilename, (off_t)0,
numOfElements * (hsize_t)in->inputSize / 8);
}
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 04b29ea..6f318a4 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -49,7 +49,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", requir
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s -i <in_file.h5> -u <in_user_file> [-o <out_file.h5>] [--clobber]\n", prog);
fprintf(stdout, "\n");
fprintf(stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n");
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c
index 077f128..d752014 100644
--- a/tools/src/h5jam/h5unjam.c
+++ b/tools/src/h5jam/h5unjam.c
@@ -50,7 +50,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s -i <in_file.h5> [-o <out_file.h5> ] [-u <out_user_file> | --delete]\n", prog);
fprintf(stdout, "\n");
fprintf(stdout, "Splits user file and HDF5 file into two files: user block data and HDF5 data.\n");
@@ -334,12 +334,12 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much)
HDfseek(infid, from, SEEK_SET);
/* Read data to buffer */
- bytes_read = HDfread(buf, (size_t)1, bytes_in, infid);
- if (0 == bytes_read && HDferror(infid)) {
+ bytes_read = fread(buf, (size_t)1, bytes_in, infid);
+ if (0 == bytes_read && ferror(infid)) {
ret_value = -1;
goto done;
} /* end if */
- if (0 == bytes_read && HDfeof(infid)) {
+ if (0 == bytes_read && feof(infid)) {
goto done;
} /* end if */
@@ -352,8 +352,8 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much)
to += (off_t)bytes_read;
/* Write nchars bytes to output file */
- bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid);
- if (bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */
+ bytes_wrote = fwrite(buf, (size_t)1, bytes_read, ofid);
+ if (bytes_wrote != bytes_read || (0 == bytes_wrote && ferror(ofid))) { /* error */
ret_value = -1;
goto done;
} /* end if */
diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c
index 3e306df..b423f0d 100644
--- a/tools/src/h5perf/pio_perf.c
+++ b/tools/src/h5perf/pio_perf.c
@@ -260,7 +260,7 @@ main(int argc, char *argv[])
}
if (opts->output_file) {
- if ((output = HDfopen(opts->output_file, "w")) == NULL) {
+ if ((output = fopen(opts->output_file, "w")) == NULL) {
fprintf(stderr, "%s: cannot open output file\n", progname);
perror(opts->output_file);
goto finish;
diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c
index b456a4f..79d025d 100644
--- a/tools/src/h5perf/sio_perf.c
+++ b/tools/src/h5perf/sio_perf.c
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
}
if (opts->output_file) {
- if ((output = HDfopen(opts->output_file, "w")) == NULL) {
+ if ((output = fopen(opts->output_file, "w")) == NULL) {
fprintf(stderr, "%s: cannot open output file\n", progname);
HDperror(opts->output_file);
goto finish;
@@ -1281,5 +1281,5 @@ usage(const char *prog)
printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
printf(" HDF5_PREFIX Data file prefix\n");
printf("\n");
- HDfflush(stdout);
+ fflush(stdout);
} /* end usage() */
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 7134865..c0a245a 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -392,7 +392,7 @@ read_info(const char *filename, pack_opt_t *options)
int i;
int ret_value = EXIT_SUCCESS;
- if (NULL == (fp = HDfopen(filename, "r"))) {
+ if (NULL == (fp = fopen(filename, "r"))) {
error_msg("cannot open options file %s\n", filename);
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -416,26 +416,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;
@@ -462,7 +462,7 @@ read_info(const char *filename, pack_opt_t *options)
done:
if (fp)
- HDfclose(fp);
+ fclose(fp);
return ret_value;
}
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 6744b56..a9e163a 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -207,7 +207,7 @@ leave(int ret)
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
fprintf(stdout, "\n");
fprintf(stdout, " ERROR\n");
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index 96da5c8..003c343 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -159,7 +159,7 @@ main(void)
*-------------------------------------------------------------------------
*/
- sp = HDfopen("txtin8.txt", "w");
+ sp = fopen("txtin8.txt", "w");
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++)
@@ -167,14 +167,14 @@ main(void)
(void)fprintf(sp, "\n");
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("txtin16.txt", "w");
+ sp = fopen("txtin16.txt", "w");
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++)
@@ -182,14 +182,14 @@ main(void)
(void)fprintf(sp, "\n");
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST txtin32.txt -c $srcdir/testfiles/textin32.conf -o textin32.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("txtin32.txt", "w");
+ sp = fopen("txtin32.txt", "w");
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++)
@@ -197,7 +197,7 @@ main(void)
(void)fprintf(sp, "\n");
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
#endif
/*-------------------------------------------------------------------------
@@ -205,17 +205,17 @@ main(void)
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binin32.bin", OPEN_FLAGS);
+ sp = fopen("binin32.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp);
+ (void)fwrite((char *)&b32i3[k][i][j], sizeof(int), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binin32.conf", "w");
+ sp = fopen("binin32.conf", "w");
(void)fprintf(sp, "PATH /int/bin/32-bit\n");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 32\n");
@@ -226,24 +226,24 @@ main(void)
(void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
(void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binuin32.bin", OPEN_FLAGS);
+ sp = fopen("binuin32.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp);
+ (void)fwrite((char *)&b32i3[k][i][j], sizeof(unsigned int), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binuin32.conf", "w");
+ sp = fopen("binuin32.conf", "w");
(void)fprintf(sp, "PATH /int/buin/32-bit\n");
(void)fprintf(sp, "INPUT-CLASS UIN\n");
(void)fprintf(sp, "INPUT-SIZE 32\n");
@@ -253,24 +253,24 @@ main(void)
(void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
(void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binin16.bin -c binin16.conf -o binin16.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binin16.bin", OPEN_FLAGS);
+ sp = fopen("binin16.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp);
+ (void)fwrite((char *)&b16i3[k][i][j], sizeof(short), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binin16.conf", "w");
+ sp = fopen("binin16.conf", "w");
(void)fprintf(sp, "PATH /int/bin/16-bit\n");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 16\n");
@@ -282,23 +282,23 @@ main(void)
(void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binuin16.bin", OPEN_FLAGS);
+ sp = fopen("binuin16.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp);
+ (void)fwrite((char *)&b16i3[k][i][j], sizeof(unsigned short), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binuin16.conf", "w");
+ sp = fopen("binuin16.conf", "w");
(void)fprintf(sp, "PATH /int/buin/16-bit\n");
(void)fprintf(sp, "INPUT-CLASS UIN\n");
(void)fprintf(sp, "INPUT-SIZE 16\n");
@@ -310,24 +310,24 @@ main(void)
(void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binin8.bin -c binin8.conf -o binin8.h5
*-------------------------------------------------------------------------
*/
- sp = HDfopen("binin8.bin", OPEN_FLAGS);
+ sp = fopen("binin8.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp);
+ (void)fwrite((char *)&b8i3[k][i][j], sizeof(char), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binin8.conf", "w");
+ sp = fopen("binin8.conf", "w");
(void)fprintf(sp, "PATH /int/bin/8-bit\n");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 8\n");
@@ -342,7 +342,7 @@ main(void)
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
(void)fprintf(sp, "COMPRESSION-PARAM 3\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
#endif /* UNICOS */
@@ -355,17 +355,17 @@ main(void)
* binary 64-bit file - rank 2 & 3
*/
- sp = HDfopen("binfp64.bin", OPEN_FLAGS);
+ sp = fopen("binfp64.bin", OPEN_FLAGS);
for (k = 0; k < npln; k++) {
for (i = 0; i < nrow; i++) {
for (j = 0; j < ncol; j++) {
- (void)HDfwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp);
+ (void)fwrite((char *)&b64r3[k][i][j], sizeof(double), 1, sp);
}
}
}
- (void)HDfclose(sp);
+ (void)fclose(sp);
- sp = HDfopen("binfp64.conf", "w");
+ sp = fopen("binfp64.conf", "w");
(void)fprintf(sp, "PATH /fp/bin/64-bit\n");
(void)fprintf(sp, "INPUT-CLASS FP\n");
(void)fprintf(sp, "INPUT-SIZE 64\n");
@@ -378,7 +378,7 @@ main(void)
(void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
(void)fprintf(sp, "COMPRESSION-PARAM 8\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
/*-------------------------------------------------------------------------
* TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5
@@ -389,15 +389,15 @@ main(void)
/* test CR+LF (13,10) and EOF (26) in windows */
char bin8w[4] = {13, 10, 26, 0};
- sp = HDfopen("binin8w.bin", OPEN_FLAGS);
+ sp = fopen("binin8w.bin", OPEN_FLAGS);
for (i = 0; i < 4; i++) {
char c = bin8w[i];
- if (HDfwrite(&c, sizeof(char), 1, sp) != 1)
+ if (fwrite(&c, sizeof(char), 1, sp) != 1)
printf("error writing file\n");
}
- HDfclose(sp);
+ fclose(sp);
- sp = HDfopen("binin8w.conf", "w");
+ sp = fopen("binin8w.conf", "w");
(void)fprintf(sp, "INPUT-CLASS IN\n");
(void)fprintf(sp, "INPUT-SIZE 8\n");
(void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
@@ -408,7 +408,7 @@ main(void)
(void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
(void)fprintf(sp, "DIMENSION-SIZES 4\n");
(void)fprintf(sp, "\n");
- (void)HDfclose(sp);
+ (void)fclose(sp);
}
return (EXIT_SUCCESS);
}
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index 139ead6..b90ddeb 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -35,7 +35,7 @@ static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s -c nb file] \n", prog);
fprintf(stdout, " print first 'nb' byts of file to stdoug.\n");
}
diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c
index 4b5606c..501ecc5 100644
--- a/tools/test/h5jam/tellub.c
+++ b/tools/test/h5jam/tellub.c
@@ -37,7 +37,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg,
static void
usage(const char *prog)
{
- HDfflush(stdout);
+ fflush(stdout);
fprintf(stdout, "usage: %s h5_file\n", prog);
fprintf(stdout, " Check that h5_fil is HDF5 file and print size of user block \n");
fprintf(stdout, " %s -h\n", prog);
diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c
index 5d5cb2f..df1c312 100644
--- a/tools/test/misc/h5repart_gentest.c
+++ b/tools/test/misc/h5repart_gentest.c
@@ -107,7 +107,7 @@ main(void)
free(buf_data);
HDputs(" PASSED");
- HDfflush(stdout);
+ fflush(stdout);
return EXIT_SUCCESS;
}
diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c
index c876d9f..805b30b 100644
--- a/tools/test/misc/talign.c
+++ b/tools/test/misc/talign.c
@@ -197,6 +197,6 @@ out:
H5Pclose(plist);
H5Fclose(fil);
HDunlink(fname);
- HDfflush(stdout);
+ fflush(stdout);
return result;
}
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index e77e288..8131f9d 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -173,7 +173,7 @@ main(void)
fprintf(stderr, HEADING, "fill raw");
for (u = 0; u < nwrite; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1]));
}
#ifdef H5_HAVE_GETRUSAGE
@@ -196,7 +196,7 @@ main(void)
fprintf(stderr, HEADING, "fill hdf5");
for (u = 0; u < nread; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data);
assert(status >= 0);
}
@@ -220,7 +220,7 @@ main(void)
fprintf(stderr, HEADING, "out raw");
for (u = 0; u < nwrite; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
offset = HDlseek(fd, (off_t)0, SEEK_SET);
assert(0 == offset);
n = HDwrite(fd, the_data, (size_t)(size[0] * size[1]));
@@ -246,7 +246,7 @@ main(void)
fprintf(stderr, HEADING, "out hdf5");
for (u = 0; u < nwrite; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
status = H5Dwrite(dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data);
assert(status >= 0);
}
@@ -270,7 +270,7 @@ main(void)
fprintf(stderr, HEADING, "in raw");
for (u = 0; u < nread; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
offset = HDlseek(fd, (off_t)0, SEEK_SET);
assert(0 == offset);
n = HDread(fd, the_data, (size_t)(size[0] * size[1]));
@@ -296,7 +296,7 @@ main(void)
fprintf(stderr, HEADING, "in hdf5");
for (u = 0; u < nread; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data);
assert(status >= 0);
}
@@ -325,7 +325,7 @@ main(void)
fprintf(stderr, HEADING, "in hdf5 partial");
for (u = 0; u < nread; u++) {
HDputc(PROGRESS, stderr);
- HDfflush(stderr);
+ fflush(stderr);
status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data);
assert(status >= 0);
}
diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c
index a21bfd8..772badd 100644
--- a/tools/test/perform/zip_perf.c
+++ b/tools/test/perform/zip_perf.c
@@ -258,7 +258,7 @@ usage(void)
fprintf(stdout, "\n");
fprintf(stdout, " Example: 37M = 37 Megabytes = %d bytes\n", 37 * ONE_MB);
fprintf(stdout, "\n");
- HDfflush(stdout);
+ fflush(stdout);
}
/*