Skip to content

Commit

Permalink
Remove HD prefix from toupper/tolower (#4340)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins authored Apr 7, 2024
1 parent 0de523b commit f776a34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/H5FDs3comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
if (lowername == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy.");
for (i = 0; i < namelen; i++)
lowername[i] = (char)HDtolower((int)name[i]);
lowername[i] = (char)tolower((int)name[i]);
lowername[namelen] = 0;

/* If value supplied, copy name, value, and concatenated "name: value".
Expand Down Expand Up @@ -2172,7 +2172,7 @@ H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len)
H5MM_memcpy(dest, s, len);
do {
len--;
dest[len] = (char)HDtolower((int)dest[len]);
dest[len] = (char)tolower((int)dest[len]);
} while (len > 0);
}

Expand Down Expand Up @@ -2264,7 +2264,7 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
strncpy(purl->scheme, curstr, (size_t)len);
purl->scheme[len] = '\0';
for (i = 0; i < len; i++)
purl->scheme[i] = (char)HDtolower(purl->scheme[i]);
purl->scheme[i] = (char)tolower(purl->scheme[i]);

/* Skip "://" */
tmpstr += 3;
Expand Down
6 changes: 0 additions & 6 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#ifndef HDtmpfile
#define HDtmpfile() tmpfile()
#endif
#ifndef HDtolower
#define HDtolower(C) tolower(C)
#endif
#ifndef HDtoupper
#define HDtoupper(C) toupper(C)
#endif
#ifndef HDunlink
#define HDunlink(S) unlink(S)
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/H5system.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
* Unix: does not apply
*/
if (H5_CHECK_ABS_DRIVE(name)) {
drive = HDtoupper(name[0]) - 'A' + 1;
drive = toupper(name[0]) - 'A' + 1;
retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN);
strncpy(new_name, &name[2], name_len);
}
Expand Down Expand Up @@ -1404,7 +1404,7 @@ H5_strcasestr(const char *haystack, const char *needle)
const char *h = haystack;
const char *n = needle;
/* loop while lowercase strings match, or needle ends */
while (HDtolower(*h) == HDtolower(*n) && *n) {
while (tolower(*h) == tolower(*n) && *n) {
h++;
n++;
}
Expand Down

0 comments on commit f776a34

Please sign in to comment.