diff options
author | Jim Meyering <jim@meyering.net> | 1999-01-28 17:32:00 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-01-28 17:32:00 +0000 |
commit | 0cf83ec8a087b52e0db95dc7a36bd239c32b2b8f (patch) | |
tree | 338228bb151d5e72a8945ae10e85f3f5e7294531 /libidu/scanners.c | |
parent | 05e39c0872e8f4632218cb45abe7a5643e50f7c1 (diff) | |
download | idutils-0cf83ec8a087b52e0db95dc7a36bd239c32b2b8f.tar.gz idutils-0cf83ec8a087b52e0db95dc7a36bd239c32b2b8f.tar.bz2 idutils-0cf83ec8a087b52e0db95dc7a36bd239c32b2b8f.zip |
(set_ushort_ctype): Use an unsigned char index.
(clear_ushort_ctype): Likewise.
(set_uchar_ctype): Likewise.
(clear_uchar_ctype): Likewise.
(id_0): Add `unsigned' to declaration of this file-scope static var..
(get_token_c): Add `unsigned' to declaration of `id'.
(get_token_asm): Likewise.
(get_token_text): Likewise.
Diffstat (limited to 'libidu/scanners.c')
-rw-r--r-- | libidu/scanners.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/libidu/scanners.c b/libidu/scanners.c index d60f939..65a002f 100644 --- a/libidu/scanners.c +++ b/libidu/scanners.c @@ -1,5 +1,5 @@ /* scanners.c -- file & directory name manipulations - Copyright (C) 1986, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1986, 1995, 1996, 1999 Free Software Foundation, Inc. Written by Greg McGary <gkm@gnu.ai.mit.edu> This program is free software; you can redistribute it and/or modify @@ -300,36 +300,40 @@ static void set_ushort_ctype (unsigned short *ctype, char const *chars, int type) { unsigned short *rct = &ctype[1]; + unsigned char const *uc = (unsigned char const *) chars; - while (*chars) - rct[*chars++] |= type; + while (*uc) + rct[*uc++] |= type; } static void clear_ushort_ctype (unsigned short *ctype, char const *chars, int type) { unsigned short *rct = &ctype[1]; + unsigned char const *uc = (unsigned char const *) chars; - while (*chars) - rct[*chars++] &= ~type; + while (*uc) + rct[*uc++] &= ~type; } static void set_uchar_ctype (unsigned char *ctype, char const *chars, int type) { unsigned char *rct = &ctype[1]; + unsigned char const *uc = (unsigned char const *) chars; - while (*chars) - rct[*chars++] |= type; + while (*uc) + rct[*uc++] |= type; } static void clear_uchar_ctype (unsigned char *ctype, char const *chars, int type) { unsigned char *rct = &ctype[1]; + unsigned char const *uc = (unsigned char const *) chars; - while (*chars) - rct[*chars++] &= ~type; + while (*uc) + rct[*uc++] &= ~type; } /*************** C & C++ ****************************************************/ @@ -473,7 +477,7 @@ parse_args_c (char **argv, int argc) return args; } -static char id_0[1<<020]; +static unsigned char id_0[1<<020]; /* Grab the next identifier from the C source file. This state machine is built for speed, not elegance. */ @@ -484,7 +488,7 @@ get_token_c (FILE *in_FILE, void const *args, int *flags) #define ARGS ((struct args_c const *) args) static int new_line = 1; unsigned short const *rct = &ARGS->ctype[1]; - char *id = id_0; + unsigned char *id = id_0; int c; obstack_blank (&tokens_obstack, offsetof (struct token, tok_name)); @@ -869,7 +873,7 @@ get_token_asm (FILE *in_FILE, void const *args, int *flags) #define ARGS ((struct args_asm const *) args) static int new_line = 1; unsigned char const *rct = &ARGS->ctype[1]; - char *id = id_0; + unsigned char *id = id_0; int c; obstack_blank (&tokens_obstack, offsetof (struct token, tok_name)); @@ -1155,7 +1159,7 @@ get_token_text (FILE *in_FILE, void const *args, int *flags) #define ARGS ((struct args_text const *) args) unsigned char const *rct = &ARGS->ctype[1]; int c; - char *id = id_0; + unsigned char *id = id_0; obstack_blank (&tokens_obstack, offsetof (struct token, tok_name)); |