summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regex2.h
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-08-11 11:42:03 +0000
committerache <ache@FreeBSD.org>1996-08-11 11:42:03 +0000
commitbef006b8fce691d9a1efce1ebaab499612c07e0f (patch)
tree56af5c05e41691870a87802f8747246bbf879fad /lib/libc/regex/regex2.h
parent286a76bdee0819fa63a83d2e2088c601183e7cb7 (diff)
downloadFreeBSD-src-bef006b8fce691d9a1efce1ebaab499612c07e0f.zip
FreeBSD-src-bef006b8fce691d9a1efce1ebaab499612c07e0f.tar.gz
Use locale for character classes instead of hardcoded values
Misc 8bit cleanup
Diffstat (limited to 'lib/libc/regex/regex2.h')
-rw-r--r--lib/libc/regex/regex2.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h
index 64b6212..9560e05 100644
--- a/lib/libc/regex/regex2.h
+++ b/lib/libc/regex/regex2.h
@@ -121,13 +121,13 @@ typedef long sopno;
typedef struct {
uch *ptr; /* -> uch [csetsize] */
uch mask; /* bit within array */
- uch hash; /* hash code */
+ short hash; /* hash code */
size_t smultis;
char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
} cset;
/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
-#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
-#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c))
+#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (uch)(c))
+#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (uch)(c))
#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask)
#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */
#define MCsub(p, cs, cp) mcsub(p, cs, cp)
@@ -170,4 +170,4 @@ struct re_guts {
/* misc utilities */
#define OUT (CHAR_MAX+1) /* a non-character value */
-#define ISWORD(c) (isalnum(c) || (c) == '_')
+#define ISWORD(c) (isalnum((uch)(c)) || (c) == '_')
OpenPOWER on IntegriCloud