Wed Oct 27 09:55:14 PDT 1999

(Mandrake)

Trying to get this to build under Tru64


SVN revision: 994
This commit is contained in:
Mandrake 1999-10-27 09:15:47 +00:00
parent ef0e68895e
commit dea684b1bd
7 changed files with 182 additions and 177 deletions

View File

@ -49,3 +49,10 @@ Wed Sep 8 12:08:19 PDT 1999
(Mandrake) (Mandrake)
aix patch aix patch
-------------------------------------------------------------------------------
Wed Oct 27 09:55:14 PDT 1999
(Mandrake)
Trying to get this to build under Tru64

View File

@ -43,7 +43,7 @@
struct arglist struct arglist
{ {
struct arglist *next; struct arglist *next;
U_CHAR *name; unsigned char *name;
int length; int length;
int argno; int argno;
}; };
@ -279,7 +279,7 @@ cpp_lex(pfile)
register struct token *toktab; register struct token *toktab;
enum cpp_token token; enum cpp_token token;
struct operation op; struct operation op;
U_CHAR *tok_start, *tok_end; unsigned char *tok_start, *tok_end;
int old_written; int old_written;
retry: retry:
@ -332,7 +332,7 @@ cpp_lex(pfile)
unsigned width = MAX_CHAR_TYPE_SIZE; unsigned width = MAX_CHAR_TYPE_SIZE;
int wide_flag = 0; int wide_flag = 0;
int max_chars; int max_chars;
U_CHAR *ptr = tok_start; unsigned char *ptr = tok_start;
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
char token_buffer[MAX_LONG_TYPE_SIZE / MAX_CHAR_TYPE_SIZE + MB_CUR_MAX]; char token_buffer[MAX_LONG_TYPE_SIZE / MAX_CHAR_TYPE_SIZE + MB_CUR_MAX];

View File

