From 0cf83ec8a087b52e0db95dc7a36bd239c32b2b8f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 28 Jan 1999 17:32:00 +0000 Subject: (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. --- libidu/scanners.c | 30 +++++++++++++++++------------- 1 file 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 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)); -- cgit v1.2.3