aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-05-10 08:53:17 +0930
committerAlan Modra <amodra@gmail.com>2022-05-10 11:21:37 +0930
commite3154ef69c94705fd8d97f32a754a1080531b804 (patch)
treeac9983de6f7556cf89c94f1b5843e496ee6aaa36
parent2ec4ffc1c6ce5659549a03ba5728df6811922bf9 (diff)
downloadfsf-binutils-gdb-e3154ef69c94705fd8d97f32a754a1080531b804.zip
fsf-binutils-gdb-e3154ef69c94705fd8d97f32a754a1080531b804.tar.gz
fsf-binutils-gdb-e3154ef69c94705fd8d97f32a754a1080531b804.tar.bz2
gprof: remove use of PTR
* basic_blocks.c: Replace uses of PTR with void * throughout. * cg_arcs.c: Likewise. * cg_print.c: Likewise. * hist.c: Likewise. * source.h: Likewise. * symtab.c: Likewise.
-rw-r--r--gprof/basic_blocks.c12
-rw-r--r--gprof/cg_arcs.c8
-rw-r--r--gprof/cg_print.c12
-rw-r--r--gprof/hist.c4
-rw-r--r--gprof/source.h4
-rw-r--r--gprof/symtab.c4
6 files changed, 22 insertions, 22 deletions
diff --git a/gprof/basic_blocks.c b/gprof/basic_blocks.c
index 8ef4010..782a282 100644
--- a/gprof/basic_blocks.c
+++ b/gprof/basic_blocks.c
@@ -33,10 +33,10 @@
#include "symtab.h"
#include "sym_ids.h"
-static int cmp_bb (const PTR, const PTR);
-static int cmp_ncalls (const PTR, const PTR);
+static int cmp_bb (const void *, const void *);
+static int cmp_ncalls (const void *, const void *);
static void fskip_string (FILE *);
-static void annotate_with_count (char *, unsigned int, int, PTR);
+static void annotate_with_count (char *, unsigned int, int, void *);
/* Default option values: */
bool bb_annotate_all_lines = false;
@@ -53,7 +53,7 @@ static long num_lines_executed;
number, and address (in that order). */
static int
-cmp_bb (const PTR lp, const PTR rp)
+cmp_bb (const void *lp, const void *rp)
{
int r;
const Sym *left = *(const Sym **) lp;
@@ -82,7 +82,7 @@ cmp_bb (const PTR lp, const PTR rp)
/* Helper for sorting. Order basic blocks in decreasing number of
calls, ties are broken in increasing order of line numbers. */
static int
-cmp_ncalls (const PTR lp, const PTR rp)
+cmp_ncalls (const void *lp, const void *rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
@@ -317,7 +317,7 @@ print_exec_counts (void)
that starts the basic-block. */
static void
-annotate_with_count (char *buf, unsigned int width, int line_num, PTR arg)
+annotate_with_count (char *buf, unsigned int width, int line_num, void *arg)
{
Source_File *sf = (Source_File *) arg;
Sym *b;
diff --git a/gprof/cg_arcs.c b/gprof/cg_arcs.c
index 77534ae..e76c2cb 100644
--- a/gprof/cg_arcs.c
+++ b/gprof/cg_arcs.c
@@ -38,13 +38,13 @@
#include "utils.h"
#include "sym_ids.h"
-static int cmp_topo (const PTR, const PTR);
+static int cmp_topo (const void *, const void *);
static void propagate_time (Sym *);
static void cycle_time (void);
static void cycle_link (void);
static void inherit_flags (Sym *);
static void propagate_flags (Sym **);
-static int cmp_total (const PTR, const PTR);
+static int cmp_total (const void *, const void *);
Sym *cycle_header;
unsigned int num_cycles;
@@ -151,7 +151,7 @@ arc_add (Sym *parent, Sym *child, unsigned long count)
static int
-cmp_topo (const PTR lp, const PTR rp)
+cmp_topo (const void *lp, const void *rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
@@ -535,7 +535,7 @@ propagate_flags (Sym **symbols)
* first. All else being equal, compare by names.
*/
static int
-cmp_total (const PTR lp, const PTR rp)
+cmp_total (const void *lp, const void *rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
diff --git a/gprof/cg_print.c b/gprof/cg_print.c
index ca71ba4..9ebe171 100644
--- a/gprof/cg_print.c
+++ b/gprof/cg_print.c
@@ -47,9 +47,9 @@ static void print_parents (Sym *);
static void sort_children (Sym *);
static void print_children (Sym *);
static void print_line (Sym *);
-static int cmp_name (const PTR, const PTR);
-static int cmp_arc_count (const PTR, const PTR);
-static int cmp_fun_nuses (const PTR, const PTR);
+static int cmp_name (const void *, const void *);
+static int cmp_arc_count (const void *, const void *);
+static int cmp_fun_nuses (const void *, const void *);
static void order_and_dump_functions_by_arcs
(Arc **, unsigned long, int, Arc **, unsigned long *);
@@ -551,7 +551,7 @@ cg_print (Sym ** timesortsym)
static int
-cmp_name (const PTR left, const PTR right)
+cmp_name (const void *left, const void *right)
{
const Sym **npp1 = (const Sym **) left;
const Sym **npp2 = (const Sym **) right;
@@ -675,7 +675,7 @@ cg_print_index (void)
We want to sort in descending order. */
static int
-cmp_arc_count (const PTR left, const PTR right)
+cmp_arc_count (const void *left, const void *right)
{
const Arc **npp1 = (const Arc **) left;
const Arc **npp2 = (const Arc **) right;
@@ -692,7 +692,7 @@ cmp_arc_count (const PTR left, const PTR right)
We want to sort in descending order. */
static int
-cmp_fun_nuses (const PTR left, const PTR right)
+cmp_fun_nuses (const void *left, const void *right)
{
const Sym **npp1 = (const Sym **) left;
const Sym **npp2 = (const Sym **) right;
diff --git a/gprof/hist.c b/gprof/hist.c
index 141a962..91a0d32 100644
--- a/gprof/hist.c
+++ b/gprof/hist.c
@@ -39,7 +39,7 @@
static void scale_and_align_entries (void);
static void print_header (int);
static void print_line (Sym *, double);
-static int cmp_time (const PTR, const PTR);
+static int cmp_time (const void *, const void *);
/* Declarations of automatically generated functions to output blurbs. */
extern void flat_blurb (FILE * fp);
@@ -535,7 +535,7 @@ print_line (Sym *sym, double scale)
lexicographic order of the function names. */
static int
-cmp_time (const PTR lp, const PTR rp)
+cmp_time (const void *lp, const void *rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
diff --git a/gprof/source.h b/gprof/source.h
index 2606581..5eece6b 100644
--- a/gprof/source.h
+++ b/gprof/source.h
@@ -58,6 +58,6 @@ extern Source_File *source_file_lookup_name (const char *);
is not stdout, it should be closed when done with it. */
extern FILE *annotate_source
(Source_File *sf, unsigned int max_width,
- void (*annote) (char *, unsigned int, int, PTR arg),
- PTR arg);
+ void (*annote) (char *, unsigned int, int, void *),
+ void *arg);
#endif /* source_h */
diff --git a/gprof/symtab.c b/gprof/symtab.c
index ff4c18e..807f4b7 100644
--- a/gprof/symtab.c
+++ b/gprof/symtab.c
@@ -26,7 +26,7 @@
#include "cg_arcs.h"
#include "corefile.h"
-static int cmp_addr (const PTR, const PTR);
+static int cmp_addr (const void *, const void *);
Sym_Table symtab;
@@ -58,7 +58,7 @@ sym_init (Sym *sym)
the global symbol survives. */
static int
-cmp_addr (const PTR lp, const PTR rp)
+cmp_addr (const void *lp, const void *rp)
{
const Sym *left = (const Sym *) lp;
const Sym *right = (const Sym *) rp;