]> gcc.gnu.org Git - gcc.git/commitdiff
emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
authorAndreas Jaeger <aj@suse.de>
Mon, 27 Aug 2001 06:48:43 +0000 (08:48 +0200)
committerAndreas Jaeger <aj@gcc.gnu.org>
Mon, 27 Aug 2001 06:48:43 +0000 (08:48 +0200)
* emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
* errors.c: Likewise.
* final.c: Likewise.
* dwarf2asm.c: Likewise.
* doprint.c (checkit): Likewise.
* diagnostic.c: Likewise.
* collect2.c: Likewise.
* calls.c: Likewise.
* c-semantics.c (build_stmt): Likewise.
* c-format.c (status_warning): Likewise.
* c-errors.c (pedwarn_c99): Likewise.
* builtins.c (validate_arglist): Likewise.
* config/pj/pj.c (pj_printf): Likewise.
* fix-header.c: Likewise.
* gcc.c: Likewise.
* gcov.c (fnotice): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c: Likewise.
* protoize.c (notice): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c: Likewise.
* tradcpp.c: Likewise.
* tree.c: Likewise.
* cp/tree.c (build_min_nt): Likewise.
(build_min): Likewise.
* cp/lex.c: Likewise.
* cp/errfn.c: Likewise.
* cp/rtti.c (create_pseudo_type_info): Likewise.

From-SVN: r45185

26 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/c-errors.c
gcc/c-format.c
gcc/c-semantics.c
gcc/collect2.c
gcc/config/pj/pj.c
gcc/cp/errfn.c
gcc/cp/lex.c
gcc/cp/rtti.c
gcc/cp/tree.c
gcc/doprint.c
gcc/dwarf2asm.c
gcc/emit-rtl.c
gcc/errors.c
gcc/final.c
gcc/fix-header.c
gcc/gcc.c
gcc/gcov.c
gcc/gensupport.c
gcc/mips-tfile.c
gcc/protoize.c
gcc/read-rtl.c
gcc/rtl-error.c
gcc/tradcpp.c
gcc/tree.c

index ac3ca07beaa57843c0513ef7a6d1be078a709212..ebcf81d78d25d47b8c432ac2ab7a0bde3724c752 100644 (file)
@@ -1,3 +1,34 @@
+2001-08-27  Andreas Jaeger  <aj@suse.de>
+
+       * emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
+       * errors.c: Likewise.
+       * final.c: Likewise.
+       * dwarf2asm.c: Likewise.
+       * doprint.c (checkit): Likewise.
+       * diagnostic.c: Likewise.
+       * collect2.c: Likewise.
+       * calls.c: Likewise.
+       * c-semantics.c (build_stmt): Likewise.
+       * c-format.c (status_warning): Likewise.
+       * c-errors.c (pedwarn_c99): Likewise.
+       * builtins.c (validate_arglist): Likewise.
+       * config/pj/pj.c (pj_printf): Likewise.
+       * fix-header.c: Likewise.
+       * gcc.c: Likewise.
+       * gcov.c (fnotice): Likewise.
+       * gensupport.c (message_with_line): Likewise.
+       * mips-tfile.c: Likewise.
+       * protoize.c (notice): Likewise.
+       * read-rtl.c (fatal_with_file_and_line): Likewise.
+       * rtl-error.c: Likewise.
+       * tradcpp.c: Likewise.
+       * tree.c: Likewise.
+       * cp/tree.c (build_min_nt): Likewise.
+       (build_min): Likewise.
+       * cp/lex.c: Likewise.
+       * cp/errfn.c: Likewise.
+       * cp/rtti.c (create_pseudo_type_info): Likewise.
+
 Sun Aug 26 20:25:44 2001  Denis Chertykov  <denisc@overta.ru>
 
        * df.c (df_uses_record): Return after recording all uses
index 3b12b38cd23c76c0213054528caeea99a3f9831f..53f6fa006b61fd0f5703fb08a4dd99054fb65f0a 100644 (file)
@@ -3864,17 +3864,11 @@ build_function_call_expr (fn, arglist)
 static int
 validate_arglist VPARAMS ((tree arglist, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  tree arglist;
-#endif
   enum tree_code code;
-  va_list ap;
-
-  VA_START (ap, arglist);
+  int res = 0;
 
-#ifndef ANSI_PROTOTYPES
-  arglist = va_arg (ap, tree);
-#endif
+  VA_OPEN (ap, arglist);
+  VA_FIXEDARG (ap, tree, arglist);
 
   do {
     code = va_arg (ap, enum tree_code);
@@ -3882,26 +3876,30 @@ validate_arglist VPARAMS ((tree arglist, ...))
     {
     case 0:
       /* This signifies an ellipses, any further arguments are all ok.  */
-      va_end (ap);
-      return 1;
+      res = 1;
+      goto end;
     case VOID_TYPE:
       /* This signifies an endlink, if no arguments remain, return
          true, otherwise return false.  */
-      va_end (ap);
-      return arglist == 0;
+      res = arglist == 0;
+      goto end;
     default:
       /* If no parameters remain or the parameter's code does not
          match the specified code, return false.  Otherwise continue
          checking any remaining arguments.  */
       if (arglist == 0 || code != TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))))
-        {
-         va_end (ap);
-         return 0;
-       }
+       goto end;
       break;
     }
     arglist = TREE_CHAIN (arglist);
   } while (1);
