cpphash.c (cpp_forall_identifiers): Add context variable for callback routine.
authorGeoff Keating <geoffk@cygnus.com>
Sun, 29 Oct 2000 07:07:20 +0000 (07:07 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sun, 29 Oct 2000 07:07:20 +0000 (07:07 +0000)
* cpphash.c (cpp_forall_identifiers): Add context variable
for callback routine.
* cppmain.c (dump_macro): Update to match cpp_forall_identifiers
change.
(main): Call cpp_forall_identifiers with null context.
* cpplib.h (cpp_forall_identifiers): Update prototype.

* cppmain.c: Make `parse_in' and `print' static.

From-SVN: r37119

gcc/ChangeLog
gcc/cpphash.c
gcc/cpplib.h
gcc/cppmain.c

index a31aed144fd5f42f3a83c90c0ea50cbb40ab3361..7e6f098c637ad340d4bc4d8fe1b66cd7d91b5545 100644 (file)
@@ -1,3 +1,14 @@
+2000-10-28  Geoffrey Keating  <geoffk@cygnus.com>
+
+       * cpphash.c (cpp_forall_identifiers): Add context variable
+       for callback routine.
+       * cppmain.c (dump_macro): Update to match cpp_forall_identifiers
+       change.
+       (main): Call cpp_forall_identifiers with null context.
+       * cpplib.h (cpp_forall_identifiers): Update prototype.
+
+       * cppmain.c: Make `parse_in' and `print' static.
+
 2000-10-28  Alan Modra <alan@linuxcare.com.au>
 
        * c-decl.c (finish_function): Clear c_function_name_declared_p.
index 1c7366d9746d4c6e92218cbd99f0b49f5349e7ba..50172d174ce6900e0360750d0511ee00ec349fba 100644 (file)
@@ -264,9 +264,10 @@ higher_prime_number (n)
 }
 
 void
-cpp_forall_identifiers (pfile, cb)
+cpp_forall_identifiers (pfile, cb, v)
      cpp_reader *pfile;
-     int (*cb) PARAMS ((cpp_reader *, cpp_hashnode *));
+     int (*cb) PARAMS ((cpp_reader *, cpp_hashnode *, void *));
+     void *v;
 {
     cpp_hashnode **p, **limit;
 
@@ -275,7 +276,7 @@ cpp_forall_identifiers (pfile, cb)
   do
     {
       if (*p)
-       if ((*cb) (pfile, *p) == 0)
+       if ((*cb) (pfile, *p, v) == 0)
          break;
     }
   while (++p < limit);
index eecd867be02a1ca34a434bafe94f8237982a344c..747ff18bad127862f0c9ead33ade5e36a4b3b13c 100644 (file)
@@ -802,7 +802,10 @@ extern cpp_hashnode *cpp_lookup            PARAMS ((cpp_reader *,
                                                 const unsigned char *, size_t));
 extern void cpp_forall_identifiers     PARAMS ((cpp_reader *,
                                                 int (*) PARAMS ((cpp_reader *,
-                                                                 cpp_hashnode *))));
+                                                                 cpp_hashnode *,
+                                                                 void *)),
+                                                void *));
+
 /* In cppmacro.c */
 extern void cpp_scan_buffer_nooutput   PARAMS ((cpp_reader *));
 extern void cpp_start_lookahead                PARAMS ((cpp_reader *));
index fc58f6a9d00b7c55d4f80f4398e8d85b7eee984c..3304c154948ef7ded7cc8e49b3e606ba10f7a4d6 100644 (file)
@@ -42,7 +42,7 @@ int main              PARAMS ((int, char **));
 /* General output routines.  */
 static void scan_buffer        PARAMS ((cpp_reader *));
 static int printer_init PARAMS ((cpp_reader *));
-static int dump_macro PARAMS ((cpp_reader *, cpp_hashnode *));
+static int dump_macro PARAMS ((cpp_reader *, cpp_hashnode *, void *));
 
 static void print_line PARAMS ((const char *));
 static void maybe_print_line PARAMS ((unsigned int));
@@ -62,8 +62,8 @@ static void cb_def_pragma PARAMS ((cpp_reader *));
 static void do_pragma_implementation PARAMS ((cpp_reader *));
 
 const char *progname;
-cpp_reader parse_in;
-struct printer print;
+static cpp_reader parse_in;
+static struct printer print;
 
 int
 main (argc, argv)
@@ -143,7 +143,7 @@ main (argc, argv)
 
   /* -dM command line option.  */
   if (CPP_OPTION (pfile, dump_macros) == dump_only)
-    cpp_forall_identifiers (pfile, dump_macro);
+    cpp_forall_identifiers (pfile, dump_macro, NULL);
 
   cpp_finish (pfile);
   cpp_cleanup (pfile);
@@ -429,9 +429,10 @@ do_pragma_implementation (pfile)
 
 /* Dump out the hash table.  */
 static int
-dump_macro (pfile, node)
+dump_macro (pfile, node, v)
      cpp_reader *pfile;
      cpp_hashnode *node;
+     void *v ATTRIBUTE_UNUSED;
 {
   if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
     {