From 9aa97a39fed07f48abdf64e964af64c296fa179b Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Sat, 7 Mar 1992 18:31:24 +0000 Subject: [PATCH] Lint removal, extra prototypes. Recopied cplus-dem from gdb, makes more things come out right. --- ld/cplus-dem.c | 26 ++++++++++++++++---------- ld/lderror.c | 8 ++++---- ld/lderror.h | 4 ++++ ld/relax.c | 2 +- ld/relax.h | 4 ++++ 5 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 ld/lderror.h create mode 100644 ld/relax.h diff --git a/ld/cplus-dem.c b/ld/cplus-dem.c index 7495a63..a4b86ea 100644 --- a/ld/cplus-dem.c +++ b/ld/cplus-dem.c @@ -1,6 +1,6 @@ /* Demangler for GNU C++ Copyright 1989, 1991 Free Software Foundation, Inc. - written by James Clark (jjc@@jclark.uucp) + written by James Clark (jjc@jclark.uucp) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,11 +47,21 @@ available memory. */ /* define this if names don't start with _ */ -#define nounderscore 1 -#include +/* #define nounderscore 1 */ +#include #include + #define xmalloc ldmalloc -#define xrealloc realloc +#define xrealloc ldrealloc + +#if 0 +/* GDB-specific, FIXME. */ +#include "defs.h" +#endif + + + +#define PARAMS(x) EXFUN(,x) /* This is '$' on systems where the assembler can deal with that. Where the assembler can't, it's '.' (but on many systems '.' is @@ -163,12 +173,6 @@ typedef struct string { char *e; /* pointer after end of allocated space */ } string; -#if _STDC_ == 1 -#define PARAMS(x) x -#else -#define PARAMS(x) () -#endif - static void string_need PARAMS ((string *, int)); @@ -235,6 +239,8 @@ cplus_mangle_opname (opname, arg_mode) { int i, len = strlen (opname); + if (arg_mode != 0 && arg_mode != 1) + einfo ("%P%F: invalid arg_mode"); for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++) { diff --git a/ld/lderror.c b/ld/lderror.c index 382f7e2..38e2a70 100644 --- a/ld/lderror.c +++ b/ld/lderror.c @@ -2,6 +2,7 @@ #include "sysdep.h" #include "../bfd/seclet.h" #include "ld.h" +#include "ldmisc.h" #define MAX_ERRORS_IN_A_ROW 5 @@ -15,7 +16,7 @@ extern bfd_error_vector_type bfd_error_vector; static void DEFUN(ld_undefined_symbol,(relent, seclet), CONST arelent *relent AND - bfd_seclet_type *seclet) + CONST bfd_seclet_type *seclet) { asymbol *s = *(relent->sym_ptr_ptr); static asymbol *error_symbol; @@ -76,7 +77,6 @@ DEFUN(ld_reloc_truncated,(relent, seclet), void DEFUN_VOID(init_bfd_error_vector) { -bfd_error_vector.undefined_symbol = ld_undefined_symbol; -bfd_error_vector.reloc_value_truncated = ld_reloc_truncated; - + bfd_error_vector.undefined_symbol = ld_undefined_symbol; + bfd_error_vector.reloc_value_truncated = ld_reloc_truncated; } diff --git a/ld/lderror.h b/ld/lderror.h new file mode 100644 index 0000000..870f4d0 --- /dev/null +++ b/ld/lderror.h @@ -0,0 +1,4 @@ + + +void EXFUN(init_bfd_error_vector,(void)); + diff --git a/ld/relax.c b/ld/relax.c index a0a8ab6..d3956ef 100644 --- a/ld/relax.c +++ b/ld/relax.c @@ -21,7 +21,7 @@ Tie together all the interseting blocks #include "ldmisc.h" #include "ldsym.h" #include "ldgram.h" - +#include "relax.h" static void DEFUN(build_it,(statement), lang_statement_union_type *statement) diff --git a/ld/relax.h b/ld/relax.h new file mode 100644 index 0000000..06322b9 --- /dev/null +++ b/ld/relax.h @@ -0,0 +1,4 @@ +void EXFUN(write_relaxnorel,( bfd *output_bfd)); +boolean EXFUN(relax_section,( lang_statement_union_type **this_ptr)); + + -- 2.7.4