OSDN Git Service

* c-common.c (shorten_compare): Use force_fit_type directly.
[pf3gnuchains/gcc-fork.git] / gcc / mips-tfile.c
index ca03f26..9b33306 100644 (file)
@@ -2,10 +2,10 @@
    contain debugging information specified by the GNU compiler
    in the form of comments (the mips assembler does not support
    assembly access to debug information).
    contain debugging information specified by the GNU compiler
    in the form of comments (the mips assembler does not support
    assembly access to debug information).
-   Copyright (C) 1991, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Michael Meissner (meissner@cygnus.com).
    Contributed by Michael Meissner (meissner@cygnus.com).
-   
+
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
@@ -98,31 +98,31 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
                array, pointer, function, etc. qualifiers.  The
                current base types that I have documentation for are:
 
                array, pointer, function, etc. qualifiers.  The
                current base types that I have documentation for are:
 
-                       btNil           -- undefined 
+                       btNil           -- undefined
                        btAdr           -- address - integer same size as ptr
                        btAdr           -- address - integer same size as ptr
-                       btChar          -- character 
-                       btUChar         -- unsigned character 
-                       btShort         -- short 
-                       btUShort        -- unsigned short 
-                       btInt           -- int 
-                       btUInt          -- unsigned int 
-                       btLong          -- long 
-                       btULong         -- unsigned long 
-                       btFloat         -- float (real) 
-                       btDouble        -- Double (real) 
-                       btStruct        -- Structure (Record) 
-                       btUnion         -- Union (variant) 
-                       btEnum          -- Enumerated 
-                       btTypedef       -- defined via a typedef isymRef 
-                       btRange         -- subrange of int 
-                       btSet           -- pascal sets 
-                       btComplex       -- fortran complex 
-                       btDComplex      -- fortran double complex 
-                       btIndirect      -- forward or unnamed typedef 
-                       btFixedDec      -- Fixed Decimal 
-                       btFloatDec      -- Float Decimal 
-                       btString        -- Varying Length Character String 
-                       btBit           -- Aligned Bit String 
+                       btChar          -- character
+                       btUChar         -- unsigned character
+                       btShort         -- short
+                       btUShort        -- unsigned short
+                       btInt           -- int
+                       btUInt          -- unsigned int
+                       btLong          -- long
+                       btULong         -- unsigned long
+                       btFloat         -- float (real)
+                       btDouble        -- Double (real)
+                       btStruct        -- Structure (Record)
+                       btUnion         -- Union (variant)
+                       btEnum          -- Enumerated
+                       btTypedef       -- defined via a typedef isymRef
+                       btRange         -- subrange of int
+                       btSet           -- pascal sets
+                       btComplex       -- fortran complex
+                       btDComplex      -- fortran double complex
+                       btIndirect      -- forward or unnamed typedef
+                       btFixedDec      -- Fixed Decimal
+                       btFloatDec      -- Float Decimal
+                       btString        -- Varying Length Character String
+                       btBit           -- Aligned Bit String
                        btPicture       -- Picture
                        btVoid          -- Void (MIPS cc revision >= 2.00)
 
                        btPicture       -- Picture
                        btVoid          -- Void (MIPS cc revision >= 2.00)
 
@@ -130,12 +130,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
                current type qualifier fields I have documentation for
                are:
 
                current type qualifier fields I have documentation for
                are:
 
-                       tqNil           -- no more qualifiers 
-                       tqPtr           -- pointer 
-                       tqProc          -- procedure 
-                       tqArray         -- array 
-                       tqFar           -- 8086 far pointers 
-                       tqVol           -- volatile 
+                       tqNil           -- no more qualifiers
+                       tqPtr           -- pointer
+                       tqProc          -- procedure
+                       tqArray         -- array
+                       tqFar           -- 8086 far pointers
+                       tqVol           -- volatile
 
 
    The dense number table is used in the front ends, and disappears by
 
 
    The dense number table is used in the front ends, and disappears by
@@ -163,7 +163,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
    Each file table has offsets for where the line numbers, local
    strings, local symbols, and procedure table starts from within the
 
    Each file table has offsets for where the line numbers, local
    strings, local symbols, and procedure table starts from within the
-   global tables, and the indexs are reset to 0 for each of those
+   global tables, and the indices are reset to 0 for each of those
    tables for the file.
 
    The procedure table contains the binary equivalents of the .ent
    tables for the file.
 
    The procedure table contains the binary equivalents of the .ent
@@ -244,7 +244,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
        }
 
    Mips-tdump produces the following information:
        }
 
    Mips-tdump produces the following information:
-   
+
    Global file header:
        magic number             0x162
        # sections               2
    Global file header:
        magic number             0x162
        # sections               2
@@ -253,12 +253,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
        symbolic header size     96
        optional header          56
        flags                    0x0
        symbolic header size     96
        optional header          56
        flags                    0x0
-   
+
    Symbolic header, magic number = 0x7009, vstamp = 1.31:
    Symbolic header, magic number = 0x7009, vstamp = 1.31:
-   
+
        Info                      Offset      Number       Bytes
        ====                      ======      ======      =====
        Info                      Offset      Number       Bytes
        ====                      ======      ======      =====
-   
+
        Line numbers                 380           4           4 [13]
        Dense numbers                  0           0           0
        Procedures Tables            384           1          52
        Line numbers                 380           4           4 [13]
        Dense numbers                  0           0           0
        Procedures Tables            384           1          52
@@ -270,14 +270,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
        File Tables                 1008           2         144
        Relative Files                 0           0           0
        External Symbols            1152          20         320
        File Tables                 1008           2         144
        Relative Files                 0           0           0
        External Symbols            1152          20         320
-   
+
    File #0, "hello2.c"
    File #0, "hello2.c"
-   
+
        Name index  = 1          Readin      = No
        Merge       = No         Endian      = LITTLE
        Debug level = G2         Language    = C
        Adr         = 0x00000000
        Name index  = 1          Readin      = No
        Merge       = No         Endian      = LITTLE
        Debug level = G2         Language    = C
        Adr         = 0x00000000
-   
+
        Info                       Start      Number        Size      Offset
        ====                       =====      ======        ====      ======
        Local strings                  0          15          15         784
        Info                       Start      Number        Size      Offset
        ====                       =====      ======        ====      ======
        Local strings                  0          15          15         784
@@ -287,7 +287,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
        Procedures                     0           1          52         384
        Auxiliary symbols              0          14          56         628
        Relative Files                 0           0           0           0
        Procedures                     0           1          52         384
        Auxiliary symbols              0          14          56         628
        Relative Files                 0           0           0           0
-   
+
     There are 6 local symbols, starting at 436
 
        Symbol# 0: "hello2.c"
     There are 6 local symbols, starting at 436
 
        Symbol# 0: "hello2.c"
@@ -602,6 +602,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "config.h"
 #include "system.h"
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "version.h"
 #include "intl.h"
 
 #include "version.h"
 #include "intl.h"
 
@@ -609,6 +611,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define saber_stop()
 #endif
 
 #define saber_stop()
 #endif
 
+/* Include getopt.h for the sake of getopt_long.  */
+#include "getopt.h"
+
 #ifndef __LINE__
 #define __LINE__ 0
 #endif
 #ifndef __LINE__
 #define __LINE__ 0
 #endif
@@ -631,13 +636,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 /* The following might be called from obstack or malloc,
    so they can't be static.  */
 
 /* The following might be called from obstack or malloc,
    so they can't be static.  */
 
