summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-10-23 01:43:00 +0000
committerache <ache@FreeBSD.org>1997-10-23 01:43:00 +0000
commitc722721f8f55d7fc7f3bf699a132350d349c80f0 (patch)
tree0c0441c59790cfd53f645aed230f67076efda605 /gnu
parentcca19fe7264e46e7cdd694359b93d7816d7978ce (diff)
downloadFreeBSD-src-c722721f8f55d7fc7f3bf699a132350d349c80f0.zip
FreeBSD-src-c722721f8f55d7fc7f3bf699a132350d349c80f0.tar.gz
Add (unsigned char) casts to ctype macros
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/dfa.c42
-rw-r--r--gnu/usr.bin/grep/search.c6
2 files changed, 24 insertions, 24 deletions
diff --git a/gnu/usr.bin/grep/dfa.c b/gnu/usr.bin/grep/dfa.c
index b8144d9..4b9eb2e 100644
--- a/gnu/usr.bin/grep/dfa.c
+++ b/gnu/usr.bin/grep/dfa.c
@@ -39,23 +39,23 @@ extern void free();
#endif
#ifndef isgraph
-#define isgraph(C) (isprint(C) && !isspace(C))
+#define isgraph(C) (isprint((unsigned char)C) && !isspace((unsigned char)C))
#endif
-#define ISALPHA(C) isalpha(C)
-#define ISUPPER(C) isupper(C)
-#define ISLOWER(C) islower(C)
-#define ISDIGIT(C) isdigit(C)
-#define ISXDIGIT(C) isxdigit(C)
-#define ISSPACE(C) isspace(C)
-#define ISPUNCT(C) ispunct(C)
-#define ISALNUM(C) isalnum(C)
-#define ISPRINT(C) isprint(C)
-#define ISGRAPH(C) isgraph(C)
-#define ISCNTRL(C) iscntrl(C)
+#define ISALPHA(C) isalpha((unsigned char)C)
+#define ISUPPER(C) isupper((unsigned char)C)
+#define ISLOWER(C) islower((unsigned char)C)
+#define ISDIGIT(C) isdigit((unsigned char)C)
+#define ISXDIGIT(C) isxdigit((unsigned char)C)
+#define ISSPACE(C) isspace((unsigned char)C)
+#define ISPUNCT(C) ispunct((unsigned char)C)
+#define ISALNUM(C) isalnum((unsigned char)C)
+#define ISPRINT(C) isprint((unsigned char)C)
+#define ISGRAPH(C) isgraph((unsigned char)C)
+#define ISCNTRL(C) iscntrl((unsigned char)C)
#include "dfa.h"
-#include "gnuregex.h"
+#include <gnuregex.h>
#if __STDC__
typedef void *ptr_t;
@@ -638,9 +638,9 @@ lex()
setbit(c3, ccl);
if (case_fold)
if (ISUPPER(c3))
- setbit(tolower(c3), ccl);
+ setbit(tolower((unsigned char)c3), ccl);
else if (ISLOWER(c3))
- setbit(toupper(c3), ccl);
+ setbit(toupper((unsigned char)c3), ccl);
}
}
#else
@@ -649,9 +649,9 @@ lex()
setbit(c, ccl);
if (case_fold)
if (ISUPPER(c))
- setbit(tolower(c), ccl);
+ setbit(tolower((unsigned char)c), ccl);
else if (ISLOWER(c))
- setbit(toupper(c), ccl);
+ setbit(toupper((unsigned char)c), ccl);
++c;
}
#endif
@@ -675,10 +675,10 @@ lex()
{
zeroset(ccl);
setbit(c, ccl);
- if (isupper(c))
- setbit(tolower(c), ccl);
+ if (isupper((unsigned char)c))
+ setbit(tolower((unsigned char)c), ccl);
else
- setbit(toupper(c), ccl);
+ setbit(toupper((unsigned char)c), ccl);
return lasttok = CSET + charclass_index(ccl);
}
return c;
@@ -1951,7 +1951,7 @@ dfacomp(s, len, d, searchflag)
case_fold = 0;
for (i = 0; i < len; ++i)
if (ISUPPER(s[i]))
- copy[i] = tolower(s[i]);
+ copy[i] = tolower((unsigned char)s[i]);
else
copy[i] = s[i];
diff --git a/gnu/usr.bin/grep/search.c b/gnu/usr.bin/grep/search.c
index 5e17d03..f0e3d5c 100644
--- a/gnu/usr.bin/grep/search.c
+++ b/gnu/usr.bin/grep/search.c
@@ -50,11 +50,11 @@ extern char *memchr();
#define ISALNUM(C) (isascii(C) && isalnum(C))
#define ISUPPER(C) (isascii(C) && isupper(C))
#else
-#define ISALNUM(C) isalnum(C)
-#define ISUPPER(C) isupper(C)
+#define ISALNUM(C) isalnum((unsigned char)C)
+#define ISUPPER(C) isupper((unsigned char)C)
#endif
-#define TOLOWER(C) (ISUPPER(C) ? tolower(C) : (C))
+#define TOLOWER(C) (ISUPPER(C) ? tolower((unsigned char)C) : (C))
#include "grep.h"
#include "dfa.h"
OpenPOWER on IntegriCloud