aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-05-14 22:42:58 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-05-14 22:42:58 +0000
commitf617b8e22206f6201c4e7226fcadb92a09aeab66 (patch)
treea0ba4aecb8e93ef8585a5f8c424191f55b6801a5 /gcc/cpplib.c
parent05ef2698d02b5631c9cb1a4abeaca091ef7d9f9e (diff)
downloadgcc-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/cpplib.c')
-rw-r--r--gcc/cpplib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index ae5e2c0..457cc21 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -156,7 +156,7 @@ _cpp_check_directive (list, token)
cpp_toklist *list;
cpp_token *token;
{
- const U_CHAR *name = list->namebuf + token->val.name.offset;
+ const U_CHAR *name = token->val.name.text;
size_t len = token->val.name.len;
unsigned int i;
@@ -339,7 +339,7 @@ do_define (pfile)
{
HASHNODE *node;
int len;
- U_CHAR *sym;
+ const U_CHAR *sym;
cpp_toklist *list = &pfile->directbuf;
pfile->no_macro_expand++;