This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

use VA_OPEN macros in java/*



Here's a patch for java/* to use VA_OPEN etc.

Bootstrapped/regtested on i686-linux-gnu.

Ok to commit?

Andreas


2001-08-26  Andreas Jaeger  <aj@suse.de>

	* parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
	* jv-scan.c: Likewise.
	* parse.c, parse.h: Regenerated.
============================================================
Index: gcc/java/jv-scan.c
--- gcc/java/jv-scan.c	2001/05/23 18:10:28	1.24
+++ gcc/java/jv-scan.c	2001/08/26 10:35:55
@@ -239,42 +239,26 @@
 void
 fatal_error VPARAMS ((const char *s, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *s;
-#endif
-  va_list ap;
+  VA_OPEN (ap, s);
+  VA_FIXEDARG (ap, const char *, s);
 
-  VA_START (ap, s);
-
-#ifndef ANSI_PROTOTYPES
-  s = va_arg (ap, const char *);
-#endif
-
   fprintf (stderr, "%s: error: ", exec_name);
   vfprintf (stderr, s, ap);
   fputc ('\n', stderr);
-  va_end (ap);
+  VA_CLOSE (ap);
   exit (1);
 }
 
 void
 warning VPARAMS ((const char *s, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *s;
-#endif
-  va_list ap;
-
-  VA_START (ap, s);
-
-#ifndef ANSI_PROTOTYPES
-  s = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, s);
+  VA_FIXEDARG (ap, const char *, s);
 
   fprintf (stderr, "%s: warning: ", exec_name);
   vfprintf (stderr, s, ap);
   fputc ('\n', stderr);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
============================================================
Index: gcc/java/parse.y
--- gcc/java/parse.y	2001/08/24 17:40:54	1.302
+++ gcc/java/parse.y	2001/08/26 10:36:11
@@ -3085,19 +3085,11 @@
 void
 parse_error_context VPARAMS ((tree cl, const char *msg, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  tree cl;
-  const char *msg;
-#endif
-  va_list ap;
-
-  VA_START (ap, msg);
-#ifndef ANSI_PROTOTYPES
-  cl = va_arg (ap, tree);
-  msg = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msg);
+  VA_FIXEDARG (ap, tree, cl);
+  VA_FIXEDARG (ap, const char *, msg);
   issue_warning_error_from_context (cl, msg, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Issue a warning at a current source line CL */
@@ -3105,22 +3097,14 @@
 static void
 parse_warning_context VPARAMS ((tree cl, const char *msg, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  tree cl;
-  const char *msg;
-#endif
-  va_list ap;
-
-  VA_START (ap, msg);
-#ifndef ANSI_PROTOTYPES
-  cl = va_arg (ap, tree);
-  msg = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msg);
+  VA_FIXEDARG (ap, tree, cl);
+  VA_FIXEDARG (ap, const char *, msg);
 
   force_error = do_warning = 1;
   issue_warning_error_from_context (cl, msg, ap);
   do_warning = force_error = 0;
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 static tree


-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]