[BACK]Return to dfn.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / gprof

Diff for /src/usr.bin/gprof/dfn.c between version 1.2 and 1.3

version 1.2, 1996/06/26 05:33:49 version 1.3, 2001/03/22 05:18:30
Line 57 
Line 57 
   
 int     dfn_counter;  int     dfn_counter;
   
   void
 dfn_init()  dfn_init()
 {  {
   
Line 67 
Line 68 
     /*      /*
      *  given this parent, depth first number its children.       *  given this parent, depth first number its children.
      */       */
   void
 dfn( parentp )  dfn( parentp )
     nltype      *parentp;      nltype      *parentp;
 {  {
Line 113 
Line 115 
     /*      /*
      *  push a parent onto the stack and mark it busy       *  push a parent onto the stack and mark it busy
      */       */
   void
 dfn_pre_visit( parentp )  dfn_pre_visit( parentp )
     nltype      *parentp;      nltype      *parentp;
 {  {
   
     dfn_depth += 1;      dfn_depth += 1;
     if ( dfn_depth >= DFN_DEPTH ) {      if ( dfn_depth >= DFN_DEPTH )
         fprintf( stderr , "[dfn] out of my depth (dfn_stack overflow)\n" );          errx(1, "[dfn] out of my depth (dfn_stack overflow)" );
         exit( 1 );  
     }  
     dfn_stack[ dfn_depth ].nlentryp = parentp;      dfn_stack[ dfn_depth ].nlentryp = parentp;
     dfn_stack[ dfn_depth ].cycletop = dfn_depth;      dfn_stack[ dfn_depth ].cycletop = dfn_depth;
     parentp -> toporder = DFN_BUSY;      parentp -> toporder = DFN_BUSY;
Line 162 
Line 163 
     /*      /*
      *  MISSING: an explanation       *  MISSING: an explanation
      */       */
   void
 dfn_findcycle( childp )  dfn_findcycle( childp )
     nltype      *childp;      nltype      *childp;
 {  {
Line 180 
Line 182 
             break;              break;
         }          }
     }      }
     if ( cycletop <= 0 ) {      if ( cycletop <= 0 )
         fprintf( stderr , "[dfn_findcycle] couldn't find head of cycle\n" );          errx( 1, "[dfn_findcycle] couldn't find head of cycle");
         exit( 1 );  
     }  
 #   ifdef DEBUG  #   ifdef DEBUG
         if ( debug & DFNDEBUG ) {          if ( debug & DFNDEBUG ) {
             printf( "[dfn_findcycle] dfn_depth %d cycletop %d " ,              printf( "[dfn_findcycle] dfn_depth %d cycletop %d " ,
Line 260 
Line 260 
                         }                          }
 #                   endif DEBUG  #                   endif DEBUG
                 }                  }
             } else if ( childp -> cyclehead != cycleheadp /* firewall */ ) {              } else if ( childp -> cyclehead != cycleheadp /* firewall */ )
                 fprintf( stderr ,                  warnx("[dfn_busy] glommed, but not to cyclehead");
                         "[dfn_busy] glommed, but not to cyclehead\n" );  
             }  
         }          }
     }      }
 }  }
Line 272 
Line 270 
      *  deal with self-cycles       *  deal with self-cycles
      *  for lint: ARGSUSED       *  for lint: ARGSUSED
      */       */
   void
 dfn_self_cycle( parentp )  dfn_self_cycle( parentp )
     nltype      *parentp;      nltype      *parentp;
 {  {
Line 293 
Line 292 
      *  [MISSING: an explanation]       *  [MISSING: an explanation]
      *  and pop it off the stack       *  and pop it off the stack
      */       */
   void
 dfn_post_visit( parentp )  dfn_post_visit( parentp )
     nltype      *parentp;      nltype      *parentp;
 {  {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3