aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-03-12 02:37:56 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-03-12 02:37:56 +0000
commit45a647bee982216e27536ea8f9a23389c1a15369 (patch)
tree5156260a027e6de15817a1c12ce4d7f0e5eac149 /gcc
parentc7ca5912e35ee202df6d4ab8036e8d1671221f5c (diff)
downloadgcc-45a647bee982216e27536ea8f9a23389c1a15369.zip
gcc-45a647bee982216e27536ea8f9a23389c1a15369.tar.gz
gcc-45a647bee982216e27536ea8f9a23389c1a15369.tar.bz2
mips-tfile.c: Cast arg to PTR when specifier is HOST_PTR_PRINTF.
* mips-tfile.c: Cast arg to PTR when specifier is HOST_PTR_PRINTF. (__proto, PTR_T, CPTR_T): Delete, use PARAMS/PTR instead. (local_index, local_rindex): Delete, use strchr/strrchr instead. (copy_object): Fix format specifier vs argument mismatch. * mips-tdump.c: Make local functions static. (rindex): Don't #undef. (__proto, PTR_T, CPTR_T): Delete, use PARAMS/PTR instead. (fatal, fancy_abort): Delete. (read_seek): Avoid signed/unsigned compare. From-SVN: r40391
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/mips-tdump.c126
-rw-r--r--gcc/mips-tfile.c251
3 files changed, 163 insertions, 227 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8db93e9..1d0db81 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2001-03-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * mips-tfile.c: Cast arg to PTR when specifier is HOST_PTR_PRINTF.
+ (__proto, PTR_T, CPTR_T): Delete, use PARAMS/PTR instead.
+ (local_index, local_rindex): Delete, use strchr/strrchr instead.
+ (copy_object): Fix format specifier vs argument mismatch.
+
+ * mips-tdump.c: Make local functions static.
+ (rindex): Don't #undef.
+ (__proto, PTR_T, CPTR_T): Delete, use PARAMS/PTR instead.
+ (fatal, fancy_abort): Delete.
+ (read_seek): Avoid signed/unsigned compare.
+
Sun Mar 11 17:01:41 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* combine.c (try_combine): Fix error in change to try original
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index d56b6d6..b199468 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#ifdef index
#undef index
-#undef rindex
#endif
#ifndef CROSS_COMPILE
#include <a.out.h>
@@ -47,34 +46,11 @@ Boston, MA 02111-1307, USA. */
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
#endif
-#define __proto(x) PARAMS(x)
-typedef PTR PTR_T;
-typedef const PTR_T CPTR_T;
-
#define uchar unsigned char
#define ushort unsigned short
#define uint unsigned int
#define ulong unsigned long
-void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN;
-void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
-
-void
-fatal (s)
- const char *s;
-{
- fprintf (stderr, "%s\n", s);
- exit (FATAL_EXIT_CODE);
-}
-
-/* Due to size_t being defined in sys/types.h and different
- in stddef.h, we have to do this by hand..... Note, these
- types are correct for MIPS based systems, and may not be
- correct for other systems. */
-
-#define size_t uint
-#define ptrdiff_t int
-
/* Redefinition of storage classes as an enumeration for better
debugging. */
@@ -250,19 +226,19 @@ ulong *rfile_desc; /* relative file tables */
PDR *proc_desc; /* procedure tables */
/* Forward reference for functions. */
-PTR_T read_seek __proto((PTR_T, size_t, off_t, const char *));
-void read_tfile __proto((void));
-void print_global_hdr __proto((struct filehdr *));
-void print_sym_hdr __proto((HDRR *));
-void print_file_desc __proto((FDR *, int));
-void print_symbol __proto((SYMR *, int, char *, AUXU *, int, FDR *));
-void print_aux __proto((AUXU, int, int));
-void emit_aggregate __proto((char *, AUXU, AUXU, const char *, FDR *));
-const char *st_to_string __proto((st_t));
-const char *sc_to_string __proto((sc_t));
-const char *glevel_to_string __proto((glevel_t));
-const char *lang_to_string __proto((lang_t));
-const char *type_to_string __proto((AUXU *, int, FDR *));
+static PTR read_seek PARAMS ((PTR, size_t, off_t, const char *));
+static void read_tfile PARAMS ((void));
+static void print_global_hdr PARAMS ((struct filehdr *));
+static void print_sym_hdr PARAMS ((HDRR *));
+static void print_file_desc PARAMS ((FDR *, int));
+static void print_symbol PARAMS ((SYMR *, int, const char *, AUXU *, int, FDR *));
+static void print_aux PARAMS ((AUXU, int, int));
+static void emit_aggregate PARAMS ((char *, AUXU, AUXU, const char *, FDR *));
+static const char *st_to_string PARAMS ((st_t));
+static const char *sc_to_string PARAMS ((sc_t));
+static const char *glevel_to_string PARAMS ((glevel_t));
+static const char *lang_to_string PARAMS ((lang_t));
+static const char *type_to_string PARAMS ((AUXU *, int, FDR *));
extern char *optarg;
extern int optind;
@@ -279,9 +255,9 @@ struct {short code; char string[10];} stab_names[] = {
/* Read some bytes at a specified location, and return a pointer. */
-PTR_T
+static PTR
read_seek (ptr, size, offset, context)
- PTR_T ptr; /* pointer to buffer or NULL */
+ PTR ptr; /* pointer to buffer or NULL */
size_t size; /* # bytes to read */
off_t offset; /* offset to read at */
const char *context; /* context for error message */
@@ -291,15 +267,17 @@ read_seek (ptr, size, offset, context)
if (size == 0) /* nothing to read */
return ptr;
- if ((ptr == (PTR_T) 0 && (ptr = xmalloc (size)) == (PTR_T) 0)
- || (tfile_offset != offset && lseek (tfile_fd, offset, 0) == -1)
+ if (!ptr)
+ ptr = xmalloc (size);
+
+ if ((tfile_offset != offset && lseek (tfile_fd, offset, 0) == -1)
|| (read_size = read (tfile_fd, ptr, size)) < 0)
{
perror (context);
exit (1);
}
- if (read_size != size)
+ if (read_size != (long) size)
{
fprintf (stderr, "%s: read %ld bytes, expected %ld bytes\n",
context, read_size, (long) size);
@@ -313,7 +291,7 @@ read_seek (ptr, size, offset, context)
/* Convert language code to string format. */
-const char *
+static const char *
lang_to_string (lang)
lang_t lang;
{
@@ -336,7 +314,7 @@ lang_to_string (lang)
/* Convert storage class to string. */
-const char *
+static const char *
sc_to_string(storage_class)
sc_t storage_class;
{
@@ -374,7 +352,7 @@ sc_to_string(storage_class)
/* Convert symbol type to string. */
-const char *
+static const char *
st_to_string(symbol_type)
st_t symbol_type;
{
@@ -415,7 +393,7 @@ st_to_string(symbol_type)
/* Convert debug level to string. */
-const char *
+static const char *
glevel_to_string (g_level)
glevel_t g_level;
{
@@ -433,7 +411,7 @@ glevel_to_string (g_level)
/* Convert the type information to string format. */
-const char *
+static const char *
type_to_string (aux_ptr, index, fdp)
AUXU *aux_ptr;
int index;
@@ -746,7 +724,7 @@ type_to_string (aux_ptr, index, fdp)
/* Print out the global file header for object files. */
-void
+static void
print_global_hdr (ptr)
struct filehdr *ptr;
{
@@ -801,7 +779,7 @@ print_global_hdr (ptr)
/* Print out the symbolic header. */
-void
+static void
print_sym_hdr (sym_ptr)
HDRR *sym_ptr;
{
@@ -875,11 +853,11 @@ print_sym_hdr (sym_ptr)
/* Print out a symbol. */
-void
+static void
print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp)
SYMR *sym_ptr;
int number;
- char *strbase;
+ const char *strbase;
AUXU *aux_base;
int ifd;
FDR *fdp;
@@ -1054,7 +1032,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp)
/* Print out a word from the aux. table in various formats. */
-void
+static void
print_aux (u, auxi, used)
AUXU u;
int auxi;
@@ -1080,7 +1058,7 @@ print_aux (u, auxi, used)
/* Write aggregate information to a string. */
-void
+static void
emit_aggregate (string, u, u2, which, fdp)
char *string;
AUXU u;
@@ -1120,7 +1098,7 @@ emit_aggregate (string, u, u2, which, fdp)
/* Print out information about a file descriptor, and the symbols,
procedures, and line numbers within it. */
-void
+static void
print_file_desc (fdp, number)
FDR *fdp;
int number;
@@ -1348,18 +1326,18 @@ print_file_desc (fdp, number)
/* Read in the portions of the .T file that we will print out. */
-void
-read_tfile __proto((void))
+static void
+read_tfile ()
{
short magic;
off_t sym_hdr_offset = 0;
- (void) read_seek ((PTR_T) &magic, sizeof (magic), (off_t) 0, "Magic number");
+ (void) read_seek ((PTR) &magic, sizeof (magic), (off_t) 0, "Magic number");
if (!tfile)
{
/* Print out the global header, since this is not a T-file. */
- (void) read_seek ((PTR_T) &global_hdr, sizeof (global_hdr), (off_t) 0,
+ (void) read_seek ((PTR) &global_hdr, sizeof (global_hdr), (off_t) 0,
"Global file header");
print_global_hdr (&global_hdr);
@@ -1373,39 +1351,39 @@ read_tfile __proto((void))
sym_hdr_offset = global_hdr.f_symptr;
}
- (void) read_seek ((PTR_T) &sym_hdr,
+ (void) read_seek ((PTR) &sym_hdr,
sizeof (sym_hdr),
sym_hdr_offset,
"Symbolic header");
print_sym_hdr (&sym_hdr);
- lines = (LINER *) read_seek ((PTR_T) 0,
+ lines = (LINER *) read_seek (NULL_PTR,
sym_hdr.cbLine,
sym_hdr.cbLineOffset,
"Line numbers");
- dense_nums = (DNR *) read_seek ((PTR_T) 0,
+ dense_nums = (DNR *) read_seek (NULL_PTR,
sym_hdr.idnMax * sizeof (DNR),
sym_hdr.cbDnOffset,
"Dense numbers");
- proc_desc = (PDR *) read_seek ((PTR_T) 0,
+ proc_desc = (PDR *) read_seek (NULL_PTR,
sym_hdr.ipdMax * sizeof (PDR),
sym_hdr.cbPdOffset,
"Procedure tables");
- l_symbols = (SYMR *) read_seek ((PTR_T) 0,
+ l_symbols = (SYMR *) read_seek (NULL_PTR,
sym_hdr.isymMax * sizeof (SYMR),
sym_hdr.cbSymOffset,
"Local symbols");
- opt_symbols = (OPTR *) read_seek ((PTR_T) 0,
+ opt_symbols = (OPTR *) read_seek (NULL_PTR,
sym_hdr.ioptMax * sizeof (OPTR),
sym_hdr.cbOptOffset,
"Optimization symbols");
- aux_symbols = (AUXU *) read_seek ((PTR_T) 0,
+ aux_symbols = (AUXU *) read_seek (NULL_PTR,
sym_hdr.iauxMax * sizeof (AUXU),
sym_hdr.cbAuxOffset,
"Auxiliary symbols");
@@ -1413,27 +1391,27 @@ read_tfile __proto((void))
if (sym_hdr.iauxMax > 0)
aux_used = xcalloc (sym_hdr.iauxMax, 1);
- l_strings = (char *) read_seek ((PTR_T) 0,
+ l_strings = (char *) read_seek (NULL_PTR,
sym_hdr.issMax,
sym_hdr.cbSsOffset,
"Local string table");
- e_strings = (char *) read_seek ((PTR_T) 0,
+ e_strings = (char *) read_seek (NULL_PTR,
sym_hdr.issExtMax,
sym_hdr.cbSsExtOffset,
"External string table");
- file_desc = (FDR *) read_seek ((PTR_T) 0,
+ file_desc = (FDR *) read_seek (NULL_PTR,
sym_hdr.ifdMax * sizeof (FDR),
sym_hdr.cbFdOffset,
"File tables");
- rfile_desc = (ulong *) read_seek ((PTR_T) 0,
+ rfile_desc = (ulong *) read_seek (NULL_PTR,
sym_hdr.crfd * sizeof (ulong),
sym_hdr.cbRfdOffset,
"Relative file tables");
- e_symbols = (EXTR *) read_seek ((PTR_T) 0,
+ e_symbols = (EXTR *) read_seek (NULL_PTR,
sym_hdr.iextMax * sizeof (EXTR),
sym_hdr.cbExtOffset,
"External symbols");
@@ -1568,11 +1546,3 @@ main (argc, argv)
return 0;
}
-
-
-void
-fancy_abort ()
-{
- fprintf (stderr, "mips-tdump internal error");
- exit (1);
-}
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 38cd70c..d080493 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -613,10 +613,6 @@ Boston, MA 02111-1307, USA. */
#define __LINE__ 0
#endif
-#define __proto(x) PARAMS(x)
-typedef PTR PTR_T;
-typedef const PTR_T CPTR_T;
-
/* Due to size_t being defined in sys/types.h and different
in stddef.h, we have to do this by hand..... Note, these
types are correct for MIPS based systems, and may not be
@@ -636,9 +632,9 @@ typedef const PTR_T CPTR_T;
so they can't be static. */
extern void pfatal_with_name
- __proto((const char *)) ATTRIBUTE_NORETURN;
-extern void fancy_abort __proto((void)) ATTRIBUTE_NORETURN;
- void botch __proto((const char *)) ATTRIBUTE_NORETURN;
+ PARAMS ((const char *)) ATTRIBUTE_NORETURN;
+extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
+ void botch PARAMS ((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;
@@ -1615,28 +1611,28 @@ static char stabs_symbol[] = STABS_SYMBOL;
#define STATIC static
#endif
-STATIC int out_of_bounds __proto((symint_t, symint_t, const char *, int));
+STATIC int out_of_bounds PARAMS ((symint_t, symint_t, const char *, int));
-STATIC shash_t *hash_string __proto((const char *,
+STATIC shash_t *hash_string PARAMS ((const char *,
Ptrdiff_t,
shash_t **,
symint_t *));
-STATIC symint_t add_string __proto((varray_t *,
+STATIC symint_t add_string PARAMS ((varray_t *,
shash_t **,
const char *,
const char *,
shash_t **));
STATIC symint_t add_local_symbol
- __proto((const char *,
+ PARAMS ((const char *,
const char *,
st_t,
sc_t,
symint_t,
symint_t));
-STATIC symint_t add_ext_symbol __proto((const char *,
+STATIC symint_t add_ext_symbol PARAMS ((const char *,
const char *,
st_t,
sc_t,
@@ -1645,88 +1641,82 @@ STATIC symint_t add_ext_symbol __proto((const char *,
int));
STATIC symint_t add_aux_sym_symint
- __proto((symint_t));
+ PARAMS ((symint_t));
STATIC symint_t add_aux_sym_rndx
- __proto((int, symint_t));
+ PARAMS ((int, symint_t));
-STATIC symint_t add_aux_sym_tir __proto((type_info_t *,
+STATIC symint_t add_aux_sym_tir PARAMS ((type_info_t *,
hash_state_t,
thash_t **));
-STATIC tag_t * get_tag __proto((const char *,
+STATIC tag_t * get_tag PARAMS ((const char *,
const char *,
symint_t,
bt_t));
-STATIC void add_unknown_tag __proto((tag_t *));
+STATIC void add_unknown_tag PARAMS ((tag_t *));
-STATIC void add_procedure __proto((const char *,
+STATIC void add_procedure PARAMS ((const char *,
const char *));
-STATIC void add_file __proto((const char *,
+STATIC void add_file PARAMS ((const char *,
const char *));
-STATIC void add_bytes __proto((varray_t *,
+STATIC void add_bytes PARAMS ((varray_t *,
char *,
Size_t));
-STATIC void add_varray_page __proto((varray_t *));
-
-STATIC void update_headers __proto((void));
-
-STATIC void write_varray __proto((varray_t *, off_t, const char *));
-STATIC void write_object __proto((void));
-STATIC const char *st_to_string __proto((st_t));
-STATIC const char *sc_to_string __proto((sc_t));
-STATIC char *read_line __proto((void));
-STATIC void parse_input __proto((void));
-STATIC void mark_stabs __proto((const char *));
-STATIC void parse_begin __proto((const char *));
-STATIC void parse_bend __proto((const char *));
-STATIC void parse_def __proto((const char *));
-STATIC void parse_end __proto((const char *));
-STATIC void parse_ent __proto((const char *));
-STATIC void parse_file __proto((const char *));
+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
- __proto((const char *, const char *, const char *));
-STATIC void parse_stabs __proto((const char *));
-STATIC void parse_stabn __proto((const char *));
-STATIC page_t *read_seek __proto((Size_t, off_t, const char *));
-STATIC void copy_object __proto((void));
+ 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 __proto((int)) ATTRIBUTE_NORETURN;
-STATIC page_t *allocate_page __proto((void));
+STATIC void catch_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
+STATIC page_t *allocate_page PARAMS ((void));
STATIC page_t *allocate_multiple_pages
- __proto((Size_t));
+ PARAMS ((Size_t));
STATIC void free_multiple_pages
- __proto((page_t *, Size_t));
+ PARAMS ((page_t *, Size_t));
#ifndef MALLOC_CHECK
STATIC page_t *allocate_cluster
- __proto((Size_t));
+ PARAMS ((Size_t));
#endif
-STATIC forward_t *allocate_forward __proto((void));
-STATIC scope_t *allocate_scope __proto((void));
-STATIC shash_t *allocate_shash __proto((void));
-STATIC tag_t *allocate_tag __proto((void));
-STATIC thash_t *allocate_thash __proto((void));
-STATIC thead_t *allocate_thead __proto((void));
-STATIC vlinks_t *allocate_vlinks __proto((void));
-
-STATIC void free_forward __proto((forward_t *));
-STATIC void free_scope __proto((scope_t *));
-STATIC void free_tag __proto((tag_t *));
-STATIC void free_thead __proto((thead_t *));
-
-STATIC char *local_index __proto((const char *, int));
-STATIC char *local_rindex __proto((const char *, int));
+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));
-extern char *mktemp __proto((char *));
-extern long strtol __proto((const char *, char **, int));
+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 *));
extern char *optarg;
extern int optind;
@@ -1740,7 +1730,7 @@ extern int opterr;
typedef struct _pseudo_ops {
const char *name; /* pseudo-op in ascii */
int len; /* length of name to compare */
- void (*func) __proto((const char *)); /* function to handle line */
+ void (*func) PARAMS ((const char *)); /* function to handle line */
} pseudo_ops_t;
static pseudo_ops_t pseudo_ops[] = {
@@ -1819,7 +1809,7 @@ hash_string (text, hash_len, hash_tbl, ret_hash_index)
for (ptr = hash_tbl[hi]; ptr != (shash_t *) 0; ptr = ptr->next)
if ((symint_t) hash_len == ptr->len
&& first_ch == ptr->string[0]
- && memcmp ((CPTR_T) text, (CPTR_T) ptr->string, hash_len) == 0)
+ && memcmp (text, ptr->string, hash_len) == 0)
break;
return ptr;
@@ -2520,7 +2510,7 @@ add_file (file_start, file_end_p1)
{
if (first_ch == file_ptr->name[0]
&& file_ptr->name[len] == '\0'
- && memcmp ((CPTR_T) file_start, (CPTR_T) file_ptr->name, len) == 0)
+ && memcmp (file_start, file_ptr->name, len) == 0)
{
cur_file_ptr = file_ptr;
break;
@@ -2604,7 +2594,7 @@ add_bytes (vp, input_ptr, nitems)
if (move_bytes >= 32)
{
- (void) memcpy ((PTR_T) ptr, (CPTR_T) input_ptr, move_bytes);
+ (void) memcpy (ptr, input_ptr, move_bytes);
input_ptr += move_bytes;
}
else
@@ -2694,7 +2684,7 @@ st_to_string(symbol_type)
semi-colon, and return each logical line independently. */
STATIC char *
-read_line __proto((void))
+read_line ()
{
static int line_split_p = 0;
register int string_p = 0;
@@ -2889,8 +2879,8 @@ parse_def (name_start)
const char *arg_start; /* start of current argument */
const char *arg_end_p1; /* end+1 of current argument */
const char *name_end_p1; /* end+1 of label */
- const char *tag_start = (const char *) 0; /* start of tag name */
- const char *tag_end_p1 = (const char *) 0; /* end+1 of tag name */
+ const char *tag_start = 0; /* start of tag name */
+ const char *tag_end_p1 = 0; /* end+1 of tag name */
sc_t storage_class = sc_Nil;
st_t symbol_type = st_Nil;
type_info_t t;
@@ -2962,7 +2952,7 @@ parse_def (name_start)
/* Pick up the subdirective argument now. */
arg_was_number = arg_number = 0;
- arg_end_p1 = (const char *) 0;
+ arg_end_p1 = 0;
arg_start = dir_end_p1+1;
ch = *arg_start;
while (ch == ' ' || ch == '\t')
@@ -3377,7 +3367,7 @@ parse_def (name_start)
that any error reporting above gives the correct name. */
case st_End:
- name_start = name_end_p1 = (const char *) 0;
+ name_start = name_end_p1 = 0;
value = inside_enumeration = 0;
break;
@@ -3565,8 +3555,8 @@ parse_file (start)
(void) strtol (start, &p, 0);
if (start == p
- || (start_name = local_index (p, '"')) == (char *) 0
- || (end_name_p1 = local_rindex (++start_name, '"')) == (char *) 0)
+ || (start_name = strchr (p, '"')) == (char *) 0
+ || (end_name_p1 = strrchr (++start_name, '"')) == (char *) 0)
{
error ("Invalid .file directive");
return;
@@ -3832,7 +3822,7 @@ STATIC void
parse_stabs (start)
const char *start; /* start of directive */
{
- const char *end = local_index (start+1, '"');
+ const char *end = strchr (start+1, '"');
if (*start != '"' || end == (const char *) 0 || end[1] != ',')
{
@@ -3856,7 +3846,7 @@ parse_stabn (start)
if needed. */
STATIC void
-parse_input __proto((void))
+parse_input ()
{
register char *p;
register Size_t i;
@@ -3919,7 +3909,7 @@ parse_input __proto((void))
to write out the .T file. */
STATIC void
-update_headers __proto((void))
+update_headers ()
{
register symint_t i;
register efdr_t *file_ptr;
@@ -4119,7 +4109,7 @@ write_varray (vp, offset, str)
if (debug)
{
fputs ("\twarray\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, vp);
+ 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);
}
@@ -4134,7 +4124,7 @@ write_varray (vp, offset, str)
? vp->objects_last_page * vp->object_size
: vp->objects_per_page * vp->object_size;
- sys_write = fwrite ((PTR_T) ptr->datum, 1, num_write, object_stream);
+ sys_write = fwrite ((PTR) ptr->datum, 1, num_write, object_stream);
if (sys_write <= 0)
pfatal_with_name (object_name);
@@ -4152,7 +4142,7 @@ write_varray (vp, offset, str)
/* Write out the symbol table in the object file. */
STATIC void
-write_object __proto((void))
+write_object ()
{
int sys_write;
efdr_t *file_ptr;
@@ -4161,12 +4151,12 @@ write_object __proto((void))
if (debug)
{
fputs ("\n\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &symbolic_header);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR) &symbolic_header);
fprintf (stderr, ", offset = %7u, size = %7lu, %s\n",
0, (unsigned long) sizeof (symbolic_header), "symbolic header");
}
- sys_write = fwrite ((PTR_T) &symbolic_header,
+ sys_write = fwrite ((PTR) &symbolic_header,
1,
sizeof (symbolic_header),
object_stream);
@@ -4194,13 +4184,13 @@ write_object __proto((void))
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &orig_linenum);
+ 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");
}
- sys_write = fwrite ((PTR_T) orig_linenum,
+ sys_write = fwrite ((PTR) orig_linenum,
1,
symbolic_header.cbLine,
object_stream);
@@ -4229,13 +4219,13 @@ write_object __proto((void))
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &orig_opt_syms);
+ 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");
}
- sys_write = fwrite ((PTR_T) orig_opt_syms,
+ sys_write = fwrite ((PTR) orig_opt_syms,
1,
num_write,
object_stream);
@@ -4321,7 +4311,7 @@ write_object __proto((void))
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &file_ptr->fdr);
+ 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");
@@ -4357,7 +4347,7 @@ write_object __proto((void))
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR_T *) &orig_rfds);
+ 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");
@@ -4437,7 +4427,7 @@ read_seek (size, offset, str)
pfatal_with_name (obj_in_name);
}
- sys_read = fread ((PTR_T)ptr, 1, size, obj_in_stream);
+ sys_read = fread ((PTR) ptr, 1, size, obj_in_stream);
if (sys_read <= 0)
pfatal_with_name (obj_in_name);
@@ -4461,7 +4451,7 @@ read_seek (size, offset, str)
symbol table. */
STATIC void
-copy_object __proto((void))
+copy_object ()
{
char buffer[ PAGE_SIZE ];
register int sys_read;
@@ -4480,7 +4470,7 @@ copy_object __proto((void))
|| fseek (obj_in_stream, 0L, SEEK_SET) != 0)
pfatal_with_name (obj_in_name);
- sys_read = fread ((PTR_T) &orig_file_header,
+ sys_read = fread ((PTR) &orig_file_header,
1,
sizeof (struct filehdr),
obj_in_stream);
@@ -4499,15 +4489,15 @@ copy_object __proto((void))
if (orig_file_header.f_nsyms != sizeof (HDRR))
- fatal ("%s symbolic header wrong size (%d bytes, should be %d)",
- input_name, orig_file_header.f_nsyms, (int) sizeof (HDRR));
+ fatal ("%s symbolic header wrong size (%ld bytes, should be %ld)",
+ input_name, (long) orig_file_header.f_nsyms, (long) sizeof (HDRR));
/* Read in the current symbolic header. */
if (fseek (obj_in_stream, (long) orig_file_header.f_symptr, SEEK_SET) != 0)
pfatal_with_name (input_name);
- sys_read = fread ((PTR_T) &orig_sym_hdr,
+ sys_read = fread ((PTR) &orig_sym_hdr,
1,
sizeof (orig_sym_hdr),
obj_in_stream);
@@ -4596,7 +4586,7 @@ copy_object __proto((void))
if (max_file_offset != stat_buf.st_size)
fatal ("Symbol table is not last (symbol table ends at %ld, .o ends at %ld",
max_file_offset,
- stat_buf.st_size);
+ (long) stat_buf.st_size);
/* If the first original file descriptor is a dummy which the assembler
@@ -4606,7 +4596,7 @@ copy_object __proto((void))
&& orig_files->caux == 0)
{
char *filename = orig_local_strs + (orig_files->issBase + orig_files->rss);
- char *suffix = local_rindex (filename, '.');
+ char *suffix = strrchr (filename, '.');
if (suffix != (char *) 0 && strcmp (suffix, ".s") == 0)
delete_ifd = 1;
@@ -4813,7 +4803,7 @@ copy_object __proto((void))
num_write
= (remaining <= (int) sizeof (buffer))
? remaining : (int) sizeof (buffer);
- sys_read = fread ((PTR_T) buffer, 1, num_write, obj_in_stream);
+ sys_read = fread ((PTR) buffer, 1, num_write, obj_in_stream);
if (sys_read <= 0)
pfatal_with_name (obj_in_name);
@@ -4846,7 +4836,7 @@ main (argc, argv)
char **argv;
{
int iflag = 0;
- char *p = local_rindex (argv[0], '/');
+ char *p = strrchr (argv[0], '/');
char *num_end;
int option;
int i;
@@ -5155,7 +5145,7 @@ allocate_cluster (npages)
{
fprintf (stderr, "\talloc\tnpages = %lu, value = ",
(unsigned long) npages);
- fprintf (stderr, HOST_PTR_PRINTF, ptr);
+ fprintf (stderr, HOST_PTR_PRINTF, (PTR) ptr);
fputs ("\n", stderr);
}
@@ -5235,7 +5225,7 @@ free_multiple_pages (page_ptr, npages)
/* Allocate one page (which is initialized to 0). */
STATIC page_t *
-allocate_page __proto((void))
+allocate_page ()
{
#ifndef MALLOC_CHECK
if (pages_left == 0)
@@ -5257,7 +5247,7 @@ allocate_page __proto((void))
/* Allocate scoping information. */
STATIC scope_t *
-allocate_scope __proto((void))
+allocate_scope ()
{
register scope_t *ptr;
static scope_t initial_scope;
@@ -5306,7 +5296,7 @@ free_scope (ptr)
alloc_counts[ (int)alloc_type_scope ].free_list.f_scope = ptr;
#else
- free ((PTR_T) ptr);
+ free ((PTR) ptr);
#endif
}
@@ -5315,7 +5305,7 @@ free_scope (ptr)
/* Allocate links for pages in a virtual array. */
STATIC vlinks_t *
-allocate_vlinks __proto((void))
+allocate_vlinks ()
{
register vlinks_t *ptr;
static vlinks_t initial_vlinks;
@@ -5348,7 +5338,7 @@ allocate_vlinks __proto((void))
/* Allocate string hash buckets. */
STATIC shash_t *
-allocate_shash __proto((void))
+allocate_shash ()
{
register shash_t *ptr;
static shash_t initial_shash;
@@ -5381,7 +5371,7 @@ allocate_shash __proto((void))
/* Allocate type hash buckets. */
STATIC thash_t *
-allocate_thash __proto((void))
+allocate_thash ()
{
register thash_t *ptr;
static thash_t initial_thash;
@@ -5414,7 +5404,7 @@ allocate_thash __proto((void))
/* Allocate structure, union, or enum tag information. */
STATIC tag_t *
-allocate_tag __proto((void))
+allocate_tag ()
{
register tag_t *ptr;
static tag_t initial_tag;
@@ -5463,7 +5453,7 @@ free_tag (ptr)
alloc_counts[ (int)alloc_type_tag ].free_list.f_tag = ptr;
#else
- free ((PTR_T) ptr);
+ free ((PTR) ptr);
#endif
}
@@ -5472,7 +5462,7 @@ free_tag (ptr)
/* Allocate forward reference to a yet unknown tag. */
STATIC forward_t *
-allocate_forward __proto((void))
+allocate_forward ()
{
register forward_t *ptr;
static forward_t initial_forward;
@@ -5521,7 +5511,7 @@ free_forward (ptr)
alloc_counts[ (int)alloc_type_forward ].free_list.f_forward = ptr;
#else
- free ((PTR_T) ptr);
+ free ((PTR) ptr);
#endif
}
@@ -5530,7 +5520,7 @@ free_forward (ptr)
/* Allocate head of type hash list. */
STATIC thead_t *
-allocate_thead __proto((void))
+allocate_thead ()
{
register thead_t *ptr;
static thead_t initial_thead;
@@ -5579,7 +5569,7 @@ free_thead (ptr)
alloc_counts[ (int)alloc_type_thead ].free_list.f_thead = ptr;
#else
- free ((PTR_T) ptr);
+ free ((PTR) ptr);
#endif
}
@@ -5669,40 +5659,3 @@ botch (s)
{
fatal ("%s", s);
}
-
-
-/* Define our own index/rindex, since the local and global symbol
- structures as defined by MIPS has an 'index' field. */
-
-STATIC char *
-local_index (str, sentinel)
- const char *str;
- int sentinel;
-{
- int ch;
-
- for ( ; (ch = *str) != sentinel; str++)
- {
- if (ch == '\0')
- return (char *) 0;
- }
-
- return (char *)str;
-}
-
-STATIC char *
-local_rindex (str, sentinel)
- const char *str;
- int sentinel;
-{
- int ch;
- const char *ret = (const char *) 0;
-
- for ( ; (ch = *str) != '\0'; str++)
- {
- if (ch == sentinel)
- ret = str;
- }
-
- return (char *)ret;
-}