=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/gprof/dfn.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/gprof/dfn.c 1996/06/26 05:33:49 1.2 +++ src/usr.bin/gprof/dfn.c 2001/03/22 05:18:30 1.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: dfn.c,v 1.2 1996/06/26 05:33:49 deraadt Exp $ */ +/* $OpenBSD: dfn.c,v 1.3 2001/03/22 05:18:30 mickey Exp $ */ /* $NetBSD: dfn.c,v 1.5 1995/04/19 07:15:56 cgd Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)dfn.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: dfn.c,v 1.2 1996/06/26 05:33:49 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: dfn.c,v 1.3 2001/03/22 05:18:30 mickey Exp $"; #endif #endif /* not lint */ @@ -57,6 +57,7 @@ int dfn_counter; +void dfn_init() { @@ -67,6 +68,7 @@ /* * given this parent, depth first number its children. */ +void dfn( parentp ) nltype *parentp; { @@ -113,15 +115,14 @@ /* * push a parent onto the stack and mark it busy */ +void dfn_pre_visit( parentp ) nltype *parentp; { dfn_depth += 1; - if ( dfn_depth >= DFN_DEPTH ) { - fprintf( stderr , "[dfn] out of my depth (dfn_stack overflow)\n" ); - exit( 1 ); - } + if ( dfn_depth >= DFN_DEPTH ) + errx(1, "[dfn] out of my depth (dfn_stack overflow)" ); dfn_stack[ dfn_depth ].nlentryp = parentp; dfn_stack[ dfn_depth ].cycletop = dfn_depth; parentp -> toporder = DFN_BUSY; @@ -162,6 +163,7 @@ /* * MISSING: an explanation */ +void dfn_findcycle( childp ) nltype *childp; { @@ -180,10 +182,8 @@ break; } } - if ( cycletop <= 0 ) { - fprintf( stderr , "[dfn_findcycle] couldn't find head of cycle\n" ); - exit( 1 ); - } + if ( cycletop <= 0 ) + errx( 1, "[dfn_findcycle] couldn't find head of cycle"); # ifdef DEBUG if ( debug & DFNDEBUG ) { printf( "[dfn_findcycle] dfn_depth %d cycletop %d " , @@ -260,10 +260,8 @@ } # endif DEBUG } - } else if ( childp -> cyclehead != cycleheadp /* firewall */ ) { - fprintf( stderr , - "[dfn_busy] glommed, but not to cyclehead\n" ); - } + } else if ( childp -> cyclehead != cycleheadp /* firewall */ ) + warnx("[dfn_busy] glommed, but not to cyclehead"); } } } @@ -272,6 +270,7 @@ * deal with self-cycles * for lint: ARGSUSED */ +void dfn_self_cycle( parentp ) nltype *parentp; { @@ -293,6 +292,7 @@ * [MISSING: an explanation] * and pop it off the stack */ +void dfn_post_visit( parentp ) nltype *parentp; {