@ -26,10 +26,10 @@
#include "cpphash.h" #include "cpphash.h"
static HASHNODE *hashtab[HASHSIZE]; static HASHNODE *hashtab[HASHSIZE];
HASHNODE *cpp_lookup(struct parse_file *pfile, const U_CHAR * name, int len, HASHNODE *cpp_lookup(struct parse_file *pfile, const unsigned char * name, int len,
int hash); int hash);
void delete_macro(HASHNODE * hp); void delete_macro(HASHNODE * hp);
HASHNODE *install(U_CHAR * name, int len, enum node_type type, int ivalue, HASHNODE *install(unsigned char * name, int len, enum node_type type, int ivalue,
char *value, int hash); char *value, int hash);
/* Define a generic NULL if one hasn't already been defined. */ /* Define a generic NULL if one hasn't already been defined. */
@ -52,7 +52,7 @@ HASHNODE *install(U_CHAR * name, int len, enum node_type type, int iva
*/ */
int int
hashf(name, len, hashsize) hashf(name, len, hashsize)
register const U_CHAR *name; register const unsigned char *name;
register int len; register int len;
int hashsize; int hashsize;
{ {
@ -77,11 +77,11 @@ hashf(name, len, hashsize)
HASHNODE * HASHNODE *
cpp_lookup(pfile, name, len, hash) cpp_lookup(pfile, name, len, hash)
struct parse_file *pfile; struct parse_file *pfile;
const U_CHAR *name; const unsigned char *name;
int len; int len;
int hash; int hash;
{ {
register const U_CHAR *bp; register const unsigned char *bp;
register HASHNODE *bucket; register HASHNODE *bucket;
pfile = NULL; pfile = NULL;
@ -164,7 +164,7 @@ delete_macro(hp)
*/ */
HASHNODE * HASHNODE *
install(name, len, type, ivalue, value, hash) install(name, len, type, ivalue, value, hash)
U_CHAR *name; unsigned char *name;
int len; int len;
enum node_type type; enum node_type type;
int ivalue; int ivalue;
@ -173,7 +173,7 @@ install(name, len, type, ivalue, value, hash)
{ {
register HASHNODE *hp; register HASHNODE *hp;
register int i, bucket; register int i, bucket;
register U_CHAR *p, *q; register unsigned char *p, *q;
if (len < 0) if (len < 0)
{ {
@ -200,7 +200,7 @@ install(name, len, type, ivalue, value, hash)
hp->value.ival = ivalue; hp->value.ival = ivalue;
else else
hp->value.cpval = value; hp->value.cpval = value;
hp->name = ((U_CHAR *) hp) + sizeof(HASHNODE); hp->name = ((unsigned char *) hp) + sizeof(HASHNODE);
p = hp->name; p = hp->name;
q = name; q = name;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)

View File

@ -16,7 +16,7 @@ struct hashnode {
of the chain and gets deleted. */ of the chain and gets deleted. */
enum node_type type; /* type of special token */ enum node_type type; /* type of special token */
int length; /* length of token, for quick comparison */ int length; /* length of token, for quick comparison */
U_CHAR *name; /* the actual name */ unsigned char *name; /* the actual name */
union hashval value; /* pointer to expansion, or whatever */ union hashval value; /* pointer to expansion, or whatever */
}; };
@ -33,4 +33,4 @@ typedef struct hashnode HASHNODE;
#define HASHSTEP(old, c) ((old << 2) + c) #define HASHSTEP(old, c) ((old << 2) + c)
#define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */ #define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
extern HASHNODE* install PARAMS ((U_CHAR*,int,enum node_type, int,char*,int)); extern HASHNODE* install PARAMS ((unsigned char*,int,enum node_type, int,char*,int));

View File

@ -210,7 +210,7 @@ struct assertion_hashnode
* of the chain and gets deleted. */ * of the chain and gets deleted. */
struct assertion_hashnode **bucket_hdr; struct assertion_hashnode **bucket_hdr;
int length; /* length of token, for quick comparison */ int length; /* length of token, for quick comparison */
U_CHAR *name; /* the actual name */ unsigned char *name; /* the actual name */
/* List of token-sequences. */ /* List of token-sequences. */
struct tokenlist_list *value; struct tokenlist_list *value;
}; };
@ -264,8 +264,8 @@ extern void delete_macro();
static int finclude(cpp_reader * pfile, int f, char *fname, static int finclude(cpp_reader * pfile, int f, char *fname,
int system_header_p, struct file_name_list *dirptr); int system_header_p, struct file_name_list *dirptr);
static void validate_else(cpp_reader * pfile, char *directive); static void validate_else(cpp_reader * pfile, char *directive);
static int comp_def_part(int first, U_CHAR * beg1, int len1, static int comp_def_part(int first, unsigned char * beg1, int len1,
U_CHAR * beg2, int len2, int last); unsigned char * beg2, int len2, int last);
extern void fancy_abort(); extern void fancy_abort();
static int lookup_import(cpp_reader * pfile, char *filename, static int lookup_import(cpp_reader * pfile, char *filename,
struct file_name_list *searchptr); struct file_name_list *searchptr);
@ -277,12 +277,12 @@ static struct file_name_map *read_name_map();
static char *read_filename_string(); static char *read_filename_string();
static int open_include_file(cpp_reader * pfile, char *filename, static int open_include_file(cpp_reader * pfile, char *filename,
struct file_name_list *searchptr); struct file_name_list *searchptr);
static int check_macro_name(cpp_reader * pfile, U_CHAR * symname, static int check_macro_name(cpp_reader * pfile, unsigned char * symname,
char *usage); char *usage);
static int compare_defs(); static int compare_defs();
static int compare_token_lists(struct arglist *l1, struct arglist *l2); static int compare_token_lists(struct arglist *l1, struct arglist *l2);
static HOST_WIDE_INT eval_if_expression(cpp_reader * pfile, U_CHAR * buf, static HOST_WIDE_INT eval_if_expression(cpp_reader * pfile, unsigned char * buf,
int length); int length);
static int change_newlines(); static int change_newlines();
@ -293,7 +293,7 @@ static struct arglist *read_token_list(cpp_reader * pfile, int *error_flag);
static void free_token_list(struct arglist *tokens); static void free_token_list(struct arglist *tokens);
static int safe_read(int desc, char *ptr, int len); static int safe_read(int desc, char *ptr, int len);
static void push_macro_expansion(cpp_reader * pfile, static void push_macro_expansion(cpp_reader * pfile,
register U_CHAR * x, register unsigned char * x,
int xbuf_len, int xbuf_len,
HASHNODE * hp); HASHNODE * hp);
@ -301,7 +301,7 @@ static struct cpp_pending *nreverse_pending(struct cpp_pending *list);
static char *savestring(char *input); static char *savestring(char *input);
static void conditional_skip(cpp_reader * pfile, int skip, static void conditional_skip(cpp_reader * pfile, int skip,
enum node_type type, U_CHAR * control_macro); enum node_type type, unsigned char * control_macro);
static void skip_if_group(cpp_reader * pfile, int any); static void skip_if_group(cpp_reader * pfile, int any);
/* Last arg to output_line_command. */ /* Last arg to output_line_command. */
@ -323,55 +323,55 @@ extern struct tm *localtime();
* are going to be placed in a table and some old compilers have trouble with * are going to be placed in a table and some old compilers have trouble with
* pointers to functions returning void. */ * pointers to functions returning void. */
static int do_define(cpp_reader * pfile, struct directive *keyword, U_CHAR * buf, static int do_define(cpp_reader * pfile, struct directive *keyword, unsigned char * buf,
U_CHAR * limit); unsigned char * limit);
static int do_line(cpp_reader * pfile, struct directive *keyword); static int do_line(cpp_reader * pfile, struct directive *keyword);
static int do_include(cpp_reader * pfile, struct directive *keyword, static int do_include(cpp_reader * pfile, struct directive *keyword,
U_CHAR * unused1, U_CHAR * unused2); unsigned char * unused1, unsigned char * unused2);
static int do_undef(cpp_reader * pfile, struct directive *keyword, static int do_undef(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_error(cpp_reader * pfile, struct directive *keyword, static int do_error(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_pragma(cpp_reader * pfile, struct directive *keyword, static int do_pragma(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_ident(cpp_reader * pfile, struct directive *keyword, static int do_ident(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_if(cpp_reader * pfile, struct directive *keyword, static int do_if(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_xifdef(cpp_reader * pfile, struct directive *keyword, static int do_xifdef(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_else(cpp_reader * pfile, struct directive *keyword, static int do_else(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_elif(cpp_reader * pfile, struct directive *keyword, static int do_elif(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_endif(cpp_reader * pfile, struct directive *keyword, static int do_endif(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_once(cpp_reader * pfile); static int do_once(cpp_reader * pfile);
static int do_assert(cpp_reader * pfile, struct directive *keyword, static int do_assert(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_unassert(cpp_reader * pfile, struct directive *keyword, static int do_unassert(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
static int do_warning(cpp_reader * pfile, struct directive *keyword, static int do_warning(cpp_reader * pfile, struct directive *keyword,
U_CHAR * buf, U_CHAR * limit); unsigned char * buf, unsigned char * limit);
struct arglist *reverse_token_list(struct arglist *tokens); struct arglist *reverse_token_list(struct arglist *tokens);
void parse_set_mark(struct parse_marker *pmark, cpp_reader * pfile); void parse_set_mark(struct parse_marker *pmark, cpp_reader * pfile);
int check_assertion(cpp_reader * pfile, U_CHAR * name, int sym_length, int check_assertion(cpp_reader * pfile, unsigned char * name, int sym_length,
int tokens_specified, struct arglist *tokens); int tokens_specified, struct arglist *tokens);
void parse_clear_mark(struct parse_marker *pmark); void parse_clear_mark(struct parse_marker *pmark);
void parse_goto_mark(struct parse_marker *pmark, cpp_reader * pfile); void parse_goto_mark(struct parse_marker *pmark, cpp_reader * pfile);
@ -383,7 +383,7 @@ struct file_name_list
char *fname; char *fname;
/* If the following is nonzero, it is a macro name. /* If the following is nonzero, it is a macro name.
* Don't include the file again if that macro is defined. */ * Don't include the file again if that macro is defined. */
U_CHAR *control_macro; unsigned char *control_macro;
/* If the following is nonzero, it is a C-language system include /* If the following is nonzero, it is a C-language system include
* directory. */ * directory. */
int c_system_include_path; int c_system_include_path;
@ -508,16 +508,16 @@ static struct directive directive_table[] =
}; };
/* table to tell if char can be part of a C identifier. */ /* table to tell if char can be part of a C identifier. */
U_CHAR is_idchar[256]; unsigned char is_idchar[256];
/* table to tell if char can be first char of a c identifier. */ /* table to tell if char can be first char of a c identifier. */
U_CHAR is_idstart[256]; unsigned char is_idstart[256];
/* table to tell if c is horizontal space. */ /* table to tell if c is horizontal space. */
U_CHAR is_hor_space[256]; unsigned char is_hor_space[256];
/* table to tell if c is horizontal or vertical space. */ /* table to tell if c is horizontal or vertical space. */
static U_CHAR is_space[256]; static unsigned char is_space[256];
/* Initialize syntactic classifications of characters. */ /* Initialize syntactic classifications of characters. */
@ -569,7 +569,7 @@ quote_string(pfile, src)
cpp_reader *pfile; cpp_reader *pfile;
char *src; char *src;
{ {
U_CHAR c; unsigned char c;
CPP_PUTC_Q(pfile, '\"'); CPP_PUTC_Q(pfile, '\"');
for (;;) for (;;)
@ -608,7 +608,7 @@ cpp_grow_buffer(pfile, n)
long old_written = CPP_WRITTEN(pfile); long old_written = CPP_WRITTEN(pfile);
pfile->token_buffer_size = n + 2 * pfile->token_buffer_size; pfile->token_buffer_size = n + 2 * pfile->token_buffer_size;
pfile->token_buffer = (U_CHAR *) pfile->token_buffer = (unsigned char *)
xrealloc(pfile->token_buffer, pfile->token_buffer_size); xrealloc(pfile->token_buffer, pfile->token_buffer_size);
CPP_SET_WRITTEN(pfile, old_written); CPP_SET_WRITTEN(pfile, old_written);
} }
@ -623,9 +623,9 @@ cpp_grow_buffer(pfile, n)
void void
cpp_define(pfile, str) cpp_define(pfile, str)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *str; unsigned char *str;
{ {
U_CHAR *buf, *p; unsigned char *buf, *p;
buf = str; buf = str;
p = str; p = str;
@ -637,7 +637,7 @@ cpp_define(pfile, str)
while (is_idchar[*++p]); while (is_idchar[*++p]);
if (*p == 0) if (*p == 0)
{ {
buf = (U_CHAR *) alloca(p - buf + 4); buf = (unsigned char *) alloca(p - buf + 4);
strcpy((char *)buf, str); strcpy((char *)buf, str);
strcat((char *)buf, " 1"); strcat((char *)buf, " 1");
} }
@ -648,10 +648,10 @@ cpp_define(pfile, str)
} }
else else
{ {
U_CHAR *q; unsigned char *q;
/* Copy the entire option so we can modify it. */ /* Copy the entire option so we can modify it. */
buf = (U_CHAR *) alloca(2 * strlen(str) + 1); buf = (unsigned char *) alloca(2 * strlen(str) + 1);
strncpy(buf, str, p - str); strncpy(buf, str, p - str);
/* Change the = to a space. */ /* Change the = to a space. */
buf[p - str] = ' '; buf[p - str] = ' ';
@ -678,13 +678,13 @@ static void
make_assertion(pfile, option, str) make_assertion(pfile, option, str)
cpp_reader *pfile; cpp_reader *pfile;
char *option; char *option;
U_CHAR *str; unsigned char *str;
{ {
cpp_buffer *ip; cpp_buffer *ip;
U_CHAR *buf, *p, *q; unsigned char *buf, *p, *q;
/* Copy the entire option so we can modify it. */ /* Copy the entire option so we can modify it. */
buf = (U_CHAR *) alloca(strlen(str) + 1); buf = (unsigned char *) alloca(strlen(str) + 1);
strcpy((char *)buf, str); strcpy((char *)buf, str);
/* Scan for any backslash-newline and remove it. */ /* Scan for any backslash-newline and remove it. */
p = q = buf; p = q = buf;
@ -1111,7 +1111,7 @@ handle_directive(pfile)
register struct directive *kt; register struct directive *kt;
int ident_length; int ident_length;
long after_ident = 0; long after_ident = 0;
U_CHAR *ident, *line_end; unsigned char *ident, *line_end;
long old_written = CPP_WRITTEN(pfile); long old_written = CPP_WRITTEN(pfile);
cpp_skip_hspace(pfile); cpp_skip_hspace(pfile);
@ -1182,7 +1182,7 @@ handle_directive(pfile)
else if (kt->type == T_DEFINE else if (kt->type == T_DEFINE
&& CPP_OPTIONS(pfile)->dump_macros == dump_names) && CPP_OPTIONS(pfile)->dump_macros == dump_names)
{ {
U_CHAR *p = pfile->token_buffer + old_written + 7; /* Skip "#define". */ unsigned char *p = pfile->token_buffer + old_written + 7; /* Skip "#define". */
SKIP_WHITE_SPACE(p); SKIP_WHITE_SPACE(p);
while (is_idchar[*p]) while (is_idchar[*p])
@ -1206,7 +1206,7 @@ handle_directive(pfile)
static void static void
pass_thru_directive(buf, limit, pfile, keyword) pass_thru_directive(buf, limit, pfile, keyword)
U_CHAR *buf, *limit; unsigned char *buf, *limit;
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
{ {
@ -1234,7 +1234,7 @@ pass_thru_directive(buf, limit, pfile, keyword)
struct arglist struct arglist
{ {
struct arglist *next; struct arglist *next;
U_CHAR *name; unsigned char *name;
int length; int length;
int argno; int argno;
char rest_args; char rest_args;
@ -1255,19 +1255,19 @@ struct arglist
static DEFINITION * static DEFINITION *
collect_expansion(pfile, buf, limit, nargs, arglist) collect_expansion(pfile, buf, limit, nargs, arglist)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
int nargs; int nargs;
struct arglist *arglist; struct arglist *arglist;
{ {
DEFINITION *defn; DEFINITION *defn;
register U_CHAR *p, *lastp, *exp_p; register unsigned char *p, *lastp, *exp_p;
struct reflist *endpat = NULL; struct reflist *endpat = NULL;
/* Pointer to first nonspace after last ## seen. */ /* Pointer to first nonspace after last ## seen. */
U_CHAR *concat = 0; unsigned char *concat = 0;
/* Pointer to first nonspace after last single-# seen. */ /* Pointer to first nonspace after last single-# seen. */
U_CHAR *stringify = 0; unsigned char *stringify = 0;
int maxsize; int maxsize;
int expected_delimiter = '\0'; int expected_delimiter = '\0';
@ -1298,7 +1298,7 @@ collect_expansion(pfile, buf, limit, nargs, arglist)
defn = (DEFINITION *) xcalloc(1, maxsize); defn = (DEFINITION *) xcalloc(1, maxsize);
defn->nargs = nargs; defn->nargs = nargs;
exp_p = defn->expansion = (U_CHAR *) defn + sizeof(DEFINITION); exp_p = defn->expansion = (unsigned char *) defn + sizeof(DEFINITION);
lastp = exp_p; lastp = exp_p;
p = buf; p = buf;
@ -1317,7 +1317,7 @@ collect_expansion(pfile, buf, limit, nargs, arglist)
while (p < limit) while (p < limit)
{ {
int skipped_arg = 0; int skipped_arg = 0;
register U_CHAR c = *p++; register unsigned char c = *p++;
*exp_p++ = c; *exp_p++ = c;
@ -1435,7 +1435,7 @@ collect_expansion(pfile, buf, limit, nargs, arglist)
/* Handle the start of a symbol. */ /* Handle the start of a symbol. */
if (is_idchar[c] && nargs > 0) if (is_idchar[c] && nargs > 0)
{ {
U_CHAR *id_beg = p - 1; unsigned char *id_beg = p - 1;
int id_len; int id_len;
--exp_p; --exp_p;
@ -1493,7 +1493,7 @@ collect_expansion(pfile, buf, limit, nargs, arglist)
tpat->argno = arg->argno; tpat->argno = arg->argno;
tpat->nchars = exp_p - lastp; tpat->nchars = exp_p - lastp;
{ {
register U_CHAR *p1 = p; register unsigned char *p1 = p;
SKIP_WHITE_SPACE(p1); SKIP_WHITE_SPACE(p1);
if (p1 + 2 <= limit && p1[0] == '#' && p1[1] == '#') if (p1 + 2 <= limit && p1[0] == '#' && p1[1] == '#')
@ -1508,7 +1508,7 @@ collect_expansion(pfile, buf, limit, nargs, arglist)
/* If this was not a macro arg, copy it into the expansion. */ /* If this was not a macro arg, copy it into the expansion. */
if (!skipped_arg) if (!skipped_arg)
{ {
register U_CHAR *lim1 = p; register unsigned char *lim1 = p;
p = id_beg; p = id_beg;
while (p != lim1) while (p != lim1)
@ -1559,12 +1559,12 @@ static char rest_extension[] = "...";
* as for do_define. */ * as for do_define. */
static MACRODEF static MACRODEF
create_definition(buf, limit, pfile, predefinition) create_definition(buf, limit, pfile, predefinition)
U_CHAR *buf, *limit; unsigned char *buf, *limit;
cpp_reader *pfile; cpp_reader *pfile;
int predefinition; int predefinition;
{ {
U_CHAR *bp; /* temp ptr into input buffer */ unsigned char *bp; /* temp ptr into input buffer */
U_CHAR *symname; /* remember where symbol name starts */ unsigned char *symname; /* remember where symbol name starts */
int sym_length; /* and how long it is */ int sym_length; /* and how long it is */
int rest_args = 0; int rest_args = 0;
long line, col; long line, col;
@ -1669,9 +1669,9 @@ create_definition(buf, limit, pfile, predefinition)
if (temp->length == otemp->length && if (temp->length == otemp->length &&
strncmp(temp->name, otemp->name, temp->length) == 0) strncmp(temp->name, otemp->name, temp->length) == 0)
{ {
U_CHAR *name; unsigned char *name;
name = (U_CHAR *) alloca(temp->length + 1); name = (unsigned char *) alloca(temp->length + 1);
(void)strncpy(name, temp->name, temp->length); (void)strncpy(name, temp->name, temp->length);
name[temp->length] = '\0'; name[temp->length] = '\0';
cpp_error(pfile, cpp_error(pfile,
@ -1690,7 +1690,7 @@ create_definition(buf, limit, pfile, predefinition)
/* Now set defn->args.argnames to the result of concatenating /* Now set defn->args.argnames to the result of concatenating
* the argument names in reverse order * the argument names in reverse order
* with comma-space between them. */ * with comma-space between them. */
defn->args.argnames = (U_CHAR *) xmalloc(arglengths + 1); defn->args.argnames = (unsigned char *) xmalloc(arglengths + 1);
{ {
struct arglist *temp; struct arglist *temp;
int i = 0; int i = 0;
@ -1763,7 +1763,7 @@ create_definition(buf, limit, pfile, predefinition)
} }
/* now everything from bp before limit is the definition. */ /* now everything from bp before limit is the definition. */
defn = collect_expansion(pfile, bp, limit, -1, NULL_PTR); defn = collect_expansion(pfile, bp, limit, -1, NULL_PTR);
defn->args.argnames = (U_CHAR *) ""; defn->args.argnames = (unsigned char *) "";
} }
defn->line = line; defn->line = line;
@ -1788,10 +1788,10 @@ create_definition(buf, limit, pfile, predefinition)
static int static int
check_macro_name(pfile, symname, usage) check_macro_name(pfile, symname, usage)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *symname; unsigned char *symname;
char *usage; char *usage;
{ {
U_CHAR *p; unsigned char *p;
int sym_length; int sym_length;
for (p = symname; is_idchar[*p]; p++); for (p = symname; is_idchar[*p]; p++);
@ -1802,9 +1802,9 @@ check_macro_name(pfile, symname, usage)
} }
else if (!is_idstart[*symname]) else if (!is_idstart[*symname])
{ {
U_CHAR *msg; /* what pain... */ unsigned char *msg; /* what pain... */
msg = (U_CHAR *) alloca(sym_length + 1); msg = (unsigned char *) alloca(sym_length + 1);
bcopy(symname, msg, sym_length); bcopy(symname, msg, sym_length);
msg[sym_length] = 0; msg[sym_length] = 0;
cpp_error(pfile, "invalid %s name `%s'", usage, msg); cpp_error(pfile, "invalid %s name `%s'", usage, msg);
@ -1825,8 +1825,8 @@ compare_defs(d1, d2)
DEFINITION *d1, *d2; DEFINITION *d1, *d2;
{ {
register struct reflist *a1, *a2; register struct reflist *a1, *a2;
register U_CHAR *p1 = d1->expansion; register unsigned char *p1 = d1->expansion;
register U_CHAR *p2 = d2->expansion; register unsigned char *p2 = d2->expansion;
int first = 1; int first = 1;
if (d1->nargs != d2->nargs) if (d1->nargs != d2->nargs)
@ -1867,12 +1867,12 @@ compare_defs(d1, d2)
static int static int
comp_def_part(first, beg1, len1, beg2, len2, last) comp_def_part(first, beg1, len1, beg2, len2, last)
int first; int first;
U_CHAR *beg1, *beg2; unsigned char *beg1, *beg2;
int len1, len2; int len1, len2;
int last; int last;
{ {
register U_CHAR *end1 = beg1 + len1; register unsigned char *end1 = beg1 + len1;
register U_CHAR *end2 = beg2 + len2; register unsigned char *end2 = beg2 + len2;
if (first) if (first)
{ {
@ -1918,7 +1918,7 @@ static int
do_define(pfile, keyword, buf, limit) do_define(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
int hashcode; int hashcode;
MACRODEF mdef; MACRODEF mdef;
@ -1946,14 +1946,14 @@ do_define(pfile, keyword, buf, limit)
/* Print the warning if it's not ok. */ /* Print the warning if it's not ok. */
if (!ok) if (!ok)
{ {
U_CHAR *msg; /* what pain... */ unsigned char *msg; /* what pain... */
/* If we are passing through #define and #undef directives, do /* If we are passing through #define and #undef directives, do
* that for this re-definition now. */ * that for this re-definition now. */
if (CPP_OPTIONS(pfile)->debug_output && keyword) if (CPP_OPTIONS(pfile)->debug_output && keyword)
pass_thru_directive(buf, limit, pfile, keyword); pass_thru_directive(buf, limit, pfile, keyword);
msg = (U_CHAR *) alloca(mdef.symlen + 22); msg = (unsigned char *) alloca(mdef.symlen + 22);
*msg = '`'; *msg = '`';
bcopy(mdef.symnam, msg + 1, mdef.symlen); bcopy(mdef.symnam, msg + 1, mdef.symlen);
strcpy((char *)(msg + mdef.symlen + 1), "' redefined"); strcpy((char *)(msg + mdef.symlen + 1), "' redefined");
@ -2009,7 +2009,7 @@ struct argdata
cpp_buffer * cpp_buffer *
cpp_push_buffer(pfile, buffer, length) cpp_push_buffer(pfile, buffer, length)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *buffer; unsigned char *buffer;
long length; long length;
{ {
#ifdef STATIC_BUFFERS #ifdef STATIC_BUFFERS
@ -2090,22 +2090,22 @@ cpp_scan_buffer(pfile)
static void static void
cpp_expand_to_buffer(pfile, buf, length) cpp_expand_to_buffer(pfile, buf, length)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *buf; unsigned char *buf;
int length; int length;
{ {
register cpp_buffer *ip; register cpp_buffer *ip;
U_CHAR *limit = buf + length; unsigned char *limit = buf + length;
U_CHAR *buf1; unsigned char *buf1;
if (length < 0) if (length < 0)
abort(); abort();
/* Set up the input on the input stack. */ /* Set up the input on the input stack. */
buf1 = (U_CHAR *) alloca(length + 1); buf1 = (unsigned char *) alloca(length + 1);
{ {
register U_CHAR *p1 = buf; register unsigned char *p1 = buf;
register U_CHAR *p2 = buf1; register unsigned char *p2 = buf1;
while (p1 != limit) while (p1 != limit)
*p2++ = *p1++; *p2++ = *p1++;
@ -2123,14 +2123,14 @@ cpp_expand_to_buffer(pfile, buf, length)
static void static void
adjust_position(buf, limit, linep, colp) adjust_position(buf, limit, linep, colp)
U_CHAR *buf; unsigned char *buf;
U_CHAR *limit; unsigned char *limit;
long *linep; long *linep;
long *colp; long *colp;
{ {
while (buf < limit) while (buf < limit)
{ {
U_CHAR ch = *buf++; unsigned char ch = *buf++;
if (ch == '\n') if (ch == '\n')
(*linep)++, (*colp) = 1; (*linep)++, (*colp) = 1;
@ -2196,14 +2196,14 @@ cpp_file_buffer(pfile)
static long static long
count_newlines(buf, limit) count_newlines(buf, limit)
register U_CHAR *buf; register unsigned char *buf;
register U_CHAR *limit; register unsigned char *limit;
{ {
register long count = 0; register long count = 0;
while (buf < limit) while (buf < limit)
{ {
U_CHAR ch = *buf++; unsigned char ch = *buf++;
if (ch == '\n') if (ch == '\n')
count++; count++;
@ -2365,12 +2365,12 @@ macarg(pfile, rest_args)
static int static int
change_newlines(start, length) change_newlines(start, length)
U_CHAR *start; unsigned char *start;
int length; int length;
{ {
register U_CHAR *ibp; register unsigned char *ibp;
register U_CHAR *obp; register unsigned char *obp;
register U_CHAR *limit; register unsigned char *limit;
register int c; register int c;
ibp = start; ibp = start;
@ -2797,7 +2797,7 @@ macroexpand(pfile, hp)
{ {
int nargs; int nargs;
DEFINITION *defn = hp->value.defn; DEFINITION *defn = hp->value.defn;
register U_CHAR *xbuf; register unsigned char *xbuf;
long start_line, start_column; long start_line, start_column;
int xbuf_len; int xbuf_len;
struct argdata *args; struct argdata *args;
@ -2864,8 +2864,8 @@ macroexpand(pfile, hp)
/* If we got one arg but it was just whitespace, call that 0 args. */ /* If we got one arg but it was just whitespace, call that 0 args. */
if (i == 1) if (i == 1)
{ {
register U_CHAR *bp = ARG_BASE + args[0].raw; register unsigned char *bp = ARG_BASE + args[0].raw;
register U_CHAR *lim = bp + args[0].raw_length; register unsigned char *lim = bp + args[0].raw_length;
/* cpp.texi says for foo ( ) we provide one argument. /* cpp.texi says for foo ( ) we provide one argument.
* However, if foo wants just 0 arguments, treat this as 0. */ * However, if foo wants just 0 arguments, treat this as 0. */
@ -2912,7 +2912,7 @@ macroexpand(pfile, hp)
} }
else else
{ {
register U_CHAR *exp = defn->expansion; register unsigned char *exp = defn->expansion;
register int offset; /* offset in expansion, register int offset; /* offset in expansion,
* *
@ -3045,7 +3045,7 @@ macroexpand(pfile, hp)
args[ap->argno].use_count++; args[ap->argno].use_count++;
} }
xbuf = (U_CHAR *) xmalloc(xbuf_len + 1); xbuf = (unsigned char *) xmalloc(xbuf_len + 1);
/* Generate in XBUF the complete expansion /* Generate in XBUF the complete expansion
* with arguments substituted in. * with arguments substituted in.
@ -3086,8 +3086,8 @@ macroexpand(pfile, hp)
} }
else if (ap->raw_before || ap->raw_after || CPP_TRADITIONAL(pfile)) else if (ap->raw_before || ap->raw_after || CPP_TRADITIONAL(pfile))
{ {
U_CHAR *p1 = ARG_BASE + arg->raw; unsigned char *p1 = ARG_BASE + arg->raw;
U_CHAR *l1 = p1 + arg->raw_length; unsigned char *l1 = p1 + arg->raw_length;
if (ap->raw_before) if (ap->raw_before)
{ {
@ -3106,7 +3106,7 @@ macroexpand(pfile, hp)
l1--; l1--;
else if (l1[-1] == '-') else if (l1[-1] == '-')
{ {
U_CHAR *p2 = l1 - 1; unsigned char *p2 = l1 - 1;
/* If a `-' is preceded by an odd number of newlines then it /* If a `-' is preceded by an odd number of newlines then it
* and the last newline are a no-reexpansion marker. */ * and the last newline are a no-reexpansion marker. */
@ -3128,7 +3128,7 @@ macroexpand(pfile, hp)
} }
else else
{ {
U_CHAR *expanded = ARG_BASE + arg->expanded; unsigned char *expanded = ARG_BASE + arg->expanded;
if (!ap->raw_before && totlen > 0 && arg->expand_length if (!ap->raw_before && totlen > 0 && arg->expand_length
&& !CPP_TRADITIONAL(pfile) && !CPP_TRADITIONAL(pfile)
@ -3204,7 +3204,7 @@ macroexpand(pfile, hp)
static void static void
push_macro_expansion(pfile, xbuf, xbuf_len, hp) push_macro_expansion(pfile, xbuf, xbuf_len, hp)
cpp_reader *pfile; cpp_reader *pfile;
register U_CHAR *xbuf; register unsigned char *xbuf;
int xbuf_len; int xbuf_len;
HASHNODE *hp; HASHNODE *hp;
{ {
@ -3281,13 +3281,13 @@ static int
do_include(pfile, keyword, unused1, unused2) do_include(pfile, keyword, unused1, unused2)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *unused1, *unused2; unsigned char *unused1, *unused2;
{ {
int importing = (keyword->type == T_IMPORT); int importing = (keyword->type == T_IMPORT);
int skip_dirs = (keyword->type == T_INCLUDE_NEXT); int skip_dirs = (keyword->type == T_INCLUDE_NEXT);
char *fname; /* Dynamically allocated fname buffer */ char *fname; /* Dynamically allocated fname buffer */
char *pcftry; char *pcftry;
U_CHAR *fbeg, *fend; /* Beginning and end of fname */ unsigned char *fbeg, *fend; /* Beginning and end of fname */
enum cpp_token token; enum cpp_token token;
/* Chain of dirs to search */ /* Chain of dirs to search */
@ -3725,13 +3725,13 @@ is_system_include(pfile, filename)
static ASSERTION_HASHNODE * static ASSERTION_HASHNODE *
assertion_install(pfile, name, len, hash) assertion_install(pfile, name, len, hash)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *name; unsigned char *name;
int len; int len;
int hash; int hash;
{ {
register ASSERTION_HASHNODE *hp; register ASSERTION_HASHNODE *hp;
register int i, bucket; register int i, bucket;
register U_CHAR *p, *q; register unsigned char *p, *q;
i = sizeof(ASSERTION_HASHNODE) + len + 1; i = sizeof(ASSERTION_HASHNODE) + len + 1;
hp = (ASSERTION_HASHNODE *) xmalloc(i); hp = (ASSERTION_HASHNODE *) xmalloc(i);
@ -3744,7 +3744,7 @@ assertion_install(pfile, name, len, hash)
hp->next->prev = hp; hp->next->prev = hp;
hp->length = len; hp->length = len;
hp->value = 0; hp->value = 0;
hp->name = ((U_CHAR *) hp) + sizeof(ASSERTION_HASHNODE); hp->name = ((unsigned char *) hp) + sizeof(ASSERTION_HASHNODE);
p = hp->name; p = hp->name;
q = name; q = name;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
@ -3766,7 +3766,7 @@ assertion_install(pfile, name, len, hash)
static ASSERTION_HASHNODE * static ASSERTION_HASHNODE *
assertion_lookup(pfile, name, len, hash) assertion_lookup(pfile, name, len, hash)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *name; unsigned char *name;
int len; int len;
int hash; int hash;
{ {
@ -3816,20 +3816,20 @@ delete_assertion(hp)
* The value returned in the end of the string written to RESULT, * The value returned in the end of the string written to RESULT,
* or NULL on error. */ * or NULL on error. */
static U_CHAR * static unsigned char *
convert_string(pfile, result, in, limit, handle_escapes) convert_string(pfile, result, in, limit, handle_escapes)
cpp_reader *pfile; cpp_reader *pfile;
register U_CHAR *result, *in, *limit; register unsigned char *result, *in, *limit;
int handle_escapes; int handle_escapes;
{ {
U_CHAR c; unsigned char c;
c = *in++; c = *in++;
if (c != '\"') if (c != '\"')
return NULL; return NULL;
while (in < limit) while (in < limit)
{ {
U_CHAR c = *in++; unsigned char c = *in++;
switch (c) switch (c)
{ {
@ -3842,11 +3842,11 @@ convert_string(pfile, result, in, limit, handle_escapes)
if (handle_escapes) if (handle_escapes)
{ {
char *bpc = (char *)in; char *bpc = (char *)in;
int i = (U_CHAR) cpp_parse_escape(pfile, &bpc); int i = (unsigned char) cpp_parse_escape(pfile, &bpc);
in = (U_CHAR *) bpc; in = (unsigned char *) bpc;
if (i >= 0) if (i >= 0)
*result++ = (U_CHAR) c; *result++ = (unsigned char) c;
break; break;
} }
/* else fall through */ /* else fall through */
@ -3898,11 +3898,11 @@ do_line(pfile, keyword)
if (token == CPP_STRING) if (token == CPP_STRING)
{ {
U_CHAR *fname = pfile->token_buffer + old_written; unsigned char *fname = pfile->token_buffer + old_written;
U_CHAR *end_name; unsigned char *end_name;
static HASHNODE *fname_table[FNAME_HASHSIZE]; static HASHNODE *fname_table[FNAME_HASHSIZE];
HASHNODE *hp, **hash_bucket; HASHNODE *hp, **hash_bucket;
U_CHAR *p; unsigned char *p;
long num_start; long num_start;
int fname_length; int fname_length;
@ -3996,11 +3996,11 @@ static int
do_undef(pfile, keyword, buf, limit) do_undef(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
int sym_length; int sym_length;
HASHNODE *hp; HASHNODE *hp;
U_CHAR *orig_buf = buf; unsigned char *orig_buf = buf;
SKIP_WHITE_SPACE(buf); SKIP_WHITE_SPACE(buf);
sym_length = check_macro_name(pfile, buf, "macro"); sym_length = check_macro_name(pfile, buf, "macro");
@ -4036,10 +4036,10 @@ static int
do_error(pfile, keyword, buf, limit) do_error(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
int length = limit - buf; int length = limit - buf;
U_CHAR *copy = (U_CHAR *) xmalloc(length + 1); unsigned char *copy = (unsigned char *) xmalloc(length + 1);
keyword = NULL; keyword = NULL;
bcopy(buf, copy, length); bcopy(buf, copy, length);
@ -4059,10 +4059,10 @@ static int
do_warning(pfile, keyword, buf, limit) do_warning(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
int length = limit - buf; int length = limit - buf;
U_CHAR *copy = (U_CHAR *) xmalloc(length + 1); unsigned char *copy = (unsigned char *) xmalloc(length + 1);
keyword = NULL; keyword = NULL;
bcopy(buf, copy, length); bcopy(buf, copy, length);
@ -4108,7 +4108,7 @@ static int
do_ident(pfile, keyword, buf, limit) do_ident(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
/* long old_written = CPP_WRITTEN (pfile); */ /* long old_written = CPP_WRITTEN (pfile); */
@ -4131,7 +4131,7 @@ static int
do_pragma(pfile, keyword, buf, limit) do_pragma(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
while (*buf == ' ' || *buf == '\t') while (*buf == ' ' || *buf == '\t')
buf++; buf++;
@ -4151,7 +4151,7 @@ do_pragma(pfile, keyword, buf, limit)
/* Be quiet about `#pragma implementation' for a file only if it hasn't /* Be quiet about `#pragma implementation' for a file only if it hasn't
* been included yet. */ * been included yet. */
struct file_name_list *ptr; struct file_name_list *ptr;
U_CHAR *p = buf + 14, *fname, *inc_fname; unsigned char *p = buf + 14, *fname, *inc_fname;
int fname_len; int fname_len;
SKIP_WHITE_SPACE(p); SKIP_WHITE_SPACE(p);
@ -4159,13 +4159,13 @@ do_pragma(pfile, keyword, buf, limit)
return 0; return 0;
fname = p + 1; fname = p + 1;
p = (U_CHAR *) index(fname, '\"'); p = (unsigned char *) index(fname, '\"');
fname_len = p != NULL ? p - fname : strlen(fname); fname_len = p != NULL ? p - fname : strlen(fname);
for (ptr = pfile->all_include_files; ptr; ptr = ptr->next) for (ptr = pfile->all_include_files; ptr; ptr = ptr->next)
{ {
inc_fname = (U_CHAR *) rindex(ptr->fname, '/'); inc_fname = (unsigned char *) rindex(ptr->fname, '/');
inc_fname = inc_fname ? inc_fname + 1 : (U_CHAR *) ptr->fname; inc_fname = inc_fname ? inc_fname + 1 : (unsigned char *) ptr->fname;
if (inc_fname && !strncmp(inc_fname, fname, fname_len)) if (inc_fname && !strncmp(inc_fname, fname, fname_len))
cpp_warning(pfile, cpp_warning(pfile,
"`#pragma implementation' for `%s' appears after file is included", "`#pragma implementation' for `%s' appears after file is included",
@ -4194,7 +4194,7 @@ static int
do_if(pfile, keyword, buf, limit) do_if(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
HOST_WIDE_INT value = eval_if_expression(pfile, buf, limit - buf); HOST_WIDE_INT value = eval_if_expression(pfile, buf, limit - buf);
@ -4212,7 +4212,7 @@ static int
do_elif(pfile, keyword, buf, limit) do_elif(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
keyword = NULL; keyword = NULL;
@ -4260,7 +4260,7 @@ do_elif(pfile, keyword, buf, limit)
static HOST_WIDE_INT static HOST_WIDE_INT
eval_if_expression(pfile, buf, length) eval_if_expression(pfile, buf, length)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *buf; unsigned char *buf;
int length; int length;
{ {
HASHNODE *save_defined; HASHNODE *save_defined;
@ -4291,15 +4291,15 @@ static int
do_xifdef(pfile, keyword, unused1, unused2) do_xifdef(pfile, keyword, unused1, unused2)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *unused1, *unused2; unsigned char *unused1, *unused2;
{ {
int skip; int skip;
cpp_buffer *ip = CPP_BUFFER(pfile); cpp_buffer *ip = CPP_BUFFER(pfile);
U_CHAR *ident; unsigned char *ident;
int ident_length; int ident_length;
enum cpp_token token; enum cpp_token token;
int start_of_file = 0; int start_of_file = 0;
U_CHAR *control_macro = 0; unsigned char *control_macro = 0;
int old_written = CPP_WRITTEN(pfile); int old_written = CPP_WRITTEN(pfile);
unused1 = NULL; unused1 = NULL;
@ -4329,7 +4329,7 @@ do_xifdef(pfile, keyword, unused1, unused2)
skip = (hp == NULL) ^ (keyword->type == T_IFNDEF); skip = (hp == NULL) ^ (keyword->type == T_IFNDEF);
if (start_of_file && !skip) if (start_of_file && !skip)
{ {
control_macro = (U_CHAR *) xmalloc(ident_length + 1); control_macro = (unsigned char *) xmalloc(ident_length + 1);
bcopy(ident, control_macro, ident_length + 1); bcopy(ident, control_macro, ident_length + 1);
} }
} }
@ -4365,7 +4365,7 @@ conditional_skip(pfile, skip, type, control_macro)
cpp_reader *pfile; cpp_reader *pfile;
int skip; int skip;
enum node_type type; enum node_type type;
U_CHAR *control_macro; unsigned char *control_macro;
{ {
IF_STACK_FRAME *temp; IF_STACK_FRAME *temp;
@ -4407,7 +4407,7 @@ skip_if_group(pfile, any)
IF_STACK_FRAME *save_if_stack = pfile->if_stack; /* don't pop past here */ IF_STACK_FRAME *save_if_stack = pfile->if_stack; /* don't pop past here */
register int ident_length; register int ident_length;
U_CHAR *ident; unsigned char *ident;
struct parse_marker line_start_mark; struct parse_marker line_start_mark;
parse_set_mark(&line_start_mark, pfile); parse_set_mark(&line_start_mark, pfile);
@ -4424,7 +4424,7 @@ skip_if_group(pfile, any)
if (CPP_OPTIONS(pfile)->output_conditionals) if (CPP_OPTIONS(pfile)->output_conditionals)
{ {
cpp_buffer *pbuf = CPP_BUFFER(pfile); cpp_buffer *pbuf = CPP_BUFFER(pfile);
U_CHAR *start_line = pbuf->buf + line_start_mark.position; unsigned char *start_line = pbuf->buf + line_start_mark.position;
CPP_PUTS(pfile, start_line, pbuf->cur - start_line); CPP_PUTS(pfile, start_line, pbuf->cur - start_line);
} }
@ -4559,7 +4559,7 @@ static int
do_else(pfile, keyword, buf, limit) do_else(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
cpp_buffer *ip = CPP_BUFFER(pfile); cpp_buffer *ip = CPP_BUFFER(pfile);
@ -4612,7 +4612,7 @@ static int
do_endif(pfile, keyword, buf, limit) do_endif(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
if (CPP_PEDANTIC(pfile)) if (CPP_PEDANTIC(pfile))
@ -4780,7 +4780,7 @@ cpp_get_token(pfile)
if (opts->put_out_comments) if (opts->put_out_comments)
{ {
cpp_buffer *pbuf = CPP_BUFFER(pfile); cpp_buffer *pbuf = CPP_BUFFER(pfile);
U_CHAR *start = pbuf->buf + start_mark.position; unsigned char *start = pbuf->buf + start_mark.position;
int len = pbuf->cur - start; int len = pbuf->cur - start;
CPP_RESERVE(pfile, 1 + len); CPP_RESERVE(pfile, 1 + len);
@ -5269,12 +5269,12 @@ cpp_get_token(pfile)
if (hp->type != T_MACRO) if (hp->type != T_MACRO)
{ {
int xbuf_len; int xbuf_len;
U_CHAR *xbuf; unsigned char *xbuf;
CPP_SET_WRITTEN(pfile, before_name_written); CPP_SET_WRITTEN(pfile, before_name_written);
special_symbol(hp, pfile); special_symbol(hp, pfile);
xbuf_len = CPP_WRITTEN(pfile) - before_name_written; xbuf_len = CPP_WRITTEN(pfile) - before_name_written;
xbuf = (U_CHAR *) xmalloc(xbuf_len + 1); xbuf = (unsigned char *) xmalloc(xbuf_len + 1);
CPP_SET_WRITTEN(pfile, before_name_written); CPP_SET_WRITTEN(pfile, before_name_written);
bcopy(CPP_PWRITTEN(pfile), xbuf, xbuf_len + 1); bcopy(CPP_PWRITTEN(pfile), xbuf, xbuf_len + 1);
push_macro_expansion(pfile, xbuf, xbuf_len, hp); push_macro_expansion(pfile, xbuf, xbuf_len, hp);
@ -5763,7 +5763,7 @@ finclude(pfile, f, fname, system_header_p, dirptr)
if (S_ISREG(st_mode)) if (S_ISREG(st_mode))
{ {
fp->buf = (U_CHAR *) xmalloc(st_size + 2); fp->buf = (unsigned char *) xmalloc(st_size + 2);
fp->alimit = fp->buf + st_size + 2; fp->alimit = fp->buf + st_size + 2;
fp->cur = fp->buf; fp->cur = fp->buf;
@ -5789,7 +5789,7 @@ finclude(pfile, f, fname, system_header_p, dirptr)
int bsize = 2000; int bsize = 2000;
st_size = 0; st_size = 0;
fp->buf = (U_CHAR *) xmalloc(bsize + 2); fp->buf = (unsigned char *) xmalloc(bsize + 2);
for (;;) for (;;)
{ {
@ -5800,7 +5800,7 @@ finclude(pfile, f, fname, system_header_p, dirptr)
if (st_size != bsize) if (st_size != bsize)
break; /* End of file */ break; /* End of file */
bsize *= 2; bsize *= 2;
fp->buf = (U_CHAR *) xrealloc(fp->buf, bsize + 2); fp->buf = (unsigned char *) xrealloc(fp->buf, bsize + 2);
} }
length = st_size; length = st_size;
} }
@ -6335,7 +6335,7 @@ init_parse_file(pfile)
pfile->get_token = cpp_get_token; pfile->get_token = cpp_get_token;
pfile->token_buffer_size = 200; pfile->token_buffer_size = 200;
pfile->token_buffer = (U_CHAR *) xmalloc(pfile->token_buffer_size); pfile->token_buffer = (unsigned char *) xmalloc(pfile->token_buffer_size);
CPP_SET_WRITTEN(pfile, 0); CPP_SET_WRITTEN(pfile, 0);
pfile->system_include_depth = 0; pfile->system_include_depth = 0;
@ -6905,7 +6905,7 @@ static int
do_assert(pfile, keyword, buf, limit) do_assert(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
long symstart; /* remember where symbol name starts */ long symstart; /* remember where symbol name starts */
@ -6956,7 +6956,7 @@ do_assert(pfile, keyword, buf, limit)
{ {
ASSERTION_HASHNODE *hp; ASSERTION_HASHNODE *hp;
U_CHAR *symname = pfile->token_buffer + symstart; unsigned char *symname = pfile->token_buffer + symstart;
int hashcode = hashf(symname, sym_length, ASSERTION_HASHSIZE); int hashcode = hashf(symname, sym_length, ASSERTION_HASHSIZE);
struct tokenlist_list *value struct tokenlist_list *value
= (struct tokenlist_list *)xmalloc(sizeof(struct tokenlist_list)); = (struct tokenlist_list *)xmalloc(sizeof(struct tokenlist_list));
@ -6985,7 +6985,7 @@ static int
do_unassert(pfile, keyword, buf, limit) do_unassert(pfile, keyword, buf, limit)
cpp_reader *pfile; cpp_reader *pfile;
struct directive *keyword; struct directive *keyword;
U_CHAR *buf, *limit; unsigned char *buf, *limit;
{ {
long symstart; /* remember where symbol name starts */ long symstart; /* remember where symbol name starts */
@ -7033,7 +7033,7 @@ do_unassert(pfile, keyword, buf, limit)
{ {
ASSERTION_HASHNODE *hp; ASSERTION_HASHNODE *hp;
U_CHAR *symname = pfile->token_buffer + symstart; unsigned char *symname = pfile->token_buffer + symstart;
int hashcode = hashf(symname, sym_length, ASSERTION_HASHSIZE); int hashcode = hashf(symname, sym_length, ASSERTION_HASHSIZE);
struct tokenlist_list *tail, *prev; struct tokenlist_list *tail, *prev;
@ -7089,7 +7089,7 @@ do_unassert(pfile, keyword, buf, limit)
int int
check_assertion(pfile, name, sym_length, tokens_specified, tokens) check_assertion(pfile, name, sym_length, tokens_specified, tokens)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *name; unsigned char *name;
int sym_length; int sym_length;
int tokens_specified; int tokens_specified;
struct arglist *tokens; struct arglist *tokens;
@ -7231,7 +7231,7 @@ read_token_list(pfile, error_flag)
temp = (struct arglist *) temp = (struct arglist *)
xmalloc(sizeof(struct arglist) + length + 1); xmalloc(sizeof(struct arglist) + length + 1);
temp->name = (U_CHAR *) (temp + 1); temp->name = (unsigned char *) (temp + 1);
bcopy((char *)(pfile->token_buffer + name_written), bcopy((char *)(pfile->token_buffer + name_written),
(char *)temp->name, length); (char *)temp->name, length);
temp->name[length] = 0; temp->name[length] = 0;

View File

@ -29,8 +29,6 @@ extern "C" {
#define STATIC_BUFFERS #define STATIC_BUFFERS
typedef unsigned char U_CHAR;
struct parse_file; struct parse_file;
typedef struct cpp_reader cpp_reader; typedef struct cpp_reader cpp_reader;
typedef struct cpp_buffer cpp_buffer; typedef struct cpp_buffer cpp_buffer;
@ -170,7 +168,7 @@ struct cpp_reader {
int errors; /* Error counter for exit code */ int errors; /* Error counter for exit code */
void *data; void *data;
U_CHAR *token_buffer; unsigned char *token_buffer;
int token_buffer_size; int token_buffer_size;
/* Line where a newline was first seen in a string constant. */ /* Line where a newline was first seen in a string constant. */
@ -539,7 +537,7 @@ typedef struct macrodef MACRODEF;
struct macrodef struct macrodef
{ {
struct definition *defn; struct definition *defn;
U_CHAR *symnam; unsigned char *symnam;
int symlen; int symlen;
}; };
@ -570,7 +568,7 @@ struct definition {
int length; /* length of expansion string */ int length; /* length of expansion string */
int predefined; /* True if the macro was builtin or */ int predefined; /* True if the macro was builtin or */
/* came from the command line */ /* came from the command line */
U_CHAR *expansion; unsigned char *expansion;
int line; /* Line number of definition */ int line; /* Line number of definition */
char *file; /* File of definition */ char *file; /* File of definition */
char rest_args; /* Nonzero if last arg. absorbs the rest */ char rest_args; /* Nonzero if last arg. absorbs the rest */
@ -590,11 +588,11 @@ struct definition {
with comma-space between them. with comma-space between them.
The only use of this is that we warn on redefinition The only use of this is that we warn on redefinition
if this differs between the old and new definitions. */ if this differs between the old and new definitions. */
U_CHAR *argnames; unsigned char *argnames;
} args; } args;
}; };
extern U_CHAR is_idchar[256]; extern unsigned char is_idchar[256];
/* Stack of conditionals currently in progress /* Stack of conditionals currently in progress
(including both successful and failing conditionals). */ (including both successful and failing conditionals). */
@ -605,7 +603,7 @@ struct if_stack {
int lineno; /* similarly */ int lineno; /* similarly */
int if_succeeded; /* true if a leg of this if-group int if_succeeded; /* true if a leg of this if-group
has been passed through rescan */ has been passed through rescan */
U_CHAR *control_macro; /* For #ifndef at start of file, unsigned char *control_macro; /* For #ifndef at start of file,
this is the macro name tested. */ this is the macro name tested. */
enum node_type type; /* type of last directive seen in this group */ enum node_type type; /* type of last directive seen in this group */
}; };
@ -613,7 +611,7 @@ typedef struct if_stack IF_STACK_FRAME;
extern void cpp_buf_line_and_col PARAMS((cpp_buffer*, long*, long*)); extern void cpp_buf_line_and_col PARAMS((cpp_buffer*, long*, long*));
extern cpp_buffer* cpp_file_buffer PARAMS((cpp_reader*)); extern cpp_buffer* cpp_file_buffer PARAMS((cpp_reader*));
extern void cpp_define PARAMS ((cpp_reader*, U_CHAR*)); extern void cpp_define PARAMS ((cpp_reader*, unsigned char*));
extern void cpp_error (); extern void cpp_error ();
extern void cpp_warning (); extern void cpp_warning ();
@ -628,10 +626,10 @@ extern void cpp_pfatal_with_name ();
extern void cpp_grow_buffer PARAMS ((cpp_reader*, long)); extern void cpp_grow_buffer PARAMS ((cpp_reader*, long));
extern int cpp_parse_escape PARAMS ((cpp_reader*, char**)); extern int cpp_parse_escape PARAMS ((cpp_reader*, char**));
extern cpp_buffer* cpp_push_buffer PARAMS ((cpp_reader *, U_CHAR*, long)); extern cpp_buffer* cpp_push_buffer PARAMS ((cpp_reader *, unsigned char*, long));
extern cpp_buffer* cpp_pop_buffer PARAMS ((cpp_reader *)); extern cpp_buffer* cpp_pop_buffer PARAMS ((cpp_reader *));
extern cpp_hashnode* cpp_lookup PARAMS ((cpp_reader*, const U_CHAR*, extern cpp_hashnode* cpp_lookup PARAMS ((cpp_reader*, const unsigned char*,
int, int)); int, int));
#ifdef __EMX__ #ifdef __EMX__

View File

@ -43,7 +43,7 @@ struct operation cpp_lex(cpp_reader *pfile);
int cpp_parse_escape(cpp_reader *pfile, char **string_ptr); int cpp_parse_escape(cpp_reader *pfile, char **string_ptr);
HOST_WIDE_INT cpp_parse_expr(cpp_reader *pfile); HOST_WIDE_INT cpp_parse_expr(cpp_reader *pfile);
void cpp_grow_buffer(cpp_reader *pfile, long n); void cpp_grow_buffer(cpp_reader *pfile, long n);
void cpp_define(cpp_reader *pfile, U_CHAR *str); void cpp_define(cpp_reader *pfile, unsigned char *str);
void init_parse_options(struct cpp_options *opts); void init_parse_options(struct cpp_options *opts);
enum cpp_token null_underflow(cpp_reader *pfile); enum cpp_token null_underflow(cpp_reader *pfile);
int null_cleanup(cpp_buffer *pbuf, cpp_reader *pfile); int null_cleanup(cpp_buffer *pbuf, cpp_reader *pfile);
@ -53,11 +53,11 @@ void cpp_skip_hspace(cpp_reader *pfile);
void copy_rest_of_line(cpp_reader *pfile); void copy_rest_of_line(cpp_reader *pfile);
void skip_rest_of_line(cpp_reader *pfile); void skip_rest_of_line(cpp_reader *pfile);
int handle_directive(cpp_reader *pfile); int handle_directive(cpp_reader *pfile);
cpp_buffer *cpp_push_buffer(cpp_reader *pfile, U_CHAR *buffer, long length); cpp_buffer *cpp_push_buffer(cpp_reader *pfile, unsigned char *buffer, long length);
cpp_buffer *cpp_pop_buffer(cpp_reader *pfile); cpp_buffer *cpp_pop_buffer(cpp_reader *pfile);
void cpp_scan_buffer(cpp_reader *pfile); void cpp_scan_buffer(cpp_reader *pfile);
void cpp_buf_line_and_col(register cpp_buffer *pbuf, long *linep, long *colp); void cpp_buf_line_and_col(register cpp_buffer *pbuf, long *linep, long *colp);
int hashf(register const U_CHAR *name,register int len, int hashsize); int hashf(register const unsigned char *name,register int len, int hashsize);
void cpp_hash_cleanup(cpp_reader *pfile); void cpp_hash_cleanup(cpp_reader *pfile);
int cpp_read_check(cpp_reader *pfile); int cpp_read_check(cpp_reader *pfile);
int parse_name(cpp_reader *pfile, int c); int parse_name(cpp_reader *pfile, int c);