version 1.7, 2003/06/03 02:56:08 |
version 1.8, 2004/07/20 08:46:23 |
|
|
int viable; |
int viable; |
int newcycle; |
int newcycle; |
int oldcycle; |
int oldcycle; |
|
void printsubcycle(cltype *); |
#endif /* DEBUG */ |
#endif /* DEBUG */ |
|
|
/* |
/* |
|
|
|
|
# ifdef DEBUG |
# ifdef DEBUG |
if ( debug & TALLYDEBUG ) { |
if ( debug & TALLYDEBUG ) { |
printf( "[addarc] %d arcs from %s to %s\n" , |
printf( "[addarc] %ld arcs from %s to %s\n" , |
count , parentp -> name , childp -> name ); |
count , parentp -> name , childp -> name ); |
} |
} |
# endif /* DEBUG */ |
# endif /* DEBUG */ |
|
|
*/ |
*/ |
# ifdef DEBUG |
# ifdef DEBUG |
if ( debug & TALLYDEBUG ) { |
if ( debug & TALLYDEBUG ) { |
printf( "[tally] hit %d += %d\n" , |
printf( "[tally] hit %ld += %ld\n" , |
arcp -> arc_count , count ); |
arcp -> arc_count , count ); |
} |
} |
# endif /* DEBUG */ |
# endif /* DEBUG */ |
|
|
*/ |
*/ |
# ifdef DEBUG |
# ifdef DEBUG |
if ( debug & BREAKCYCLE ) { |
if ( debug & BREAKCYCLE ) { |
printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle ); |
printf("[doarcs] pass %ld, cycle(s) %d\n" , pass , ncycle ); |
} |
} |
# endif /* DEBUG */ |
# endif /* DEBUG */ |
if ( pass == 1 ) { |
if ( pass == 1 ) { |
|
|
if ( debug & PROPDEBUG ) { |
if ( debug & PROPDEBUG ) { |
printf( "[dotime] child \t" ); |
printf( "[dotime] child \t" ); |
printname( childp ); |
printname( childp ); |
printf( " with %f %f %d/%d\n" , |
printf( " with %f %f %ld/%ld\n" , |
childp -> time , childp -> childtime , |
childp -> time , childp -> childtime , |
arcp -> arc_count , childp -> npropcall ); |
arcp -> arc_count , childp -> npropcall ); |
printf( "[dotime] parent\t" ); |
printf( "[dotime] parent\t" ); |
|
|
*/ |
*/ |
cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) ); |
cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) ); |
if ( cyclenl == 0 ) |
if ( cyclenl == 0 ) |
errx(0, "No room for %d bytes of cycle headers", |
errx(0, "No room for %ld bytes of cycle headers", |
(ncycle + 1) * sizeof(nltype)); |
(ncycle + 1) * sizeof(nltype)); |
/* |
/* |
* now link cycles to true cycleheads, |
* now link cycles to true cycleheads, |
|
|
done = FALSE; |
done = FALSE; |
cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) ); |
cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) ); |
if ( cyclestack == 0 ) { |
if ( cyclestack == 0 ) { |
warnx("No room for %d bytes of cycle stack" , |
warnx("No room for %ld bytes of cycle stack" , |
(size + 1) * sizeof(arctype *)); |
(size + 1) * sizeof(arctype *)); |
return (done); |
return (done); |
} |
} |
|
|
clp = (cltype *) |
clp = (cltype *) |
calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); |
calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); |
if ( clp == 0 ) { |
if ( clp == 0 ) { |
warnx("No room for %d bytes of subcycle storage" , |
warnx("No room for %ld bytes of subcycle storage" , |
sizeof(cltype) + (size - 1) * sizeof(arctype *)); |
sizeof(cltype) + (size - 1) * sizeof(arctype *)); |
return( FALSE ); |
return( FALSE ); |
} |
} |
|
|
} |
} |
|
|
#ifdef DEBUG |
#ifdef DEBUG |
|
void |
printsubcycle( clp ) |
printsubcycle( clp ) |
cltype *clp; |
cltype *clp; |
{ |
{ |
|
|
printf( "%s <cycle %d>\n" , (*arcpp) -> arc_parentp -> name , |
printf( "%s <cycle %d>\n" , (*arcpp) -> arc_parentp -> name , |
(*arcpp) -> arc_parentp -> cycleno ) ; |
(*arcpp) -> arc_parentp -> cycleno ) ; |
for ( endlist = &clp -> list[ clp -> size ]; arcpp < endlist ; arcpp++ ) |
for ( endlist = &clp -> list[ clp -> size ]; arcpp < endlist ; arcpp++ ) |
printf( "\t(%d) -> %s\n" , (*arcpp) -> arc_count , |
printf( "\t(%ld) -> %s\n" , (*arcpp) -> arc_count , |
(*arcpp) -> arc_childp -> name ) ; |
(*arcpp) -> arc_childp -> name ) ; |
} |
} |
#endif /* DEBUG */ |
#endif /* DEBUG */ |