diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-14 22:42:58 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-14 22:42:58 +0000 |
commit | e916a3569e1e28d877426a4038e3b6e0e20ed852 (patch) | |
tree | a0ba4aecb8e93ef8585a5f8c424191f55b6801a5 /gcc/cpplib.h | |
parent | 90add96a7bbe9f0930b2734b43fb80c3937e9e31 (diff) | |
download | gcc-e916a3569e1e28d877426a4038e3b6e0e20ed852.tar.gz |
* 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
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r-- | gcc/cpplib.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 4103a2b6f2b..7a09252a5d6 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -110,8 +110,8 @@ typedef struct cpp_name cpp_name; C(CPP_OTHER, 0) /* stray punctuation */ \ \ I(CPP_NAME, 0) /* word */ \ - N(CPP_INT, 0) /* 23 */ \ - N(CPP_FLOAT, 0) /* 3.14159 */ \ + I(CPP_INT, 0) /* 23 */ \ + I(CPP_FLOAT, 0) /* 3.14159 */ \ I(CPP_NUMBER, 0) /* 34_be+ta */ \ S(CPP_CHAR, 0) /* 'char' */ \ S(CPP_WCHAR, 0) /* L'char' */ \ @@ -151,7 +151,7 @@ enum cpp_ttype struct cpp_name { unsigned int len; - unsigned int offset; /* from list->namebuf */ + const unsigned char *text; }; /* Accessor macros for token lists - all expect you have a @@ -162,8 +162,7 @@ struct cpp_name #define TOK_AUX(l_, i_) ((l_)->tokens[i_].aux) #define TOK_COL(l_, i_) ((l_)->tokens[i_].col) #define TOK_INT(l_, i_) ((l_)->tokens[i_].val.integer) -#define TOK_OFFSET(l_, i_) ((l_)->tokens[i_].val.name.offset) -#define TOK_NAME(l_, i_) ((l_)->tokens[i_].val.name.offset + (l_)->namebuf) +#define TOK_NAME(l_, i_) ((l_)->tokens[i_].val.name.text) #define TOK_LEN(l_, i_) ((l_)->tokens[i_].val.name.len) #define TOK_PREV_WHITE(l_, i_) (TOK_FLAGS(l_, i_) & PREV_WHITESPACE) |