* buildsym.h, buildsym.c: Convert to ANSI-only.

This commit is contained in:
Stan Shebs 1999-02-01 00:38:25 +00:00
parent 3d26bb0e8e
commit 552316ee17
3 changed files with 70 additions and 113 deletions

View File

@ -1,5 +1,7 @@
Sun Jan 31 15:24:24 1999 Stan Shebs <shebs@andros.cygnus.com> Sun Jan 31 15:24:24 1999 Stan Shebs <shebs@andros.cygnus.com>
* buildsym.h, buildsym.c: Convert to ANSI-only.
* buildsym.h, buildsym.c: Reformat to standard. * buildsym.h, buildsym.c: Reformat to standard.
* buildsym.c (merge_symbol_lists): Remove unused variable. * buildsym.c (merge_symbol_lists): Remove unused variable.

View File

@ -53,8 +53,7 @@ static struct pending *free_pendings;
static int have_line_numbers; static int have_line_numbers;
static int static int compare_line_numbers (const void *ln1p, const void *ln2p);
compare_line_numbers PARAMS ((const void *, const void *));
/* Initial sizes of data structures. These are realloc'd larger if /* Initial sizes of data structures. These are realloc'd larger if
@ -87,9 +86,7 @@ struct complaint blockvector_complaint =
/* Add a symbol to one of the lists of symbols. */ /* Add a symbol to one of the lists of symbols. */
void void
add_symbol_to_list (symbol, listhead) add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
struct symbol *symbol;
struct pending **listhead;
{ {
register struct pending *link; register struct pending *link;
@ -123,10 +120,7 @@ add_symbol_to_list (symbol, listhead)
'\0'-terminated; LENGTH is the length of the name. */ '\0'-terminated; LENGTH is the length of the name. */
struct symbol * struct symbol *
find_symbol_in_list (list, name, length) find_symbol_in_list (struct pending *list, char *name, int length)
struct pending *list;
char *name;
int length;
{ {
int j; int j;
char *pp; char *pp;
@ -152,15 +146,14 @@ find_symbol_in_list (list, name, length)
/* ARGSUSED */ /* ARGSUSED */
void void
really_free_pendings (foo) really_free_pendings (int foo)
int foo;
{ {
struct pending *next, *next1; struct pending *next, *next1;
for (next = free_pendings; next; next = next1) for (next = free_pendings; next; next = next1)
{ {
next1 = next->next; next1 = next->next;
free ((PTR) next); free ((void *) next);
} }
free_pendings = NULL; free_pendings = NULL;
@ -169,14 +162,14 @@ really_free_pendings (foo)
for (next = file_symbols; next != NULL; next = next1) for (next = file_symbols; next != NULL; next = next1)
{ {
next1 = next->next; next1 = next->next;
free ((PTR) next); free ((void *) next);
} }
file_symbols = NULL; file_symbols = NULL;
for (next = global_symbols; next != NULL; next = next1) for (next = global_symbols; next != NULL; next = next1)
{ {
next1 = next->next; next1 = next->next;
free ((PTR) next); free ((void *) next);
} }
global_symbols = NULL; global_symbols = NULL;
} }
@ -184,7 +177,7 @@ really_free_pendings (foo)
/* This function is called to discard any pending blocks. */ /* This function is called to discard any pending blocks. */
void void
free_pending_blocks () free_pending_blocks (void)
{ {
#if 0 /* Now we make the links in the #if 0 /* Now we make the links in the
symbol_obstack, so don't free symbol_obstack, so don't free
@ -194,7 +187,7 @@ free_pending_blocks ()
for (bnext = pending_blocks; bnext; bnext = bnext1) for (bnext = pending_blocks; bnext; bnext = bnext1)
{ {
bnext1 = bnext->next; bnext1 = bnext->next;
free ((PTR) bnext); free ((void *) bnext);
} }
#endif #endif
pending_blocks = NULL; pending_blocks = NULL;
@ -205,12 +198,10 @@ free_pending_blocks ()
file). Put the block on the list of pending blocks. */ file). Put the block on the list of pending blocks. */
void void
finish_block (symbol, listhead, old_blocks, start, end, objfile) finish_block (struct symbol *symbol, struct pending **listhead,
struct symbol *symbol; struct pending_block *old_blocks,
struct pending **listhead; CORE_ADDR start, CORE_ADDR end,
struct pending_block *old_blocks; struct objfile *objfile)
CORE_ADDR start, end;
struct objfile *objfile;
{ {
register struct pending *next, *next1; register struct pending *next, *next1;
register struct block *block; register struct block *block;
@ -416,10 +407,8 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile)
time. This wastes a little space. FIXME: Is it worth it? */ time. This wastes a little space. FIXME: Is it worth it? */
void void
record_pending_block (objfile, block, opblock) record_pending_block (struct objfile *objfile, struct block *block,
struct objfile *objfile; struct pending_block *opblock)
struct block *block;
struct pending_block *opblock;
{ {
register struct pending_block *pblock; register struct pending_block *pblock;
@ -443,8 +432,7 @@ record_pending_block (objfile, block, opblock)
that is done, it can be made static again. */ that is done, it can be made static again. */
struct blockvector * struct blockvector *
make_blockvector (objfile) make_blockvector (struct objfile *objfile)
struct objfile *objfile;
{ {
register struct pending_block *next; register struct pending_block *next;
register struct blockvector *blockvector; register struct blockvector *blockvector;
@ -522,9 +510,7 @@ make_blockvector (objfile)
the directory in which it resides (or NULL if not known). */ the directory in which it resides (or NULL if not known). */
void void
start_subfile (name, dirname) start_subfile (char *name, char *dirname)
char *name;
char *dirname;
{ {
register struct subfile *subfile; register struct subfile *subfile;
@ -624,9 +610,7 @@ start_subfile (name, dirname)
directory name actually is (by checking for a trailing '/'). */ directory name actually is (by checking for a trailing '/'). */
void void
patch_subfile_names (subfile, name) patch_subfile_names (struct subfile *subfile, char *name)
struct subfile *subfile;
char *name;
{ {
if (subfile != NULL && subfile->dirname == NULL && subfile->name != NULL if (subfile != NULL && subfile->dirname == NULL && subfile->name != NULL
&& subfile->name[strlen (subfile->name) - 1] == '/') && subfile->name[strlen (subfile->name) - 1] == '/')
@ -661,7 +645,7 @@ patch_subfile_names (subfile, name)
order. */ order. */
void void
push_subfile () push_subfile (void)
{ {
register struct subfile_stack *tem register struct subfile_stack *tem
= (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack)); = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack));
@ -676,7 +660,7 @@ push_subfile ()
} }
char * char *
pop_subfile () pop_subfile (void)
{ {
register char *name; register char *name;
register struct subfile_stack *link = subfile_stack; register struct subfile_stack *link = subfile_stack;
@ -687,7 +671,7 @@ pop_subfile ()
} }
name = link->name; name = link->name;
subfile_stack = link->next; subfile_stack = link->next;
free ((PTR) link); free ((void *) link);
return (name); return (name);
} }
@ -695,10 +679,7 @@ pop_subfile ()
line vector for SUBFILE. */ line vector for SUBFILE. */
void void
record_line (subfile, line, pc) record_line (register struct subfile *subfile, int line, CORE_ADDR pc)
register struct subfile *subfile;
int line;
CORE_ADDR pc;
{ {
struct linetable_entry *e; struct linetable_entry *e;
/* Ignore the dummy line number in libg.o */ /* Ignore the dummy line number in libg.o */
@ -737,9 +718,7 @@ record_line (subfile, line, pc)
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */ /* Needed in order to sort line tables from IBM xcoff files. Sigh! */
static int static int
compare_line_numbers (ln1p, ln2p) compare_line_numbers (const void *ln1p, const void *ln2p)
const void *ln1p;
const void *ln2p;
{ {
struct linetable_entry *ln1 = (struct linetable_entry *) ln1p; struct linetable_entry *ln1 = (struct linetable_entry *) ln1p;
struct linetable_entry *ln2 = (struct linetable_entry *) ln2p; struct linetable_entry *ln2 = (struct linetable_entry *) ln2p;
@ -763,10 +742,7 @@ compare_line_numbers (ln1p, ln2p)
one original source file. */ one original source file. */
void void
start_symtab (name, dirname, start_addr) start_symtab (char *name, char *dirname, CORE_ADDR start_addr)
char *name;
char *dirname;
CORE_ADDR start_addr;
{ {
last_source_file = name; last_source_file = name;
@ -812,10 +788,7 @@ start_symtab (name, dirname, start_addr)
never know about this empty file (FIXME). */ never know about this empty file (FIXME). */
struct symtab * struct symtab *
end_symtab (end_addr, objfile, section) end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
CORE_ADDR end_addr;
struct objfile *objfile;
int section;
{ {
register struct symtab *symtab = NULL; register struct symtab *symtab = NULL;
register struct blockvector *blockvector; register struct blockvector *blockvector;
@ -1007,23 +980,23 @@ end_symtab (end_addr, objfile, section)
} }
if (subfile->name != NULL) if (subfile->name != NULL)
{ {
free ((PTR) subfile->name); free ((void *) subfile->name);
} }
if (subfile->dirname != NULL) if (subfile->dirname != NULL)
{ {
free ((PTR) subfile->dirname); free ((void *) subfile->dirname);
} }
if (subfile->line_vector != NULL) if (subfile->line_vector != NULL)
{ {
free ((PTR) subfile->line_vector); free ((void *) subfile->line_vector);
} }
if (subfile->debugformat != NULL) if (subfile->debugformat != NULL)
{ {
free ((PTR) subfile->debugformat); free ((void *) subfile->debugformat);
} }
nextsub = subfile->next; nextsub = subfile->next;
free ((PTR) subfile); free ((void *) subfile);
} }
/* Set this for the main source file. */ /* Set this for the main source file. */
@ -1043,9 +1016,7 @@ end_symtab (end_addr, objfile, section)
context. */ context. */
struct context_stack * struct context_stack *
push_context (desc, valu) push_context (int desc, CORE_ADDR valu)
int desc;
CORE_ADDR valu;
{ {
register struct context_stack *new; register struct context_stack *new;
@ -1074,8 +1045,7 @@ push_context (desc, valu)
/* Compute a small integer hash code for the given name. */ /* Compute a small integer hash code for the given name. */
int int
hashname (name) hashname (char *name)
char *name;
{ {
register char *p = name; register char *p = name;
register int total = p[0]; register int total = p[0];
@ -1103,8 +1073,7 @@ hashname (name)
void void
record_debugformat (format) record_debugformat (char *format)
char *format;
{ {
current_subfile->debugformat = savestring (format, strlen (format)); current_subfile->debugformat = savestring (format, strlen (format));
} }
@ -1118,9 +1087,7 @@ record_debugformat (format)
Void return. */ Void return. */
void void
merge_symbol_lists (srclist, targetlist) merge_symbol_lists (struct pending **srclist, struct pending **targetlist)
struct pending **srclist;
struct pending **targetlist;
{ {
register int i; register int i;

View File

@ -211,7 +211,7 @@ EXTERN struct subfile_stack *subfile_stack;
/* Function to invoke get the next symbol. Return the symbol name. */ /* Function to invoke get the next symbol. Return the symbol name. */
EXTERN char *(*next_symbol_text_func) PARAMS ((struct objfile *)); EXTERN char *(*next_symbol_text_func) (struct objfile *);
/* Vector of types defined so far, indexed by their type numbers. /* Vector of types defined so far, indexed by their type numbers.
Used for both stabs and coff. (In newer sun systems, dbx uses a Used for both stabs and coff. (In newer sun systems, dbx uses a
@ -230,79 +230,67 @@ EXTERN int type_vector_length;
#define INITIAL_TYPE_VECTOR_LENGTH 160 #define INITIAL_TYPE_VECTOR_LENGTH 160
extern void extern void add_symbol_to_list (struct symbol *symbol,
add_symbol_to_list PARAMS ((struct symbol *, struct pending **)); struct pending **listhead);
extern struct symbol * extern struct symbol *find_symbol_in_list (struct pending *list,
find_symbol_in_list PARAMS ((struct pending *, char *, int)); char *name, int length);
extern void extern void finish_block (struct symbol *symbol,
finish_block PARAMS ((struct symbol *, struct pending **, struct pending **listhead,
struct pending_block *, CORE_ADDR, CORE_ADDR, struct pending_block *old_blocks,
struct objfile *)); CORE_ADDR start, CORE_ADDR end,
struct objfile *objfile);
extern void extern void really_free_pendings (int foo);
really_free_pendings PARAMS ((int foo));
extern void extern void start_subfile (char *name, char *dirname);
start_subfile PARAMS ((char *, char *));
extern void extern void patch_subfile_names (struct subfile *subfile, char *name);
patch_subfile_names PARAMS ((struct subfile * subfile, char *name));
extern void extern void push_subfile (void);
push_subfile PARAMS ((void));
extern char * extern char *pop_subfile (void);
pop_subfile PARAMS ((void));
extern struct symtab * extern struct symtab *end_symtab (CORE_ADDR end_addr,
end_symtab PARAMS ((CORE_ADDR, struct objfile *, int)); struct objfile *objfile, int section);
extern void /* Defined in stabsread.c. */
scan_file_globals PARAMS ((struct objfile *));
extern void extern void scan_file_globals (struct objfile *objfile);
buildsym_new_init PARAMS ((void));
extern void extern void buildsym_new_init (void);
buildsym_init PARAMS ((void));
extern struct context_stack * extern void buildsym_init (void);
push_context PARAMS ((int, CORE_ADDR));
extern void extern struct context_stack *push_context (int desc, CORE_ADDR valu);
record_line PARAMS ((struct subfile *, int, CORE_ADDR));
extern void extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc);
start_symtab PARAMS ((char *, char *, CORE_ADDR));
extern int extern void start_symtab (char *name, char *dirname, CORE_ADDR start_addr);
hashname PARAMS ((char *));
extern void extern int hashname (char *name);
free_pending_blocks PARAMS ((void));
extern void free_pending_blocks (void);
/* FIXME: Note that this is used only in buildsym.c and dstread.c, /* FIXME: Note that this is used only in buildsym.c and dstread.c,
which should be fixed to not need direct access to which should be fixed to not need direct access to
make_blockvector. */ make_blockvector. */
extern struct blockvector * extern struct blockvector *make_blockvector (struct objfile *objfile);
make_blockvector PARAMS ((struct objfile *));
/* FIXME: Note that this is used only in buildsym.c and dstread.c, /* FIXME: Note that this is used only in buildsym.c and dstread.c,
which should be fixed to not need direct access to which should be fixed to not need direct access to
record_pending_block. */ record_pending_block. */
extern void extern void record_pending_block (struct objfile *objfile,
record_pending_block PARAMS ((struct objfile *, struct block *, struct block *block,
struct pending_block *)); struct pending_block *opblock);
extern void extern void record_debugformat (char *format);
record_debugformat PARAMS ((char *));
extern void extern void merge_symbol_lists (struct pending **srclist,
merge_symbol_lists PARAMS ((struct pending **, struct pending **)); struct pending **targetlist);
#undef EXTERN #undef EXTERN