From 7196d1e4c2a59509b6274c41b068ab89d63a3336 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 29 Jun 2023 12:47:16 -0700 Subject: Remove HD from HDis* (e.g., isalpha) (#3212) * HDisalnum * HDisalpha * HDiscntrl * HDisdigit * HDisgraph * HDislower * HDisprint * HDispunct * HDisspace * HDisupper * HDisxdigit --- 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 | 67 ++++++++++--------------------------- 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, 69 insertions(+), 103 deletions(-) diff --git a/src/H5.c b/src/H5.c index 2abecd2..7949504 100644 --- a/src/H5.c +++ b/src/H5.c @@ -693,7 +693,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) { @@ -709,7 +709,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'; @@ -741,7 +741,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; @@ -885,7 +885,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 491459d..a984eb8 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -144,7 +144,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 47f6ae5..b72b892 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -280,7 +280,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 a2d5801..56d7d74 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -1958,7 +1958,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'; @@ -2186,7 +2186,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"); } @@ -2252,7 +2252,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 */ @@ -2699,7 +2699,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--; } @@ -2711,7 +2711,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 */ @@ -2788,8 +2788,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 71a0974..6cdd4b7 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 64b8b05..b2b4183 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -379,10 +379,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; /* @@ -394,7 +394,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; } @@ -411,7 +411,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; @@ -419,18 +419,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") } @@ -438,12 +438,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; @@ -1420,11 +1420,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 */ @@ -1558,7 +1558,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 083a81c..69afd01 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -114,7 +114,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 71f32da..23fb104 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 @@ -1198,8 +1165,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) \ @@ -1437,34 +1404,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 45065a2..ba84f7a 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -234,7 +234,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++; @@ -3908,7 +3908,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 baff559..e9b6dfc 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 db13a83..dd223f3 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 76a9be5..37e6aeb 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -1331,10 +1331,10 @@ parse_command_line(int argc, const char *const *argv) memset(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 0a3850e..5ffad71 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -852,7 +852,7 @@ parse_command_line(int argc, const char *const *argv) memset(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")) { @@ -892,7 +892,7 @@ parse_command_line(int argc, const char *const *argv) memset(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); @@ -918,14 +918,14 @@ parse_command_line(int argc, const char *const *argv) memset(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); } @@ -975,7 +975,7 @@ parse_command_line(int argc, const char *const *argv) memset(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); @@ -1044,7 +1044,7 @@ parse_command_line(int argc, const char *const *argv) memset(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); @@ -1071,7 +1071,7 @@ parse_command_line(int argc, const char *const *argv) memset(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 3d6f829..f88ba6f 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); @@ -581,7 +581,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); -- cgit v0.12