This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] gas/[lm]*: Convert to ISO-C.


Hi,

Committed as preapproved.

Kazu Hirata

2003-11-24  Kazu Hirata  <kazu@cs.umass.edu>

	* listing.c: Convert to ISO-C.
	* listing.h: Likewise.
	* macro.c: Likewise.
	* macro.h: Likewise.

Index: listing.c
===================================================================
RCS file: /cvs/src/src/gas/listing.c,v
retrieving revision 1.22
diff -u -r1.22 listing.c
--- listing.c	27 Oct 2003 12:45:17 -0000	1.22
+++ listing.c	22 Nov 2003 02:17:14 -0000
@@ -204,27 +204,22 @@
 static char *data_buffer;
 
 /* Prototypes.  */
-static void listing_message PARAMS ((const char *name, const char *message));
-static file_info_type *file_info PARAMS ((const char *file_name));
-static void new_frag PARAMS ((void));
-static char *buffer_line PARAMS ((file_info_type *file,
-				  char *line, unsigned int size));
-static void listing_page PARAMS ((list_info_type *list));
-static unsigned int calc_hex PARAMS ((list_info_type *list));
-static void print_lines PARAMS ((list_info_type *, unsigned int,
-				 char *, unsigned int));
-static void list_symbol_table PARAMS ((void));
-static void print_source PARAMS ((file_info_type *current_file,
-				  list_info_type *list,
-				  char *buffer,
-				  unsigned int width));
-static int debugging_pseudo PARAMS ((list_info_type *, const char *));
-static void listing_listing PARAMS ((char *name));
+static void listing_message (const char *name, const char *message);
+static file_info_type *file_info (const char *file_name);
+static void new_frag (void);
+static char *buffer_line (file_info_type *file, char *line, unsigned int size);
+static void listing_page (list_info_type *list);
+static unsigned int calc_hex (list_info_type *list);
+static void print_lines (list_info_type *, unsigned int,
+			 char *, unsigned int);
+static void list_symbol_table (void);
+static void print_source (file_info_type *current_file, list_info_type *list,
+			  char *buffer, unsigned int width);
+static int debugging_pseudo (list_info_type *, const char *);
+static void listing_listing (char *name);
 
 static void
