summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-29 13:32:40 (GMT)
committerGitHub <noreply@github.com>2023-06-29 13:32:40 (GMT)
commita90bdbbcfc6db6718d368fe7d0c570238e302bc7 (patch)
tree41e896d50e68458fa5cadddafeca80ef44c327e3 /tools
parent651b20ccb7b83d5e9ef215594542cdb8119071a5 (diff)
downloadhdf5-a90bdbbcfc6db6718d368fe7d0c570238e302bc7.zip
hdf5-a90bdbbcfc6db6718d368fe7d0c570238e302bc7.tar.gz
hdf5-a90bdbbcfc6db6718d368fe7d0c570238e302bc7.tar.bz2
Remove HD from protected POSIX calls (#3203)
These calls are non-C99 but protected by ifdefs and have no Windows equivalents: * HDalarm * HDasprintf * HDclock_gettime * HDfcntl * HDgethostname * HDgetrusage * HDsymlink
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff.c8
-rw-r--r--tools/test/perform/iopipe.c28
2 files changed, 18 insertions, 18 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index cb3295f..442fb3e 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
if (HDstrncmp(objname1, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if (HDasprintf(&obj1fullname, "/%s", objname1) < 0)
+ 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) */
@@ -725,7 +725,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
if (HDstrncmp(objname2, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if (HDasprintf(&obj2fullname, "/%s", objname2) < 0)
+ 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) */
@@ -1182,7 +1182,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
/* make full path for obj1 */
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if (HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) {
+ if (asprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) {
H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed");
}
#else /* H5_HAVE_ASPRINTF */
@@ -1200,7 +1200,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
/* make full path for obj2 */
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if (HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) {
+ if (asprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) {
H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed");
}
#else /* H5_HAVE_ASPRINTF */
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index 8d0daf0..e77e288 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -167,7 +167,7 @@ main(void)
/* Fill raw */
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "fill raw");
@@ -177,7 +177,7 @@ main(void)
HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1]));
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);
@@ -190,7 +190,7 @@ main(void)
/* Fill hdf5 */
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "fill hdf5");
@@ -201,7 +201,7 @@ main(void)
assert(status >= 0);
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);
@@ -214,7 +214,7 @@ main(void)
/* Write the raw dataset */
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "out raw");
@@ -227,7 +227,7 @@ main(void)
assert(n >= 0 && (size_t)n == (size[0] * size[1]));
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);
@@ -240,7 +240,7 @@ main(void)
/* Write the hdf5 dataset */
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "out hdf5");
@@ -251,7 +251,7 @@ main(void)
assert(status >= 0);
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);
@@ -264,7 +264,7 @@ main(void)
/* Read the raw dataset */
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "in raw");
@@ -277,7 +277,7 @@ main(void)
assert(n >= 0 && (size_t)n == (size[0] * size[1]));
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);
@@ -290,7 +290,7 @@ main(void)
/* Read the hdf5 dataset */
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "in hdf5");
@@ -301,7 +301,7 @@ main(void)
assert(status >= 0);
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);
@@ -319,7 +319,7 @@ main(void)
assert(status >= 0);
synchronize();
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_start);
+ getrusage(RUSAGE_SELF, &r_start);
#endif
t_start = H5_get_time();
fprintf(stderr, HEADING, "in hdf5 partial");
@@ -330,7 +330,7 @@ main(void)
assert(status >= 0);
}
#ifdef H5_HAVE_GETRUSAGE
- HDgetrusage(RUSAGE_SELF, &r_stop);
+ getrusage(RUSAGE_SELF, &r_stop);
#endif
t_stop = H5_get_time();
HDputc('\n', stderr);