From 1a88fc965a1e1ce60591e991c1d6acbb4d4f444d Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 13 Jan 2001 14:23:04 +0000 Subject: [PATCH] * c-lex.c (init_c_lex): Use cpp_get_callbacks to set callbacks. * c-parse.in (finish_parse): Use cpp_errors. (__yylex): Use return value of cpp_pop_buffer. * cp/lex.c (finish_parse): Use cpp_errors. * cp/spew.c (read_token): Use return value of cpp_pop_buffer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38982 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/c-lex.c | 13 ++++++++----- gcc/c-parse.in | 5 ++--- gcc/cp/lex.c | 2 +- gcc/cp/spew.c | 3 +-- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8818fc9..c73d1c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-01-13 Neil Booth + + * c-lex.c (init_c_lex): Use cpp_get_callbacks to set + callbacks. + * c-parse.in (finish_parse): Use cpp_errors. + (__yylex): Use return value of cpp_pop_buffer. + * cp/lex.c (finish_parse): Use cpp_errors. + * cp/spew.c (read_token): Use return value of cpp_pop_buffer. + Sat Jan 13 16:57:40 2001 Denis Chertykov * README.AVR: URLs corrected. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 0cddf7e..f30cd71 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -99,6 +99,7 @@ const char * init_c_lex (filename) const char *filename; { + struct cpp_callbacks *cb; struct c_fileinfo *toplevel; orig_filename = filename; @@ -121,16 +122,18 @@ init_c_lex (filename) GET_ENVIRONMENT (literal_codeset, "LANG"); #endif - parse_in->cb.ident = cb_ident; - parse_in->cb.file_change = cb_file_change; - parse_in->cb.def_pragma = cb_def_pragma; + cb = cpp_get_callbacks (parse_in); + + cb->ident = cb_ident; + cb->file_change = cb_file_change; + cb->def_pragma = cb_def_pragma; /* Set the debug callbacks if we can use them. */ if (debug_info_level == DINFO_LEVEL_VERBOSE && (write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG)) { - parse_in->cb.define = cb_define; - parse_in->cb.undef = cb_undef; + cb->define = cb_define; + cb->undef = cb_undef; } if (filename == 0 || !strcmp (filename, "-")) diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 5c46b20..daff75f 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -3161,7 +3161,7 @@ void finish_parse () { cpp_finish (parse_in); - errorcount += parse_in->errors; + errorcount += cpp_errors (parse_in); } #define NAME(type) cpp_type2name (type) @@ -3257,8 +3257,7 @@ _yylex () case CPP_DOT: return '.'; case CPP_EOF: - cpp_pop_buffer (parse_in); - if (! CPP_BUFFER (parse_in)) + if (cpp_pop_buffer (parse_in) == 0) return 0; goto retry; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index f295e7c..c8d6587 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -755,7 +755,7 @@ void finish_parse () { cpp_finish (parse_in); - errorcount += parse_in->errors; + errorcount += cpp_errors (parse_in); } inline void diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c index d7fd78e..ba2013b 100644 --- a/gcc/cp/spew.c +++ b/gcc/cp/spew.c @@ -329,8 +329,7 @@ read_token (t) #undef YYCODE case CPP_EOF: - cpp_pop_buffer (parse_in); - if (CPP_BUFFER (parse_in)) + if (cpp_pop_buffer (parse_in) != 0) goto retry; t->yychar = 0; break; -- 2.7.4