From 857bce81b0f1537559721133f0a43835539088b8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 29 Jun 2023 10:43:25 -0700 Subject: [PATCH 1/2] Remove HD from HDis* (e.g., isalpha) --- src/H5.c | 8 ++-- src/H5AC.c | 2 +- src/H5FDmpio.c | 2 +- src/H5FDs3comms.c | 13 +++--- src/H5Omtime.c | 2 +- src/H5Ztrans.c | 26 ++++++------ src/H5dbg.c | 2 +- src/H5private.h | 63 +++++++---------------------- src/H5trace.c | 4 +- tools/lib/h5tools_utils.c | 6 +-- tools/src/h5dump/h5dump.c | 8 ++-- tools/src/h5perf/pio_perf.c | 4 +- tools/src/h5perf/sio_perf.c | 16 ++++---- tools/src/h5repack/h5repack_parse.c | 12 +++--- 14 files changed, 67 insertions(+), 101 deletions(-) diff --git a/src/H5.c b/src/H5.c index 54e6f175e21..2336bbd5103 100644 --- a/src/H5.c +++ b/src/H5.c @@ -696,7 +696,7 @@ H5__debug_mask(const char *s) while (s && *s) { - if (HDisalpha(*s) || '-' == *s || '+' == *s) { + if (isalpha(*s) || '-' == *s || '+' == *s) { /* Enable or Disable debugging? */ if ('-' == *s) { @@ -712,7 +712,7 @@ H5__debug_mask(const char *s) } /* end if */ /* Get the name */ - for (i = 0; HDisalpha(*s); i++, s++) + for (i = 0; isalpha(*s); i++, s++) if (i < sizeof pkg_name) pkg_name[i] = *s; pkg_name[MIN(sizeof(pkg_name) - 1, i)] = '\0'; @@ -744,7 +744,7 @@ H5__debug_mask(const char *s) fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); } /* end if-else */ } - else if (HDisdigit(*s)) { + else if (isdigit(*s)) { int fd = (int)strtol(s, &rest, 0); H5_debug_open_stream_t *open_stream; @@ -888,7 +888,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) /* Allow different versions of the header files and library? */ s = HDgetenv("HDF5_DISABLE_VERSION_CHECK"); - if (s && HDisdigit(*s)) + if (s && isdigit(*s)) disable_version_check = (unsigned int)strtol(s, NULL, 0); } diff --git a/src/H5AC.c b/src/H5AC.c index 3a441472dbf..b32c2c691d5 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -149,7 +149,7 @@ H5AC_init(void) const char *s; /* String for environment variables */ s = HDgetenv("H5_COLL_API_SANITY_CHECK"); - if (s && HDisdigit(*s)) { + if (s && isdigit(*s)) { long env_val = strtol(s, NULL, 0); H5_coll_api_sanity_check_g = (0 == env_val) ? FALSE : TRUE; } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index fbe1d86981c..38c9e3de711 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -290,7 +290,7 @@ H5FD_mpio_init(void) /* Allow MPI buf-and-file-type optimizations? */ s = HDgetenv("HDF5_MPI_OPT_TYPES"); - if (s && HDisdigit(*s)) + if (s && isdigit(*s)) H5FD_mpi_opt_types_g = (0 == strtol(s, NULL, 0)) ? FALSE : TRUE; #ifdef H5FDmpio_DEBUG diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index b3e16202888..688fcbc4767 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -2005,7 +2005,7 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha /* "trim" tailing whitespace by replacing with null terminator*/ buffer_i = 0; - while (!HDisspace(setting_pointers[setting_i][buffer_i])) + while (!isspace(setting_pointers[setting_i][buffer_i])) buffer_i++; setting_pointers[setting_i][buffer_i] = '\0'; @@ -2242,7 +2242,7 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl) /* check for restrictions */ for (i = 0; i < len; i++) { /* scheme = [a-zA-Z+-.]+ (terminated by ":") */ - if (!HDisalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && '.' != curstr[i]) + if (!isalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && '.' != curstr[i]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction"); } @@ -2308,7 +2308,7 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl) else if (len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring"); for (i = 0; i < len; i++) - if (!HDisdigit(curstr[i])) + if (!isdigit(curstr[i])) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT is not a decimal string"); /* copy port */ @@ -2766,7 +2766,7 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written) /* Find first non-whitespace character from start; * reduce total length per character. */ - while ((s_len > 0) && HDisspace((unsigned char)s[0]) && s_len > 0) { + while ((s_len > 0) && isspace((unsigned char)s[0]) && s_len > 0) { s++; s_len--; } @@ -2778,7 +2778,7 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written) if (s_len > 0) { do { s_len--; - } while (HDisspace((unsigned char)s[s_len])); + } while (isspace((unsigned char)s[s_len])); s_len++; /* write output into dest */ @@ -2858,8 +2858,7 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s */ for (s_off = 0; s_off < s_len; s_off++) { c = s[s_off]; - if (HDisalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' || - (c == '/' && encode_slash == FALSE)) + if (isalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' || (c == '/' && encode_slash == FALSE)) dest[dest_off++] = c; else { hex_off = 0; diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 9fb182693b6..186809bb382 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -184,7 +184,7 @@ H5O__mtime_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, if (H5_IS_BUFFER_OVERFLOW(p, 16, p_end)) HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); for (int i = 0; i < 14; i++) - if (!HDisdigit(p[i])) + if (!isdigit(p[i])) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") /* Convert YYYYMMDDhhmmss UTC to a time_t. */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 7734e8f31d8..64f7310f224 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -390,10 +390,10 @@ H5Z__get_token(H5Z_token *current) current->tok_begin = current->tok_end; while (current->tok_begin[0] != '\0') { - if (HDisspace(current->tok_begin[0])) { + if (isspace(current->tok_begin[0])) { /* ignore whitespace */ } - else if (HDisdigit(current->tok_begin[0]) || current->tok_begin[0] == '.') { + else if (isdigit(current->tok_begin[0]) || current->tok_begin[0] == '.') { current->tok_end = current->tok_begin; /* @@ -405,7 +405,7 @@ H5Z__get_token(H5Z_token *current) /* is number */ current->tok_type = H5Z_XFORM_INTEGER; - while (HDisdigit(current->tok_end[0])) + while (isdigit(current->tok_end[0])) ++current->tok_end; } @@ -422,7 +422,7 @@ H5Z__get_token(H5Z_token *current) if (current->tok_end[0] == '.') do { ++current->tok_end; - } while (HDisdigit(current->tok_end[0])); + } while (isdigit(current->tok_end[0])); if (current->tok_end[0] == 'e' || current->tok_end[0] == 'E') { ++current->tok_end; @@ -430,18 +430,18 @@ H5Z__get_token(H5Z_token *current) if (current->tok_end[0] == '-' || current->tok_end[0] == '+') ++current->tok_end; - if (!HDisdigit(current->tok_end[0])) { + if (!isdigit(current->tok_end[0])) { current->tok_type = H5Z_XFORM_ERROR; HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number") } - while (HDisdigit(current->tok_end[0])) + while (isdigit(current->tok_end[0])) ++current->tok_end; } /* Check that this is a properly formatted numerical value */ - if (HDisalpha(current->tok_end[0]) || current->tok_end[0] == '.') { + if (isalpha(current->tok_end[0]) || current->tok_end[0] == '.') { current->tok_type = H5Z_XFORM_ERROR; HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number") } @@ -449,12 +449,12 @@ H5Z__get_token(H5Z_token *current) break; } - else if (HDisalpha(current->tok_begin[0])) { + else if (isalpha(current->tok_begin[0])) { /* is symbol */ current->tok_type = H5Z_XFORM_SYMBOL; current->tok_end = current->tok_begin; - while (HDisalnum(current->tok_end[0])) + while (isalnum(current->tok_end[0])) ++current->tok_end; break; @@ -1476,11 +1476,11 @@ H5Z_xform_create(const char *expr) * A more sophisticated check is needed to support scientific notation. */ for (i = 0; i < HDstrlen(expr); i++) { - if (HDisalpha(expr[i])) { + if (isalpha(expr[i])) { if ((i > 0) && (i < (HDstrlen(expr) - 1))) { if (((expr[i] == 'E') || (expr[i] == 'e')) && - (HDisdigit(expr[i - 1]) || (expr[i - 1] == '.')) && - (HDisdigit(expr[i + 1]) || (expr[i + 1] == '-') || (expr[i + 1] == '+'))) + (isdigit(expr[i - 1]) || (expr[i - 1] == '.')) && + (isdigit(expr[i + 1]) || (expr[i + 1] == '-') || (expr[i + 1] == '+'))) continue; } /* end if */ @@ -1622,7 +1622,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) /* Find the number of times "x" is used in this equation, and allocate room for storing that many * points */ for (i = 0; i < HDstrlen(new_data_xform_prop->xform_exp); i++) - if (HDisalpha(new_data_xform_prop->xform_exp[i])) + if (isalpha(new_data_xform_prop->xform_exp[i])) count++; if (count > 0) diff --git a/src/H5dbg.c b/src/H5dbg.c index ed517ad67c8..5c0514d921a 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -119,7 +119,7 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *mark else { c = buf[buf_offset + u + v]; - if (HDisprint(c)) + if (isprint(c)) HDfputc(c, stream); else HDfputc('.', stream); diff --git a/src/H5private.h b/src/H5private.h index a062ae7dca0..d75843e20b9 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -754,45 +754,12 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDgmtime #define HDgmtime(T) gmtime(T) #endif -#ifndef HDisalnum -#define HDisalnum(C) isalnum((int)(C)) /* Cast for Solaris warning */ -#endif -#ifndef HDisalpha -#define HDisalpha(C) isalpha((int)(C)) /* Cast for Solaris warning */ -#endif #ifndef HDisatty #define HDisatty(F) isatty(F) #endif -#ifndef HDiscntrl -#define HDiscntrl(C) iscntrl((int)(C)) /* Cast for solaris warning */ -#endif -#ifndef HDisdigit -#define HDisdigit(C) isdigit((int)(C)) /* Cast for Solaris warning */ -#endif -#ifndef HDisgraph -#define HDisgraph(C) isgraph((int)(C)) /* Cast for Solaris warning*/ -#endif -#ifndef HDislower -#define HDislower(C) islower((int)(C)) /* Cast for Solaris warning */ -#endif #ifndef HDisnan #define HDisnan(X) isnan(X) #endif -#ifndef HDisprint -#define HDisprint(C) isprint((int)(C)) /* Cast for Solaris warning */ -#endif -#ifndef HDispunct -#define HDispunct(C) ispunct((int)(C)) /* Cast for Solaris warning */ -#endif -#ifndef HDisspace -#define HDisspace(C) isspace((int)(C)) /* Cast for Solaris warning */ -#endif -#ifndef HDisupper -#define HDisupper(C) isupper((int)(C)) /* Cast for Solaris warning */ -#endif -#ifndef HDisxdigit -#define HDisxdigit(C) isxdigit((int)(C)) /* Cast for Solaris warning */ -#endif #ifndef HDlabs #define HDlabs(X) labs(X) #endif @@ -1449,34 +1416,34 @@ H5_DLL herr_t H5_trace_args(struct H5RS_str_t *rs, const char *type, va_list ap) * Handles H5XY_. */ #define H5_IS_API(S) \ - ('_' != ((const char *)S)[2] /* underscore at position 2 */ \ - && '_' != ((const char *)S)[3] /* underscore at position 3 */ \ - && !( /* NOT */ \ - ((const char *)S)[4] /* pos 4 exists */ \ - && (HDisupper(S[3]) || HDisdigit(S[3])) /* pos 3 dig | uc */ \ - && '_' == ((const char *)S)[4] /* pos 4 underscore */ \ + ('_' != ((const char *)S)[2] /* underscore at position 2 */ \ + && '_' != ((const char *)S)[3] /* underscore at position 3 */ \ + && !( /* NOT */ \ + ((const char *)S)[4] /* pos 4 exists */ \ + && (isupper(S[3]) || isdigit(S[3])) /* pos 3 dig | uc */ \ + && '_' == ((const char *)S)[4] /* pos 4 underscore */ \ )) /* `S' is the name of a function which is being tested to check if it's */ /* a public API function */ #define H5_IS_PUB(S) \ - (((HDisdigit(S[1]) || HDisupper(S[1])) && HDislower(S[2])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && HDislower(S[3])) || \ - (!S[4] || ((HDisdigit(S[3]) || HDisupper(S[3])) && HDislower(S[4])))) + (((isdigit(S[1]) || isupper(S[1])) && islower(S[2])) || \ + ((isdigit(S[2]) || isupper(S[2])) && islower(S[3])) || \ + (!S[4] || ((isdigit(S[3]) || isupper(S[3])) && islower(S[4])))) /* `S' is the name of a function which is being tested to check if it's */ /* a private library function */ #define H5_IS_PRIV(S) \ - (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && HDislower(S[3])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && HDislower(S[4])) || \ - ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && HDislower(S[5]))) + (((isdigit(S[1]) || isupper(S[1])) && '_' == S[2] && islower(S[3])) || \ + ((isdigit(S[2]) || isupper(S[2])) && '_' == S[3] && islower(S[4])) || \ + ((isdigit(S[3]) || isupper(S[3])) && '_' == S[4] && islower(S[5]))) /* `S' is the name of a function which is being tested to check if it's */ /* a package private function */ #define H5_IS_PKG(S) \ - (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && '_' == S[3] && HDislower(S[4])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && '_' == S[4] && HDislower(S[5])) || \ - ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && '_' == S[5] && HDislower(S[6]))) + (((isdigit(S[1]) || isupper(S[1])) && '_' == S[2] && '_' == S[3] && islower(S[4])) || \ + ((isdigit(S[2]) || isupper(S[2])) && '_' == S[3] && '_' == S[4] && islower(S[5])) || \ + ((isdigit(S[3]) || isupper(S[3])) && '_' == S[4] && '_' == S[5] && islower(S[6]))) /* global library version information string */ extern char H5_lib_vers_info_g[]; diff --git a/src/H5trace.c b/src/H5trace.c index 60632de5d47..f9ed8f5a093 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -248,7 +248,7 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) asize[i] = -1; /* Parse the argument types */ - for (argno = 0; *type; argno++, type += (HDisupper(*type) ? 2 : 1)) { + for (argno = 0; *type; argno++, type += (isupper(*type) ? 2 : 1)) { /* Count levels of indirection */ for (ptr = 0; '*' == *type; type++) ptr++; @@ -3922,7 +3922,7 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) break; default: - if (HDisupper(type[0])) + if (isupper(type[0])) H5RS_asprintf_cat(rs, "BADTYPE(%c%c)", type[0], type[1]); else H5RS_asprintf_cat(rs, "BADTYPE(%c)", type[0]); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 717ab12f4f1..31f26a7d3fb 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -187,7 +187,7 @@ parse_hsize_list(const char *h_list, subset_d *d) H5TOOLS_START_DEBUG(" - h_list:%s", h_list); /* count how many integers do we have */ for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if (HDisdigit(*ptr)) { + if (isdigit(*ptr)) { if (!last_digit) /* the last read character wasn't a digit */ size_count++; @@ -209,11 +209,11 @@ parse_hsize_list(const char *h_list, subset_d *d) H5TOOLS_INFO("Unable to allocate space for subset data"); for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if (HDisdigit(*ptr)) { + if (isdigit(*ptr)) { /* we should have an integer now */ p_list[i++] = (hsize_t)strtoull(ptr, NULL, 0); - while (HDisdigit(*ptr)) + while (isdigit(*ptr)) /* scroll to end of integer */ ptr++; } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 31671b02b8d..3b0fd72ddb1 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -602,7 +602,7 @@ parse_mask_list(const char *h_list) ptr = h_list; while (*ptr) { /* scan for an offset which is an unsigned int */ - if (!HDisdigit(*ptr)) { + if (!isdigit(*ptr)) { error_msg("Bad mask list(%s)\n", h_list); return FAIL; } @@ -615,7 +615,7 @@ parse_mask_list(const char *h_list) } /* skip to end of integer */ - while (HDisdigit(*++ptr)) + while (isdigit(*++ptr)) ; /* Look for the common separator */ if (*ptr++ != ',') { @@ -624,7 +624,7 @@ parse_mask_list(const char *h_list) } /* scan for a length which is a positive int */ - if (!HDisdigit(*ptr)) { + if (!isdigit(*ptr)) { error_msg("Bad mask list(%s)\n", h_list); return FAIL; } @@ -641,7 +641,7 @@ parse_mask_list(const char *h_list) } /* skip to end of int */ - while (HDisdigit(*++ptr)) + while (isdigit(*++ptr)) ; /* store the offset,length pair */ diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index b423f0dd082..fa0eaaa0dce 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -1345,10 +1345,10 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; - if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) { + if (HDstrlen(buf) > 1 || isdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index 79d025d424c..1880e0b5a9c 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -862,7 +862,7 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; if (!HDstrcasecmp(buf, "hdf5")) { @@ -902,7 +902,7 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->chk_size[j] = parse_size_directive(buf); @@ -928,14 +928,14 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; - if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) { + if (HDstrlen(buf) > 1 || isdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) - if (!HDisdigit(buf[j])) { + if (!isdigit(buf[j])) { fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); exit(EXIT_FAILURE); } @@ -985,7 +985,7 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->dset_size[j] = parse_size_directive(buf); @@ -1054,7 +1054,7 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->buf_size[j] = parse_size_directive(buf); @@ -1081,7 +1081,7 @@ parse_command_line(int argc, const char *const *argv) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (HDisalnum(*end) && i < 10) + if (isalnum(*end) && i < 10) buf[i++] = *end; cl_opts->order[j] = (int)parse_size_directive(buf); diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 38f9d3b8083..b5df9fae11a 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); @@ -242,13 +242,13 @@ 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("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); @@ -585,7 +585,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); From 1bb32cda35d072573c800c460e86baa3418e9a09 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 29 Jun 2023 12:21:29 -0700 Subject: [PATCH 2/2] Fixed missing HDisalpha --- src/H5private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index d75843e20b9..d0eff840fa5 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1177,8 +1177,8 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); #define H5_DIR_SEPC '\\' #define H5_DIR_SEPS "\\" #define H5_CHECK_DELIMITER(SS) ((SS == H5_DIR_SEPC) || (SS == H5_DIR_SLASH_SEPC)) -#define H5_CHECK_ABSOLUTE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':') && (H5_CHECK_DELIMITER(NAME[2]))) -#define H5_CHECK_ABS_DRIVE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':')) +#define H5_CHECK_ABSOLUTE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':') && (H5_CHECK_DELIMITER(NAME[2]))) +#define H5_CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':')) #define H5_CHECK_ABS_PATH(NAME) (H5_CHECK_DELIMITER(NAME[0])) #define H5_GET_LAST_DELIMITER(NAME, ptr) \