From e916a3569e1e28d877426a4038e3b6e0e20ed852 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 14 May 2000 22:42:58 +0000 Subject: * cpphash.c (trad_stringify, warn_trad_stringify, collect_params): Make some pointers pointers to const. * cpplex.c (auto_expand_name_space) Guaranteed to always expand by at least one character. (SPELL_CHAR, SPELL_NONE): Temporarily reverse order. (struct token_spelling): Use const U_CHAR * rather than PTR. (expand_name_space): Fix up token pointers if name space is moved when expanding. (INIT_NAME, cpp_scan_line, parse_name, parse_number, parse_string2, save_comment, spell_token, cpp_output_list): Update so the routines handle tokens with a direct pointer to their text, rather than an offset into the token's list's namebuf. (_cpp_lex_line): Rearrange for clarity. * cpplib.c (_cpp_check_directive): Similarly. (do_define): Make SYM a pointer to const. * cpplib.h (struct cpp_name): Replace offset with direct pointer. (CPP_INT, CPP_FLOAT): Spelling type should be SPELL_IDENT. (TOK_OFFSET): Delete. (TOK_NAME): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33901 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cpphash.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'gcc/cpphash.c') diff --git a/gcc/cpphash.c b/gcc/cpphash.c index 1e61dafea1a..21efb090ad4 100644 --- a/gcc/cpphash.c +++ b/gcc/cpphash.c @@ -162,9 +162,10 @@ collect_funlike_expansion PARAMS ((cpp_reader *, cpp_toklist *, static unsigned int collect_params PARAMS ((cpp_reader *, cpp_toklist *, struct arglist *)); -static void warn_trad_stringify PARAMS ((cpp_reader *, U_CHAR *, size_t, +static void warn_trad_stringify PARAMS ((cpp_reader *, const U_CHAR *, size_t, unsigned int, const struct arg *)); -static unsigned int trad_stringify PARAMS ((cpp_reader *, U_CHAR *, size_t, +static unsigned int trad_stringify PARAMS ((cpp_reader *, const U_CHAR *, + size_t, unsigned int, const struct arg *, struct reflist **, struct reflist **, unsigned int)); @@ -371,12 +372,12 @@ add_pat (pat, endpat, nchars, argno, raw_before, raw_after, strize, rest) static void warn_trad_stringify (pfile, p, len, argc, argv) cpp_reader *pfile; - U_CHAR *p; + const U_CHAR *p; size_t len; unsigned int argc; const struct arg *argv; { - U_CHAR *limit; + const U_CHAR *limit; unsigned int i; limit = p + len; @@ -406,14 +407,14 @@ warn_trad_stringify (pfile, p, len, argc, argv) static unsigned int trad_stringify (pfile, base, len, argc, argv, pat, endpat, last) cpp_reader *pfile; - U_CHAR *base; + const U_CHAR *base; size_t len; unsigned int argc; const struct arg *argv; struct reflist **pat, **endpat; unsigned int last; { - U_CHAR *p, *limit; + const U_CHAR *p, *limit; unsigned int i; p = base; @@ -548,7 +549,8 @@ collect_funlike_expansion (pfile, list, arglist, replacement) int j, argc; size_t len; const struct arg *argv; - U_CHAR *tok, *exp; + const U_CHAR *tok; + U_CHAR *exp; enum { START = 0, NORM, ARG, STRIZE, PASTE } last_token = START; argv = arglist->argv; @@ -728,7 +730,8 @@ collect_params (pfile, list, arglist) struct arglist *arglist; { struct arg *argv = 0; - U_CHAR *namebuf, *p, *tok; + const U_CHAR *tok; + U_CHAR *namebuf, *p; unsigned int len, argslen; unsigned int argc, a, i, j; -- cgit v1.2.1