summaryrefslogtreecommitdiffstats
path: root/test/API/testhdf5.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 /test/API/testhdf5.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 'test/API/testhdf5.c')
-rw-r--r--test/API/testhdf5.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/API/testhdf5.c b/test/API/testhdf5.c
index e82ac12..c2b4260 100644
--- a/test/API/testhdf5.c
+++ b/test/API/testhdf5.c
@@ -56,7 +56,7 @@ print_func(const char *format, ...)
int ret_value;
va_start(arglist, format);
- ret_value = HDvprintf(format, arglist);
+ ret_value = vprintf(format, arglist);
va_end(arglist);
return ret_value;
}
@@ -76,7 +76,7 @@ TestErrPrintf(const char *format, ...)
/* Print the requested information */
va_start(arglist, format);
- ret_value = HDvprintf(format, arglist);
+ ret_value = vprintf(format, arglist);
va_end(arglist);
/* Return the length of the string produced (like printf() does) */
@@ -123,7 +123,7 @@ getenv_all(MPI_Comm comm, int root, const char *name)
if (mpi_rank == root) {
env = HDgetenv(name);
if (env) {
- len = (int)HDstrlen(env);
+ len = (int)strlen(env);
MPI_Bcast(&len, 1, MPI_INT, root, comm);
MPI_Bcast(env, len, MPI_CHAR, root, comm);
}
@@ -138,7 +138,7 @@ getenv_all(MPI_Comm comm, int root, const char *name)
if (len >= 0) {
if (env == NULL)
env = (char *)malloc((size_t)len + 1);
- else if (HDstrlen(env) < (size_t)len)
+ else if (strlen(env) < (size_t)len)
env = (char *)realloc(env, (size_t)len + 1);
MPI_Bcast(env, len, MPI_CHAR, root, comm);
@@ -235,12 +235,12 @@ h5_get_libver_fapl(hid_t fapl)
* If it's nothing (environment variable was whitespace)
* just return the default fapl.
*/
- HDstrncpy(buf, env, sizeof(buf));
+ strncpy(buf, env, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
if (NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts)))
goto done;
- if (!HDstrcmp(tok, "latest")) {
+ if (!strcmp(tok, "latest")) {
/* use the latest format */
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
goto error;
@@ -302,7 +302,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
* we are using the split driver since both of those
* use the multi VFD under the hood.
*/
- if (driver_env_var && !HDstrcmp(driver_env_var, "split")) {
+ if (driver_env_var && !strcmp(driver_env_var, "split")) {
/* split VFD */
if (subst_for_superblock)
suffix = ".h5.meta";
@@ -396,7 +396,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
/* This is a parallel system */
char *subdir;
- if (!HDstrcmp(prefix, HDF5_PARAPREFIX)) {
+ if (!strcmp(prefix, HDF5_PARAPREFIX)) {
/*
* If the prefix specifies the HDF5_PARAPREFIX directory, then
* default to using the "/tmp/$USER" or "/tmp/$LOGIN"
@@ -421,11 +421,11 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
if (!fullname[0]) {
/* 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.
@@ -440,10 +440,10 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
* 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 */
@@ -451,25 +451,25 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
}
}
else {
- if (HDsnprintf(fullname, size, "%s/%s", prefix, base_name) == (int)size)
+ if (snprintf(fullname, size, "%s/%s", prefix, base_name) == (int)size)
/* 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 */
@@ -506,7 +506,7 @@ h5_using_default_driver(const char *drv_name)
drv_name = HDgetenv(HDF5_DRIVER);
if (drv_name)
- return (!HDstrcmp(drv_name, "sec2") || !HDstrcmp(drv_name, "nomatch"));
+ return (!strcmp(drv_name, "sec2") || !strcmp(drv_name, "nomatch"));
return ret_val;
}