aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-01-13 01:07:32 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-01-13 01:07:32 +0000
commitf85c14eed13fe0985ac491e89ccd0ff8bd4b8a1e (patch)
treea7922a725bb54929e724a801edbcfd3a1f73d998
parent7e96d768fe4e8fa821372cc7c7cd707efb917a3b (diff)
downloadgcc-f85c14eed13fe0985ac491e89ccd0ff8bd4b8a1e.zip
gcc-f85c14eed13fe0985ac491e89ccd0ff8bd4b8a1e.tar.gz
gcc-f85c14eed13fe0985ac491e89ccd0ff8bd4b8a1e.tar.bz2
fix-header.c (read_scan_file): Use cpp_get_callbacks and cpp_get_options rather than dereferencing pfile and...
* fix-header.c (read_scan_file): Use cpp_get_callbacks and cpp_get_options rather than dereferencing pfile and using CPP_OPTION. * scan-decls.c (scan_decls): Use return value of cpp_pop_buffer rather than CPP_BUFFER. From-SVN: r38972
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/fix-header.c11
-rw-r--r--gcc/scan-decls.c6
3 files changed, 18 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a5c8380..fe1a746 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2001-01-13 Neil Booth <neil@daikokuya.demon.co.uk>
+ * fix-header.c (read_scan_file): Use cpp_get_callbacks and
+ cpp_get_options rather than dereferencing pfile and using
+ CPP_OPTION.
+ * scan-decls.c (scan_decls): Use return value of
+ cpp_pop_buffer rather than CPP_BUFFER.
+
+2001-01-13 Neil Booth <neil@daikokuya.demon.co.uk>
+
* cppinit.c (cpp_handle_option): help_only is now part of the
cpp_options structure.
* cpplib.c (cpp_errors, cpp_get_options, cpp_get_callbacks,
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 11b1141..522434f 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -613,6 +613,8 @@ read_scan_file (in_fname, argc, argv)
char **argv;
{
cpp_reader* scan_in;
+ cpp_callbacks *cb;
+ cpp_options *options;
struct fn_decl *fn;
int i;
register struct symbol_list *cur_symbols;
@@ -620,12 +622,15 @@ read_scan_file (in_fname, argc, argv)
obstack_init (&scan_file_obstack);
scan_in = cpp_create_reader (CLK_GNUC89);
- scan_in->cb.file_change = cb_file_change;
+ cb = cpp_get_callbacks (scan_in);
+ cb->file_change = cb_file_change;
/* We are going to be scanning a header file out of its proper context,
so ignore warnings and errors. */
- CPP_OPTION (scan_in, inhibit_warnings) = 1;
- CPP_OPTION (scan_in, inhibit_errors) = 1;
+ options = cpp_get_options (pfile);
+ options->inhibit_warnings = 1;
+ options->inhibit_errors = 1;
+
i = cpp_handle_options (scan_in, argc, argv);
if (i < argc && ! CPP_FATAL_ERRORS (scan_in))
cpp_fatal (scan_in, "Invalid option `%s'", argv[i]);
diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c
index cd92cdd..55f10ab 100644
--- a/gcc/scan-decls.c
+++ b/gcc/scan-decls.c
@@ -113,8 +113,7 @@ scan_decls (pfile, argc, argv)
}
if (token.type == CPP_EOF)
{
- cpp_pop_buffer (pfile);
- if (CPP_BUFFER (pfile) == NULL)
+ if (cpp_pop_buffer (pfile) == 0)
return 0;
goto new_statement;
@@ -149,8 +148,7 @@ scan_decls (pfile, argc, argv)
goto new_statement;
case CPP_EOF:
- cpp_pop_buffer (pfile);
- if (CPP_BUFFER (pfile) == NULL)
+ if (cpp_pop_buffer (pfile) == 0)
return 0;
break;