diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 8 | ||||
-rw-r--r-- | src/H5AC.c | 2 | ||||
-rw-r--r-- | src/H5FDmpio.c | 2 | ||||
-rw-r--r-- | src/H5FDs3comms.c | 13 | ||||
-rw-r--r-- | src/H5Omtime.c | 2 | ||||
-rw-r--r-- | src/H5Ztrans.c | 26 | ||||
-rw-r--r-- | src/H5dbg.c | 2 | ||||
-rw-r--r-- | src/H5private.h | 67 | ||||
-rw-r--r-- | src/H5trace.c | 4 |
9 files changed, 46 insertions, 80 deletions
@@ -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); } @@ -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]); |