-extern void    pfatal_with_name
-                               PARAMS ((const char *)) ATTRIBUTE_NORETURN;
-extern void    fancy_abort     PARAMS ((void)) ATTRIBUTE_NORETURN;
-       void    botch           PARAMS ((const char *)) ATTRIBUTE_NORETURN;
+extern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN;
+extern void fancy_abort (void) ATTRIBUTE_NORETURN;
+extern void botch (const char *) ATTRIBUTE_NORETURN;
 
 
-extern void    fatal           PARAMS ((const char *format, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-extern void    error           PARAMS ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
+extern void fatal (const char *format, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+extern void error (const char *format, ...) ATTRIBUTE_PRINTF_1;
 \f
 #ifndef MIPS_DEBUGGING_INFO
 
 \f
 #ifndef MIPS_DEBUGGING_INFO
 
@@ -649,7 +653,7 @@ static const char *progname;
 static const char *input_name;
 
 int
 static const char *input_name;
 
 int
-main ()
+main (void)
 {
   fprintf (stderr, "Mips-tfile should only be run on a MIPS computer!\n");
   exit (1);
 {
   fprintf (stderr, "Mips-tfile should only be run on a MIPS computer!\n");
   exit (1);
@@ -681,7 +685,7 @@ main ()
 #endif
 
 #define IS_ASM_IDENT(ch) \
 #endif
 
 #define IS_ASM_IDENT(ch) \
-  (ISALNUM (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$')
+  (ISIDNUM (ch) || (ch) == '.' || (ch) == '$')
 
 \f
 /* Redefinition of storage classes as an enumeration for better
 
 \f
 /* Redefinition of storage classes as an enumeration for better
@@ -893,16 +897,13 @@ enum alloc_type {
    pages.  On systems with a BSD malloc that define USE_MALLOC, the
    MAX_CLUSTER_PAGES should be 1 less than a power of two, since malloc
    adds its overhead, and rounds up to the next power of 2.  Pages are
    pages.  On systems with a BSD malloc that define USE_MALLOC, the
    MAX_CLUSTER_PAGES should be 1 less than a power of two, since malloc
    adds its overhead, and rounds up to the next power of 2.  Pages are
-   linked together via a linked list.
-
-   If PAGE_SIZE is > 4096, the string length in the shash_t structure
-   can't be represented (assuming there are strings > 4096 bytes).  */
+   linked together via a linked list.  */
 
 #ifndef PAGE_SIZE
 
 #ifndef PAGE_SIZE
-#define PAGE_SIZE 4096         /* size of varray pages */
+#define PAGE_SIZE 32768                /* size of varray pages */
 #endif
 
 #endif
 
-#define PAGE_USIZE ((Size_t)PAGE_SIZE)
+#define PAGE_USIZE ((Size_t) PAGE_SIZE)
 
 
 #ifndef MAX_CLUSTER_PAGES      /* # pages to get from system */
 
 
 #ifndef MAX_CLUSTER_PAGES      /* # pages to get from system */
@@ -948,6 +949,13 @@ typedef struct varray {
   OBJECTS_PER_PAGE (type),     /* objects_last_page */                 \
 }
 
   OBJECTS_PER_PAGE (type),     /* objects_last_page */                 \
 }
 
+#define INITIALIZE_VARRAY(x,type)                      \
+do {                                                   \
+  (x)->object_size = sizeof (type);                    \
+  (x)->objects_per_page = OBJECTS_PER_PAGE (type);     \
+  (x)->objects_last_page = OBJECTS_PER_PAGE (type);    \
+} while (0)
+
 /* Master type for indexes within the symbol table.  */
 typedef unsigned long symint_t;
 
 /* Master type for indexes within the symbol table.  */
 typedef unsigned long symint_t;
 
@@ -1064,90 +1072,8 @@ typedef struct efdr {
 } efdr_t;
 
 /* Pre-initialized extended file structure.  */
 } efdr_t;
 
 /* Pre-initialized extended file structure.  */
-static efdr_t init_file = 
-{
-  {                    /* FDR structure */
-#ifdef __alpha
-    0,                 /* adr:         memory address of beginning of file */
-    0,                 /* cbLineOffset: byte offset from header for this file ln's */
-    0,                 /* cbLine:      size of lines for this file */
-    0,                 /* cbSs:        number of bytes in the ss */
-    0,                 /* rss:         file name (of source, if known) */
-    0,                 /* issBase:     file's string space */
-    0,                 /* isymBase:    beginning of symbols */
-    0,                 /* csym:        count file's of symbols */
-    0,                 /* ilineBase:   file's line symbols */
-    0,                 /* cline:       count of file's line symbols */
-    0,                 /* ioptBase:    file's optimization entries */
-    0,                 /* copt:        count of file's optimization entries */
-    0,                 /* ipdFirst:    start of procedures for this file */
-    0,                 /* cpd:         count of procedures for this file */
-    0,                 /* iauxBase:    file's auxiliary entries */
-    0,                 /* caux:        count of file's auxiliary entries */
-    0,                 /* rfdBase:     index into the file indirect table */
-    0,                 /* crfd:        count file indirect entries */
-    langC,             /* lang:        language for this file */
-    1,                 /* fMerge:      whether this file can be merged */
-    0,                 /* fReadin:     true if read in (not just created) */
-#ifdef HOST_WORDS_BIG_ENDIAN
-    1,                 /* fBigendian:  if 1, compiled on big endian machine */
-#else
-    0,                 /* fBigendian:  if 1, compiled on big endian machine */
-#endif
-    0,                 /* fTrim:       whether the symbol table was trimmed */
-    GLEVEL_2,          /* glevel:      level this file was compiled with */
-    0,                 /* reserved:    reserved for future use */
-#else
-    0,                 /* adr:         memory address of beginning of file */
-    0,                 /* rss:         file name (of source, if known) */
-    0,                 /* issBase:     file's string space */
-    0,                 /* cbSs:        number of bytes in the ss */
-    0,                 /* isymBase:    beginning of symbols */
-    0,                 /* csym:        count file's of symbols */
-    0,                 /* ilineBase:   file's line symbols */
-    0,                 /* cline:       count of file's line symbols */
-    0,                 /* ioptBase:    file's optimization entries */
-    0,                 /* copt:        count of file's optimization entries */
-    0,                 /* ipdFirst:    start of procedures for this file */
-    0,                 /* cpd:         count of procedures for this file */
-    0,                 /* iauxBase:    file's auxiliary entries */
-    0,                 /* caux:        count of file's auxiliary entries */
-    0,                 /* rfdBase:     index into the file indirect table */
-    0,                 /* crfd:        count file indirect entries */
-    langC,             /* lang:        language for this file */
-    1,                 /* fMerge:      whether this file can be merged */
-    0,                 /* fReadin:     true if read in (not just created) */
-#ifdef HOST_WORDS_BIG_ENDIAN
-    1,                 /* fBigendian:  if 1, compiled on big endian machine */
-#else
-    0,                 /* fBigendian:  if 1, compiled on big endian machine */
-#endif
-    GLEVEL_2,          /* glevel:      level this file was compiled with */
-    0,                 /* reserved:    reserved for future use */
-    0,                 /* cbLineOffset: byte offset from header for this file ln's */
-    0,                 /* cbLine:      size of lines for this file */
-#endif
-  },
-
-  (FDR *) 0,           /* orig_fdr:    original file header pointer */
-  (char *) 0,          /* name:        pointer to filename */
-  0,                   /* name_len:    length of filename */
-  0,                   /* void_type:   ptr to aux node for void type */
-  0,                   /* int_type:    ptr to aux node for int type */
-  (scope_t *) 0,       /* cur_scope:   current scope being processed */
-  0,                   /* file_index:  current file # */
-  0,                   /* nested_scopes: # nested scopes */
-  INIT_VARRAY (char),  /* strings:     local string varray */
-  INIT_VARRAY (SYMR),  /* symbols:     local symbols varray */
-  INIT_VARRAY (PDR),   /* procs:       procedure varray */
-  INIT_VARRAY (AUXU),  /* aux_syms:    auxiliary symbols varray */
-
-  (struct efdr *) 0,   /* next_file:   next file structure */
-
-  (shash_t **) 0,      /* shash_head:  string hash table */
-  { 0 },               /* thash_head:  type hash table */
-};
-
+static int init_file_initialized = 0;
+static efdr_t init_file;
 
 static efdr_t *first_file;                     /* first file descriptor */
 static efdr_t **last_file_ptr = &first_file;   /* file descriptor tail */
 
 static efdr_t *first_file;                     /* first file descriptor */
 static efdr_t **last_file_ptr = &first_file;   /* file descriptor tail */
@@ -1273,7 +1199,7 @@ static EXTR         *last_func_eptr;
    Maybe this will be fixed in 2.10 or 2.20 of the MIPS compiler
    suite, but for now go with what works.  */
 
    Maybe this will be fixed in 2.10 or 2.20 of the MIPS compiler
    suite, but for now go with what works.  */
 
-static bt_t map_coff_types[ (int)T_MAX ] = {
+static const bt_t map_coff_types[ (int) T_MAX ] = {
   bt_Nil,                      /* T_NULL */
   bt_Nil,                      /* T_ARG */
   bt_Char,                     /* T_CHAR */
   bt_Nil,                      /* T_NULL */
   bt_Nil,                      /* T_ARG */
   bt_Char,                     /* T_CHAR */
@@ -1293,7 +1219,7 @@ static bt_t map_coff_types[ (int)T_MAX ] = {
 };
 
 /* Convert COFF storage class to ECOFF storage class.  */
 };
 
 /* Convert COFF storage class to ECOFF storage class.  */
-static sc_t map_coff_storage[ (int)C_MAX ] = {
+static const sc_t map_coff_storage[ (int) C_MAX ] = {
   sc_Nil,                      /*   0: C_NULL */
   sc_Abs,                      /*   1: C_AUTO    auto var */
   sc_Undefined,                        /*   2: C_EXT     external */
   sc_Nil,                      /*   0: C_NULL */
   sc_Abs,                      /*   1: C_AUTO    auto var */
   sc_Undefined,                        /*   2: C_EXT     external */
@@ -1404,7 +1330,7 @@ static sc_t map_coff_storage[ (int)C_MAX ] = {
 };
 
 /* Convert COFF storage class to ECOFF symbol type.  */
 };
 
 /* Convert COFF storage class to ECOFF symbol type.  */
-static st_t map_coff_sym_type[ (int)C_MAX ] = {
+static const st_t map_coff_sym_type[ (int) C_MAX ] = {
   st_Nil,                      /*   0: C_NULL */
   st_Local,                    /*   1: C_AUTO    auto var */
   st_Global,                   /*   2: C_EXT     external */
   st_Nil,                      /*   0: C_NULL */
   st_Local,                    /*   1: C_AUTO    auto var */
   st_Global,                   /*   2: C_EXT     external */
@@ -1515,7 +1441,7 @@ static st_t map_coff_sym_type[ (int)C_MAX ] = {
 };
 
 /* Map COFF derived types to ECOFF type qualifiers.  */
 };
 
 /* Map COFF derived types to ECOFF type qualifiers.  */
-static tq_t map_coff_derived_type[ (int)DT_MAX ] = {
+static const tq_t map_coff_derived_type[ (int) DT_MAX ] = {
   tq_Nil,                      /* 0: DT_NON    no more qualifiers */
   tq_Ptr,                      /* 1: DT_PTR    pointer */
   tq_Proc,                     /* 2: DT_FCN    function */
   tq_Nil,                      /* 0: DT_NON    no more qualifiers */
   tq_Ptr,                      /* 1: DT_PTR    pointer */
   tq_Proc,                     /* 2: DT_FCN    function */
@@ -1524,7 +1450,7 @@ static tq_t map_coff_derived_type[ (int)DT_MAX ] = {
 
 
 /* Keep track of different sized allocation requests.  */
 
 
 /* Keep track of different sized allocation requests.  */
-static alloc_info_t alloc_counts[ (int)alloc_type_last ];
+static alloc_info_t alloc_counts[ (int) alloc_type_last ];
 
 \f
 /* Pointers and such to the original symbol table that is read in.  */
 
 \f
 /* Pointers and such to the original symbol table that is read in.  */
@@ -1546,7 +1472,7 @@ static EXTR       *orig_ext_syms;                 /* external symbols */
 /* Macros to convert an index into a given object within the original
    symbol table.  */
 #define CHECK(num,max,str) \
 /* Macros to convert an index into a given object within the original
    symbol table.  */
 #define CHECK(num,max,str) \
-  (((unsigned long)num > (unsigned long)max) ? out_of_bounds (num, max, str, __LINE__) : 0)
+  (((unsigned long) num > (unsigned long) max) ? out_of_bounds (num, max, str, __LINE__) : 0)
 
 #define ORIG_LINENUM(indx)     (CHECK ((indx), orig_sym_hdr.cbLine,    "line#"), (indx) + orig_linenum)
 #define ORIG_DENSE(indx)       (CHECK ((indx), orig_sym_hdr.idnMax,    "dense"), (indx) + orig_dense)
 
 #define ORIG_LINENUM(indx)     (CHECK ((indx), orig_sym_hdr.cbLine,    "line#"), (indx) + orig_linenum)
 #define ORIG_DENSE(indx)       (CHECK ((indx), orig_sym_hdr.idnMax,    "dense"), (indx) + orig_dense)
@@ -1568,8 +1494,8 @@ static SYMR    *cur_oproc_begin   = (SYMR *) 0;   /* original proc. sym begin info *
 static SYMR    *cur_oproc_end  = (SYMR *) 0;   /* original proc. sym end info */
 static PDR     *cur_oproc_ptr  = (PDR *) 0;    /* current original procedure*/
 static thead_t *cur_tag_head   = (thead_t *) 0;/* current tag head */
 static SYMR    *cur_oproc_end  = (SYMR *) 0;   /* original proc. sym end info */
 static PDR     *cur_oproc_ptr  = (PDR *) 0;    /* current original procedure*/
 static thead_t *cur_tag_head   = (thead_t *) 0;/* current tag head */
-static long    file_offset     = 0;            /* current file offset */
-static long    max_file_offset = 0;            /* maximum file offset */
+static unsigned long file_offset       = 0;    /* current file offset */
+static unsigned long max_file_offset   = 0;    /* maximum file offset */
 static FILE    *object_stream  = (FILE *) 0;   /* file desc. to output .o */
 static FILE    *obj_in_stream  = (FILE *) 0;   /* file desc. to input .o */
 static char    *progname       = (char *) 0;   /* program name for errors */
 static FILE    *object_stream  = (FILE *) 0;   /* file desc. to output .o */
 static FILE    *obj_in_stream  = (FILE *) 0;   /* file desc. to input .o */
 static char    *progname       = (char *) 0;   /* program name for errors */
@@ -1581,8 +1507,9 @@ static char    *cur_line_ptr      = (char *) 0;   /* ptr within current line */
 static unsigned        cur_line_nbytes = 0;            /* # bytes for current line */
 static unsigned        cur_line_alloc  = 0;            /* # bytes total in buffer */
 static long    line_number     = 0;            /* current input line number */
 static unsigned        cur_line_nbytes = 0;            /* # bytes for current line */
 static unsigned        cur_line_alloc  = 0;            /* # bytes total in buffer */
 static long    line_number     = 0;            /* current input line number */
-static int     debug           = 0;            /* trace functions */
-static int     version         = 0;            /* print version # */
+static int     debug           = 0;            /* trace functions */
+static int     version         = 0;            /* print version # */
+static int     verbose         = 0;
 static int     had_errors      = 0;            /* != 0 if errors were found */
 static int     rename_output   = 0;            /* != 0 if rename output file*/
 static int     delete_input    = 0;            /* != 0 if delete input after done */
 static int     had_errors      = 0;            /* != 0 if errors were found */
 static int     rename_output   = 0;            /* != 0 if rename output file*/
 static int     delete_input    = 0;            /* != 0 if delete input after done */
@@ -1594,7 +1521,7 @@ static int        stabs_seen      = 0;            /* != 0 if stabs have been seen */
 #define STABS_SYMBOL "@stabs"
 #endif
 
 #define STABS_SYMBOL "@stabs"
 #endif
 
-static char stabs_symbol[] = STABS_SYMBOL;
+static const char stabs_symbol[] = STABS_SYMBOL;
 
 \f
 /* Forward reference for functions.  See the definition for more details.  */
 
 \f
 /* Forward reference for functions.  See the definition for more details.  */
@@ -1603,107 +1530,64 @@ static char stabs_symbol[] = STABS_SYMBOL;
 #define STATIC static
 #endif
 
 #define STATIC static
 #endif
 
-STATIC int     out_of_bounds   PARAMS ((symint_t, symint_t, const char *, int));
-
-STATIC shash_t *hash_string    PARAMS ((const char *,
-                                        Ptrdiff_t,
-                                        shash_t **,
-                                        symint_t *));
-
-STATIC symint_t        add_string      PARAMS ((varray_t *,
-                                        shash_t **,
-                                        const char *,
-                                        const char *,
-                                        shash_t **));
-
-STATIC symint_t        add_local_symbol
-                               PARAMS ((const char *,
-                                        const char *,
-                                        st_t,
-                                        sc_t,
-                                        symint_t,
-                                        symint_t));
-
-STATIC symint_t        add_ext_symbol  PARAMS ((EXTR *,
-                                        int));
-
-STATIC symint_t        add_aux_sym_symint
-                               PARAMS ((symint_t));
-
-STATIC symint_t        add_aux_sym_rndx
-                               PARAMS ((int, symint_t));
-
-STATIC symint_t        add_aux_sym_tir PARAMS ((type_info_t *,
-                                        hash_state_t,
-                                        thash_t **));
-
-STATIC tag_t * get_tag         PARAMS ((const char *,
-                                        const char *,
-                                        symint_t,
-                                        bt_t));
-
-STATIC void    add_unknown_tag PARAMS ((tag_t *));
-
-STATIC void    add_procedure   PARAMS ((const char *,
-                                        const char *));
-
-STATIC void    add_file        PARAMS ((const char *,
-                                        const char *));
-
-STATIC void    add_bytes       PARAMS ((varray_t *,
-                                        char *,
-                                        Size_t));
-
-STATIC void    add_varray_page PARAMS ((varray_t *));
-
-STATIC void    update_headers  PARAMS ((void));
-
-STATIC void    write_varray    PARAMS ((varray_t *, off_t, const char *));
-STATIC void    write_object    PARAMS ((void));
-STATIC const char *st_to_string        PARAMS ((st_t));
-STATIC const char *sc_to_string        PARAMS ((sc_t));
-STATIC char    *read_line      PARAMS ((void));
-STATIC void    parse_input     PARAMS ((void));
-STATIC void    mark_stabs      PARAMS ((const char *));
-STATIC void    parse_begin     PARAMS ((const char *));
-STATIC void    parse_bend      PARAMS ((const char *));
-STATIC void    parse_def       PARAMS ((const char *));
-STATIC void    parse_end       PARAMS ((const char *));
-STATIC void    parse_ent       PARAMS ((const char *));
-STATIC void    parse_file      PARAMS ((const char *));
-STATIC void    parse_stabs_common
-                               PARAMS ((const char *, const char *, const char *));
-STATIC void    parse_stabs     PARAMS ((const char *));
-STATIC void    parse_stabn     PARAMS ((const char *));
-STATIC page_t  *read_seek      PARAMS ((Size_t, off_t, const char *));
-STATIC void    copy_object     PARAMS ((void));
-
-STATIC void    catch_signal    PARAMS ((int)) ATTRIBUTE_NORETURN;
-STATIC page_t  *allocate_page  PARAMS ((void));
-
-STATIC page_t  *allocate_multiple_pages
-                               PARAMS ((Size_t));
-
-STATIC void    free_multiple_pages
-                               PARAMS ((page_t *, Size_t));
+STATIC int out_of_bounds (symint_t, symint_t, const char *, int);
+STATIC shash_t *hash_string (const char *, Ptrdiff_t, shash_t **, symint_t *);
+STATIC symint_t        add_string (varray_t *, shash_t **, const char *, const char *,
+                           shash_t **);
+STATIC symint_t        add_local_symbol (const char *, const char *, st_t, sc_t,
+                                 symint_t, symint_t);
+STATIC symint_t        add_ext_symbol (EXTR *, int);
+STATIC symint_t        add_aux_sym_symint (symint_t);
+STATIC symint_t        add_aux_sym_rndx (int, symint_t);
+STATIC symint_t        add_aux_sym_tir (type_info_t *, hash_state_t, thash_t **);
+STATIC tag_t * get_tag (const char *, const char *, symint_t, bt_t);
+STATIC void add_unknown_tag (tag_t *);
+STATIC void add_procedure (const char *, const char *);
+STATIC void initialize_init_file (void);
+STATIC void add_file (const char *, const char *);
+STATIC void add_bytes (varray_t *, char *, Size_t);
+STATIC void add_varray_page (varray_t *);
+STATIC void update_headers (void);
+STATIC void write_varray (varray_t *, off_t, const char *);
+STATIC void write_object (void);
+STATIC const char *st_to_string (st_t);
+STATIC const char *sc_to_string (sc_t);
+STATIC char *read_line (void);
+STATIC void parse_input (void);
+STATIC void mark_stabs (const char *);
+STATIC void parse_begin (const char *);
+STATIC void parse_bend (const char *);
+STATIC void parse_def (const char *);
+STATIC void parse_end (const char *);
+STATIC void parse_ent (const char *);
+STATIC void parse_file (const char *);
+STATIC void parse_stabs_common (const char *, const char *, const char *);
+STATIC void parse_stabs (const char *);
+STATIC void parse_stabn (const char *);
+STATIC page_t  *read_seek (Size_t, off_t, const char *);
+STATIC void copy_object (void);
+
+STATIC void catch_signal (int) ATTRIBUTE_NORETURN;
+STATIC page_t *allocate_page (void);
+STATIC page_t *allocate_multiple_pages (Size_t);
+STATIC void    free_multiple_pages (page_t *, Size_t);
 
 #ifndef MALLOC_CHECK
 
 #ifndef MALLOC_CHECK
-STATIC page_t  *allocate_cluster
-                               PARAMS ((Size_t));
+STATIC page_t  *allocate_cluster (Size_t);
 #endif
 
 #endif
 
-STATIC forward_t *allocate_forward     PARAMS ((void));
-STATIC scope_t  *allocate_scope        PARAMS ((void));
-STATIC shash_t  *allocate_shash        PARAMS ((void));
-STATIC tag_t    *allocate_tag          PARAMS ((void));
-STATIC thash_t  *allocate_thash        PARAMS ((void));
-STATIC thead_t  *allocate_thead        PARAMS ((void));
-STATIC vlinks_t         *allocate_vlinks       PARAMS ((void));
+STATIC forward_t *allocate_forward (void);
+STATIC scope_t *allocate_scope (void);
+STATIC shash_t *allocate_shash (void);
+STATIC tag_t  *allocate_tag (void);
+STATIC thash_t *allocate_thash (void);
+STATIC thead_t *allocate_thead (void);
+STATIC vlinks_t *allocate_vlinks (void);
 
 
-STATIC void      free_forward          PARAMS ((forward_t *));
-STATIC void      free_scope            PARAMS ((scope_t *));
-STATIC void      free_tag              PARAMS ((tag_t *));
-STATIC void      free_thead            PARAMS ((thead_t *));
+STATIC void free_forward (forward_t *);
+STATIC void free_scope (scope_t *);
+STATIC void free_tag (tag_t *);
+STATIC void free_thead (thead_t *);
 
 extern char *optarg;
 extern int   optind;
 
 extern char *optarg;
 extern int   optind;
@@ -1715,12 +1599,12 @@ extern int   opterr;
    do......  */
 
 typedef struct _pseudo_ops {
    do......  */
 
 typedef struct _pseudo_ops {
-  const char *name;                    /* pseudo-op in ascii */
-  int len;                             /* length of name to compare */
-  void (*func) PARAMS ((const char *));        /* function to handle line */
+  const char *const name;                      /* pseudo-op in ascii */
+  const int len;                               /* length of name to compare */
+  void (*const func) (const char *);   /* function to handle line */
 } pseudo_ops_t;
 
 } pseudo_ops_t;
 
-static pseudo_ops_t pseudo_ops[] = {
+static const pseudo_ops_t pseudo_ops[] = {
   { "#.def",   sizeof("#.def")-1,      parse_def },
   { "#.begin", sizeof("#.begin")-1,    parse_begin },
   { "#.bend",  sizeof("#.bend")-1,     parse_bend },
   { "#.def",   sizeof("#.def")-1,      parse_def },
   { "#.begin", sizeof("#.begin")-1,    parse_begin },
   { "#.bend",  sizeof("#.bend")-1,     parse_bend },
@@ -1735,23 +1619,31 @@ static pseudo_ops_t pseudo_ops[] = {
 };
 
 \f
 };
 
 \f
+/* Command line options for getopt_long.  */
+
+static const struct option options[] =
+{
+  { "version", 0, 0, 'V' },
+  { "verbose", 0, 0, 'v' },
+  { 0, 0, 0, 0 }
+};
+\f
 /* Add a page to a varray object.  */
 
 STATIC void
 /* Add a page to a varray object.  */
 
 STATIC void
-add_varray_page (vp)
-     varray_t *vp;                             /* varray to add page to */
+add_varray_page (varray_t *vp)
 {
   vlinks_t *new_links = allocate_vlinks ();
 
 #ifdef MALLOC_CHECK
   if (vp->object_size > 1)
 {
   vlinks_t *new_links = allocate_vlinks ();
 
 #ifdef MALLOC_CHECK
   if (vp->object_size > 1)
-    new_links->datum = (page_t *) xcalloc (1, vp->object_size);
+    new_links->datum = xcalloc (1, vp->object_size);
   else
 #endif
     new_links->datum = allocate_page ();
 
   else
 #endif
     new_links->datum = allocate_page ();
 
-  alloc_counts[ (int)alloc_type_varray ].total_alloc++;
-  alloc_counts[ (int)alloc_type_varray ].total_pages++;
+  alloc_counts[ (int) alloc_type_varray ].total_alloc++;
+  alloc_counts[ (int) alloc_type_varray ].total_pages++;
 
   new_links->start_index = vp->num_allocated;
   vp->objects_last_page = 0;
 
   new_links->start_index = vp->num_allocated;
   vp->objects_last_page = 0;
@@ -1772,11 +1664,8 @@ add_varray_page (vp)
 #define HASHBITS 30
 
 STATIC shash_t *
 #define HASHBITS 30
 
 STATIC shash_t *
-hash_string (text, hash_len, hash_tbl, ret_hash_index)
-     const char *text;                 /* ptr to text to hash */
-     Ptrdiff_t hash_len;               /* length of the text */
-     shash_t **hash_tbl;               /* hash table */
-     symint_t *ret_hash_index;         /* ptr to store hash index */
+hash_string (const char *text, Ptrdiff_t hash_len, shash_t **hash_tbl,
+            symint_t *ret_hash_index)
 {
   unsigned long hi;
   Ptrdiff_t i;
 {
   unsigned long hi;
   Ptrdiff_t i;
@@ -1804,23 +1693,22 @@ hash_string (text, hash_len, hash_tbl, ret_hash_index)
 
 \f
 /* Add a string (and null pad) to one of the string tables.  A
 
 \f
 /* Add a string (and null pad) to one of the string tables.  A
-   consequence of hashing strings, is that we don't let strings
-   cross page boundaries.  The extra nulls will be ignored.  */
+   consequence of hashing strings, is that we don't let strings cross
+   page boundaries.  The extra nulls will be ignored.  VP is a string
+   virtual array, HASH_TBL a pointer to the hash table, the string
+   starts at START and the position one byte after the string is given
+   with END_P1, the resulting hash pointer is returned in RET_HASH.  */
 
 STATIC symint_t
 
 STATIC symint_t
-add_string (vp, hash_tbl, start, end_p1, ret_hash)
-     varray_t *vp;                     /* string virtual array */
-     shash_t **hash_tbl;               /* ptr to hash table */
-     const char *start;                        /* 1st byte in string */
-     const char *end_p1;               /* 1st byte after string */
-     shash_t **ret_hash;               /* return hash pointer */
+add_string (varray_t *vp, shash_t **hash_tbl, const char *start,
+           const char *end_p1, shash_t **ret_hash)
 {
   Ptrdiff_t len = end_p1 - start;
   shash_t *hash_ptr;
   symint_t hi;
 
   if (len >= (Ptrdiff_t) PAGE_USIZE)
 {
   Ptrdiff_t len = end_p1 - start;
   shash_t *hash_ptr;
   symint_t hi;
 
   if (len >= (Ptrdiff_t) PAGE_USIZE)
-    fatal ("String too big (%ld bytes)", (long) len);
+    fatal ("string too big (%ld bytes)", (long) len);
 
   hash_ptr = hash_string (start, len, hash_tbl, &hi);
   if (hash_ptr == (shash_t *) 0)
 
   hash_ptr = hash_string (start, len, hash_tbl, &hi);
   if (hash_ptr == (shash_t *) 0)
@@ -1858,16 +1746,14 @@ add_string (vp, hash_tbl, start, end_p1, ret_hash)
 }
 
 \f
 }
 
 \f
-/* Add a local symbol.  */
+/* Add a local symbol.  The symbol string starts at STR_START and the
+   first byte after it is makred by STR_END_P1.  The symbol has type
+   TYPE and storage class STORAGE and value VALUE.  INDX is an index
+   to local/aux. symbols.  */
 
 STATIC symint_t
 
 STATIC symint_t
-add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
-     const char *str_start;            /* first byte in string */
-     const char *str_end_p1;           /* first byte after string */
-     st_t type;                                /* symbol type */
-     sc_t storage;                     /* storage class */
-     symint_t value;                   /* value of symbol */
-     symint_t indx;                    /* index to local/aux. syms */
+add_local_symbol (const char *str_start, const char *str_end_p1, st_t type,
+                 sc_t storage,  symint_t value, symint_t indx)
 {
   symint_t ret;
   SYMR *psym;
 {
   symint_t ret;
   SYMR *psym;
@@ -1898,7 +1784,7 @@ add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
 
   ret = vp->num_allocated++;
 
 
   ret = vp->num_allocated++;
 
-  if (MIPS_IS_STAB(psym))
+  if (MIPS_IS_STAB (psym))
     return ret;
 
   /* Save the symbol within the hash table if this is a static
     return ret;
 
   /* Save the symbol within the hash table if this is a static
@@ -1942,7 +1828,7 @@ add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
 
     case st_End:
       pscope = cur_file_ptr->cur_scope;
 
     case st_End:
       pscope = cur_file_ptr->cur_scope;
-      if (pscope == (scope_t *)0)
+      if (pscope == (scope_t *) 0)
        error ("internal error, too many st_End's");
 
       else
        error ("internal error, too many st_End's");
 
       else
@@ -2036,12 +1922,11 @@ add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
 }
 
 \f
 }
 
 \f
-/* Add an external symbol.  */
+/* Add an external symbol with symbol pointer ESYM and file index
+   IFD.  */
 
 STATIC symint_t
 
 STATIC symint_t
-add_ext_symbol (esym, ifd)
-     EXTR *esym;                       /* symbol pointer */
-     int ifd;                          /* file index */
+add_ext_symbol (EXTR *esym, int ifd)
 {
   const char *str_start;               /* first byte in string */
   const char *str_end_p1;              /* first byte after string */
 {
   const char *str_start;               /* first byte in string */
   const char *str_end_p1;              /* first byte after string */
@@ -2050,7 +1935,7 @@ add_ext_symbol (esym, ifd)
   shash_t *hash_ptr = (shash_t *) 0;
 
   str_start = ORIG_ESTRS (esym->asym.iss);
   shash_t *hash_ptr = (shash_t *) 0;
 
   str_start = ORIG_ESTRS (esym->asym.iss);
-  str_end_p1 = str_start + strlen(str_start);
+  str_end_p1 = str_start + strlen (str_start);
 
   if (debug > 1)
     {
 
   if (debug > 1)
     {
@@ -2093,8 +1978,7 @@ add_ext_symbol (esym, ifd)
 /* Add an auxiliary symbol (passing a symint).  */
 
 STATIC symint_t
 /* Add an auxiliary symbol (passing a symint).  */
 
 STATIC symint_t
-add_aux_sym_symint (aux_word)
-     symint_t aux_word;                /* auxiliary information word */
+add_aux_sym_symint (symint_t aux_word)
 {
   AUXU *aux_ptr;
   efdr_t *file_ptr = cur_file_ptr;
 {
   AUXU *aux_ptr;
   efdr_t *file_ptr = cur_file_ptr;
@@ -2113,9 +1997,7 @@ add_aux_sym_symint (aux_word)
 /* Add an auxiliary symbol (passing a file/symbol index combo).  */
 
 STATIC symint_t
 /* Add an auxiliary symbol (passing a file/symbol index combo).  */
 
 STATIC symint_t
-add_aux_sym_rndx (file_index, sym_index)
-     int file_index;
-     symint_t sym_index;
+add_aux_sym_rndx (int file_index, symint_t sym_index)
 {
   AUXU *aux_ptr;
   efdr_t *file_ptr = cur_file_ptr;
 {
   AUXU *aux_ptr;
   efdr_t *file_ptr = cur_file_ptr;
@@ -2136,10 +2018,7 @@ add_aux_sym_rndx (file_index, sym_index)
    type qualifiers).  */
 
 STATIC symint_t
    type qualifiers).  */
 
 STATIC symint_t
-add_aux_sym_tir (t, state, hash_tbl)
-     type_info_t *t;           /* current type information */
-     hash_state_t state;       /* whether to hash type or not */
-     thash_t **hash_tbl;       /* pointer to hash table to use */
+add_aux_sym_tir (type_info_t *t, hash_state_t state, thash_t **hash_tbl)
 {
   AUXU *aux_ptr;
   efdr_t *file_ptr = cur_file_ptr;
 {
   AUXU *aux_ptr;
   efdr_t *file_ptr = cur_file_ptr;
@@ -2223,7 +2102,7 @@ add_aux_sym_tir (t, state, hash_tbl)
   ret = vp->num_allocated++;
 
   /* Add bitfield length if it exists.
   ret = vp->num_allocated++;
 
   /* Add bitfield length if it exists.
-     
+
      NOTE:  Mips documentation claims bitfield goes at the end of the
      AUX record, but the DECstation compiler emits it here.
      (This would only make a difference for enum bitfields.)
      NOTE:  Mips documentation claims bitfield goes at the end of the
      AUX record, but the DECstation compiler emits it here.
      (This would only make a difference for enum bitfields.)
@@ -2232,7 +2111,7 @@ add_aux_sym_tir (t, state, hash_tbl)
      for an enum bitfield.  */
 
   if (t->bitfield)
      for an enum bitfield.  */
 
   if (t->bitfield)
-    (void) add_aux_sym_symint ((symint_t)t->sizes[t->num_sizes-1]);
+    (void) add_aux_sym_symint ((symint_t) t->sizes[t->num_sizes-1]);
 
 
   /* Add tag information if needed.  Structure, union, and enum
 
 
   /* Add tag information if needed.  Structure, union, and enum
@@ -2298,11 +2177,11 @@ add_aux_sym_tir (t, state, hash_tbl)
 /* Add a tag to the tag table (unless it already exists).  */
 
 STATIC tag_t *
 /* Add a tag to the tag table (unless it already exists).  */
 
 STATIC tag_t *
-get_tag (tag_start, tag_end_p1, indx, basic_type)
-     const char *tag_start;            /* 1st byte of tag name */
-     const char *tag_end_p1;           /* 1st byte after tag name */
-     symint_t indx;                    /* index of tag start block */
-     bt_t basic_type;                  /* bt_Struct, bt_Union, or bt_Enum */
+get_tag (const char *tag_start,                /* 1st byte of tag name */
+        const char *tag_end_p1,        /* 1st byte after tag name */
+        symint_t indx,         /* index of tag start block */
+        bt_t basic_type)               /* bt_Struct, bt_Union, or bt_Enum */
+
 {
   shash_t *hash_ptr;
   tag_t *tag_ptr;
 {
   shash_t *hash_ptr;
   tag_t *tag_ptr;
@@ -2350,8 +2229,7 @@ get_tag (tag_start, tag_end_p1, indx, basic_type)
 /* Add an unknown {struct, union, enum} tag.  */
 
 STATIC void
 /* Add an unknown {struct, union, enum} tag.  */
 
 STATIC void
-add_unknown_tag (ptag)
-     tag_t     *ptag;          /* pointer to tag information */
+add_unknown_tag (tag_t *ptag)
 {
   shash_t *hash_ptr    = ptag->hash_ptr;
   char *name_start     = hash_ptr->string;
 {
   shash_t *hash_ptr    = ptag->hash_ptr;
   char *name_start     = hash_ptr->string;
@@ -2410,9 +2288,8 @@ add_unknown_tag (ptag)
    this procedure, use that to initialize the current PDR.  */
 
 STATIC void
    this procedure, use that to initialize the current PDR.  */
 
 STATIC void
-add_procedure (func_start, func_end_p1)
-     const char *func_start;           /* 1st byte of func name */
-     const char *func_end_p1;          /* 1st byte after func name */
+add_procedure (const char *func_start,  /* 1st byte of func name */
+              const char *func_end_p1) /* 1st byte after func name */
 {
   PDR *new_proc_ptr;
   efdr_t *file_ptr = cur_file_ptr;
 {
   PDR *new_proc_ptr;
   efdr_t *file_ptr = cur_file_ptr;
@@ -2444,20 +2321,20 @@ add_procedure (func_start, func_end_p1)
 
       if (old_proc_ptr != (PDR *) 0
          && sym_ptr != (SYMR *) 0
 
       if (old_proc_ptr != (PDR *) 0
          && sym_ptr != (SYMR *) 0
-         && ((st_t)sym_ptr->st == st_Proc || (st_t)sym_ptr->st == st_StaticProc))
+         && ((st_t) sym_ptr->st == st_Proc || (st_t) sym_ptr->st == st_StaticProc))
        {
          cur_oproc_begin = sym_ptr;
          cur_oproc_end = shash_ptr->end_ptr;
          value = sym_ptr->value;
 
          cur_oproc_ptr = old_proc_ptr;
        {
          cur_oproc_begin = sym_ptr;
          cur_oproc_end = shash_ptr->end_ptr;
          value = sym_ptr->value;
 
          cur_oproc_ptr = old_proc_ptr;
-         proc_type = (st_t)sym_ptr->st;
+         proc_type = (st_t) sym_ptr->st;
          *new_proc_ptr = *old_proc_ptr;        /* initialize */
        }
     }
 
   if (cur_oproc_ptr == (PDR *) 0)
          *new_proc_ptr = *old_proc_ptr;        /* initialize */
        }
     }
 
   if (cur_oproc_ptr == (PDR *) 0)
-    error ("Did not find a PDR block for %.*s",
+    error ("did not find a PDR block for %.*s",
           (int) (func_end_p1 - func_start), func_start);
 
   /* Determine the start of symbols.  */
           (int) (func_end_p1 - func_start), func_start);
 
   /* Determine the start of symbols.  */
@@ -2471,14 +2348,36 @@ add_procedure (func_start, func_end_p1)
 }
 
 \f
 }
 
 \f
+/* Initialize the init_file structure.  */
+
+STATIC void
+initialize_init_file (void)
+{
+  memset (&init_file, 0, sizeof (init_file));
+
+  init_file.fdr.lang = langC;
+  init_file.fdr.fMerge = 1;
+  init_file.fdr.glevel = GLEVEL_2;
+
+#ifdef HOST_WORDS_BIG_ENDIAN
+  init_file.fdr.fBigendian = 1;
+#endif
+
+  INITIALIZE_VARRAY (&init_file.strings, char);
+  INITIALIZE_VARRAY (&init_file.symbols, SYMR);
+  INITIALIZE_VARRAY (&init_file.procs, PDR);
+  INITIALIZE_VARRAY (&init_file.aux_syms, AUXU);
+
+  init_file_initialized = 1;
+}
+
 /* Add a new filename, and set up all of the file relative
    virtual arrays (strings, symbols, aux syms, etc.).  Record
    where the current file structure lives.  */
 
 STATIC void
 /* Add a new filename, and set up all of the file relative
    virtual arrays (strings, symbols, aux syms, etc.).  Record
    where the current file structure lives.  */
 
 STATIC void
-add_file (file_start, file_end_p1)
-     const char *file_start;           /* first byte in string */
-     const char *file_end_p1;          /* first byte after string */
+add_file (const char *file_start,  /* first byte in string */
+         const char *file_end_p1) /* first byte after string */
 {
   static char zero_bytes[2] = { '\0', '\0' };
 
 {
   static char zero_bytes[2] = { '\0', '\0' };
 
@@ -2509,6 +2408,9 @@ add_file (file_start, file_end_p1)
       if (file_desc.objects_last_page == file_desc.objects_per_page)
        add_varray_page (&file_desc);
 
       if (file_desc.objects_last_page == file_desc.objects_per_page)
        add_varray_page (&file_desc);
 
+      if (! init_file_initialized)
+       initialize_init_file ();
+
       file_ptr = cur_file_ptr
        = &file_desc.last->datum->file[ file_desc.objects_last_page++ ];
       *file_ptr = init_file;
       file_ptr = cur_file_ptr
        = &file_desc.last->datum->file[ file_desc.objects_last_page++ ];
       *file_ptr = init_file;
@@ -2526,7 +2428,7 @@ add_file (file_start, file_end_p1)
                  (shash_t **) 0);
 
       if (file_end_p1 - file_start > (long) PAGE_USIZE-2)
                  (shash_t **) 0);
 
       if (file_end_p1 - file_start > (long) PAGE_USIZE-2)
-       fatal ("Filename goes over one page boundary.");
+       fatal ("filename goes over one page boundary");
 
       /* Push the start of the filename. We assume that the filename
          will be stored at string offset 1.  */
 
       /* Push the start of the filename. We assume that the filename
          will be stored at string offset 1.  */
@@ -2556,10 +2458,9 @@ add_file (file_start, file_end_p1)
 /* Add a stream of random bytes to a varray.  */
 
 STATIC void
 /* Add a stream of random bytes to a varray.  */
 
 STATIC void
-add_bytes (vp, input_ptr, nitems)
-     varray_t *vp;                     /* virtual array to add too */
-     char *input_ptr;                  /* start of the bytes */
-     Size_t nitems;                    /* # items to move */
+add_bytes (varray_t *vp,       /* virtual array to add too */
+          char *input_ptr,     /* start of the bytes */
+          Size_t nitems)       /* # items to move */
 {
   Size_t move_items;
   Size_t move_bytes;
 {
   Size_t move_items;
   Size_t move_bytes;
@@ -2595,10 +2496,9 @@ add_bytes (vp, input_ptr, nitems)
 /* Convert storage class to string.  */
 
 STATIC const char *
 /* Convert storage class to string.  */
 
 STATIC const char *
-sc_to_string(storage_class)
-     sc_t storage_class;
+sc_to_string (sc_t storage_class)
 {
 {
-  switch(storage_class)
+  switch (storage_class)
     {
     case sc_Nil:        return "Nil,";
     case sc_Text:       return "Text,";
     {
     case sc_Nil:        return "Nil,";
     case sc_Text:       return "Text,";
@@ -2633,10 +2533,9 @@ sc_to_string(storage_class)
 /* Convert symbol type to string.  */
 
 STATIC const char *
 /* Convert symbol type to string.  */
 
 STATIC const char *
-st_to_string(symbol_type)
-     st_t symbol_type;
+st_to_string (st_t symbol_type)
 {
 {
-  switch(symbol_type)
+  switch (symbol_type)
     {
     case st_Nil:       return "Nil,";
     case st_Global:    return "Global,";
     {
     case st_Nil:       return "Nil,";
     case st_Global:    return "Global,";
@@ -2670,7 +2569,7 @@ st_to_string(symbol_type)
    semi-colon, and return each logical line independently.  */
 
 STATIC char *
    semi-colon, and return each logical line independently.  */
 
 STATIC char *
-read_line ()
+read_line (void)
 {
   static   int line_split_p    = 0;
   int string_p         = 0;
 {
   static   int line_split_p    = 0;
   int string_p         = 0;
@@ -2713,7 +2612,7 @@ read_line ()
        }
 
       else if (ch == '\0')
        }
 
       else if (ch == '\0')
-       error ("Null character found in input");
+       error ("null character found in input");
 
       else if (!comment_p)
        {
 
       else if (!comment_p)
        {
@@ -2746,8 +2645,7 @@ read_line ()
    which gives the location of the start of the block.  */
 
 STATIC void
    which gives the location of the start of the block.  */
 
 STATIC void
-parse_begin (start)
-     const char *start;                        /* start of directive */
+parse_begin (const char *start)
 {
   const char *end_p1;                  /* end of label */
   int ch;
 {
   const char *end_p1;                  /* end of label */
   int ch;
@@ -2775,14 +2673,14 @@ parse_begin (start)
 
   if (hash_ptr == (shash_t *) 0)
     {
 
   if (hash_ptr == (shash_t *) 0)
     {
-      error ("Label %.*s not found for #.begin",
+      error ("label %.*s not found for #.begin",
             (int) (end_p1 - start), start);
       return;
     }
 
   if (cur_oproc_begin == (SYMR *) 0)
     {
             (int) (end_p1 - start), start);
       return;
     }
 
   if (cur_oproc_begin == (SYMR *) 0)
     {
-      error ("Procedure table %.*s not found for #.begin",
+      error ("procedure table %.*s not found for #.begin",
             (int) (end_p1 - start), start);
       return;
     }
             (int) (end_p1 - start), start);
       return;
     }
@@ -2798,8 +2696,7 @@ parse_begin (start)
    which gives the location of the end of the block.  */
 
 STATIC void
    which gives the location of the end of the block.  */
 
 STATIC void
-parse_bend (start)
-     const char *start;                        /* start of directive */
+parse_bend (const char *start)
 {
   const char *end_p1;                  /* end of label */
   int ch;
 {
   const char *end_p1;                  /* end of label */
   int ch;
@@ -2827,20 +2724,20 @@ parse_bend (start)
 
   if (hash_ptr == (shash_t *) 0)
     {
 
   if (hash_ptr == (shash_t *) 0)
     {
-      error ("Label %.*s not found for #.bend", (int) (end_p1 - start), start);
+      error ("label %.*s not found for #.bend", (int) (end_p1 - start), start);
       return;
     }
 
   if (cur_oproc_begin == (SYMR *) 0)
     {
       return;
     }
 
   if (cur_oproc_begin == (SYMR *) 0)
     {
-      error ("Procedure table %.*s not found for #.bend",
+      error ("procedure table %.*s not found for #.bend",
             (int) (end_p1 - start), start);
       return;
     }
 
   (void) add_local_symbol ((const char *) 0, (const char *) 0,
                           st_End, sc_Text,
             (int) (end_p1 - start), start);
       return;
     }
 
   (void) add_local_symbol ((const char *) 0, (const char *) 0,
                           st_End, sc_Text,
-                          (symint_t)hash_ptr->sym_ptr->value - cur_oproc_begin->value,
+                          (symint_t) hash_ptr->sym_ptr->value - cur_oproc_begin->value,
                           (symint_t) 0);
 }
 
                           (symint_t) 0);
 }
 
@@ -2857,8 +2754,7 @@ parse_bend (start)
        .tag    specify a tag for a struct, union, or enum.  */
 
 STATIC void
        .tag    specify a tag for a struct, union, or enum.  */
 
 STATIC void
-parse_def (name_start)
-     const char *name_start;                   /* start of directive */
+parse_def (const char *name_start)
 {
   const char *dir_start;                       /* start of current directive*/
   const char *dir_end_p1;                      /* end+1 of current directive*/
 {
   const char *dir_start;                       /* start of current directive*/
   const char *dir_end_p1;                      /* end+1 of current directive*/
@@ -2923,7 +2819,7 @@ parse_def (name_start)
          && memcmp (dir_start, ".endef", sizeof (".endef")-1) == 0)
        break;
 
          && memcmp (dir_start, ".endef", sizeof (".endef")-1) == 0)
        break;
 
-      /* Pick up the subdirective now */
+      /* Pick up the subdirective now */
       for (dir_end_p1 = dir_start+1;
           (ch = *dir_end_p1) != ' ' && ch != '\t';
           dir_end_p1++)
       for (dir_end_p1 = dir_start+1;
           (ch = *dir_end_p1) != ' ' && ch != '\t';
           dir_end_p1++)
@@ -2948,7 +2844,7 @@ parse_def (name_start)
        {
          int ch2;
          arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
        {
          int ch2;
          arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
-         if (arg_end_p1 != arg_start || (ch2 = *arg_end_p1 != ';') || ch2 != ',')
+         if (arg_end_p1 != arg_start || ((ch2 = *arg_end_p1) != ';') || ch2 != ',')
            arg_was_number++;
        }
 
            arg_was_number++;
        }
 
@@ -3004,7 +2900,7 @@ parse_def (name_start)
                    {
                      int ch2;
                      arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
                    {
                      int ch2;
                      arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
-                     if (arg_end_p1 != arg_start || (ch2 = *arg_end_p1 != ';') || ch2 != ',')
+                     if (arg_end_p1 != arg_start || ((ch2 = *arg_end_p1) != ';') || ch2 != ',')
                        arg_was_number++;
 
                      if (t_ptr == &temp_array[0])
                        arg_was_number++;
 
                      if (t_ptr == &temp_array[0])
@@ -3078,7 +2974,7 @@ parse_def (name_start)
                    {
                      int ch2;
                      arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
                    {
                      int ch2;
                      arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
-                     if (arg_end_p1 != arg_start || (ch2 = *arg_end_p1 != ';') || ch2 != ',')
+                     if (arg_end_p1 != arg_start || ((ch2 = *arg_end_p1) != ';') || ch2 != ',')
                        arg_was_number++;
 
                      if (t_ptr == &temp_array[0])
                        arg_was_number++;
 
                      if (t_ptr == &temp_array[0])
@@ -3123,13 +3019,13 @@ parse_def (name_start)
              tq_t *tq_ptr = &t.type_qualifiers[0];
 
              t.orig_type = (coff_type_t) (arg_number & N_BTMASK);
              tq_t *tq_ptr = &t.type_qualifiers[0];
 
              t.orig_type = (coff_type_t) (arg_number & N_BTMASK);
-             t.basic_type = map_coff_types [(int)t.orig_type];
+             t.basic_type = map_coff_types [(int) t.orig_type];
              for (i = N_TQ-1; i >= 0; i--)
                {
                  int dt = (arg_number >> ((i * N_TQ_SHIFT) + N_BT_SHIFT)
                            & N_TMASK);
 
              for (i = N_TQ-1; i >= 0; i--)
                {
                  int dt = (arg_number >> ((i * N_TQ_SHIFT) + N_BT_SHIFT)
                            & N_TMASK);
 
-                 if (dt != (int)DT_NON)
+                 if (dt != (int) DT_NON)
                    *tq_ptr++ = map_coff_derived_type [dt];
                }
 
                    *tq_ptr++ = map_coff_derived_type [dt];
                }
 
@@ -3177,7 +3073,7 @@ parse_def (name_start)
                 class, symbol type, etc.  */
              else
                {
                 class, symbol type, etc.  */
              else
                {
-                 shash_t *orig_hash_ptr;       /* hash within orig sym table*/
+                 shash_t *orig_hash_ptr;       /* hash within orig sym table*/
                  shash_t *ext_hash_ptr;        /* hash within ext. sym table*/
 
                  ext_hash_ptr = hash_string (arg_start,
                  shash_t *ext_hash_ptr;        /* hash within ext. sym table*/
 
                  ext_hash_ptr = hash_string (arg_start,
@@ -3289,13 +3185,13 @@ parse_def (name_start)
        {
          if (tag_start == (char *) 0)
            {
        {
          if (tag_start == (char *) 0)
            {
-             error ("No tag specified for %.*s",
+             error ("no tag specified for %.*s",
                     (int) (name_end_p1 - name_start),
                     name_start);
              return;
            }
 
                     (int) (name_end_p1 - name_start),
                     name_start);
              return;
            }
 
-         t.tag_ptr = get_tag (tag_start, tag_end_p1,  (symint_t)indexNil,
+         t.tag_ptr = get_tag (tag_start, tag_end_p1,  (symint_t) indexNil,
                               t.basic_type);
        }
 
                               t.basic_type);
        }
 
@@ -3376,7 +3272,7 @@ parse_def (name_start)
      for which the external symbol table is fine enough.  */
 
   if (eptr == (EXTR *) 0
      for which the external symbol table is fine enough.  */
 
   if (eptr == (EXTR *) 0
-      || eptr->asym.st == (int)st_Nil
+      || eptr->asym.st == (int) st_Nil
       || cur_proc_ptr != (PDR *) 0)
     {
       symint_t isym = add_local_symbol (name_start, name_end_p1,
       || cur_proc_ptr != (PDR *) 0)
     {
       symint_t isym = add_local_symbol (name_start, name_end_p1,
@@ -3384,7 +3280,7 @@ parse_def (name_start)
                                        value,
                                        indx);
 
                                        value,
                                        indx);
 
-      /* deal with struct, union, and enum tags.  */
+      /* Deal with struct, union, and enum tags.  */
       if (symbol_type == st_Block)
         {
          /* Create or update the tag information.  */
       if (symbol_type == st_Block)
         {
          /* Create or update the tag information.  */
@@ -3432,8 +3328,7 @@ bomb_out:
 /* Parse .end directives.  */
 
 STATIC void
 /* Parse .end directives.  */
 
 STATIC void
-parse_end (start)
-     const char *start;                        /* start of directive */
+parse_end (const char *start)
 {
   const char *start_func, *end_func_p1;
   int ch;
 {
   const char *start_func, *end_func_p1;
   int ch;
@@ -3476,11 +3371,11 @@ parse_end (start)
 
   orig_fdr = cur_file_ptr->orig_fdr;
   value = 0;
 
   orig_fdr = cur_file_ptr->orig_fdr;
   value = 0;
-  if (orig_fdr != (FDR *)0 && cur_oproc_end != (SYMR *) 0)
+  if (orig_fdr != (FDR *) 0 && cur_oproc_end != (SYMR *) 0)
     value = cur_oproc_end->value;
 
   else
     value = cur_oproc_end->value;
 
   else
-    error ("Cannot find .end block for %.*s",
+    error ("cannot find .end block for %.*s",
           (int) (end_func_p1 - start_func), start_func);
 
   (void) add_local_symbol (start_func, end_func_p1,
           (int) (end_func_p1 - start_func), start_func);
 
   (void) add_local_symbol (start_func, end_func_p1,
@@ -3495,8 +3390,7 @@ parse_end (start)
 /* Parse .ent directives.  */
 
 STATIC void
 /* Parse .ent directives.  */
 
 STATIC void
-parse_ent (start)
-     const char *start;                        /* start of directive */
+parse_ent (const char *start)
 {
   const char *start_func, *end_func_p1;
   int ch;
 {
   const char *start_func, *end_func_p1;
   int ch;
@@ -3533,8 +3427,7 @@ parse_ent (start)
 /* Parse .file directives.  */
 
 STATIC void
 /* Parse .file directives.  */
 
 STATIC void
-parse_file (start)
-     const char *start;                        /* start of directive */
+parse_file (const char *start)
 {
   char *p;
   char *start_name, *end_name_p1;
 {
   char *p;
   char *start_name, *end_name_p1;
@@ -3544,13 +3437,13 @@ parse_file (start)
       || (start_name = strchr (p, '"')) == (char *) 0
       || (end_name_p1 = strrchr (++start_name, '"')) == (char *) 0)
     {
       || (start_name = strchr (p, '"')) == (char *) 0
       || (end_name_p1 = strrchr (++start_name, '"')) == (char *) 0)
     {
-      error ("Invalid .file directive");
+      error ("invalid .file directive");
       return;
     }
 
   if (cur_proc_ptr != (PDR *) 0)
     {
       return;
     }
 
   if (cur_proc_ptr != (PDR *) 0)
     {
-      error ("No way to handle .file within .ent/.end section");
+      error ("no way to handle .file within .ent/.end section");
       return;
     }
 
       return;
     }
 
@@ -3561,8 +3454,7 @@ parse_file (start)
 /* Make sure the @stabs symbol is emitted.  */
 
 static void
 /* Make sure the @stabs symbol is emitted.  */
 
 static void
-mark_stabs (start)
-  const char *start ATTRIBUTE_UNUSED;  /* Start of directive (ignored) */
+mark_stabs (const char *start ATTRIBUTE_UNUSED)
 {
   if (!stabs_seen)
     {
 {
   if (!stabs_seen)
     {
@@ -3570,7 +3462,7 @@ mark_stabs (start)
       stabs_seen = 1;
       (void) add_local_symbol (stabs_symbol,
                               stabs_symbol + sizeof (stabs_symbol),
       stabs_seen = 1;
       (void) add_local_symbol (stabs_symbol,
                               stabs_symbol + sizeof (stabs_symbol),
-                              stNil, scInfo, -1, MIPS_MARK_STAB(0));
+                              stNil, scInfo, -1, MIPS_MARK_STAB (0));
 
     }
 }
 
     }
 }
@@ -3606,10 +3498,9 @@ mark_stabs (start)
        value           a numeric value or an address.  */
 
 STATIC void
        value           a numeric value or an address.  */
 
 STATIC void
-parse_stabs_common (string_start, string_end, rest)
-     const char *string_start;         /* start of string or NULL */
-     const char *string_end;           /* end+1 of string or NULL */
-     const char *rest;                 /* rest of the directive.  */
+parse_stabs_common (const char *string_start,  /* start of string or NULL */
+                   const char *string_end,     /* end+1 of string or NULL */
+                   const char *rest)           /* rest of the directive.  */
 {
   efdr_t *save_file_ptr = cur_file_ptr;
   symint_t code;
 {
   efdr_t *save_file_ptr = cur_file_ptr;
   symint_t code;
@@ -3625,7 +3516,7 @@ parse_stabs_common (string_start, string_end, rest)
   /* Read code from stabs.  */
   if (!ISDIGIT (*rest))
     {
   /* Read code from stabs.  */
   if (!ISDIGIT (*rest))
     {
-      error ("Invalid .stabs/.stabn directive, code is non-numeric");
+      error ("invalid .stabs/.stabn directive, code is non-numeric");
       return;
     }
 
       return;
     }
 
@@ -3637,7 +3528,7 @@ parse_stabs_common (string_start, string_end, rest)
      address.  The symbol type is st_Label, which should be different from
      the other stabs, so that gdb can recognize it.  */
 
      address.  The symbol type is st_Label, which should be different from
      the other stabs, so that gdb can recognize it.  */
 
-  if (code == (int)N_SLINE)
+  if (code == (int) N_SLINE)
     {
       SYMR *sym_ptr, dummy_symr;
       shash_t *shash_ptr;
     {
       SYMR *sym_ptr, dummy_symr;
       shash_t *shash_ptr;
@@ -3645,7 +3536,7 @@ parse_stabs_common (string_start, string_end, rest)
       /* Skip ,0, */
       if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !ISDIGIT (p[3]))
        {
       /* Skip ,0, */
       if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !ISDIGIT (p[3]))
        {
-         error ("Invalid line number .stabs/.stabn directive");
+         error ("invalid line number .stabs/.stabn directive");
          return;
        }
 
          return;
        }
 
@@ -3653,14 +3544,14 @@ parse_stabs_common (string_start, string_end, rest)
       ch = *++p;
       if (p[-1] != ',' || ISDIGIT (ch) || !IS_ASM_IDENT (ch))
        {
       ch = *++p;
       if (p[-1] != ',' || ISDIGIT (ch) || !IS_ASM_IDENT (ch))
        {
-         error ("Invalid line number .stabs/.stabn directive");
+         error ("invalid line number .stabs/.stabn directive");
          return;
        }
 
       dummy_symr.index = code;
       if (dummy_symr.index != code)
        {
          return;
        }
 
       dummy_symr.index = code;
       if (dummy_symr.index != code)
        {
-         error ("Line number (%lu) for .stabs/.stabn directive cannot fit in index field (20 bits)",
+         error ("line number (%lu) for .stabs/.stabn directive cannot fit in index field (20 bits)",
                 code);
 
          return;
                 code);
 
          return;
@@ -3674,13 +3565,13 @@ parse_stabs_common (string_start, string_end, rest)
       if (shash_ptr == (shash_t *) 0
          || (sym_ptr = shash_ptr->sym_ptr) == (SYMR *) 0)
        {
       if (shash_ptr == (shash_t *) 0
          || (sym_ptr = shash_ptr->sym_ptr) == (SYMR *) 0)
        {
-         error ("Invalid .stabs/.stabn directive, value not found");
+         error ("invalid .stabs/.stabn directive, value not found");
          return;
        }
 
       if ((st_t) sym_ptr->st != st_Label)
        {
          return;
        }
 
       if ((st_t) sym_ptr->st != st_Label)
        {
-         error ("Invalid line number .stabs/.stabn directive");
+         error ("invalid line number .stabs/.stabn directive");
          return;
        }
 
          return;
        }
 
@@ -3705,7 +3596,7 @@ parse_stabs_common (string_start, string_end, rest)
       if (!IS_ASM_IDENT (ch) && ch != '-')
        {
        failure:
       if (!IS_ASM_IDENT (ch) && ch != '-')
        {
        failure:
-         error ("Invalid .stabs/.stabn directive, bad character");
+         error ("invalid .stabs/.stabn directive, bad character");
          return;
        }
 
          return;
        }
 
@@ -3716,13 +3607,13 @@ parse_stabs_common (string_start, string_end, rest)
          value = strtol (p, &p, 0);
          if (*p != '\n')
            {
          value = strtol (p, &p, 0);
          if (*p != '\n')
            {
-             error ("Invalid .stabs/.stabn directive, stuff after numeric value");
+             error ("invalid .stabs/.stabn directive, stuff after numeric value");
              return;
            }
        }
       else if (!IS_ASM_IDENT (ch))
        {
              return;
            }
        }
       else if (!IS_ASM_IDENT (ch))
        {
-         error ("Invalid .stabs/.stabn directive, bad character");
+         error ("invalid .stabs/.stabn directive, bad character");
          return;
        }
       else
          return;
        }
       else
@@ -3735,7 +3626,7 @@ parse_stabs_common (string_start, string_end, rest)
          if ((end_p1 = strchr (start, '+')) == (char *) 0)
            {
              if ((end_p1 = strchr (start, '-')) == (char *) 0)
          if ((end_p1 = strchr (start, '+')) == (char *) 0)
            {
              if ((end_p1 = strchr (start, '-')) == (char *) 0)
-               end_p1 = start + strlen(start) - 1;
+               end_p1 = start + strlen (start) - 1;
            }
 
          shash_ptr = hash_string (start,
            }
 
          shash_ptr = hash_string (start,
@@ -3754,7 +3645,7 @@ parse_stabs_common (string_start, string_end, rest)
              if (shash_ptr == (shash_t *) 0
                  || shash_ptr->esym_ptr == (EXTR *) 0)
                {
              if (shash_ptr == (shash_t *) 0
                  || shash_ptr->esym_ptr == (EXTR *) 0)
                {
-                 error ("Invalid .stabs/.stabn directive, value not found");
+                 error ("invalid .stabs/.stabn directive, value not found");
                  return;
                }
              else
                  return;
                }
              else
@@ -3780,7 +3671,7 @@ parse_stabs_common (string_start, string_end, rest)
              if (((!ISDIGIT (*end_p1)) && (*end_p1 != '-'))
                  || ((ch != '+') && (ch != '-')))
                {
              if (((!ISDIGIT (*end_p1)) && (*end_p1 != '-'))
                  || ((ch != '+') && (ch != '-')))
                {
-                 error ("Invalid .stabs/.stabn directive, badly formed value");
+                 error ("invalid .stabs/.stabn directive, badly formed value");
                  return;
                }
              if (ch == '+')
                  return;
                }
              if (ch == '+')
@@ -3790,12 +3681,12 @@ parse_stabs_common (string_start, string_end, rest)
 
              if (*p != '\n')
                {
 
              if (*p != '\n')
                {
-                 error ("Invalid .stabs/.stabn directive, stuff after numeric value");
+                 error ("invalid .stabs/.stabn directive, stuff after numeric value");
                  return;
                }
            }
        }
                  return;
                }
            }
        }
-      code = MIPS_MARK_STAB(code);
+      code = MIPS_MARK_STAB (code);
     }
 
   (void) add_local_symbol (string_start, string_end, st, sc, value, code);
     }
 
   (void) add_local_symbol (string_start, string_end, st, sc, value, code);
@@ -3805,14 +3696,13 @@ parse_stabs_common (string_start, string_end, rest)
 
 
 STATIC void
 
 
 STATIC void
-parse_stabs (start)
-     const char *start;                        /* start of directive */
+parse_stabs (const char *start)
 {
   const char *end = strchr (start+1, '"');
 
   if (*start != '"' || end == (const char *) 0 || end[1] != ',')
     {
 {
   const char *end = strchr (start+1, '"');
 
   if (*start != '"' || end == (const char *) 0 || end[1] != ',')
     {
-      error ("Invalid .stabs directive, no string");
+      error ("invalid .stabs directive, no string");
       return;
     }
 
       return;
     }
 
@@ -3821,8 +3711,7 @@ parse_stabs (start)
 
 
 STATIC void
 
 
 STATIC void
-parse_stabn (start)
-     const char *start;                        /* start of directive */
+parse_stabn (const char *start)
 {
   parse_stabs_common ((const char *) 0, (const char *) 0, start);
 }
 {
   parse_stabs_common ((const char *) 0, (const char *) 0, start);
 }
@@ -3832,7 +3721,7 @@ parse_stabn (start)
    if needed.  */
 
 STATIC void
    if needed.  */
 
 STATIC void
-parse_input ()
+parse_input (void)
 {
   char *p;
   Size_t i;
 {
   char *p;
   Size_t i;
@@ -3852,7 +3741,7 @@ parse_input ()
 
   while ((p = read_line ()) != (char *) 0)
     {
 
   while ((p = read_line ()) != (char *) 0)
     {
-      /* Skip leading blanks */
+      /* Skip leading blanks */
       while (ISSPACE ((unsigned char)*p))
        p++;
 
       while (ISSPACE ((unsigned char)*p))
        p++;
 
@@ -3895,7 +3784,7 @@ parse_input ()
    to write out the .T file.  */
 
 STATIC void
    to write out the .T file.  */
 
 STATIC void
-update_headers ()
+update_headers (void)
 {
   symint_t i;
   efdr_t *file_ptr;
 {
   symint_t i;
   efdr_t *file_ptr;
@@ -3939,7 +3828,7 @@ update_headers ()
       sym_end_p1 = sym_start + fd_ptr->csym;
       for (sym = sym_start; sym < sym_end_p1; sym++)
        {
       sym_end_p1 = sym_start + fd_ptr->csym;
       for (sym = sym_start; sym < sym_end_p1; sym++)
        {
-         if ((st_t)sym->st == st_Static)
+         if ((st_t) sym->st == st_Static)
            {
              char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss);
              Size_t len = strlen (str);
            {
              char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss);
              Size_t len = strlen (str);
@@ -3949,15 +3838,15 @@ update_headers ()
              if (str[0] == '$' && str[1] == 'L')
                continue;
              hash_ptr = hash_string (str,
              if (str[0] == '$' && str[1] == 'L')
                continue;
              hash_ptr = hash_string (str,
-                                     (Ptrdiff_t)len,
+                                     (Ptrdiff_t) len,
                                      &file_ptr->shash_head[0],
                                      &file_ptr->shash_head[0],
-                                     (symint_t *) 0);
+                                     (symint_t *) 0);
              if (hash_ptr == (shash_t *) 0)
                {
                  (void) add_local_symbol (str, str + len,
              if (hash_ptr == (shash_t *) 0)
                {
                  (void) add_local_symbol (str, str + len,
-                                          (st_t)sym->st, (sc_t)sym->sc,
-                                          (symint_t)sym->value,
-                                          (symint_t)indexNil);
+                                          (st_t) sym->st, (sc_t) sym->sc,
+                                          (symint_t) sym->value,
+                                          (symint_t) indexNil);
                }
            }
        }
                }
            }
        }
@@ -4081,10 +3970,9 @@ update_headers ()
 /* Write out a varray at a given location.  */
 
 STATIC void
 /* Write out a varray at a given location.  */
 
 STATIC void
-write_varray (vp, offset, str)
-     varray_t *vp;                     /* virtual array */
-     off_t offset;                     /* offset to write varray to */
-     const char *str;                  /* string to print out when tracing */
+write_varray (varray_t *vp,    /* virtual array */
+             off_t offset,    /* offset to write varray to */
+             const char *str) /* string to print out when tracing */
 {
   int num_write, sys_write;
   vlinks_t *ptr;
 {
   int num_write, sys_write;
   vlinks_t *ptr;
@@ -4093,15 +3981,13 @@ write_varray (vp, offset, str)
     return;
 
   if (debug)
     return;
 
   if (debug)
-    {
-      fputs ("\twarray\tvp = ", stderr);
-      fprintf (stderr, HOST_PTR_PRINTF, (PTR) vp);
-      fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
-              (unsigned long) offset, vp->num_allocated * vp->object_size, str);
-    }
-  
-  if (file_offset != offset
-      && fseek (object_stream, (long)offset, SEEK_SET) < 0)
+    fprintf (stderr, "\twarray\tvp = " HOST_PTR_PRINTF
+            ", offset = %7lu, size = %7lu, %s\n",
+            (void *) vp, (unsigned long) offset,
+            vp->num_allocated * vp->object_size, str);
+
+  if (file_offset != (unsigned long) offset
+      && fseek (object_stream, (long) offset, SEEK_SET) < 0)
     pfatal_with_name (object_name);
 
   for (ptr = vp->first; ptr != (vlinks_t *) 0; ptr = ptr->next)
     pfatal_with_name (object_name);
 
   for (ptr = vp->first; ptr != (vlinks_t *) 0; ptr = ptr->next)
@@ -4110,12 +3996,12 @@ write_varray (vp, offset, str)
        ? vp->objects_last_page * vp->object_size
        : vp->objects_per_page  * vp->object_size;
 
        ? vp->objects_last_page * vp->object_size
        : vp->objects_per_page  * vp->object_size;
 
-      sys_write = fwrite ((PTR) ptr->datum, 1, num_write, object_stream);
+      sys_write = fwrite (ptr->datum, 1, num_write, object_stream);
       if (sys_write <= 0)
        pfatal_with_name (object_name);
 
       else if (sys_write != num_write)
       if (sys_write <= 0)
        pfatal_with_name (object_name);
 
       else if (sys_write != num_write)
-       fatal ("Wrote %d bytes to %s, system returned %d",
+       fatal ("wrote %d bytes to %s, system returned %d",
               num_write,
               object_name,
               sys_write);
               num_write,
               object_name,
               sys_write);
@@ -4128,21 +4014,19 @@ write_varray (vp, offset, str)
 /* Write out the symbol table in the object file.  */
 
 STATIC void
 /* Write out the symbol table in the object file.  */
 
 STATIC void
-write_object ()
+write_object (void)
 {
   int sys_write;
   efdr_t *file_ptr;
   off_t offset;
 
   if (debug)
 {
   int sys_write;
   efdr_t *file_ptr;
   off_t offset;
 
   if (debug)
-    {
-      fputs ("\n\twrite\tvp = ", stderr);
-      fprintf (stderr, HOST_PTR_PRINTF, (PTR) &symbolic_header);
-      fprintf (stderr, ", offset = %7u, size = %7lu, %s\n",
-              0, (unsigned long) sizeof (symbolic_header), "symbolic header");
-    }
+    fprintf (stderr, "\n\twrite\tvp = " HOST_PTR_PRINTF
+            ", offset = %7u, size = %7lu, %s\n",
+            (void *) &symbolic_header, 0,
+            (unsigned long) sizeof (symbolic_header), "symbolic header");
 
 
-  sys_write = fwrite ((PTR) &symbolic_header,
+  sys_write = fwrite (&symbolic_header,
                      1,
                      sizeof (symbolic_header),
                      object_stream);
                      1,
                      sizeof (symbolic_header),
                      object_stream);
@@ -4151,7 +4035,7 @@ write_object ()
     pfatal_with_name (object_name);
 
   else if (sys_write != sizeof (symbolic_header))
     pfatal_with_name (object_name);
 
   else if (sys_write != sizeof (symbolic_header))
-    fatal ("Wrote %d bytes to %s, system returned %d",
+    fatal ("wrote %d bytes to %s, system returned %d",
           (int) sizeof (symbolic_header),
           object_name,
           sys_write);
           (int) sizeof (symbolic_header),
           object_name,
           sys_write);
@@ -4163,20 +4047,17 @@ write_object ()
     {
       long sys_write;
 
     {
       long sys_write;
 
-      if (file_offset != symbolic_header.cbLineOffset
+      if (file_offset != (unsigned long) symbolic_header.cbLineOffset
          && fseek (object_stream, symbolic_header.cbLineOffset, SEEK_SET) != 0)
        pfatal_with_name (object_name);
 
       if (debug)
          && fseek (object_stream, symbolic_header.cbLineOffset, SEEK_SET) != 0)
        pfatal_with_name (object_name);
 
       if (debug)
-       {
-         fputs ("\twrite\tvp = ", stderr);
-         fprintf (stderr, HOST_PTR_PRINTF, (PTR) &orig_linenum);
-         fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
-                  (long) symbolic_header.cbLineOffset,
-                  (long) symbolic_header.cbLine, "Line numbers");
-       }
+       fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
+                ", offset = %7lu, size = %7lu, %s\n",
+                (void *) &orig_linenum, (long) symbolic_header.cbLineOffset,
+                (long) symbolic_header.cbLine, "Line numbers");
 
 
-      sys_write = fwrite ((PTR) orig_linenum,
+      sys_write = fwrite (orig_linenum,
                          1,
                          symbolic_header.cbLine,
                          object_stream);
                          1,
                          symbolic_header.cbLine,
                          object_stream);
@@ -4185,7 +4066,7 @@ write_object ()
        pfatal_with_name (object_name);
 
       else if (sys_write != symbolic_header.cbLine)
        pfatal_with_name (object_name);
 
       else if (sys_write != symbolic_header.cbLine)
-       fatal ("Wrote %ld bytes to %s, system returned %ld",
+       fatal ("wrote %ld bytes to %s, system returned %ld",
               (long) symbolic_header.cbLine,
               object_name,
               sys_write);
               (long) symbolic_header.cbLine,
               object_name,
               sys_write);
@@ -4198,20 +4079,17 @@ write_object ()
       long sys_write;
       long num_write = symbolic_header.ioptMax * sizeof (OPTR);
 
       long sys_write;
       long num_write = symbolic_header.ioptMax * sizeof (OPTR);
 
-      if (file_offset != symbolic_header.cbOptOffset
+      if (file_offset != (unsigned long) symbolic_header.cbOptOffset
          && fseek (object_stream, symbolic_header.cbOptOffset, SEEK_SET) != 0)
        pfatal_with_name (object_name);
 
       if (debug)
          && fseek (object_stream, symbolic_header.cbOptOffset, SEEK_SET) != 0)
        pfatal_with_name (object_name);
 
       if (debug)
-       {
-         fputs ("\twrite\tvp = ", stderr);
-         fprintf (stderr, HOST_PTR_PRINTF, (PTR) &orig_opt_syms);
-         fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
-                  (long) symbolic_header.cbOptOffset,
-                  num_write, "Optimizer symbols");
-       }
+       fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
+                ", offset = %7lu, size = %7lu, %s\n",
+                (void *) &orig_opt_syms, (long) symbolic_header.cbOptOffset,
+                num_write, "Optimizer symbols");
 
 
-      sys_write = fwrite ((PTR) orig_opt_syms,
+      sys_write = fwrite (orig_opt_syms,
                          1,
                          num_write,
                          object_stream);
                          1,
                          num_write,
                          object_stream);
@@ -4220,7 +4098,7 @@ write_object ()
        pfatal_with_name (object_name);
 
       else if (sys_write != num_write)
        pfatal_with_name (object_name);
 
       else if (sys_write != num_write)
-       fatal ("Wrote %ld bytes to %s, system returned %ld",
+       fatal ("wrote %ld bytes to %s, system returned %ld",
               num_write,
               object_name,
               sys_write);
               num_write,
               object_name,
               sys_write);
@@ -4229,7 +4107,7 @@ write_object ()
     }
 
   if (symbolic_header.idnMax > 0)              /* dense numbers */
     }
 
   if (symbolic_header.idnMax > 0)              /* dense numbers */
-    write_varray (&dense_num, (off_t)symbolic_header.cbDnOffset, "Dense numbers");
+    write_varray (&dense_num, (off_t) symbolic_header.cbDnOffset, "Dense numbers");
 
   if (symbolic_header.ipdMax > 0)              /* procedure tables */
     {
 
   if (symbolic_header.ipdMax > 0)              /* procedure tables */
     {
@@ -4285,8 +4163,8 @@ write_object ()
   if (symbolic_header.ifdMax > 0)              /* file tables */
     {
       offset = symbolic_header.cbFdOffset;
   if (symbolic_header.ifdMax > 0)              /* file tables */
     {
       offset = symbolic_header.cbFdOffset;
-      if (file_offset != offset
-         && fseek (object_stream, (long)offset, SEEK_SET) < 0)
+      if (file_offset != (unsigned long) offset
+         && fseek (object_stream, (long) offset, SEEK_SET) < 0)
        pfatal_with_name (object_name);
 
       file_offset = offset;
        pfatal_with_name (object_name);
 
       file_offset = offset;
@@ -4295,13 +4173,10 @@ write_object ()
           file_ptr = file_ptr->next_file)
        {
          if (debug)
           file_ptr = file_ptr->next_file)
        {
          if (debug)
-           {
-             fputs ("\twrite\tvp = ", stderr);
-             fprintf (stderr, HOST_PTR_PRINTF, (PTR) &file_ptr->fdr);
-             fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
-                      file_offset, (unsigned long) sizeof (FDR),
-                      "File header");
-           }
+           fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
+                    ", offset = %7lu, size = %7lu, %s\n",
+                    (void *) &file_ptr->fdr, file_offset,
+                    (unsigned long) sizeof (FDR), "File header");
 
          sys_write = fwrite (&file_ptr->fdr,
                              1,
 
          sys_write = fwrite (&file_ptr->fdr,
                              1,
@@ -4312,7 +4187,7 @@ write_object ()
            pfatal_with_name (object_name);
 
          else if (sys_write != sizeof (FDR))
            pfatal_with_name (object_name);
 
          else if (sys_write != sizeof (FDR))
-           fatal ("Wrote %d bytes to %s, system returned %d",
+           fatal ("wrote %d bytes to %s, system returned %d",
                   (int) sizeof (FDR),
                   object_name,
                   sys_write);
                   (int) sizeof (FDR),
                   object_name,
                   sys_write);
@@ -4326,18 +4201,15 @@ write_object ()
       long sys_write;
       symint_t num_write = symbolic_header.crfd * sizeof (symint_t);
 
       long sys_write;
       symint_t num_write = symbolic_header.crfd * sizeof (symint_t);
 
-      if (file_offset != symbolic_header.cbRfdOffset
+      if (file_offset != (unsigned long) symbolic_header.cbRfdOffset
          && fseek (object_stream, symbolic_header.cbRfdOffset, SEEK_SET) != 0)
        pfatal_with_name (object_name);
 
       if (debug)
          && fseek (object_stream, symbolic_header.cbRfdOffset, SEEK_SET) != 0)
        pfatal_with_name (object_name);
 
       if (debug)
-       {
-         fputs ("\twrite\tvp = ", stderr);
-         fprintf (stderr, HOST_PTR_PRINTF, (PTR) &orig_rfds);
-         fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
-                  (long) symbolic_header.cbRfdOffset,
-                  num_write, "Relative file descriptors");
-       }
+       fprintf (stderr, "\twrite\tvp = " HOST_PTR_PRINTF
+                ", offset = %7lu, size = %7lu, %s\n",
+                (void *) &orig_rfds, (long) symbolic_header.cbRfdOffset,
+                num_write, "Relative file descriptors");
 
       sys_write = fwrite (orig_rfds,
                          1,
 
       sys_write = fwrite (orig_rfds,
                          1,
@@ -4347,8 +4219,8 @@ write_object ()
       if (sys_write <= 0)
        pfatal_with_name (object_name);
 
       if (sys_write <= 0)
        pfatal_with_name (object_name);
 
-      else if (sys_write != (long)num_write)
-       fatal ("Wrote %lu bytes to %s, system returned %ld",
+      else if (sys_write != (long) num_write)
+       fatal ("wrote %lu bytes to %s, system returned %ld",
               num_write,
               object_name,
               sys_write);
               num_write,
               object_name,
               sys_write);
@@ -4357,7 +4229,7 @@ write_object ()
     }
 
   if (symbolic_header.issExtMax > 0)           /* external symbols */
     }
 
   if (symbolic_header.issExtMax > 0)           /* external symbols */
-    write_varray (&ext_symbols, (off_t)symbolic_header.cbExtOffset, "External symbols");
+    write_varray (&ext_symbols, (off_t) symbolic_header.cbExtOffset, "External symbols");
 
   if (fclose (object_stream) != 0)
     pfatal_with_name (object_name);
 
   if (fclose (object_stream) != 0)
     pfatal_with_name (object_name);
@@ -4367,10 +4239,9 @@ write_object ()
 /* Read some bytes at a specified location, and return a pointer.  */
 
 STATIC page_t *
 /* Read some bytes at a specified location, and return a pointer.  */
 
 STATIC page_t *
-read_seek (size, offset, str)
-     Size_t size;              /* # bytes to read */
-     off_t offset;             /* offset to read at */
-     const char *str;          /* name for tracing */
+read_seek (Size_t size,                /* # bytes to read */
+          off_t offset,        /* offset to read at */
+          const char *str)     /* name for tracing */
 {
   page_t *ptr;
   long sys_read = 0;
 {
   page_t *ptr;
   long sys_read = 0;
@@ -4386,12 +4257,12 @@ read_seek (size, offset, str)
 #ifndef MALLOC_CHECK
   ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE);
 #else
 #ifndef MALLOC_CHECK
   ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE);
 #else
-  ptr = (page_t *) xcalloc (1, size);
+  ptr = xcalloc (1, size);
 #endif
 
   /* If we need to seek, and the distance is nearby, just do some reads,
      to speed things up.  */
 #endif
 
   /* If we need to seek, and the distance is nearby, just do some reads,
      to speed things up.  */
-  if (file_offset != offset)
+  if (file_offset != (unsigned long) offset)
     {
       symint_t difference = offset - file_offset;
 
     {
       symint_t difference = offset - file_offset;
 
@@ -4403,8 +4274,8 @@ read_seek (size, offset, str)
          if (sys_read <= 0)
            pfatal_with_name (obj_in_name);
 
          if (sys_read <= 0)
            pfatal_with_name (obj_in_name);
 
-         if ((symint_t)sys_read != difference)
-           fatal ("Wanted to read %lu bytes from %s, system returned %ld",
+         if ((symint_t) sys_read != difference)
+           fatal ("wanted to read %lu bytes from %s, system returned %ld",
                   (unsigned long) size,
                   obj_in_name,
                   sys_read);
                   (unsigned long) size,
                   obj_in_name,
                   sys_read);
@@ -4413,12 +4284,12 @@ read_seek (size, offset, str)
        pfatal_with_name (obj_in_name);
     }
 
        pfatal_with_name (obj_in_name);
     }
 
-  sys_read = fread ((PTR) ptr, 1, size, obj_in_stream);
+  sys_read = fread (ptr, 1, size, obj_in_stream);
   if (sys_read <= 0)
     pfatal_with_name (obj_in_name);
 
   if (sys_read != (long) size)
   if (sys_read <= 0)
     pfatal_with_name (obj_in_name);
 
   if (sys_read != (long) size)
-    fatal ("Wanted to read %lu bytes from %s, system returned %ld",
+    fatal ("wanted to read %lu bytes from %s, system returned %ld",
           (unsigned long) size,
           obj_in_name,
           sys_read);
           (unsigned long) size,
           obj_in_name,
           sys_read);
@@ -4437,7 +4308,7 @@ read_seek (size, offset, str)
    symbol table.  */
 
 STATIC void
    symbol table.  */
 
 STATIC void
-copy_object ()
+copy_object (void)
 {
   char buffer[ PAGE_SIZE ];
   int sys_read;
 {
   char buffer[ PAGE_SIZE ];
   int sys_read;
@@ -4456,7 +4327,7 @@ copy_object ()
       || fseek (obj_in_stream, 0L, SEEK_SET) != 0)
     pfatal_with_name (obj_in_name);
 
       || fseek (obj_in_stream, 0L, SEEK_SET) != 0)
     pfatal_with_name (obj_in_name);
 
-  sys_read = fread ((PTR) &orig_file_header,
+  sys_read = fread (&orig_file_header,
                    1,
                    sizeof (struct filehdr),
                    obj_in_stream);
                    1,
                    sizeof (struct filehdr),
                    obj_in_stream);
@@ -4468,7 +4339,7 @@ copy_object ()
     return;                    /* create a .T file sans file header */
 
   else if (sys_read < (int) sizeof (struct filehdr))
     return;                    /* create a .T file sans file header */
 
   else if (sys_read < (int) sizeof (struct filehdr))
-    fatal ("Wanted to read %d bytes from %s, system returned %d",
+    fatal ("wanted to read %d bytes from %s, system returned %d",
           (int) sizeof (struct filehdr),
           obj_in_name,
           sys_read);
           (int) sizeof (struct filehdr),
           obj_in_name,
           sys_read);
@@ -4483,7 +4354,7 @@ copy_object ()
   if (fseek (obj_in_stream, (long) orig_file_header.f_symptr, SEEK_SET) != 0)
     pfatal_with_name (input_name);
 
   if (fseek (obj_in_stream, (long) orig_file_header.f_symptr, SEEK_SET) != 0)
     pfatal_with_name (input_name);
 
-  sys_read = fread ((PTR) &orig_sym_hdr,
+  sys_read = fread (&orig_sym_hdr,
                    1,
                    sizeof (orig_sym_hdr),
                    obj_in_stream);
                    1,
                    sizeof (orig_sym_hdr),
                    obj_in_stream);
@@ -4492,7 +4363,7 @@ copy_object ()
     pfatal_with_name (object_name);
 
   else if (sys_read < (int) sizeof (struct filehdr))
     pfatal_with_name (object_name);
 
   else if (sys_read < (int) sizeof (struct filehdr))
-    fatal ("Wanted to read %d bytes from %s, system returned %d",
+    fatal ("wanted to read %d bytes from %s, system returned %d",
           (int) sizeof (struct filehdr),
           obj_in_name,
           sys_read);
           (int) sizeof (struct filehdr),
           obj_in_name,
           sys_read);
@@ -4508,69 +4379,69 @@ copy_object ()
   file_offset =  orig_file_header.f_symptr + sizeof (struct filehdr);
 
   if (orig_sym_hdr.cbLine > 0)                 /* line numbers */
   file_offset =  orig_file_header.f_symptr + sizeof (struct filehdr);
 
   if (orig_sym_hdr.cbLine > 0)                 /* line numbers */
-    orig_linenum = (char *) read_seek ((Size_t)orig_sym_hdr.cbLine,
+    orig_linenum = (char *) read_seek (orig_sym_hdr.cbLine,
                                       orig_sym_hdr.cbLineOffset,
                                       "Line numbers");
 
   if (orig_sym_hdr.ipdMax > 0)                 /* procedure tables */
                                       orig_sym_hdr.cbLineOffset,
                                       "Line numbers");
 
   if (orig_sym_hdr.ipdMax > 0)                 /* procedure tables */
-    orig_procs = (PDR *) read_seek ((Size_t)orig_sym_hdr.ipdMax * sizeof (PDR),
+    orig_procs = (PDR *) read_seek (orig_sym_hdr.ipdMax * sizeof (PDR),
                                    orig_sym_hdr.cbPdOffset,
                                    "Procedure tables");
 
   if (orig_sym_hdr.isymMax > 0)                        /* local symbols */
                                    orig_sym_hdr.cbPdOffset,
                                    "Procedure tables");
 
   if (orig_sym_hdr.isymMax > 0)                        /* local symbols */
-    orig_local_syms = (SYMR *) read_seek ((Size_t)orig_sym_hdr.isymMax * sizeof (SYMR),
+    orig_local_syms = (SYMR *) read_seek (orig_sym_hdr.isymMax * sizeof (SYMR),
                                          orig_sym_hdr.cbSymOffset,
                                          "Local symbols");
 
   if (orig_sym_hdr.iauxMax > 0)                        /* aux symbols */
                                          orig_sym_hdr.cbSymOffset,
                                          "Local symbols");
 
   if (orig_sym_hdr.iauxMax > 0)                        /* aux symbols */
-    orig_aux_syms = (AUXU *) read_seek ((Size_t)orig_sym_hdr.iauxMax * sizeof (AUXU),
+    orig_aux_syms = (AUXU *) read_seek (orig_sym_hdr.iauxMax * sizeof (AUXU),
                                        orig_sym_hdr.cbAuxOffset,
                                        "Aux. symbols");
 
   if (orig_sym_hdr.issMax > 0)                 /* local strings */
                                        orig_sym_hdr.cbAuxOffset,
                                        "Aux. symbols");
 
   if (orig_sym_hdr.issMax > 0)                 /* local strings */
-    orig_local_strs = (char *) read_seek ((Size_t)orig_sym_hdr.issMax,
+    orig_local_strs = (char *) read_seek (orig_sym_hdr.issMax,
                                          orig_sym_hdr.cbSsOffset,
                                          "Local strings");
 
   if (orig_sym_hdr.issExtMax > 0)              /* external strings */
                                          orig_sym_hdr.cbSsOffset,
                                          "Local strings");
 
   if (orig_sym_hdr.issExtMax > 0)              /* external strings */
-    orig_ext_strs = (char *) read_seek ((Size_t)orig_sym_hdr.issExtMax,
+    orig_ext_strs = (char *) read_seek (orig_sym_hdr.issExtMax,
                                        orig_sym_hdr.cbSsExtOffset,
                                        "External strings");
 
   if (orig_sym_hdr.ifdMax > 0)                 /* file tables */
                                        orig_sym_hdr.cbSsExtOffset,
                                        "External strings");
 
   if (orig_sym_hdr.ifdMax > 0)                 /* file tables */
-    orig_files = (FDR *) read_seek ((Size_t)orig_sym_hdr.ifdMax * sizeof (FDR),
+    orig_files = (FDR *) read_seek (orig_sym_hdr.ifdMax * sizeof (FDR),
                                    orig_sym_hdr.cbFdOffset,
                                    "File tables");
 
   if (orig_sym_hdr.crfd > 0)                   /* relative file descriptors */
                                    orig_sym_hdr.cbFdOffset,
                                    "File tables");
 
   if (orig_sym_hdr.crfd > 0)                   /* relative file descriptors */
-    orig_rfds = (symint_t *) read_seek ((Size_t)orig_sym_hdr.crfd * sizeof (symint_t),
+    orig_rfds = (symint_t *) read_seek (orig_sym_hdr.crfd * sizeof (symint_t),
                                        orig_sym_hdr.cbRfdOffset,
                                        "Relative file descriptors");
 
   if (orig_sym_hdr.issExtMax > 0)              /* external symbols */
                                        orig_sym_hdr.cbRfdOffset,
                                        "Relative file descriptors");
 
   if (orig_sym_hdr.issExtMax > 0)              /* external symbols */
-    orig_ext_syms = (EXTR *) read_seek ((Size_t)orig_sym_hdr.iextMax * sizeof (EXTR),
+    orig_ext_syms = (EXTR *) read_seek (orig_sym_hdr.iextMax * sizeof (EXTR),
                                        orig_sym_hdr.cbExtOffset,
                                        "External symbols");
 
   if (orig_sym_hdr.idnMax > 0)                 /* dense numbers */
     {
                                        orig_sym_hdr.cbExtOffset,
                                        "External symbols");
 
   if (orig_sym_hdr.idnMax > 0)                 /* dense numbers */
     {
-      orig_dense = (DNR *) read_seek ((Size_t)orig_sym_hdr.idnMax * sizeof (DNR),
+      orig_dense = (DNR *) read_seek (orig_sym_hdr.idnMax * sizeof (DNR),
                                      orig_sym_hdr.cbDnOffset,
                                      "Dense numbers");
 
                                      orig_sym_hdr.cbDnOffset,
                                      "Dense numbers");
 
-      add_bytes (&dense_num, (char *) orig_dense, (Size_t)orig_sym_hdr.idnMax);
+      add_bytes (&dense_num, (char *) orig_dense, orig_sym_hdr.idnMax);
     }
 
   if (orig_sym_hdr.ioptMax > 0)                        /* opt symbols */
     }
 
   if (orig_sym_hdr.ioptMax > 0)                        /* opt symbols */
-    orig_opt_syms = (OPTR *) read_seek ((Size_t)orig_sym_hdr.ioptMax * sizeof (OPTR),
+    orig_opt_syms = (OPTR *) read_seek (orig_sym_hdr.ioptMax * sizeof (OPTR),
                                        orig_sym_hdr.cbOptOffset,
                                        "Optimizer symbols");
 
 
 
   /* Abort if the symbol table is not last.  */
                                        orig_sym_hdr.cbOptOffset,
                                        "Optimizer symbols");
 
 
 
   /* Abort if the symbol table is not last.  */
-  if (max_file_offset != stat_buf.st_size)
-    fatal ("Symbol table is not last (symbol table ends at %ld, .o ends at %ld",
+  if (max_file_offset != (unsigned long) stat_buf.st_size)
+    fatal ("symbol table is not last (symbol table ends at %ld, .o ends at %ld",
           max_file_offset,
           (long) stat_buf.st_size);
 
           max_file_offset,
           (long) stat_buf.st_size);
 
@@ -4593,7 +4464,7 @@ copy_object ()
      (in case there are duplicate filenames, we collapse them into one
      file section, the MIPS assembler may or may not collapse them).  */
 
      (in case there are duplicate filenames, we collapse them into one
      file section, the MIPS assembler may or may not collapse them).  */
 
-  remap_file_number = (int *) alloca (sizeof (int) * orig_sym_hdr.ifdMax);
+  remap_file_number = alloca (sizeof (int) * orig_sym_hdr.ifdMax);
 
   for (fd = delete_ifd; fd < orig_sym_hdr.ifdMax; fd++)
     {
 
   for (fd = delete_ifd; fd < orig_sym_hdr.ifdMax; fd++)
     {
@@ -4623,7 +4494,7 @@ copy_object ()
   for (es = 0; es < orig_sym_hdr.iextMax; es++)
     {
       EXTR *eptr = orig_ext_syms + es;
   for (es = 0; es < orig_sym_hdr.iextMax; es++)
     {
       EXTR *eptr = orig_ext_syms + es;
-      unsigned ifd = eptr->ifd;
+      int ifd = eptr->ifd;
 
       (void) add_ext_symbol (eptr, ((long) ifd < orig_sym_hdr.ifdMax)
                             ? remap_file_number[ ifd ] : ifd );
 
       (void) add_ext_symbol (eptr, ((long) ifd < orig_sym_hdr.ifdMax)
                             ? remap_file_number[ ifd ] : ifd );
@@ -4686,7 +4557,7 @@ copy_object ()
                char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss);
                Size_t len = strlen (str);
                shash_t *shash_ptr = hash_string (str,
                char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss);
                Size_t len = strlen (str);
                shash_t *shash_ptr = hash_string (str,
-                                                 (Ptrdiff_t)len,
+                                                 (Ptrdiff_t) len,
                                                  &orig_str_hash[0],
                                                  &hash_index);
 
                                                  &orig_str_hash[0],
                                                  &hash_index);
 
@@ -4716,7 +4587,7 @@ copy_object ()
                    {
                      Size_t len = strlen (str);
                      shash_t *shash_ptr = hash_string (str,
                    {
                      Size_t len = strlen (str);
                      shash_t *shash_ptr = hash_string (str,
-                                                       (Ptrdiff_t)len,
+                                                       (Ptrdiff_t) len,
                                                        &orig_str_hash[0],
                                                        (symint_t *) 0);
 
                                                        &orig_str_hash[0],
                                                        (symint_t *) 0);
 
@@ -4746,7 +4617,7 @@ copy_object ()
          char *str = ORIG_LSTRS (fd_ptr->issBase + proc_sym->iss);
          Size_t len = strlen (str);
          shash_t *shash_ptr = hash_string (str,
          char *str = ORIG_LSTRS (fd_ptr->issBase + proc_sym->iss);
          Size_t len = strlen (str);
          shash_t *shash_ptr = hash_string (str,
-                                           (Ptrdiff_t)len,
+                                           (Ptrdiff_t) len,
                                            &orig_str_hash[0],
                                            (symint_t *) 0);
 
                                            &orig_str_hash[0],
                                            (symint_t *) 0);
 
@@ -4781,12 +4652,12 @@ copy_object ()
       num_write
        = (remaining <= (int) sizeof (buffer))
          ? remaining : (int) sizeof (buffer);
       num_write
        = (remaining <= (int) sizeof (buffer))
          ? remaining : (int) sizeof (buffer);
-      sys_read = fread ((PTR) buffer, 1, num_write, obj_in_stream);
+      sys_read = fread (buffer, 1, num_write, obj_in_stream);
       if (sys_read <= 0)
        pfatal_with_name (obj_in_name);
 
       else if (sys_read != num_write)
       if (sys_read <= 0)
        pfatal_with_name (obj_in_name);
 
       else if (sys_read != num_write)
-       fatal ("Wanted to read %d bytes from %s, system returned %d",
+       fatal ("wanted to read %d bytes from %s, system returned %d",
               num_write,
               obj_in_name,
               sys_read);
               num_write,
               obj_in_name,
               sys_read);
@@ -4796,7 +4667,7 @@ copy_object ()
        pfatal_with_name (object_name);
 
       else if (sys_write != num_write)
        pfatal_with_name (object_name);
 
       else if (sys_write != num_write)
-       fatal ("Wrote %d bytes to %s, system returned %d",
+       fatal ("wrote %d bytes to %s, system returned %d",
               num_write,
               object_name,
               sys_write);
               num_write,
               object_name,
               sys_write);
@@ -4806,12 +4677,10 @@ copy_object ()
 \f
 /* Ye olde main program.  */
 
 \f
 /* Ye olde main program.  */
 
-extern int main PARAMS ((int, char **));
+extern int main (int, char **);
 
 int
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
 {
   int iflag = 0;
   char *p = strrchr (argv[0], '/');
 {
   int iflag = 0;
   char *p = strrchr (argv[0], '/');
@@ -4827,12 +4696,12 @@ main (argc, argv)
 
 #if !defined(__SABER__) && !defined(lint)
   if (sizeof (efdr_t) > PAGE_USIZE)
 
 #if !defined(__SABER__) && !defined(lint)
   if (sizeof (efdr_t) > PAGE_USIZE)
-    fatal ("Efdr_t has a sizeof %d bytes, when it should be less than %d",
+    fatal ("efdr_t has a sizeof %d bytes, when it should be less than %d",
           (int) sizeof (efdr_t),
           (int) PAGE_USIZE);
 
   if (sizeof (page_t) != PAGE_USIZE)
           (int) sizeof (efdr_t),
           (int) PAGE_USIZE);
 
   if (sizeof (page_t) != PAGE_USIZE)
-    fatal ("Page_t has a sizeof %d bytes, when it should be %d",
+    fatal ("page_t has a sizeof %d bytes, when it should be %d",
           (int) sizeof (page_t),
           (int) PAGE_USIZE);
 
           (int) sizeof (page_t),
           (int) PAGE_USIZE);
 
@@ -4854,7 +4723,7 @@ main (argc, argv)
   void_type_info = type_info_init;
   void_type_info.basic_type = bt_Void;
 
   void_type_info = type_info_init;
   void_type_info.basic_type = bt_Void;
 
-  while ((option = getopt (argc, argv, "d:i:I:o:v")) != EOF)
+  while ((option = getopt_long (argc, argv, "d:i:I:o:v", options, NULL)) != -1)
     switch (option)
       {
       default:
     switch (option)
       {
       default:
@@ -4863,7 +4732,7 @@ main (argc, argv)
 
       case 'd':
        debug = strtol (optarg, &num_end, 0);
 
       case 'd':
        debug = strtol (optarg, &num_end, 0);
-       if ((unsigned)debug > 4 || num_end == optarg)
+       if ((unsigned) debug > 4 || num_end == optarg)
          had_errors++;
 
        break;
          had_errors++;
 
        break;
@@ -4874,7 +4743,7 @@ main (argc, argv)
        else
          rename_output = 1;
 
        else
          rename_output = 1;
 
-       /* fall through to 'i' case.  */
+       /* Fall through to 'i' case.  */
 
       case 'i':
        if (obj_in_name == (char *) 0)
 
       case 'i':
        if (obj_in_name == (char *) 0)
@@ -4894,10 +4763,24 @@ main (argc, argv)
        break;
 
       case 'v':
        break;
 
       case 'v':
+       verbose++;
+       break;
+
+      case 'V':
        version++;
        break;
       }
 
        version++;
        break;
       }
 
+  if (version)
+    {
+      printf (_("mips-tfile (GCC) %s\n"), version_string);
+      fputs ("Copyright (C) 2004 Free Software Foundation, Inc.\n", stdout);
+      fputs (_("This is free software; see the source for copying conditions.  There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
+            stdout);
+      exit (0);
+    }
+
   if (obj_in_name == (char *) 0 && optind <= argc - 2)
     obj_in_name = argv[--argc];
 
   if (obj_in_name == (char *) 0 && optind <= argc - 2)
     obj_in_name = argv[--argc];
 
@@ -4907,13 +4790,25 @@ main (argc, argv)
   /* If there is an output name, but no input name use
      the same file for both, deleting the name between
      opening it for input and opening it for output.  */
   /* If there is an output name, but no input name use
      the same file for both, deleting the name between
      opening it for input and opening it for output.  */
-  if (obj_in_name == (char *) 0 && object_name != (char *)0)
+  if (obj_in_name == (char *) 0 && object_name != (char *) 0)
     {
       obj_in_name = object_name;
       delete_input = 1;
     }
 
     {
       obj_in_name = object_name;
       delete_input = 1;
     }
 
-  if (object_name == (char *) 0 || had_errors || optind != argc - 1)
+  if (optind != argc - 1)
+    had_errors++;
+
+  if (verbose || had_errors)
+    {
+      fprintf (stderr, _("mips-tfile (GCC) %s"), version_string);
+#ifdef TARGET_VERSION
+      TARGET_VERSION;
+#endif
+      fputc ('\n', stderr);
+    }
+
+  if (object_name == (char *) 0 || had_errors)
     {
       fprintf (stderr, _("Calling Sequence:\n"));
       fprintf (stderr, _("\tmips-tfile [-d <num>] [-v] [-i <o-in-file>] -o <o-out-file> <s-file> (or)\n"));
     {
       fprintf (stderr, _("Calling Sequence:\n"));
       fprintf (stderr, _("\tmips-tfile [-d <num>] [-v] [-i <o-in-file>] -o <o-out-file> <s-file> (or)\n"));
@@ -4928,16 +4823,6 @@ main (argc, argv)
       return 1;
     }
 
       return 1;
     }
 
-
-  if (version)
-    {
-      fprintf (stderr, _("mips-tfile version %s"), version_string);
-#ifdef TARGET_VERSION
-      TARGET_VERSION;
-#endif
-      fputc ('\n', stderr);
-    }
-
   if (obj_in_name == (char *) 0)
     obj_in_name = object_name;
 
   if (obj_in_name == (char *) 0)
     obj_in_name = object_name;
 
@@ -4968,7 +4853,7 @@ main (argc, argv)
            fatal ("wrote %d bytes to %s, expected to write %d", len2, obj_in_name, len);
        }
 
            fatal ("wrote %d bytes to %s, expected to write %d", len2, obj_in_name, len);
        }
 
-      free_multiple_pages ((page_t *)buffer, 4);
+      free_multiple_pages ((page_t *) buffer, 4);
 
       if (len < 0)
        pfatal_with_name (object_name);
 
       if (len < 0)
        pfatal_with_name (object_name);
@@ -5009,7 +4894,7 @@ main (argc, argv)
   if (debug)
     {
       fprintf (stderr, "\n\tAllocation summary:\n\n");
   if (debug)
     {
       fprintf (stderr, "\n\tAllocation summary:\n\n");
-      for (i = (int)alloc_type_none; i < (int)alloc_type_last; i++)
+      for (i = (int) alloc_type_none; i < (int) alloc_type_last; i++)
        if (alloc_counts[i].total_alloc)
          {
            fprintf (stderr,
        if (alloc_counts[i].total_alloc)
          {
            fprintf (stderr,
@@ -5028,19 +4913,17 @@ main (argc, argv)
 /* Catch a signal and exit without dumping core.  */
 
 STATIC void
 /* Catch a signal and exit without dumping core.  */
 
 STATIC void
-catch_signal (signum)
-     int signum;
+catch_signal (int signum)
 {
   (void) signal (signum, SIG_DFL);     /* just in case...  */
 {
   (void) signal (signum, SIG_DFL);     /* just in case...  */
-  fatal ("%s", strsignal(signum));
+  fatal ("%s", strsignal (signum));
 }
 
 /* Print a fatal error message.  NAME is the text.
    Also include a system error message based on `errno'.  */
 
 void
 }
 
 /* Print a fatal error message.  NAME is the text.
    Also include a system error message based on `errno'.  */
 
 void
-pfatal_with_name (msg)
-  const char *msg;
+pfatal_with_name (const char *msg)
 {
   int save_errno = errno;              /* just in case....  */
   if (line_number > 0)
 {
   int save_errno = errno;              /* just in case....  */
   if (line_number > 0)
@@ -5063,11 +4946,10 @@ pfatal_with_name (msg)
    ORIG_xxx macros, but the function never returns.  */
 
 static int
    ORIG_xxx macros, but the function never returns.  */
 
 static int
-out_of_bounds (indx, max, str, prog_line)
-     symint_t indx;            /* index that is out of bounds */
-     symint_t max;             /* maximum index */
-     const char *str;          /* string to print out */
-     int prog_line;            /* line number within mips-tfile.c */
+out_of_bounds (symint_t indx,  /* index that is out of bounds */
+              symint_t max,    /* maximum index */
+              const char *str, /* string to print out */
+              int prog_line)   /* line number within mips-tfile.c */
 {
   if (indx < max)              /* just in case */
     return 0;
 {
   if (indx < max)              /* just in case */
     return 0;
@@ -5088,10 +4970,9 @@ out_of_bounds (indx, max, str, prog_line)
 #ifdef USE_MALLOC
 
 STATIC page_t *
 #ifdef USE_MALLOC
 
 STATIC page_t *
-allocate_cluster (npages)
-     Size_t npages;
+allocate_cluster (Size_t npages)
 {
 {
-  page_t *value = (page_t *) xcalloc (npages, PAGE_USIZE);
+  page_t *value = xcalloc (npages, PAGE_USIZE);
 
   if (debug > 3)
     fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value);
 
   if (debug > 3)
     fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value);
@@ -5102,8 +4983,7 @@ allocate_cluster (npages)
 #else /* USE_MALLOC */
 
 STATIC page_t *
 #else /* USE_MALLOC */
 
 STATIC page_t *
-allocate_cluster (npages)
-     Size_t npages;
+allocate_cluster (Size_t npages)
 {
   page_t *ptr = (page_t *) sbrk (0);   /* current sbreak */
   unsigned long offset = ((unsigned long) ptr) & (PAGE_SIZE - 1);
 {
   page_t *ptr = (page_t *) sbrk (0);   /* current sbreak */
   unsigned long offset = ((unsigned long) ptr) & (PAGE_SIZE - 1);
@@ -5113,19 +4993,15 @@ allocate_cluster (npages)
       if (sbrk (PAGE_USIZE - offset) == (char *)-1)
        pfatal_with_name ("allocate_cluster");
 
       if (sbrk (PAGE_USIZE - offset) == (char *)-1)
        pfatal_with_name ("allocate_cluster");
 
-      ptr = (page_t *) (((char *)ptr) + PAGE_SIZE - offset);
+      ptr = (page_t *) (((char *) ptr) + PAGE_SIZE - offset);
     }
 
     }
 
-  if (sbrk (npages * PAGE_USIZE) == (char *)-1)
+  if (sbrk (npages * PAGE_USIZE) == (char *) -1)
     pfatal_with_name ("allocate_cluster");
 
   if (debug > 3)
     pfatal_with_name ("allocate_cluster");
 
   if (debug > 3)
-    {
-      fprintf (stderr, "\talloc\tnpages = %lu, value = ",
-              (unsigned long) npages);
-      fprintf (stderr, HOST_PTR_PRINTF, (PTR) ptr);
-      fputs ("\n", stderr);
-    }
+    fprintf (stderr, "\talloc\tnpages = %lu, value = " HOST_PTR_PRINTF "\n",
+            (unsigned long) npages, (void *) ptr);
 
   return ptr;
 }
 
   return ptr;
 }
@@ -5142,8 +5018,7 @@ static unsigned    pages_left     = 0;
 /* Allocate some pages (which is initialized to 0).  */
 
 STATIC page_t *
 /* Allocate some pages (which is initialized to 0).  */
 
 STATIC page_t *
-allocate_multiple_pages (npages)
-     Size_t npages;
+allocate_multiple_pages (Size_t npages)
 {
 #ifndef MALLOC_CHECK
   if (pages_left == 0 && npages < MAX_CLUSTER_PAGES)
 {
 #ifndef MALLOC_CHECK
   if (pages_left == 0 && npages < MAX_CLUSTER_PAGES)
@@ -5163,7 +5038,7 @@ allocate_multiple_pages (npages)
   return allocate_cluster (npages);
 
 #else  /* MALLOC_CHECK */
   return allocate_cluster (npages);
 
 #else  /* MALLOC_CHECK */
-  return (page_t *) xcalloc (npages, PAGE_SIZE);
+  return xcalloc (npages, PAGE_SIZE);
 
 #endif /* MALLOC_CHECK */
 }
 
 #endif /* MALLOC_CHECK */
 }
@@ -5172,9 +5047,7 @@ allocate_multiple_pages (npages)
 /* Release some pages.  */
 
 STATIC void
 /* Release some pages.  */
 
 STATIC void
-free_multiple_pages (page_ptr, npages)
-     page_t *page_ptr;
-     Size_t npages;
+free_multiple_pages (page_t *page_ptr, Size_t npages)
 {
 #ifndef MALLOC_CHECK
   if (pages_left == 0)
 {
 #ifndef MALLOC_CHECK
   if (pages_left == 0)
@@ -5194,7 +5067,7 @@ free_multiple_pages (page_ptr, npages)
      the free pages is done right after an allocate.  */
 
 #else  /* MALLOC_CHECK */
      the free pages is done right after an allocate.  */
 
 #else  /* MALLOC_CHECK */
-  free ((char *) page_ptr);
+  free (page_ptr);
 
 #endif /* MALLOC_CHECK */
 }
 
 #endif /* MALLOC_CHECK */
 }
@@ -5203,7 +5076,7 @@ free_multiple_pages (page_ptr, npages)
 /* Allocate one page (which is initialized to 0).  */
 
 STATIC page_t *
 /* Allocate one page (which is initialized to 0).  */
 
 STATIC page_t *
-allocate_page ()
+allocate_page (void)
 {
 #ifndef MALLOC_CHECK
   if (pages_left == 0)
 {
 #ifndef MALLOC_CHECK
   if (pages_left == 0)
@@ -5216,7 +5089,7 @@ allocate_page ()
   return cluster_ptr++;
 
 #else  /* MALLOC_CHECK */
   return cluster_ptr++;
 
 #else  /* MALLOC_CHECK */
-  return (page_t *) xcalloc (1, PAGE_SIZE);
+  return xcalloc (1, PAGE_SIZE);
 
 #endif /* MALLOC_CHECK */
 }
 
 #endif /* MALLOC_CHECK */
 }
@@ -5225,38 +5098,38 @@ allocate_page ()
 /* Allocate scoping information.  */
 
 STATIC scope_t *
 /* Allocate scoping information.  */
 
 STATIC scope_t *
-allocate_scope ()
+allocate_scope (void)
 {
   scope_t *ptr;
   static scope_t initial_scope;
 
 #ifndef MALLOC_CHECK
 {
   scope_t *ptr;
   static scope_t initial_scope;
 
 #ifndef MALLOC_CHECK
-  ptr = alloc_counts[ (int)alloc_type_scope ].free_list.f_scope;
+  ptr = alloc_counts[ (int) alloc_type_scope ].free_list.f_scope;
   if (ptr != (scope_t *) 0)
   if (ptr != (scope_t *) 0)
-    alloc_counts[ (int)alloc_type_scope ].free_list.f_scope = ptr->free;
+    alloc_counts[ (int) alloc_type_scope ].free_list.f_scope = ptr->free;
 
   else
     {
 
   else
     {
-      int unallocated  = alloc_counts[ (int)alloc_type_scope ].unallocated;
-      page_t *cur_page = alloc_counts[ (int)alloc_type_scope ].cur_page;
+      int unallocated  = alloc_counts[ (int) alloc_type_scope ].unallocated;
+      page_t *cur_page = alloc_counts[ (int) alloc_type_scope ].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (scope_t);
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (scope_t);
-         alloc_counts[ (int)alloc_type_scope ].cur_page = cur_page = allocate_page ();
-         alloc_counts[ (int)alloc_type_scope ].total_pages++;
+         alloc_counts[ (int) alloc_type_scope ].cur_page = cur_page = allocate_page ();
+         alloc_counts[ (int) alloc_type_scope ].total_pages++;
        }
 
       ptr = &cur_page->scope[ --unallocated ];
        }
 
       ptr = &cur_page->scope[ --unallocated ];
-      alloc_counts[ (int)alloc_type_scope ].unallocated = unallocated;
+      alloc_counts[ (int) alloc_type_scope ].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
-  ptr = (scope_t *) xmalloc (sizeof (scope_t));
+  ptr = xmalloc (sizeof (scope_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_scope ].total_alloc++;
+  alloc_counts[ (int) alloc_type_scope ].total_alloc++;
   *ptr = initial_scope;
   return ptr;
 }
   *ptr = initial_scope;
   return ptr;
 }
@@ -5264,17 +5137,16 @@ allocate_scope ()
 /* Free scoping information.  */
 
 STATIC void
 /* Free scoping information.  */
 
 STATIC void
-free_scope (ptr)
-     scope_t *ptr;
+free_scope (scope_t *ptr)
 {
 {
-  alloc_counts[ (int)alloc_type_scope ].total_free++;
+  alloc_counts[ (int) alloc_type_scope ].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[ (int)alloc_type_scope ].free_list.f_scope;
-  alloc_counts[ (int)alloc_type_scope ].free_list.f_scope = ptr;
+  ptr->free = alloc_counts[ (int) alloc_type_scope ].free_list.f_scope;
+  alloc_counts[ (int) alloc_type_scope ].free_list.f_scope = ptr;
 
 #else
 
 #else
-  free ((PTR) ptr);
+  free (ptr);
 #endif
 
 }
 #endif
 
 }
@@ -5283,31 +5155,31 @@ free_scope (ptr)
 /* Allocate links for pages in a virtual array.  */
 
 STATIC vlinks_t *
 /* Allocate links for pages in a virtual array.  */
 
 STATIC vlinks_t *
-allocate_vlinks ()
+allocate_vlinks (void)
 {
   vlinks_t *ptr;
   static vlinks_t initial_vlinks;
 
 #ifndef MALLOC_CHECK
 {
   vlinks_t *ptr;
   static vlinks_t initial_vlinks;
 
 #ifndef MALLOC_CHECK
-  int unallocated      = alloc_counts[ (int)alloc_type_vlinks ].unallocated;
-  page_t *cur_page     = alloc_counts[ (int)alloc_type_vlinks ].cur_page;
+  int unallocated      = alloc_counts[ (int) alloc_type_vlinks ].unallocated;
+  page_t *cur_page     = alloc_counts[ (int) alloc_type_vlinks ].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (vlinks_t);
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (vlinks_t);
-      alloc_counts[ (int)alloc_type_vlinks ].cur_page = cur_page = allocate_page ();
-      alloc_counts[ (int)alloc_type_vlinks ].total_pages++;
+      alloc_counts[ (int) alloc_type_vlinks ].cur_page = cur_page = allocate_page ();
+      alloc_counts[ (int) alloc_type_vlinks ].total_pages++;
     }
 
   ptr = &cur_page->vlinks[ --unallocated ];
     }
 
   ptr = &cur_page->vlinks[ --unallocated ];
-  alloc_counts[ (int)alloc_type_vlinks ].unallocated = unallocated;
+  alloc_counts[ (int) alloc_type_vlinks ].unallocated = unallocated;
 
 #else
 
 #else
-  ptr = (vlinks_t *) xmalloc (sizeof (vlinks_t));
+  ptr = xmalloc (sizeof (vlinks_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_vlinks ].total_alloc++;
+  alloc_counts[ (int) alloc_type_vlinks ].total_alloc++;
   *ptr = initial_vlinks;
   return ptr;
 }
   *ptr = initial_vlinks;
   return ptr;
 }
@@ -5316,31 +5188,31 @@ allocate_vlinks ()
 /* Allocate string hash buckets.  */
 
 STATIC shash_t *
 /* Allocate string hash buckets.  */
 
 STATIC shash_t *
-allocate_shash ()
+allocate_shash (void)
 {
   shash_t *ptr;
   static shash_t initial_shash;
 
 #ifndef MALLOC_CHECK
 {
   shash_t *ptr;
   static shash_t initial_shash;
 
 #ifndef MALLOC_CHECK
-  int unallocated      = alloc_counts[ (int)alloc_type_shash ].unallocated;
-  page_t *cur_page     = alloc_counts[ (int)alloc_type_shash ].cur_page;
+  int unallocated      = alloc_counts[ (int) alloc_type_shash ].unallocated;
+  page_t *cur_page     = alloc_counts[ (int) alloc_type_shash ].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (shash_t);
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (shash_t);
-      alloc_counts[ (int)alloc_type_shash ].cur_page = cur_page = allocate_page ();
-      alloc_counts[ (int)alloc_type_shash ].total_pages++;
+      alloc_counts[ (int) alloc_type_shash ].cur_page = cur_page = allocate_page ();
+      alloc_counts[ (int) alloc_type_shash ].total_pages++;
     }
 
   ptr = &cur_page->shash[ --unallocated ];
     }
 
   ptr = &cur_page->shash[ --unallocated ];
-  alloc_counts[ (int)alloc_type_shash ].unallocated = unallocated;
+  alloc_counts[ (int) alloc_type_shash ].unallocated = unallocated;
 
 #else
 
 #else
-  ptr = (shash_t *) xmalloc (sizeof (shash_t));
+  ptr = xmalloc (sizeof (shash_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_shash ].total_alloc++;
+  alloc_counts[ (int) alloc_type_shash ].total_alloc++;
   *ptr = initial_shash;
   return ptr;
 }
   *ptr = initial_shash;
   return ptr;
 }
@@ -5349,31 +5221,31 @@ allocate_shash ()
 /* Allocate type hash buckets.  */
 
 STATIC thash_t *
 /* Allocate type hash buckets.  */
 
 STATIC thash_t *
-allocate_thash ()
+allocate_thash (void)
 {
   thash_t *ptr;
   static thash_t initial_thash;
 
 #ifndef MALLOC_CHECK
 {
   thash_t *ptr;
   static thash_t initial_thash;
 
 #ifndef MALLOC_CHECK
-  int unallocated      = alloc_counts[ (int)alloc_type_thash ].unallocated;
-  page_t *cur_page     = alloc_counts[ (int)alloc_type_thash ].cur_page;
+  int unallocated      = alloc_counts[ (int) alloc_type_thash ].unallocated;
+  page_t *cur_page     = alloc_counts[ (int) alloc_type_thash ].cur_page;
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (thash_t);
 
   if (unallocated == 0)
     {
       unallocated = PAGE_SIZE / sizeof (thash_t);
-      alloc_counts[ (int)alloc_type_thash ].cur_page = cur_page = allocate_page ();
-      alloc_counts[ (int)alloc_type_thash ].total_pages++;
+      alloc_counts[ (int) alloc_type_thash ].cur_page = cur_page = allocate_page ();
+      alloc_counts[ (int) alloc_type_thash ].total_pages++;
     }
 
   ptr = &cur_page->thash[ --unallocated ];
     }
 
   ptr = &cur_page->thash[ --unallocated ];
-  alloc_counts[ (int)alloc_type_thash ].unallocated = unallocated;
+  alloc_counts[ (int) alloc_type_thash ].unallocated = unallocated;
 
 #else
 
 #else
-  ptr = (thash_t *) xmalloc (sizeof (thash_t));
+  ptr = xmalloc (sizeof (thash_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_thash ].total_alloc++;
+  alloc_counts[ (int) alloc_type_thash ].total_alloc++;
   *ptr = initial_thash;
   return ptr;
 }
   *ptr = initial_thash;
   return ptr;
 }
@@ -5382,38 +5254,38 @@ allocate_thash ()
 /* Allocate structure, union, or enum tag information.  */
 
 STATIC tag_t *
 /* Allocate structure, union, or enum tag information.  */
 
 STATIC tag_t *
-allocate_tag ()
+allocate_tag (void)
 {
   tag_t *ptr;
   static tag_t initial_tag;
 
 #ifndef MALLOC_CHECK
 {
   tag_t *ptr;
   static tag_t initial_tag;
 
 #ifndef MALLOC_CHECK
-  ptr = alloc_counts[ (int)alloc_type_tag ].free_list.f_tag;
+  ptr = alloc_counts[ (int) alloc_type_tag ].free_list.f_tag;
   if (ptr != (tag_t *) 0)
   if (ptr != (tag_t *) 0)
-    alloc_counts[ (int)alloc_type_tag ].free_list.f_tag = ptr->free;
+    alloc_counts[ (int) alloc_type_tag ].free_list.f_tag = ptr->free;
 
   else
     {
 
   else
     {
-      int unallocated  = alloc_counts[ (int)alloc_type_tag ].unallocated;
-      page_t *cur_page = alloc_counts[ (int)alloc_type_tag ].cur_page;
+      int unallocated  = alloc_counts[ (int) alloc_type_tag ].unallocated;
+      page_t *cur_page = alloc_counts[ (int) alloc_type_tag ].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (tag_t);
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (tag_t);
-         alloc_counts[ (int)alloc_type_tag ].cur_page = cur_page = allocate_page ();
-         alloc_counts[ (int)alloc_type_tag ].total_pages++;
+         alloc_counts[ (int) alloc_type_tag ].cur_page = cur_page = allocate_page ();
+         alloc_counts[ (int) alloc_type_tag ].total_pages++;
        }
 
       ptr = &cur_page->tag[ --unallocated ];
        }
 
       ptr = &cur_page->tag[ --unallocated ];
-      alloc_counts[ (int)alloc_type_tag ].unallocated = unallocated;
+      alloc_counts[ (int) alloc_type_tag ].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
-  ptr = (tag_t *) xmalloc (sizeof (tag_t));
+  ptr = xmalloc (sizeof (tag_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_tag ].total_alloc++;
+  alloc_counts[ (int) alloc_type_tag ].total_alloc++;
   *ptr = initial_tag;
   return ptr;
 }
   *ptr = initial_tag;
   return ptr;
 }
@@ -5421,17 +5293,16 @@ allocate_tag ()
 /* Free scoping information.  */
 
 STATIC void
 /* Free scoping information.  */
 
 STATIC void
-free_tag (ptr)
-     tag_t *ptr;
+free_tag (tag_t *ptr)
 {
 {
-  alloc_counts[ (int)alloc_type_tag ].total_free++;
+  alloc_counts[ (int) alloc_type_tag ].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[ (int)alloc_type_tag ].free_list.f_tag;
-  alloc_counts[ (int)alloc_type_tag ].free_list.f_tag = ptr;
+  ptr->free = alloc_counts[ (int) alloc_type_tag ].free_list.f_tag;
+  alloc_counts[ (int) alloc_type_tag ].free_list.f_tag = ptr;
 
 #else
 
 #else
-  free ((PTR) ptr);
+  free (ptr);
 #endif
 
 }
 #endif
 
 }
@@ -5440,38 +5311,38 @@ free_tag (ptr)
 /* Allocate forward reference to a yet unknown tag.  */
 
 STATIC forward_t *
 /* Allocate forward reference to a yet unknown tag.  */
 
 STATIC forward_t *
-allocate_forward ()
+allocate_forward (void)
 {
   forward_t *ptr;
   static forward_t initial_forward;
 
 #ifndef MALLOC_CHECK
 {
   forward_t *ptr;
   static forward_t initial_forward;
 
 #ifndef MALLOC_CHECK
-  ptr = alloc_counts[ (int)alloc_type_forward ].free_list.f_forward;
+  ptr = alloc_counts[ (int) alloc_type_forward ].free_list.f_forward;
   if (ptr != (forward_t *) 0)
   if (ptr != (forward_t *) 0)
-    alloc_counts[ (int)alloc_type_forward ].free_list.f_forward = ptr->free;
+    alloc_counts[ (int) alloc_type_forward ].free_list.f_forward = ptr->free;
 
   else
     {
 
   else
     {
-      int unallocated  = alloc_counts[ (int)alloc_type_forward ].unallocated;
-      page_t *cur_page = alloc_counts[ (int)alloc_type_forward ].cur_page;
+      int unallocated  = alloc_counts[ (int) alloc_type_forward ].unallocated;
+      page_t *cur_page = alloc_counts[ (int) alloc_type_forward ].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (forward_t);
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (forward_t);
-         alloc_counts[ (int)alloc_type_forward ].cur_page = cur_page = allocate_page ();
-         alloc_counts[ (int)alloc_type_forward ].total_pages++;
+         alloc_counts[ (int) alloc_type_forward ].cur_page = cur_page = allocate_page ();
+         alloc_counts[ (int) alloc_type_forward ].total_pages++;
        }
 
       ptr = &cur_page->forward[ --unallocated ];
        }
 
       ptr = &cur_page->forward[ --unallocated ];
-      alloc_counts[ (int)alloc_type_forward ].unallocated = unallocated;
+      alloc_counts[ (int) alloc_type_forward ].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
-  ptr = (forward_t *) xmalloc (sizeof (forward_t));
+  ptr = xmalloc (sizeof (forward_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_forward ].total_alloc++;
+  alloc_counts[ (int) alloc_type_forward ].total_alloc++;
   *ptr = initial_forward;
   return ptr;
 }
   *ptr = initial_forward;
   return ptr;
 }
@@ -5479,17 +5350,16 @@ allocate_forward ()
 /* Free scoping information.  */
 
 STATIC void
 /* Free scoping information.  */
 
 STATIC void
-free_forward (ptr)
-     forward_t *ptr;
+free_forward (forward_t *ptr)
 {
 {
-  alloc_counts[ (int)alloc_type_forward ].total_free++;
+  alloc_counts[ (int) alloc_type_forward ].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #ifndef MALLOC_CHECK
-  ptr->free = alloc_counts[ (int)alloc_type_forward ].free_list.f_forward;
-  alloc_counts[ (int)alloc_type_forward ].free_list.f_forward = ptr;
+  ptr->free = alloc_counts[ (int) alloc_type_forward ].free_list.f_forward;
+  alloc_counts[ (int) alloc_type_forward ].free_list.f_forward = ptr;
 
 #else
 
 #else
-  free ((PTR) ptr);
+  free (ptr);
 #endif
 
 }
 #endif
 
 }
@@ -5498,38 +5368,38 @@ free_forward (ptr)
 /* Allocate head of type hash list.  */
 
 STATIC thead_t *
 /* Allocate head of type hash list.  */
 
 STATIC thead_t *
-allocate_thead ()
+allocate_thead (void)
 {
   thead_t *ptr;
   static thead_t initial_thead;
 
 #ifndef MALLOC_CHECK
 {
   thead_t *ptr;
   static thead_t initial_thead;
 
 #ifndef MALLOC_CHECK
-  ptr = alloc_counts[ (int)alloc_type_thead ].free_list.f_thead;
+  ptr = alloc_counts[ (int) alloc_type_thead ].free_list.f_thead;
   if (ptr != (thead_t *) 0)
   if (ptr != (thead_t *) 0)
-    alloc_counts[ (int)alloc_type_thead ].free_list.f_thead = ptr->free;
+    alloc_counts[ (int) alloc_type_thead ].free_list.f_thead = ptr->free;
 
   else
     {
 
   else
     {
-      int unallocated  = alloc_counts[ (int)alloc_type_thead ].unallocated;
-      page_t *cur_page = alloc_counts[ (int)alloc_type_thead ].cur_page;
+      int unallocated  = alloc_counts[ (int) alloc_type_thead ].unallocated;
+      page_t *cur_page = alloc_counts[ (int) alloc_type_thead ].cur_page;
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (thead_t);
 
       if (unallocated == 0)
        {
          unallocated = PAGE_SIZE / sizeof (thead_t);
-         alloc_counts[ (int)alloc_type_thead ].cur_page = cur_page = allocate_page ();
-         alloc_counts[ (int)alloc_type_thead ].total_pages++;
+         alloc_counts[ (int) alloc_type_thead ].cur_page = cur_page = allocate_page ();
+         alloc_counts[ (int) alloc_type_thead ].total_pages++;
        }
 
       ptr = &cur_page->thead[ --unallocated ];
        }
 
       ptr = &cur_page->thead[ --unallocated ];
-      alloc_counts[ (int)alloc_type_thead ].unallocated = unallocated;
+      alloc_counts[ (int) alloc_type_thead ].unallocated = unallocated;
     }
 
 #else
     }
 
 #else
-  ptr = (thead_t *) xmalloc (sizeof (thead_t));
+  ptr = xmalloc (sizeof (thead_t));
 
 #endif
 
 
 #endif
 
-  alloc_counts[ (int)alloc_type_thead ].total_alloc++;
+  alloc_counts[ (int) alloc_type_thead ].total_alloc++;
   *ptr = initial_thead;
   return ptr;
 }
   *ptr = initial_thead;
   return ptr;
 }
@@ -5537,17 +5407,16 @@ allocate_thead ()
 /* Free scoping information.  */
 
 STATIC void
 /* Free scoping information.  */
 
 STATIC void
-free_thead (ptr)
-     thead_t *ptr;
+free_thead (thead_t *ptr)
 {
 {
-  alloc_counts[ (int)alloc_type_thead ].total_free++;
+  alloc_counts[ (int) alloc_type_thead ].total_free++;
 
 #ifndef MALLOC_CHECK
 
 #ifndef MALLOC_CHECK
-  ptr->free = (thead_t *) alloc_counts[ (int)alloc_type_thead ].free_list.f_thead;
-  alloc_counts[ (int)alloc_type_thead ].free_list.f_thead = ptr;
+  ptr->free = (thead_t *) alloc_counts[ (int) alloc_type_thead ].free_list.f_thead;
+  alloc_counts[ (int) alloc_type_thead ].free_list.f_thead = ptr;
 
 #else
 
 #else
-  free ((PTR) ptr);
+  free (ptr);
 #endif
 
 }
 #endif
 
 }
@@ -5555,14 +5424,14 @@ free_thead (ptr)
 #endif /* MIPS_DEBUGGING_INFO */
 
 \f
 #endif /* MIPS_DEBUGGING_INFO */
 
 \f
-/* Output an error message and exit */
+/* Output an error message and exit */
 
 
-/*VARARGS*/
 void
 void
-fatal VPARAMS ((const char *format, ...))
+fatal (const char *format, ...)
 {
 {
-  VA_OPEN (ap, format);
-  VA_FIXEDARG (ap, const char *, format);
+  va_list ap;
+
+  va_start (ap, format);
 
   if (line_number > 0)
     fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
 
   if (line_number > 0)
     fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
@@ -5570,7 +5439,7 @@ fatal VPARAMS ((const char *format, ...))
     fprintf (stderr, "%s:", progname);
 
   vfprintf (stderr, format, ap);
     fprintf (stderr, "%s:", progname);
 
   vfprintf (stderr, format, ap);
-  VA_CLOSE (ap);
+  va_end (ap);
   fprintf (stderr, "\n");
   if (line_number > 0)
     fprintf (stderr, "line:\t%s\n", cur_line_start);
   fprintf (stderr, "\n");
   if (line_number > 0)
     fprintf (stderr, "line:\t%s\n", cur_line_start);
@@ -5579,12 +5448,12 @@ fatal VPARAMS ((const char *format, ...))
   exit (1);
 }
 
   exit (1);
 }
 
-/*VARARGS*/
 void
 void
-error VPARAMS ((const char *format, ...))
+error (const char *format, ...)
 {
 {
-  VA_OPEN (ap, format);
-  VA_FIXEDARG (ap, char *, format);
+  va_list ap;
+
+  va_start (ap, format);
 
   if (line_number > 0)
     fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
 
   if (line_number > 0)
     fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
@@ -5597,7 +5466,7 @@ error VPARAMS ((const char *format, ...))
     fprintf (stderr, "line:\t%s\n", cur_line_start);
 
   had_errors++;
     fprintf (stderr, "line:\t%s\n", cur_line_start);
 
   had_errors++;
-  VA_CLOSE (ap);
+  va_end (ap);
 
   saber_stop ();
 }
 
   saber_stop ();
 }
@@ -5606,9 +5475,9 @@ error VPARAMS ((const char *format, ...))
    config.h can #define abort fancy_abort if you like that sort of thing.  */
 
 void
    config.h can #define abort fancy_abort if you like that sort of thing.  */
 
 void
-fancy_abort ()
+fancy_abort (void)
 {
 {
-  fatal ("Internal abort.");
+  fatal ("internal abort");
 }
 \f
 
 }
 \f
 
@@ -5616,8 +5485,7 @@ fancy_abort ()
    it calls this function to report clobberage.  */
 
 void
    it calls this function to report clobberage.  */
 
 void
-botch (s)
-     const char *s;
+botch (const char *s)
 {
   fatal ("%s", s);
 }
 {
   fatal ("%s", s);
 }