diff options
author | Alan Modra <amodra@gmail.com> | 2002-02-01 08:24:16 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-02-01 08:24:16 +0000 |
commit | 1355568ab48a9dcfd079493f7deb5e1c5e88015b (patch) | |
tree | 9b1cc576a383708096f9c89c5800bd25f6126768 /gprof/basic_blocks.c | |
parent | 48fa4a5def1116273c2c2a236939e96eb9b6231a (diff) | |
download | gdb-1355568ab48a9dcfd079493f7deb5e1c5e88015b.zip gdb-1355568ab48a9dcfd079493f7deb5e1c5e88015b.tar.gz gdb-1355568ab48a9dcfd079493f7deb5e1c5e88015b.tar.bz2 |
* alpha.c (alpha_find_call): Warning fixes.
* mips.c (mips_find_call): Likewise.
* sparc.c (sparc_find_call): Likewise.
* basic_blocks.c: Warning fixes. Eliminate DEFUN.
* call_graph.c: Likewise.
* cg_arcs.c: Likewise.
* cg_dfn.cp: Likewise.
* gprof.c: Likewise.
* gprof.h: Likewise.
* hist.c: Likewise.
* search_list.c: Likewise.
* source.c: Likewise.
* source.h: Likewise.
* sym_ids.c: Likewise.
* symtab.c: Likewise.
* symtab.h: Likewise.
* utils.c: Likewise.
* cg_print.c: Likewise.
(struct function_map, symbol_map, symbol_map_count): Move
declaration to..
* corefile: ..here.
* corefile.c: Warning fixes. Eliminate DEFUN.
(struct function_map): Remove declaration.
* gmon_io.c: Warning fixes. Eliminate DEFUN.
(gmon_io_read_64): Make static.
(gmon_io_write_64): Likewise.
(gmon_read_raw_arc): Likewise.
(gmon_write_raw_arc): Likewise.
(gmon_io_write_8): Don't pass char, pass int param.
* gmon_io.h (gmon_io_write_8): Likewise.
and a few copyright dates that should have been done previously.
Diffstat (limited to 'gprof/basic_blocks.c')
-rw-r--r-- | gprof/basic_blocks.c | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/gprof/basic_blocks.c b/gprof/basic_blocks.c index d1bd3f0..74f29a0 100644 --- a/gprof/basic_blocks.c +++ b/gprof/basic_blocks.c @@ -2,7 +2,7 @@ of basic-block info to/from gmon.out; computing and formatting of basic-block related statistics. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -32,6 +32,11 @@ #include "symtab.h" #include "sym_ids.h" +static int cmp_bb PARAMS ((const PTR, const PTR)); +static int cmp_ncalls PARAMS ((const PTR, const PTR)); +static void fskip_string PARAMS ((FILE *)); +static void annotate_with_count PARAMS ((char *, unsigned int, int, PTR)); + /* Default option values: */ boolean bb_annotate_all_lines = false; unsigned long bb_min_calls = 1; @@ -47,7 +52,9 @@ static long num_lines_executed; number, and address (in that order). */ static int -DEFUN (cmp_bb, (lp, rp), const void *lp AND const void *rp) +cmp_bb (lp, rp) + const PTR lp; + const PTR rp; { int r; const Sym *left = *(const Sym **) lp; @@ -76,7 +83,9 @@ DEFUN (cmp_bb, (lp, rp), const void *lp AND const void *rp) /* Helper for sorting. Order basic blocks in decreasing number of calls, ties are broken in increasing order of line numbers. */ static int -DEFUN (cmp_ncalls, (lp, rp), const void *lp AND const void *rp) +cmp_ncalls (lp, rp) + const PTR lp; + const PTR rp; { const Sym *left = *(const Sym **) lp; const Sym *right = *(const Sym **) rp; @@ -96,7 +105,8 @@ DEFUN (cmp_ncalls, (lp, rp), const void *lp AND const void *rp) /* Skip over variable length string. */ static void -DEFUN (fskip_string, (fp), FILE * fp) +fskip_string (fp) + FILE *fp; { int ch; @@ -111,7 +121,9 @@ DEFUN (fskip_string, (fp), FILE * fp) of file IFP and is provided for formatting error-messages only. */ void -DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename) +bb_read_rec (ifp, filename) + FILE *ifp; + const char *filename; { int nblocks, b; bfd_vma addr, ncalls; @@ -199,9 +211,11 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename) is the name of OFP and is provided for producing error-messages only. */ void -DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename) +bb_write_blocks (ofp, filename) + FILE *ofp; + const char *filename; { - int nblocks = 0; + unsigned int nblocks = 0; Sym *sym; int i; @@ -227,7 +241,7 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename) for (i = 0; i < NBBS && sym->bb_addr[i]; i++) { if (gmon_io_write_vma (ofp, sym->bb_addr[i]) - || gmon_io_write_vma (ofp, sym->bb_calls[i])) + || gmon_io_write_vma (ofp, (bfd_vma) sym->bb_calls[i])) { perror (filename); done (1); @@ -242,10 +256,10 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename) <filename>:<line-number>: (<function-name>:<bb-addr): <ncalls> */ void -DEFUN_VOID (print_exec_counts) +print_exec_counts () { Sym **sorted_bbs, *sym; - int i, j, len; + unsigned int i, j, len; if (first_output) first_output = false; @@ -309,12 +323,15 @@ DEFUN_VOID (print_exec_counts) that starts the basic-block. */ static void -DEFUN (annotate_with_count, (buf, width, line_num, arg), - char *buf AND int width AND int line_num AND void *arg) +annotate_with_count (buf, width, line_num, arg) + char *buf; + unsigned int width; + int line_num; + PTR arg; { Source_File *sf = arg; Sym *b; - int i; + unsigned int i; static unsigned long last_count; unsigned long last_print = (unsigned long) -1; @@ -335,7 +352,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), char *p; unsigned long ncalls; int ncalls_set; - int len; + unsigned int len; ++num_executable_lines; @@ -411,7 +428,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), if (! ncalls_set) { - int c; + unsigned int c; for (c = 0; c < width; c++) buf[c] = ' '; @@ -438,7 +455,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), } else { - int c; + unsigned int c; strcpy (buf + width - len, tmpbuf); for (c = 0; c < width - len; ++c) @@ -452,7 +469,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), regarding that source file are printed. */ void -DEFUN_VOID (print_annotated_source) +print_annotated_source () { Sym *sym, *line_stats, *new_line; Source_File *sf; |