summaryrefslogtreecommitdiff
path: root/usr.bin/gprof
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/gprof')
-rw-r--r--usr.bin/gprof/arcs.c15
-rw-r--r--usr.bin/gprof/elf.c2
-rw-r--r--usr.bin/gprof/gprof.c4
-rw-r--r--usr.bin/gprof/printgprof.c6
-rw-r--r--usr.bin/gprof/printlist.c4
5 files changed, 15 insertions, 16 deletions
diff --git a/usr.bin/gprof/arcs.c b/usr.bin/gprof/arcs.c
index 824e99a8725..8ba102e3cae 100644
--- a/usr.bin/gprof/arcs.c
+++ b/usr.bin/gprof/arcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arcs.c,v 1.12 2009/10/27 23:59:38 deraadt Exp $ */
+/* $OpenBSD: arcs.c,v 1.13 2015/08/20 22:32:41 deraadt Exp $ */
/* $NetBSD: arcs.c,v 1.6 1995/04/19 07:15:52 cgd Exp $ */
/*
@@ -68,7 +68,7 @@ addarc(nltype *parentp, nltype *childp, long count)
arcp -> arc_count += count;
return;
}
- arcp = (arctype *)calloc( 1 , sizeof *arcp );
+ arcp = calloc( 1 , sizeof *arcp );
arcp -> arc_parentp = parentp;
arcp -> arc_childp = childp;
arcp -> arc_count = count;
@@ -189,7 +189,7 @@ doarcs()
/*
* Sort the symbol table in reverse topological order
*/
- topsortnlp = (nltype **) calloc( nname , sizeof(nltype *) );
+ topsortnlp = calloc( nname , sizeof(nltype *) );
if ( topsortnlp == (nltype **) 0 )
warnx("[doarcs] ran out of memory for topo sorting");
for ( index = 0 ; index < nname ; index += 1 ) {
@@ -225,7 +225,7 @@ doarcs()
* sorting both the regular function names
* and cycle headers.
*/
- timesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );
+ timesortnlp = calloc( nname + ncycle , sizeof(nltype *) );
if ( timesortnlp == (nltype **) 0 )
warnx("ran out of memory for sorting");
for ( index = 0 ; index < nname ; index++ ) {
@@ -364,7 +364,7 @@ cyclelink()
* cyclenl is indexed by cycle number:
* i.e. it is origin 1, not origin 0.
*/
- cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) );
+ cyclenl = calloc( ncycle + 1 , sizeof( nltype ) );
if ( cyclenl == 0 )
errx(0, "No room for %ld bytes of cycle headers",
(ncycle + 1) * sizeof(nltype));
@@ -467,7 +467,7 @@ cycleanalyze()
if ( size <= cyclethreshold )
continue;
done = FALSE;
- cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) );
+ cyclestack = calloc( size + 1 , sizeof( arctype *) );
if ( cyclestack == 0 ) {
warnx("No room for %ld bytes of cycle stack" ,
(size + 1) * sizeof(arctype *));
@@ -581,8 +581,7 @@ addcycle(arctype **stkstart, arctype **stkend)
return( TRUE );
}
}
- clp = (cltype *)
- calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
+ clp = calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
if ( clp == 0 ) {
warnx("No room for %ld bytes of subcycle storage" ,
sizeof(cltype) + (size - 1) * sizeof(arctype *));
diff --git a/usr.bin/gprof/elf.c b/usr.bin/gprof/elf.c
index 5a2381325c9..321f1357321 100644
--- a/usr.bin/gprof/elf.c
+++ b/usr.bin/gprof/elf.c
@@ -103,7 +103,7 @@ getnfile(const char *filename, char ***defaultEs)
#endif
/* Allocate memory for them, plus a terminating entry. */
- if ((nl = (nltype *)calloc(nname + 1, sizeof(nltype))) == NULL)
+ if ((nl = calloc(nname + 1, sizeof(nltype))) == NULL)
errx(1, "Insufficient memory for symbol table");
/* Read them in. */
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index 50dd2807710..2f38f9c3739 100644
--- a/usr.bin/gprof/gprof.c
+++ b/usr.bin/gprof/gprof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gprof.c,v 1.21 2014/12/22 18:21:10 tedu Exp $ */
+/* $OpenBSD: gprof.c,v 1.22 2015/08/20 22:32:41 deraadt Exp $ */
/* $NetBSD: gprof.c,v 1.8 1995/04/19 07:15:59 cgd Exp $ */
/*
@@ -369,7 +369,7 @@ readsamples(FILE *pfile)
int i;
if (samples == 0) {
- samples = (UNIT *) calloc(sampbytes, sizeof (UNIT));
+ samples = calloc(sampbytes, sizeof (UNIT));
if (samples == 0)
errx(1, "No room for %ld sample pc's", sampbytes / sizeof (UNIT));
}
diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c
index 8a0f820639c..e53a8f0e00c 100644
--- a/usr.bin/gprof/printgprof.c
+++ b/usr.bin/gprof/printgprof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printgprof.c,v 1.12 2009/10/27 23:59:38 deraadt Exp $ */
+/* $OpenBSD: printgprof.c,v 1.13 2015/08/20 22:32:41 deraadt Exp $ */
/* $NetBSD: printgprof.c,v 1.5 1995/04/19 07:16:21 cgd Exp $ */
/*
@@ -50,7 +50,7 @@ printprof()
/*
* Sort the symbol table in by time
*/
- sortednlp = (nltype **) calloc( nname , sizeof(nltype *) );
+ sortednlp = calloc( nname , sizeof(nltype *) );
if ( sortednlp == (nltype **) 0 )
warnx("[printprof] ran out of memory for time sorting");
for ( index = 0 ; index < nname ; index += 1 ) {
@@ -659,7 +659,7 @@ printindex()
* Now, sort regular function name alphbetically
* to create an index.
*/
- namesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );
+ namesortnlp = calloc( nname + ncycle , sizeof(nltype *) );
if ( namesortnlp == (nltype **) 0 )
warnx("ran out of memory for sorting");
for ( index = 0 , nnames = 0 ; index < nname ; index++ ) {
diff --git a/usr.bin/gprof/printlist.c b/usr.bin/gprof/printlist.c
index 534200809c3..663b362b4d4 100644
--- a/usr.bin/gprof/printlist.c
+++ b/usr.bin/gprof/printlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printlist.c,v 1.7 2009/10/27 23:59:38 deraadt Exp $ */
+/* $OpenBSD: printlist.c,v 1.8 2015/08/20 22:32:41 deraadt Exp $ */
/* $NetBSD: printlist.c,v 1.5 1995/04/19 07:16:23 cgd Exp $ */
/*
@@ -58,7 +58,7 @@ addlist(struct stringlist *listp, char *funcname)
{
struct stringlist *slp;
- slp = (struct stringlist *) malloc( sizeof(struct stringlist));
+ slp = malloc(sizeof(struct stringlist));
if (slp == (struct stringlist *) 0)
errx(0, "ran out room for printlist");
slp -> next = listp -> next;