* listing.h: Likewise.
* macro.c: Likewise.
* macro.h: Likewise.
+2003-11-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * listing.c: Convert to ISO-C.
+ * listing.h: Likewise.
+ * macro.c: Likewise.
+ * macro.h: Likewise.
+
2003-11-24 Jakub Jelinek <jakub@redhat.com>
* app.c (do_scrub_chars): Add PUT (ch) and ch = GET ()
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)
{
}
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;
}
static void
-new_frag ()
+new_frag (void)
{
frag_wane (frag_now);
}
void
-listing_newline (ps)
- char *ps;
+listing_newline (char *ps)
{
char *file;
unsigned int line;
with the new instruction. */
void
-listing_prev_line ()
+listing_prev_line (void)
{
list_info_type *l;
fragS *f;
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;
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) */
}
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;
}
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;
}
static void
-list_symbol_table ()
+list_symbol_table (void)
{
extern symbolS *symbol_rootP;
int got_some = 0;
}
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)
{
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;
}
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;
}
void
-listing_print (name)
- char *name;
+listing_print (char *name)
{
int using_stdout;
}
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++;
the current line should be listed, but the next line should not. */
void
-listing_list (on)
- int on;
+listing_list (int on)
{
if (listing)
{
}
void
-listing_psize (width_only)
- int width_only;
+listing_psize (int width_only)
{
if (! width_only)
{
}
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;
}
void
-listing_source_line (line)
- unsigned int line;
+listing_source_line (unsigned int line)
{
if (listing)
{
}
void
-listing_source_file (file)
- const char *file;
+listing_source_file (const char *file)
{
if (listing)
listing_tail->hll_file = file_info (file);
/* 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)
{
}
#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;
/* 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')
/* 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. */
/* 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;
/* 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;
}
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);
/* 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])
/* 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);
*/
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);
/* 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 = ¯o->formals;
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;
/* 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
/* 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;
/* 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;
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;
*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;
/* Delete a macro. */
void
-delete_macro (name)
- const char *name;
+delete_macro (const char *name)
{
hash_delete (macro_hash, name);
}
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;
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
#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:
*/
static void
-identify (file)
- char *file;
+identify (char *file)
{
static int identified;
if (identified)
static int warning_count;
int
-had_warnings ()
+had_warnings (void)
{
return (warning_count);
}
static int error_count;
int
-had_errors ()
+had_errors (void)
{
return (error_count);
}
/* Print the current location to stderr. */
static void
-as_show_where ()
+as_show_where (void)
{
char *file;
unsigned int line;
/* 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;
/* 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;
/* 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;
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"));
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)
/* Support routines. */
void
-fprint_value (file, val)
- FILE *file;
- valueT val;
+fprint_value (FILE *file, valueT val)
{
if (sizeof (val) <= sizeof (long))
{
}
void
-sprint_value (buf, val)
- char *buf;
- valueT val;
+sprint_value (char *buf, valueT val)
{
if (sizeof (val) <= sizeof (long))
{