diff options
author | Neil Booth <neilb@earthling.net> | 2000-05-14 22:42:58 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-05-14 22:42:58 +0000 |
commit | f617b8e22206f6201c4e7226fcadb92a09aeab66 (patch) | |
tree | a0ba4aecb8e93ef8585a5f8c424191f55b6801a5 /gcc/cpphash.c | |
parent | 05ef2698d02b5631c9cb1a4abeaca091ef7d9f9e (diff) | |
download | gcc-f617b8e22206f6201c4e7226fcadb92a09aeab66.zip gcc-f617b8e22206f6201c4e7226fcadb92a09aeab66.tar.gz gcc-f617b8e22206f6201c4e7226fcadb92a09aeab66.tar.bz2 |
cpphash.c (trad_stringify, [...]): Make some pointers pointers to const.
* 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.
From-SVN: r33901
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r-- | gcc/cpphash.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c index 1e61daf..21efb09 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; |