diff options
-rw-r--r-- | lib/system.h | 14 | ||||
-rw-r--r-- | tests/argcv.c | 8 | ||||
-rw-r--r-- | tests/genfile.c | 8 |
3 files changed, 8 insertions, 22 deletions
diff --git a/lib/system.h b/lib/system.h index 2b3d50b..1070463 100644 --- a/lib/system.h +++ b/lib/system.h @@ -23,20 +23,6 @@ #include <alloca.h> #include <sys/types.h> -#include <ctype.h> - -/* IN_CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given - as an argument to <ctype.h> macros like `isspace'. */ -#if STDC_HEADERS -# define IN_CTYPE_DOMAIN(c) 1 -#else -# define IN_CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif - -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#define ISODIGIT(c) ((unsigned) (c) - '0' <= 7) -#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) -#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) /* Declare string and memory handling routines. Take care that an ANSI string.h and pre-ANSI memory.h might conflict, and that memory.h and diff --git a/tests/argcv.c b/tests/argcv.c index 794ebbd..81de2bc 100644 --- a/tests/argcv.c +++ b/tests/argcv.c @@ -19,8 +19,8 @@ #ifdef HAVE_CONFIG_H # include <config.h> #endif -#include <ctype.h> +#include <c-ctype.h> #include <argcv.h> /* @@ -156,7 +156,7 @@ escaped_length (const char *str, int *quote) len += 2; *quote = 1; } - else if (isprint ((unsigned char) *str)) + else if (c_isprint (*str)) len++; else if (argcv_escape_char (*str) != -1) len += 2; @@ -252,7 +252,7 @@ escape_copy (char *dst, const char *src) *dst++ = '\\'; *dst++ = '"'; } - else if (*src != '\t' && isprint ((unsigned char) *src)) + else if (*src != '\t' && c_isprint (*src)) *dst++ = *src; else { @@ -371,7 +371,7 @@ argcv_string (int argc, char **argv, char **pstring) buffer[j++] = '"'; } - for (; j > 0 && isspace ((unsigned char) buffer[j - 1]); j--) + for (; j > 0 && c_isspace (buffer[j - 1]); j--) ; buffer[j] = 0; if (pstring) diff --git a/tests/genfile.c b/tests/genfile.c index 0074c5c..ee82f9e 100644 --- a/tests/genfile.c +++ b/tests/genfile.c @@ -688,7 +688,7 @@ print_stat (const char *name) { uintmax_t val = st.st_mode; - if (ispunct ((unsigned char) p[4])) + if (c_ispunct (p[4])) { char *q; @@ -933,12 +933,12 @@ exec_command (int argc, char **argv) while ((p = fgets (buf, sizeof buf, fp))) { - while (*p && !isspace ((unsigned char) *p) && *p != ':') + while (*p && !c_isspace (*p) && *p != ':') p++; if (*p == ':') { - for (p++; *p && isspace ((unsigned char) *p); p++) + for (p++; *p && c_isspace (*p); p++) ; if (*p @@ -947,7 +947,7 @@ exec_command (int argc, char **argv) char *end; uintmax_t n = strtoumax (p + sizeof CHECKPOINT_TEXT - 1, &end, 10); - if (!(*end && !isspace ((unsigned char) *end))) + if (!(*end && !c_isspace (*end))) { process_checkpoint (n); kill (pid, SIGUSR1); |