+
+  /* We need gotos here since we can only have one VA_CLOSE in a
+     function.  */
+ end: ;
+  VA_CLOSE (ap);
+
+  return res;
 }
 
 /* Default version of target-specific builtin setup that does nothing.  */
index 30a93d4fe4d84bf17193523ba3f2fe1faacd06d8..3f030f9a255fe00504fd1a39412a1cc10480fea1 100644 (file)
@@ -1,5 +1,5 @@
 /* Various diagnostic subroutines for the GNU C language.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
    Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
 
 This file is part of GCC.
@@ -32,20 +32,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 void
 pedwarn_c99 VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
   diagnostic_context dc;
 
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   set_diagnostic_context (&dc, msgid, &ap, input_filename, lineno,
                           !flag_isoc99 || !flag_pedantic_errors);
   report_diagnostic (&dc);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
index 5ca4aceec46dbfec8aceb401df54700e98bd1c05..d7ef210e4d4402e107e6689fedb56ae4b66935fe 100644 (file)
@@ -1149,19 +1149,11 @@ check_function_format (status, name, assembler_name, params)
 static void
 status_warning VPARAMS ((int *status, const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int *status;
-  const char *msgid;
-#endif
-  va_list ap;
   diagnostic_context dc;
 
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  status = va_arg (ap, int *);
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, int *, status);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   if (status)
     *status = 1;
@@ -1173,7 +1165,7 @@ status_warning VPARAMS ((int *status, const char *msgid, ...))
       report_diagnostic (&dc);
     }
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Variables used by the checking of $ operand number formats.  */
index 6da71b3e310f1ea0eff645368ed520f71bda33d7..84000b9f853819dd54be4ca8f2e869def40a3e4b 100644 (file)
@@ -170,19 +170,12 @@ finish_stmt_tree (t)
 tree
 build_stmt VPARAMS ((enum tree_code code, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  enum tree_code code;
-#endif
-  va_list p;
   register tree t;
   register int length;
   register int i;
 
-  VA_START (p, code);
-
-#ifndef ANSI_PROTOTYPES
-  code = va_arg (p, enum tree_code);
-#endif
+  VA_OPEN (p, code);
+  VA_FIXEDARG (p, enum tree_code, code);
 
   t = make_node (code);
   length = TREE_CODE_LENGTH (code);
@@ -191,7 +184,7 @@ build_stmt VPARAMS ((enum tree_code code, ...))
   for (i = 0; i < length; i++)
     TREE_OPERAND (t, i) = va_arg (p, tree);
 
-  va_end (p);
+  VA_CLOSE (p);
   return t;
 }
 
index d36b3e0bbffae929f4ead24304466a1e4ccc8bb5..3405f6ed1077019f64c5eb6b4518573efb544d00 100644 (file)
@@ -363,19 +363,11 @@ collect_exit (status)
 void
 notice VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   vfprintf (stderr, _(msgid), ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Die when sys call fails.  */
@@ -383,22 +375,15 @@ notice VPARAMS ((const char *msgid, ...))
 void
 fatal_perror VPARAMS ((const char * msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
   int e = errno;
-  va_list ap;
-
-  VA_START (ap, msgid);
 
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   fprintf (stderr, "collect2: ");
   vfprintf (stderr, _(msgid), ap);
   fprintf (stderr, ": %s\n", xstrerror (e));
-  va_end (ap);
+  VA_CLOSE (ap);
 
   collect_exit (FATAL_EXIT_CODE);
 }
@@ -408,21 +393,13 @@ fatal_perror VPARAMS ((const char * msgid, ...))
 void
 fatal VPARAMS ((const char * msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-  
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
   
   fprintf (stderr, "collect2: ");
   vfprintf (stderr, _(msgid), ap);
   fprintf (stderr, "\n");
-  va_end (ap);
+  VA_CLOSE (ap);
 
   collect_exit (FATAL_EXIT_CODE);
 }
@@ -432,21 +409,13 @@ fatal VPARAMS ((const char * msgid, ...))
 void
 error VPARAMS ((const char * msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char * msgid;
-#endif
-  va_list ap;
-  VA_START (ap, msgid);
-  
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   fprintf (stderr, "collect2: ");
   vfprintf (stderr, _(msgid), ap);
   fprintf (stderr, "\n");
-  va_end(ap);
+  VA_CLOSE(ap);
 }
 
 /* In case obstack is linked in, and abort is defined to fancy_abort,
index 870960b0f9b2296828e1637834a6d0d2843094e5..18525ce690de91a79df98e54f7c12bd2800407f4 100644 (file)
@@ -1,5 +1,5 @@
 /* Output routines for GCC for picoJava II
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -140,18 +140,12 @@ struct gcc_target targetm = TARGET_INITIALIZER;
 static void
 pj_printf VPARAMS ((const char *template, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *template;
-#endif
   register int c;
-
-  va_list argptr;
   int ops_read = 0;
   rtx operands[10];
-  VA_START (argptr, template);
-#ifndef ANSI_PROTOTYPES
-  template = va_arg (argptr, const char *);
-#endif
+
+  VA_OPEN (argptr, template);
+  VA_FIXEDARG (argptr, const char *, template);
 
   while ((c = *template++))
     {
@@ -229,7 +223,7 @@ pj_printf VPARAMS ((const char *template, ...))
          }
        }
     }
-  va_end (argptr);
+  VA_CLOSE (argptr);
 }
 
 /* Output code to efficiently push a single word integer constant onto
index 351dba958884b2320dbd9d47d9f4116275cab951..84ad1f5e20f3f3210dced845140b02e49be5219e 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a call-back mechanism for handling error output.
-   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
    Contributed by Jason Merrill (jason@cygnus.com)
 
@@ -185,77 +185,45 @@ cp_thing (errfn, atarg1, format, ap)
 void
 cp_error VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) error, 0, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 cp_warning VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) warning, 0, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 cp_pedwarn VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) pedwarn, 0, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 cp_compiler_error VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) compiler_error, 0, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
@@ -271,74 +239,42 @@ cp_deprecated (msg)
 void
 cp_sprintf VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   cp_thing ((errorfn *) sprintf, 0, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 cp_error_at VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) error_with_file_and_line, 1, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 cp_warning_at VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) warning_with_file_and_line, 1, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 cp_pedwarn_at VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (! cp_silent)
     cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
index 8cee04eb9550cd31234f17eeb903d16a1281d23c..a05dd37b50c9b2e54bf22b415e05ca9e740c42bb 100644 (file)
@@ -1636,20 +1636,14 @@ make_aggr_type (code)
 void
 compiler_error VPARAMS ((const char *msg, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msg;
-#endif
   char buf[1024];
-  va_list ap;
-
-  VA_START (ap, msg);
 
-#ifndef ANSI_PROTOTYPES
-  msg = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msg);
+  VA_FIXEDARG (ap, const char *, msg);
 
   vsprintf (buf, msg, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
+
   error_with_file_and_line (input_filename, lineno, "%s (compiler error)", buf);
 }
 
index 89fa5a3db7d55b997f41f4d0c9a9ab5bc4d9fcdc..6cdac79ac6af8dad51b3c9b20e775776b7de1fe6 100644 (file)
@@ -1154,11 +1154,6 @@ create_real_tinfo_var (target_type, name, type, init, non_public)
 static tree
 create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char const *real_name;
-  int ident;
-#endif
-  va_list ap;
   tree real_type, pseudo_type;
   char *pseudo_name;
   tree vtable_decl;
@@ -1166,12 +1161,10 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
   tree fields[10];
   tree field_decl;
   tree result;
-  
-  VA_START (ap, ident);
-#ifndef ANSI_PROTOTYPES
-  real_name = va_arg (ap, char const *);
-  ident = va_arg (ap, int);
-#endif
+
+  VA_OPEN (ap, ident);
+  VA_FIXEDARG (ap, const char *, real_name);
+  VA_FIXEDARG (ap, int, ident);
 
   /* Generate the pseudo type name. */
   pseudo_name = (char *)alloca (strlen (real_name) + 30);
@@ -1205,8 +1198,8 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
   pseudo_type = make_aggr_type (RECORD_TYPE);
   finish_builtin_type (pseudo_type, pseudo_name, fields, ix, ptr_type_node);
   TYPE_HAS_CONSTRUCTOR (pseudo_type) = 1;
-  va_end (ap);
-  
+  VA_CLOSE (ap);
+
   result = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
   TINFO_VTABLE_DECL (result) = vtable_decl;
   TINFO_PSEUDO_TYPE (result) = pseudo_type;
index f5c651051d9319892ba5b9db25a9b0a36cc77967..04e8add6a0d40764abcad65d54fcb5354bb02da1 100644 (file)
@@ -1724,19 +1724,12 @@ break_out_target_exprs (t)
 tree
 build_min_nt VPARAMS ((enum tree_code code, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  enum tree_code code;
-#endif
-  va_list p;
   register tree t;
   register int length;
   register int i;
 
-  VA_START (p, code);
-
-#ifndef ANSI_PROTOTYPES
-  code = va_arg (p, enum tree_code);
-#endif
+  VA_OPEN (p, code);
+  VA_FIXEDARG (p, enum tree_code, code);
 
   t = make_node (code);
   length = TREE_CODE_LENGTH (code);
@@ -1748,7 +1741,7 @@ build_min_nt VPARAMS ((enum tree_code code, ...))
       TREE_OPERAND (t, i) = x;
     }
 
-  va_end (p);
+  VA_CLOSE (p);
   return t;
 }
 
@@ -1758,21 +1751,13 @@ build_min_nt VPARAMS ((enum tree_code code, ...))
 tree
 build_min VPARAMS ((enum tree_code code, tree tt, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  enum tree_code code;
-  tree tt;
-#endif
-  va_list p;
   register tree t;
   register int length;
   register int i;
 
-  VA_START (p, tt);
-
-#ifndef ANSI_PROTOTYPES
-  code = va_arg (p, enum tree_code);
-  tt = va_arg (p, tree);
-#endif
+  VA_OPEN (p, tt);
+  VA_FIXEDARG (p, enum tree_code, code);
+  VA_FIXEDARG (p, tree, tt);
 
   t = make_node (code);
   length = TREE_CODE_LENGTH (code);
@@ -1785,7 +1770,7 @@ build_min VPARAMS ((enum tree_code code, tree tt, ...))
       TREE_OPERAND (t, i) = x;
     }
 
-  va_end (p);
+  VA_CLOSE (p);
   return t;
 }
 
index 114dcb7f77e22114f5ecf58be69c7e6044f3c966..bc43b0322f0e080e4054104ce6deeba28cb27142 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a version _doprnt in terms of fprintf.
-   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001   Free Software Foundation, Inc.
    Contributed by Kaveh Ghazi  (ghazi@caip.rutgers.edu)  3/29/98
 
 This program is free software; you can redistribute it and/or modify it
@@ -209,21 +209,12 @@ static int checkit PARAMS ((const char * format, ...)) ATTRIBUTE_PRINTF_1;
 static int
 checkit VPARAMS ((const char* format, ...))
 {
-  va_list args;
   int result;
-
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-
-  VA_START (args, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (args, char *);
-#endif
+  VA_OPEN (args, format);
+  VA_FIXEDARG (args, char *, format);
 
   result = _doprnt (format, args, stdout);
-  va_end(args);
+  VA_CLOSE (args);
 
   return result;
 }
index affa965ca2e456a113bc9a639e6e83affb3faeb7..f9158cfa5c8cd59af8475f2d8ae118258ff849f0 100644 (file)
@@ -84,20 +84,10 @@ void
 dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
                              const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int size;
-  unsigned HOST_WIDE_INT value;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  size = va_arg (ap, int);
-  value = va_arg (ap, unsigned HOST_WIDE_INT);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, size);
+  VA_FIXEDARG (ap, unsigned HOST_WIDE_INT, value);
+  VA_FIXEDARG (ap, const char *, comment);
 
   if (size * 8 < HOST_BITS_PER_WIDE_INT)
     value &= ~(~(unsigned HOST_WIDE_INT)0 << (size * 8));
@@ -116,7 +106,7 @@ dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Output the difference between two symbols in a given size.  */
@@ -129,21 +119,11 @@ void
 dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
                               const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int size;
-  const char *lab1, *lab2;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  size = va_arg (ap, int);
-  lab1 = va_arg (ap, const char *);
-  lab2 = va_arg (ap, const char *);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, size);
+  VA_FIXEDARG (ap, const char *, lab1);
+  VA_FIXEDARG (ap, const char *, lab2);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef UNALIGNED_INT_ASM_OP
   fputs (unaligned_integer_asm_op (size), asm_out_file);
@@ -163,7 +143,7 @@ dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Output a section-relative reference to a label.  In general this
@@ -176,20 +156,10 @@ void
 dw2_asm_output_offset VPARAMS ((int size, const char *label,
                               const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int size;
-  const char *label;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  size = va_arg (ap, int);
-  label = va_arg (ap, const char *);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, size);
+  VA_FIXEDARG (ap, const char *, label);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef ASM_OUTPUT_DWARF_OFFSET
   ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label);
@@ -209,7 +179,7 @@ dw2_asm_output_offset VPARAMS ((int size, const char *label,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Output a self-relative reference to a label, possibly in a
@@ -219,20 +189,10 @@ void
 dw2_asm_output_pcrel VPARAMS ((int size, const char *label,
                               const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int size;
-  const char *label;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  size = va_arg (ap, int);
-  label = va_arg (ap, const char *);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, size);
+  VA_FIXEDARG (ap, const char *, label);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef ASM_OUTPUT_DWARF_PCREL
   ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
@@ -254,7 +214,7 @@ dw2_asm_output_pcrel VPARAMS ((int size, const char *label,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Output an absolute reference to a label.  */
@@ -263,20 +223,10 @@ void
 dw2_asm_output_addr VPARAMS ((int size, const char *label,
                              const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int size;
-  const char *label;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  size = va_arg (ap, int);
-  label = va_arg (ap, const char *);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, size);
+  VA_FIXEDARG (ap, const char *, label);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef UNALIGNED_INT_ASM_OP
   fputs (unaligned_integer_asm_op (size), asm_out_file);
@@ -292,7 +242,7 @@ dw2_asm_output_addr VPARAMS ((int size, const char *label,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Similar, but use an RTX expression instead of a text label.  */
@@ -301,20 +251,10 @@ void
 dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
                                  const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int size;
-  rtx addr;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  size = va_arg (ap, int);
-  addr = va_arg (ap, rtx);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, size);
+  VA_FIXEDARG (ap, rtx, addr);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef UNALIGNED_INT_ASM_OP
   fputs (unaligned_integer_asm_op (size), asm_out_file);
@@ -330,28 +270,21 @@ dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 dw2_asm_output_nstring VPARAMS ((const char *str, size_t orig_len,
                                 const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *str;
-  size_t orig_len;
-  const char *comment;
-#endif
-  va_list ap;
-  size_t i, len = orig_len;
+  size_t i, len;
 
-  VA_START (ap, comment);
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, const char *, str);
+  VA_FIXEDARG (ap, size_t, len);
+  VA_FIXEDARG (ap, const char *, comment);
 
-#ifndef ANSI_PROTOTYPES
-  str = va_arg (ap, const char *);
-  len = va_arg (ap, size_t);
-  comment = va_arg (ap, const char *);
-#endif
+  len = orig_len;
 
   if (len == (size_t) -1)
     len = strlen (str);
@@ -384,7 +317,7 @@ dw2_asm_output_nstring VPARAMS ((const char *str, size_t orig_len,
        fprintf (asm_out_file, "%s0\n", ASM_BYTE_OP);
     }
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 \f
 
@@ -617,18 +550,9 @@ void
 dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value,
                                      const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  unsigned HOST_WIDE_INT value;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  value = va_arg (ap, unsigned HOST_WIDE_INT);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, unsigned HOST_WIDE_INT, value);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef HAVE_AS_LEB128
   fputs ("\t.uleb128 ", asm_out_file);
@@ -672,7 +596,7 @@ dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value,
 #endif
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* Output an signed LEB128 quantity.  */
@@ -681,18 +605,9 @@ void
 dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value,
                                      const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  HOST_WIDE_INT value;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  value = va_arg (ap, HOST_WIDE_INT);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, HOST_WIDE_INT, value);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef HAVE_AS_LEB128
   fputs ("\t.sleb128 ", asm_out_file);
@@ -739,7 +654,7 @@ dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value,
 #endif
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
@@ -747,19 +662,10 @@ dw2_asm_output_delta_uleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
                                       const char *lab2 ATTRIBUTE_UNUSED,
                                       const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *lab1, *lab2;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  lab1 = va_arg (ap, const char *);
-  lab2 = va_arg (ap, const char *);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, const char *, lab1);
+  VA_FIXEDARG (ap, const char *, lab2);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef HAVE_AS_LEB128
   fputs ("\t.uleb128 ", asm_out_file);
@@ -777,7 +683,7 @@ dw2_asm_output_delta_uleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
@@ -785,19 +691,10 @@ dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
                                       const char *lab2 ATTRIBUTE_UNUSED,
                                       const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *lab1, *lab2;
-  const char *comment;
-#endif
-  va_list ap;
-
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  lab1 = va_arg (ap, const char *);
-  lab2 = va_arg (ap, const char *);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, const char *, lab1);
+  VA_FIXEDARG (ap, const char *, lab2);
+  VA_FIXEDARG (ap, const char *, comment);
 
 #ifdef HAVE_AS_LEB128
   fputs ("\t.sleb128 ", asm_out_file);
@@ -815,7 +712,7 @@ dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 \f
 static rtx dw2_force_const_mem PARAMS ((rtx));
@@ -912,21 +809,12 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
                                          rtx addr,
                                          const char *comment, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int encoding;
-  rtx addr;
-  const char *comment;
-#endif
-  va_list ap;
   int size;
 
-  VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
-  encoding = va_arg (ap, int);
-  addr = va_arg (ap, rtx);
-  comment = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, comment);
+  VA_FIXEDARG (ap, int, encoding);
+  VA_FIXEDARG (ap, rtx, addr);
+  VA_FIXEDARG (ap, const char *, comment);
 
   size = size_of_encoded_value (encoding);
 
@@ -1010,5 +898,5 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
     }
   fputc ('\n', asm_out_file);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
index b41de83ddadfebab57b564f2ac6ed85ac3ac0f8a..379bfb6b80932a739f593f2feb71f7b0ebc6c879 100644 (file)
@@ -424,21 +424,13 @@ gen_lowpart_SUBREG (mode, reg)
 rtx
 gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  enum rtx_code code;
-  enum machine_mode mode;
-#endif
-  va_list p;
   register int i;              /* Array indices...                     */
   register const char *fmt;    /* Current rtx's format...              */
   register rtx rt_val;         /* RTX to return to caller...           */
 
-  VA_START (p, mode);
-
-#ifndef ANSI_PROTOTYPES
-  code = va_arg (p, enum rtx_code);
-  mode = va_arg (p, enum machine_mode);
-#endif
+  VA_OPEN (p, mode);
+  VA_FIXEDARG (p, enum rtx_code, code);
+  VA_FIXEDARG (p, enum machine_mode, mode);
 
   switch (code)
     {
@@ -511,7 +503,7 @@ gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...))
       break;
     }
 
-  va_end (p);
+  VA_CLOSE (p);
   return rt_val;
 }
 
@@ -525,18 +517,11 @@ gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...))
 rtvec
 gen_rtvec VPARAMS ((int n, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int n;
-#endif
   int i;
-  va_list p;
   rtx *vector;
 
-  VA_START (p, n);
-
-#ifndef ANSI_PROTOTYPES
-  n = va_arg (p, int);
-#endif
+  VA_OPEN (p, n);
+  VA_FIXEDARG (p, int, n);
 
   if (n == 0)
     return NULL_RTVEC;         /* Don't allocate an empty rtvec...     */
@@ -545,7 +530,7 @@ gen_rtvec VPARAMS ((int n, ...))
 
   for (i = 0; i < n; i++)
     vector[i] = va_arg (p, rtx);
-  va_end (p);
+  VA_CLOSE (p);
 
   return gen_rtvec_v (n, vector);
 }
index be59323e296075b22a209f815356b74bb3a16aef..8d072979c351bd9623c12084f02533cd24960fb3 100644 (file)
@@ -39,20 +39,12 @@ int have_error = 0;
 void
 warning VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   fprintf (stderr, "%s: warning: ", progname);
   vfprintf (stderr, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
   fputc('\n', stderr);
 }
 
@@ -62,20 +54,12 @@ warning VPARAMS ((const char *format, ...))
 void
 error VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   fprintf (stderr, "%s: ", progname);
   vfprintf (stderr, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
   fputc('\n', stderr);
 
   have_error = 1;
@@ -87,20 +71,12 @@ error VPARAMS ((const char *format, ...))
 void
 fatal VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   fprintf (stderr, "%s: ", progname);
   vfprintf (stderr, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
   fputc('\n', stderr);
   exit (FATAL_EXIT_CODE);
 }
@@ -110,20 +86,12 @@ fatal VPARAMS ((const char *format, ...))
 void
 internal_error VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   fprintf (stderr, "%s: Internal error: ", progname);
   vfprintf (stderr, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
   fputc ('\n', stderr);
   exit (FATAL_EXIT_CODE);
 }
index f0e51e9c9b8687e7c935df4730a7ba7dd7196e98..d524ccb934574cb7537b416f8608cf9b530ddbaa 100644 (file)
@@ -3651,20 +3651,12 @@ output_addr_const (file, x)
 void
 asm_fprintf VPARAMS ((FILE *file, const char *p, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  FILE *file;
-  const char *p;
-#endif
-  va_list argptr;
   char buf[10];
   char *q, c;
 
-  VA_START (argptr, p);
-
-#ifndef ANSI_PROTOTYPES
-  file = va_arg (argptr, FILE *);
-  p = va_arg (argptr, const char *);
-#endif
+  VA_OPEN (argptr, p);
+  VA_FIXEDARG (argptr, FILE *, file);
+  VA_FIXEDARG (argptr, const char *, p);
 
   buf[0] = '%';
 
@@ -3812,7 +3804,7 @@ asm_fprintf VPARAMS ((FILE *file, const char *p, ...))
       default:
        fputc (c, file);
       }
-  va_end (argptr);
+  VA_CLOSE (argptr);
 }
 \f
 /* Split up a CONST_DOUBLE or integer constant rtx
index 068cc692c6ee4084ef6252e18c4c98347877c1d9..24cbfef35e7bd0c81d4042bb467d9c5cffd3f2c6 100644 (file)
@@ -1,6 +1,6 @@
 /* fix-header.c - Make C header file suitable for C++.
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   1999, 2000, 2001 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -1317,17 +1317,9 @@ v_fatal (str, ap)
 static void
 fatal VPARAMS ((const char *str, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *str;
-#endif
-  va_list ap;
-  
-  VA_START (ap, str);
-
-#ifndef ANSI_PROTOTYPES
-  str = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, str);
+  VA_FIXEDARG (ap, const char *, str);
 
   v_fatal (str, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
index 3e2f6e4c0b993ac3cd675547a35aea5da8b73b89..fcb0d8483ce83587fa71ff507c423e39faabd99b 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -6204,20 +6204,12 @@ fancy_abort ()
 void
 fatal VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   fprintf (stderr, "%s: ", programname);
   vfprintf (stderr, _(msgid), ap);
-  va_end (ap);
+  VA_CLOSE (ap);
   fprintf (stderr, "\n");
   delete_temp_files ();
   exit (1);
@@ -6226,20 +6218,12 @@ fatal VPARAMS ((const char *msgid, ...))
 void
 error VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   fprintf (stderr, "%s: ", programname);
   vfprintf (stderr, _(msgid), ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 
   fprintf (stderr, "\n");
 }
@@ -6247,19 +6231,11 @@ error VPARAMS ((const char *msgid, ...))
 static void
 notice VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   vfprintf (stderr, _(msgid), ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 \f
 static void
index 4fe37b20c30182a622fa7aa2887632c9667a2663..b88bf093fc04dc1a39de2e83da99d88be2d30ca4 100644 (file)
@@ -273,21 +273,12 @@ static void fnotice PARAMS ((FILE *, const char *, ...)) ATTRIBUTE_PRINTF_2;
 static void
 fnotice VPARAMS ((FILE *file, const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  FILE *file;
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  file = va_arg (ap, FILE *);
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, FILE *, file);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   vfprintf (file, _(msgid), ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 /* More 'friendly' abort that prints the line and file.
index fe69e05b339d0aa30be5f5ddd27a2468c1345bf1..bc18866ceb681f1807100caa12deb5fe0511d9d4 100644 (file)
@@ -79,24 +79,15 @@ static void process_define_cond_exec PARAMS ((void));
 void
 message_with_line VPARAMS ((int lineno, const char *msg, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int lineno;
-  const char *msg;
-#endif
-  va_list ap;
-
-  VA_START (ap, msg);
-
-#ifndef ANSI_PROTOTYPES
-  lineno = va_arg (ap, int);
-  msg = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msg);
+  VA_FIXEDARG (ap, int, lineno);
+  VA_FIXEDARG (ap, const char *, msg);
 
   fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno);
   vfprintf (stderr, msg, ap);
   fputc ('\n', stderr);
 
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 \f
 /* Queue PATTERN on LIST_TAIL.  */
index 61db2c7c8be96a51932f6a0cc7ecb29738b58035..bc191db55765df62c0640889791bab48b7ca550f 100644 (file)
@@ -5561,16 +5561,8 @@ free_thead (ptr)
 void
 fatal VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, const char *, format);
 
   if (line_number > 0)
     fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
@@ -5578,7 +5570,7 @@ fatal VPARAMS ((const char *format, ...))
     fprintf (stderr, "%s:", progname);
 
   vfprintf (stderr, format, ap);
-  va_end (ap);
+  VA_CLOSE (ap);
   fprintf (stderr, "\n");
   if (line_number > 0)
     fprintf (stderr, "line:\t%s\n", cur_line_start);
@@ -5591,16 +5583,8 @@ fatal VPARAMS ((const char *format, ...))
 void
 error VPARAMS ((const char *format, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  char *format;
-#endif
-  va_list ap;
-
-  VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
-#endif
+  VA_OPEN (ap, format);
+  VA_FIXEDARG (ap, char *, format);
 
   if (line_number > 0)
     fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
@@ -5613,7 +5597,7 @@ error VPARAMS ((const char *format, ...))
     fprintf (stderr, "line:\t%s\n", cur_line_start);
 
   had_errors++;
-  va_end (ap);
+  VA_CLOSE (ap);
 
   saber_stop ();
 }
index 92b4b513388e2095c6db6b212b482556872f5d4b..98a0940c17240f29b5a39a360db2e899bdbaeed2 100644 (file)
@@ -1,6 +1,6 @@
 /* Protoize program - Original version by Ron Guilmette (rfg@segfault.us.com).
    Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   1999, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -564,19 +564,11 @@ static char * saved_repl_write_ptr;
 static void
 notice VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   vfprintf (stderr, _(msgid), ap);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 \f
index 959a6f342df5af2cb2c1d7caee6ae1bf4f52c517..9342a279a8e31fa026fb48f47b79f730bc2ba74c 100644 (file)
@@ -53,21 +53,13 @@ const char *read_rtx_filename = "<unknown>";
 static void
 fatal_with_file_and_line VPARAMS ((FILE *infile, const char *msg, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  FILE *infile;
-  const char *msg;
-#endif
-  va_list ap;
   char context[64];
   size_t i;
   int c;
 
-  VA_START (ap, msg);
-
-#ifndef ANSI_PROTOTYPES
-  infile = va_arg (ap, FILE *);
-  msg = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msg);
+  VA_FIXEDARG (ap, FILE *, infile);
+  VA_FIXEDARG (ap, const char *, msg);
 
   fprintf (stderr, "%s:%d: ", read_rtx_filename, read_rtx_lineno);
   vfprintf (stderr, msg, ap);
@@ -88,7 +80,7 @@ fatal_with_file_and_line VPARAMS ((FILE *infile, const char *msg, ...))
   fprintf (stderr, "%s:%d: following context is `%s'\n",
           read_rtx_filename, read_rtx_lineno, context);
 
-  va_end (ap);
+  VA_CLOSE (ap);
   exit (1);
 }
 
index 3acb507b383514b8b0dda891137dac7b22cf0206..7515f527f92a5f47c65519bc2e24aad5500221fc 100644 (file)
@@ -91,41 +91,23 @@ diagnostic_for_asm (insn, msg, args_ptr, warn)
 void
 error_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  rtx insn;
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  insn = va_arg (ap, rtx);
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, rtx, insn);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 0);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
 warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  rtx insn;
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
-  insn = va_arg (ap, rtx);
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN (ap, msgid);
+  VA_FIXEDARG (ap, rtx, insn);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 1);
-  va_end (ap);
+  VA_CLOSE (ap);
 }
 
 void
index 7d5e11050ec89af195772a3b2d6ce8a301cc794a..69848860dc5173a46c627581bd9d6629641887c1 100644 (file)
@@ -4686,37 +4686,22 @@ v_message (mtype, line, msgid, ap)
 void
 error VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START(ap, msgid);
-  
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN(ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   v_message (ERROR, 0, msgid, ap);
+  VA_CLOSE (ap);
 }
 
 void
 error_with_line VPARAMS ((int line, const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  int line;
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START(ap, msgid);
-  
-#ifndef ANSI_PROTOTYPES
-  line = va_arg (ap, int);
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN(ap, msgid);
+  VA_FIXEDARG (ap, int, line);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   v_message (ERROR, line, msgid, ap);
+  VA_CLOSE (ap);
 }
 
 /* Error including a message from `errno'.  */
@@ -4731,35 +4716,21 @@ error_from_errno (name)
 void
 warning VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START(ap, msgid);
-  
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN(ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   v_message (WARNING, 0, msgid, ap);
+  VA_CLOSE (ap);
 }
 
 void
 fatal VPARAMS ((const char *msgid, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
-
-  VA_START(ap, msgid);
-  
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
+  VA_OPEN(ap, msgid);
+  VA_FIXEDARG (ap, const char *, msgid);
 
   v_message (FATAL, 0, msgid, ap);
+  VA_CLOSE (ap);
   exit (FATAL_EXIT_CODE);
 }
 
index b4e483d353888f2ded07b92c55dd70b4555b660e..e5bc8d8dba9cbcbd2812f9ab2f908aee88f0b1a4 100644 (file)
@@ -2334,23 +2334,15 @@ stabilize_reference_1 (e)
 tree
 build VPARAMS ((enum tree_code code, tree tt, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  enum tree_code code;
-  tree tt;
-#endif
-  va_list p;
   register tree t;
   register int length;
   register int i;
   int fro;
   int constant;
 
-  VA_START (p, tt);
-
-#ifndef ANSI_PROTOTYPES
-  code = va_arg (p, enum tree_code);
-  tt = va_arg (p, tree);
-#endif
+  VA_OPEN (p, tt);
+  VA_FIXEDARG (p, enum tree_code, code);
+  VA_FIXEDARG (p, tree, tt);
 
   t = make_node (code);
   length = TREE_CODE_LENGTH (code);
@@ -2427,7 +2419,7 @@ build VPARAMS ((enum tree_code code, tree tt, ...))
            }
        }
     }
-  va_end (p);
+  VA_CLOSE (p);
 
   TREE_CONSTANT (t) = constant;
   return t;
@@ -2518,19 +2510,12 @@ build1 (code, type, node)
 tree
 build_nt VPARAMS ((enum tree_code code, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  enum tree_code code;
-#endif
-  va_list p;
   register tree t;
   register int length;
   register int i;
 
-  VA_START (p, code);
-
-#ifndef ANSI_PROTOTYPES
-  code = va_arg (p, enum tree_code);
-#endif
+  VA_OPEN (p, code);
+  VA_FIXEDARG (p, enum tree_code, code);
 
   t = make_node (code);
   length = TREE_CODE_LENGTH (code);
@@ -2538,7 +2523,7 @@ build_nt VPARAMS ((enum tree_code code, ...))
   for (i = 0; i < length; i++)
     TREE_OPERAND (t, i) = va_arg (p, tree);
 
-  va_end (p);
+  VA_CLOSE (p);
   return t;
 }
 
This page took 0.140544 seconds and 5 git commands to generate.