[PATCH RFC] Protoize gdbserver/utils.c

Kevin Buettner kevinb@cygnus.com
Sat Aug 26 10:47:00 GMT 2000


More protoization...

This one was a bit different in that the prototypes were already there
along with the K&R way of doing things (controlled by ifdefs).  So,
assuming that the prototyped version was correct, all I had to do was
delete the right lines.

	* gdbserver/utils.c (error, fatal): Protoize.

Index: gdbserver/utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/utils.c,v
retrieving revision 1.2
diff -u -r1.2 utils.c
--- utils.c	2000/07/30 01:48:28	1.2
+++ utils.c	2000/08/26 17:37:49
@@ -56,33 +56,14 @@
    STRING is the error message, used as a fprintf string,
    and ARG is passed as an argument to it.  */
 
-#ifdef ANSI_PROTOTYPES
 NORETURN void
 error (const char *string,...)
-#else
-void
-error (va_alist)
-     va_dcl
-#endif
 {
   extern jmp_buf toplevel;
   va_list args;
-#ifdef ANSI_PROTOTYPES
   va_start (args, string);
-#else
-  va_start (args);
-#endif
   fflush (stdout);
-#ifdef ANSI_PROTOTYPES
   vfprintf (stderr, string, args);
-#else
-  {
-    char *string1;
-
-    string1 = va_arg (args, char *);
-    vfprintf (stderr, string1, args);
-  }
-#endif
   fprintf (stderr, "\n");
   longjmp (toplevel, 1);
 }
@@ -93,21 +74,10 @@
 
 /* VARARGS */
 NORETURN void
-#ifdef ANSI_PROTOTYPES
 fatal (char *string,...)
-#else
-fatal (va_alist)
-     va_dcl
-#endif
 {
   va_list args;
-#ifdef ANSI_PROTOTYPES
   va_start (args, string);
-#else
-  char *string;
-  va_start (args);
-  string = va_arg (args, char *);
-#endif
   fprintf (stderr, "gdb: ");
   vfprintf (stderr, string, args);
   fprintf (stderr, "\n");



More information about the Gdb-patches mailing list