-listing_message (name, message)
-     const char *name;
-     const char *message;
+listing_message (const char *name, const char *message)
 {
   if (listing_tail != (list_info_type *) NULL)
     {
@@ -237,22 +232,19 @@
 }
 
 void
-listing_warning (message)
-     const char *message;
+listing_warning (const char *message)
 {
   listing_message (_("Warning:"), message);
 }
 
 void
-listing_error (message)
-     const char *message;
+listing_error (const char *message)
 {
   listing_message (_("Error:"), message);
 }
 
 static file_info_type *
-file_info (file_name)
-     const char *file_name;
+file_info (const char *file_name)
 {
   /* Find an entry with this file name.  */
   file_info_type *p = file_info_head;
@@ -278,7 +270,7 @@
 }
 
 static void
-new_frag ()
+new_frag (void)
 {
 
   frag_wane (frag_now);
@@ -287,8 +279,7 @@
 }
 
 void
-listing_newline (ps)
-     char *ps;
+listing_newline (char *ps)
 {
   char *file;
   unsigned int line;
@@ -432,7 +423,7 @@
    with the new instruction.  */
 
 void
-listing_prev_line ()
+listing_prev_line (void)
 {
   list_info_type *l;
   fragS *f;
@@ -459,10 +450,7 @@
    file to make.  */
 
 static char *
-buffer_line (file, line, size)
-     file_info_type *file;
-     char *line;
-     unsigned int size;
+buffer_line (file_info_type *file, char *line, unsigned int size)
 {
   unsigned int count = 0;
   int c;
@@ -533,8 +521,7 @@
 static unsigned int on_page;	/* Number of lines printed on current page */
 
 static void
-listing_page (list)
-     list_info_type *list;
+listing_page (list_info_type *list)
 {
   /* Grope around, see if we can see a title or subtitle edict coming up
      soon.  (we look down 10 lines of the page and see if it's there)  */
@@ -577,8 +564,7 @@
 }
 
 static unsigned int
-calc_hex (list)
-     list_info_type *list;
+calc_hex (list_info_type *list)
 {
   int data_buffer_size;
   list_info_type *first = list;
@@ -653,11 +639,8 @@
 }
 
 static void
-print_lines (list, lineno, string, address)
-     list_info_type *list;
-     unsigned int lineno;
-     char *string;
-     unsigned int address;
+print_lines (list_info_type *list, unsigned int lineno,
+	     char *string, unsigned int address)
 {
   unsigned int idx;
   unsigned int nchars;
@@ -761,7 +744,7 @@
 }
 
 static void
-list_symbol_table ()
+list_symbol_table (void)
 {
   extern symbolS *symbol_rootP;
   int got_some = 0;
@@ -869,11 +852,8 @@
 }
 
 static void
-print_source (current_file, list, buffer, width)
-     file_info_type *current_file;
-     list_info_type *list;
-     char *buffer;
-     unsigned int width;
+print_source (file_info_type *current_file, list_info_type *list,
+	      char *buffer, unsigned int width)
 {
   if (!current_file->at_end)
     {
@@ -893,9 +873,7 @@
    records inserted by the compiler, see if the line is suspicious.  */
 
 static int
-debugging_pseudo (list, line)
-     list_info_type *list;
-     const char *line;
+debugging_pseudo (list_info_type *list, const char *line)
 {
   static int in_debug;
   int was_debug;
@@ -965,8 +943,7 @@
 }
 
 static void
-listing_listing (name)
-     char *name ATTRIBUTE_UNUSED;
+listing_listing (char *name ATTRIBUTE_UNUSED)
 {
   list_info_type *list = head;
   file_info_type *current_hll_file = (file_info_type *) NULL;
@@ -1107,8 +1084,7 @@
 }
 
 void
-listing_print (name)
-     char *name;
+listing_print (char *name)
 {
   int using_stdout;
 
@@ -1161,23 +1137,20 @@
 }
 
 void
-listing_file (name)
-     const char *name;
+listing_file (const char *name)
 {
   fn = name;
 }
 
 void
-listing_eject (ignore)
-     int ignore ATTRIBUTE_UNUSED;
+listing_eject (int ignore ATTRIBUTE_UNUSED)
 {
   if (listing)
     listing_tail->edict = EDICT_EJECT;
 }
 
 void
-listing_flags (ignore)
-     int ignore ATTRIBUTE_UNUSED;
+listing_flags (int ignore ATTRIBUTE_UNUSED)
 {
   while ((*input_line_pointer++) && (*input_line_pointer != '\n'))
     input_line_pointer++;
@@ -1190,8 +1163,7 @@
    the current line should be listed, but the next line should not.  */
 
 void
-listing_list (on)
-     int on;
+listing_list (int on)
 {
   if (listing)
     {
@@ -1220,8 +1192,7 @@
 }
 
 void
-listing_psize (width_only)
-     int width_only;
+listing_psize (int width_only)
 {
   if (! width_only)
     {
@@ -1248,15 +1219,13 @@
 }
 
 void
-listing_nopage (ignore)
-     int ignore ATTRIBUTE_UNUSED;
+listing_nopage (int ignore ATTRIBUTE_UNUSED)
 {
   paper_height = 0;
 }
 
 void
-listing_title (depth)
-     int depth;
+listing_title (int depth)
 {
   int quoted;
   char *start;
@@ -1308,8 +1277,7 @@
 }
 
 void
-listing_source_line (line)
-     unsigned int line;
+listing_source_line (unsigned int line)
 {
   if (listing)
     {
@@ -1320,8 +1288,7 @@
 }
 
 void
-listing_source_file (file)
-     const char *file;
+listing_source_file (const char *file)
 {
   if (listing)
     listing_tail->hll_file = file_info (file);
@@ -1332,71 +1299,61 @@
 /* Dummy functions for when compiled without listing enabled.  */
 
 void
-listing_flags (ignore)
-     int ignore;
+listing_flags (int ignore)
 {
   s_ignore (0);
 }
 
 void
-listing_list (on)
-     int on;
+listing_list (int on)
 {
   s_ignore (0);
 }
 
 void
-listing_eject (ignore)
-     int ignore;
+listing_eject (int ignore)
 {
   s_ignore (0);
 }
 
 void
-listing_psize (ignore)
-     int ignore;
+listing_psize (int ignore)
 {
   s_ignore (0);
 }
 
 void
-listing_nopage (ignore)
-     int ignore;
+listing_nopage (int ignore)
 {
   s_ignore (0);
 }
 
 void
-listing_title (depth)
-     int depth;
+listing_title (int depth)
 {
   s_ignore (0);
 }
 
 void
-listing_file (name)
-     const char *name;
+listing_file (const char *name)
 {
 
 }
 
 void
-listing_newline (name)
-     char *name;
+listing_newline (char *name)
 {
 
 }
 
 void
-listing_source_line (n)
-     unsigned int n;
+listing_source_line (unsigned int n)
 {
 
 }
 
 void
-listing_source_file (n)
-     const char *n;
+listing_source_file (const char *n)
 {
 
 }
Index: listing.h
===================================================================
RCS file: /cvs/src/src/gas/listing.h,v
retrieving revision 1.2
diff -u -r1.2 listing.h
--- listing.h	8 Mar 2001 23:24:22 -0000	1.2
+++ listing.h	22 Nov 2003 02:17:14 -0000
@@ -41,21 +41,21 @@
 
 #define LISTING_SKIP_COND() ((listing & LISTING_NOCOND) != 0)
 
-void listing_eject PARAMS ((int));
-void listing_error PARAMS ((const char *message));
-void listing_file PARAMS ((const char *name));
-void listing_flags PARAMS ((int));
-void listing_list PARAMS ((int on));
-void listing_newline PARAMS ((char *ps));
-void listing_prev_line PARAMS ((void));
-void listing_print PARAMS ((char *name));
-void listing_psize PARAMS ((int));
-void listing_nopage PARAMS ((int));
-void listing_source_file PARAMS ((const char *));
-void listing_source_line PARAMS ((unsigned int));
-void listing_title PARAMS ((int depth));
-void listing_warning PARAMS ((const char *message));
-void listing_width PARAMS ((unsigned int x));
+void listing_eject (int);
+void listing_error (const char *message);
+void listing_file (const char *name);
+void listing_flags (int);
+void listing_list (int on);
+void listing_newline (char *ps);
+void listing_prev_line (void);
+void listing_print (char *name);
+void listing_psize (int);
+void listing_nopage (int);
+void listing_source_file (const char *);
+void listing_source_line (unsigned int);
+void listing_title (int depth);
+void listing_warning (const char *message);
+void listing_width (unsigned int x);
 
 extern int listing_lhs_width;
 extern int listing_lhs_width_second;
Index: macro.c
===================================================================
RCS file: /cvs/src/src/gas/macro.c,v
retrieving revision 1.22
diff -u -r1.22 macro.c
--- macro.c	2 Jun 2003 15:03:20 -0000	1.22
+++ macro.c	22 Nov 2003 02:17:15 -0000
@@ -67,16 +67,15 @@
 
 /* Internal functions.  */
 
-static int get_token PARAMS ((int, sb *, sb *));
-static int getstring PARAMS ((int, sb *, sb *));
-static int get_any_string PARAMS ((int, sb *, sb *, int, int));
-static int do_formals PARAMS ((macro_entry *, int, sb *));
-static int get_apost_token PARAMS ((int, sb *, sb *, int));
-static int sub_actual
-  PARAMS ((int, sb *, sb *, struct hash_control *, int, sb *, int));
+static int get_token (int, sb *, sb *);
+static int getstring (int, sb *, sb *);
+static int get_any_string (int, sb *, sb *, int, int);
+static int do_formals (macro_entry *, int, sb *);
+static int get_apost_token (int, sb *, sb *, int);
+static int sub_actual (int, sb *, sb *, struct hash_control *, int, sb *, int);
 static const char *macro_expand_body
-  PARAMS ((sb *, sb *, formal_entry *, struct hash_control *, int));
-static const char *macro_expand PARAMS ((int, sb *, macro_entry *, sb *));
+  (sb *, sb *, formal_entry *, struct hash_control *, int);
+static const char *macro_expand (int, sb *, macro_entry *, sb *);
 
 #define ISWHITE(x) ((x) == ' ' || (x) == '\t')
 
@@ -113,7 +112,7 @@
 
 /* Function to use to parse an expression.  */
 
-static int (*macro_expr) PARAMS ((const char *, int, sb *, int *));
+static int (*macro_expr) (const char *, int, sb *, int *);
 
 /* Number of macro expansions that have been done.  */
 
@@ -122,11 +121,8 @@
 /* Initialize macro processing.  */
 
 void
-macro_init (alternate, mri, strip_at, expr)
-     int alternate;
-     int mri;
-     int strip_at;
-     int (*expr) PARAMS ((const char *, int, sb *, int *));
+macro_init (int alternate, int mri, int strip_at,
+	    int (*expr) (const char *, int, sb *, int *))
 {
   macro_hash = hash_new ();
   macro_defined = 0;
@@ -139,8 +135,7 @@
 /* Switch in and out of MRI mode on the fly.  */
 
 void
-macro_mri_mode (mri)
-     int mri;
+macro_mri_mode (int mri)
 {
   macro_mri = mri;
 }
@@ -152,11 +147,8 @@
    Return 1 on success, 0 on unexpected EOF.  */
 
 int
-buffer_and_nest (from, to, ptr, get_line)
-     const char *from;
-     const char *to;
-     sb *ptr;
-     int (*get_line) PARAMS ((sb *));
+buffer_and_nest (const char *from, const char *to, sb *ptr,
+		 int (*get_line) (sb *))
 {
   int from_len = strlen (from);
   int to_len = strlen (to);
@@ -235,10 +227,7 @@
 /* Pick up a token.  */
 
 static int
-get_token (idx, in, name)
-     int idx;
-     sb *in;
-     sb *name;
+get_token (int idx, sb *in, sb *name)
 {
   if (idx < in->len
       && (ISALPHA (in->ptr[idx])
@@ -263,10 +252,7 @@
 /* Pick up a string.  */
 
 static int
-getstring (idx, in, acc)
-     int idx;
-     sb *in;
-     sb *acc;
+getstring (int idx, sb *in, sb *acc)
 {
   idx = sb_skip_white (idx, in);
 
@@ -354,12 +340,7 @@
 */
 
 static int
-get_any_string (idx, in, out, expand, pretend_quoted)
-     int idx;
-     sb *in;
-     sb *out;
-     int expand;
-     int pretend_quoted;
+get_any_string (int idx, sb *in, sb *out, int expand, int pretend_quoted)
 {
   sb_reset (out);
   idx = sb_skip_white (idx, in);
@@ -439,10 +420,7 @@
 /* Pick up the formal parameters of a macro definition.  */
 
 static int
-do_formals (macro, idx, in)
-     macro_entry *macro;
-     int idx;
-     sb *in;
+do_formals (macro_entry *macro, int idx, sb *in)
 {
   formal_entry **p = &macro->formals;
 
@@ -522,12 +500,8 @@
    the macro which was defined.  */
 
 const char *
-define_macro (idx, in, label, get_line, namep)
-     int idx;
-     sb *in;
-     sb *label;
-     int (*get_line) PARAMS ((sb *));
-     const char **namep;
+define_macro (int idx, sb *in, sb *label,
+	      int (*get_line) (sb *), const char **namep)
 {
   macro_entry *macro;
   sb name;
@@ -583,11 +557,7 @@
 /* Scan a token, and then skip KIND.  */
 
 static int
-get_apost_token (idx, in, name, kind)
-     int idx;
-     sb *in;
-     sb *name;
-     int kind;
+get_apost_token (int idx, sb *in, sb *name, int kind)
 {
   idx = get_token (idx, in, name);
   if (idx < in->len
@@ -601,14 +571,8 @@
 /* Substitute the actual value for a formal parameter.  */
 
 static int
-sub_actual (start, in, t, formal_hash, kind, out, copyifnotthere)
-     int start;
-     sb *in;
-     sb *t;
-     struct hash_control *formal_hash;
-     int kind;
-     sb *out;
-     int copyifnotthere;
+sub_actual (int start, sb *in, sb *t, struct hash_control *formal_hash,
+	    int kind, sb *out, int copyifnotthere)
 {
   int src;
   formal_entry *ptr;
@@ -654,12 +618,8 @@
 /* Expand the body of a macro.  */
 
 static const char *
-macro_expand_body (in, out, formals, formal_hash, locals)
-     sb *in;
-     sb *out;
-     formal_entry *formals;
-     struct hash_control *formal_hash;
-     int locals;
+macro_expand_body (sb *in, sb *out, formal_entry *formals,
+		   struct hash_control *formal_hash, int locals)
 {
   sb t;
   int src = 0;
@@ -881,11 +841,7 @@
    body.  */
 
 static const char *
-macro_expand (idx, in, m, out)
-     int idx;
-     sb *in;
-     macro_entry *m;
-     sb *out;
+macro_expand (int idx, sb *in, macro_entry *m, sb *out)
 {
   sb t;
   formal_entry *ptr;
@@ -1073,11 +1029,8 @@
    *EXPAND.  Return 1 if a macro is found, 0 otherwise.  */
 
 int
-check_macro (line, expand, error, info)
-     const char *line;
-     sb *expand;
-     const char **error;
-     macro_entry **info;
+check_macro (const char *line, sb *expand,
+	     const char **error, macro_entry **info)
 {
   const char *s;
   char *copy, *cs;
@@ -1127,8 +1080,7 @@
 /* Delete a macro.  */
 
 void
-delete_macro (name)
-     const char *name;
+delete_macro (const char *name)
 {
   hash_delete (macro_hash, name);
 }
@@ -1138,12 +1090,7 @@
    success, or an error message otherwise.  */
 
 const char *
-expand_irp (irpc, idx, in, out, get_line)
-     int irpc;
-     int idx;
-     sb *in;
-     sb *out;
-     int (*get_line) PARAMS ((sb *));
+expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *))
 {
   const char *mn;
   sb sub;
Index: macro.h
===================================================================
RCS file: /cvs/src/src/gas/macro.h,v
retrieving revision 1.8
diff -u -r1.8 macro.h
--- macro.h	27 Oct 2003 12:45:17 -0000	1.8
+++ macro.h	22 Nov 2003 02:17:15 -0000
@@ -70,19 +70,14 @@
 
 extern int macro_nest;
 
-extern int buffer_and_nest
-  PARAMS ((const char *, const char *, sb *, int (*) PARAMS ((sb *))));
+extern int buffer_and_nest (const char *, const char *, sb *, int (*) (sb *));
 extern void macro_init
-  PARAMS ((int, int, int, int (*) PARAMS ((const char *, int, sb *, int *))));
-extern void macro_mri_mode
-  PARAMS ((int));
+  (int, int, int, int (*) (const char *, int, sb *, int *));
+extern void macro_mri_mode (int);
 extern const char *define_macro
-  PARAMS ((int, sb *, sb *, int (*) PARAMS ((sb *)), const char **));
-extern int check_macro
-  PARAMS ((const char *, sb *, const char **, macro_entry **));
-extern void delete_macro
-  PARAMS ((const char *));
-extern const char *expand_irp
-  PARAMS ((int, int, sb *, sb *, int (*) PARAMS ((sb *))));
+  (int, sb *, sb *, int (*) (sb *), const char **);
+extern int check_macro (const char *, sb *, const char **, macro_entry **);
+extern void delete_macro (const char *);
+extern const char *expand_irp (int, int, sb *, sb *, int (*) (sb *));
 
 #endif
Index: messages.c
===================================================================
RCS file: /cvs/src/src/gas/messages.c,v
retrieving revision 1.6
diff -u -r1.6 messages.c
--- messages.c	8 Mar 2001 23:24:22 -0000	1.6
+++ messages.c	22 Nov 2003 02:17:15 -0000
@@ -42,10 +42,10 @@
 #define va_end(ARGS)
 #endif
 
-static void identify PARAMS ((char *));
-static void as_show_where PARAMS ((void));
-static void as_warn_internal PARAMS ((char *, unsigned int, char *));
-static void as_bad_internal PARAMS ((char *, unsigned int, char *));
+static void identify (char *);
+static void as_show_where (void);
+static void as_warn_internal (char *, unsigned int, char *);
+static void as_bad_internal (char *, unsigned int, char *);
 
 /* Despite the rest of the comments in this file, (FIXME-SOON),
  * here is the current scheme for error messages etc:
@@ -85,8 +85,7 @@
  */
 
 static void
-identify (file)
-     char *file;
+identify (char *file)
 {
   static int identified;
   if (identified)
@@ -108,7 +107,7 @@
 static int warning_count;
 
 int
-had_warnings ()
+had_warnings (void)
 {
   return (warning_count);
 }
@@ -119,7 +118,7 @@
 static int error_count;
 
 int
-had_errors ()
+had_errors (void)
 {
   return (error_count);
 }
@@ -127,7 +126,7 @@
 /* Print the current location to stderr.  */
 
 static void
-as_show_where ()
+as_show_where (void)
 {
   char *file;
   unsigned int line;
@@ -141,9 +140,8 @@
 /* Like perror(3), but with more info.  */
 
 void
-as_perror (gripe, filename)
-     const char *gripe;		/* Unpunctuated error theme.  */
-     const char *filename;
+as_perror (const char *gripe,		/* Unpunctuated error theme.  */
+	   const char *filename)
 {
   const char *errtxt;
 
@@ -198,10 +196,7 @@
 /* The common portion of as_warn and as_warn_where.  */
 
 static void
-as_warn_internal (file, line, buffer)
-     char *file;
-     unsigned int line;
-     char *buffer;
+as_warn_internal (char *file, unsigned int line, char *buffer)
 {
   ++warning_count;
 
@@ -302,10 +297,7 @@
 /* The common portion of as_bad and as_bad_where.  */
 
 static void
-as_bad_internal (file, line, buffer)
-     char *file;
-     unsigned int line;
-     char *buffer;
+as_bad_internal (char *file, unsigned int line, char *buffer)
 {
   ++error_count;
 
@@ -442,9 +434,7 @@
    Arguments: Filename, line number, optional function name.  */
 
 void
-as_assert (file, line, fn)
-     const char *file, *fn;
-     int line;
+as_assert (const char *file, int line, const char *fn)
 {
   as_show_where ();
   fprintf (stderr, _("Internal error!\n"));
@@ -461,9 +451,7 @@
    and exit without producing a core file.  */
 
 void
-as_abort (file, line, fn)
-     const char *file, *fn;
-     int line;
+as_abort (const char *file, int line, const char *fn)
 {
   as_show_where ();
   if (fn)
@@ -479,9 +467,7 @@
 /* Support routines.  */
 
 void
-fprint_value (file, val)
-     FILE *file;
-     valueT val;
+fprint_value (FILE *file, valueT val)
 {
   if (sizeof (val) <= sizeof (long))
     {
@@ -499,9 +485,7 @@
 }
 
 void
-sprint_value (buf, val)
-     char *buf;
-     valueT val;
+sprint_value (char *buf, valueT val)
 {
   if (sizeof (val) <= sizeof (long))
     {


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