Project

General

Profile

Actions

Bug #75

closed

warning fixes, multiple diffs included.

Added by kevin.kane about 18 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

More of the same:
gprof.c:86:12: warning: extra tokens at end of #else directive
etc.. etc..

Index: aout.c ===================================================================
RCS file: /home/dcvs/src/usr.bin/gprof/aout.c,v
retrieving revision 1.2
diff u -r1.2 aout.c
--
aout.c 10 Apr 2005 20:55:38 0000 1.2
++ aout.c 19 Jan 2006 02:58:57 -0000
@ -50,7 +50,7 @
printf("[getnfile] 0X%08x\t%s\n", nl[j].value, nl[j].name);
}
}
# endif DEBUG
# endif /* DEBUG /
*defaultEs = excludes;
return 0;
}
@ -118,7 +118,7 @
printf( "[getsymtab] rejecting: 0x%x %s\n" ,
nbuf.n_type , strtab + nbuf.n_un.n_strx );
}
# endif DEBUG
# endif /
DEBUG /
continue;
}
npe>value = nbuf.n_value;
@ -128,7 +128,7 @
printf( "[getsymtab] %d %s 0x%08x\n" ,
nname , npe > name , npe -> value );
}
# endif DEBUG
# endif /
DEBUG */
npe++;
nname++;
}

Index: arcs.c ===================================================================
RCS file: /home/dcvs/src/usr.bin/gprof/arcs.c,v
retrieving revision 1.4
diff u -r1.4 arcs.c
--
arcs.c 10 Apr 2005 20:55:38 0000 1.4
++ arcs.c 19 Jan 2006 03:01:32 -0000
@ -43,7 +43,7 @
int viable;
int newcycle;
int oldcycle;
#endif DEBUG
#endif /* DEBUG */

/*
 * add (or just increment) an arc
@ -57,7 +57,7 @
printf( "[addarc] d arcs from %s to %s\n" ,
count , parentp > name , childp -> name );
}
# endif DEBUG
# endif /* DEBUG /
arcp = arclookup( parentp , childp );
if ( arcp != 0 ) {
/

@ -68,7 +68,7 @
printf( "[tally] hit %d += %d\n" ,
arcp > arc_count , count );
}
# endif DEBUG
# endif /* DEBUG /
arcp > arc_count = count;
return;
}
@ -166,7 +166,7 @
if ( debug x%x
BREAKCYCLE ) {
printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle );
}
# endif DEBUG
# endif /
DEBUG /
if ( pass == 1 ) {
printf( "\n\n%s %s\n%s %d:\n" ,
"The following arcs were deleted" ,
@ -210,7 +210,7 @
printf( "\n" );
}
}
-# endif DEBUG
+# endif /
DEBUG /
/
* starting from the topological top, * propagate print flags to children.
@ -339,7 +339,7 @
printname( parentp );
printf( "\n[dotime] share %f\n" , share );
}
-# endif DEBUG
+# endif /* DEBUG */
}
}

@ -407,7 +407,7 @
printname( nlp );
printf( " is the head of cycle %d\n" , cycle );
}
-# endif DEBUG
+# endif /* DEBUG /
/
* link members to cycle header
/
@ -482,7 +482,7 @
printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" ,
cycleno , ncycle , size );
}
# endif DEBUG
# endif /
DEBUG /
for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) {
stkp = &cyclestack0;
nlp -> flags |= CYCLEHEAD;
@ -510,7 +510,7 @
printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n",
"[doarcs]" , visited , viable , newcycle , oldcycle);
}
# endif DEBUG
# endif /
DEBUG */
return( done );
}

@ -522,14 +522,14 @
for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) { # ifdef DEBUG
visited++;
-# endif DEBUG
+# endif /* DEBUG */
if ( arcp -> arc_childp -> cycleno != node -> cycleno || ( arcp -> arc_childp -> flags & VISITED ) || ( arcp -> arc_flags & DEADARC ) )
continue; # ifdef DEBUG
viable++;
-# endif DEBUG
+# endif /* DEBUG */
*stkp = arcp;
if ( arcp -> arc_childp -> flags & CYCLEHEAD ) {
if ( addcycle( stkstart , stkp ) FALSE )
@ -578,7 +578,7 @
if ( arcpp endlist ) { # ifdef DEBUG
oldcycle++;
# endif DEBUG
# endif /* DEBUG /
return( TRUE );
}
}
@ -610,7 +610,7 @
if ( debug & SUBCYCLELIST ) {
printsubcycle( clp );
}
# endif DEBUG
# endif /
DEBUG */
cyclecnt++;
if ( cyclecnt >= CYCLEMAX )
return( FALSE );
@ -675,7 +675,7 @
maxarcp = maxexitarcp; # ifdef DEBUG
type = "exit";
-# endif DEBUG
+# endif /* DEBUG /
} else if ( maxwithparentcnt > 0 ) {
/
* second choice is edge leading to node with at least one
@ -684,7 +684,7 @
maxarcp = maxwithparentarcp; # ifdef DEBUG
type = "internal";
-# endif DEBUG
+# endif /* DEBUG /
} else {
/
* last choice is edge leading to node with only this arc as
@ -693,7 +693,7 @
maxarcp = maxnoparentarcp; # ifdef DEBUG
type = "orphan";
# endif DEBUG
# endif /* DEBUG /
}
maxarcp -> arc_flags |= DEADARC;
maxarcp -> arc_childp -> parentcnt -= 1;
@ -705,7 +705,7 @
maxarcp -> arc_count , maxarcp -> arc_childp -> name ,
maxarcp -> arc_cyclecnt );
}
# endif DEBUG
# endif /
DEBUG /
printf( "\t%s to %s with %d calls\n" , maxarcp > arc_parentp -> name ,
maxarcp -> arc_childp -> name , maxarcp -> arc_count );
prev = &cyclehead;
@ -741,7 +741,7 @
printf( "\t(%d) -> %s\n" , (*arcpp) -> arc_count ,
(*arcpp) -> arc_childp -> name ) ;
}
#endif DEBUG
+#endif /
DEBUG */

cycletime(void)
{
@ -799,7 +799,7 @
printf( " inherits printflag %d and propfraction %f\n" ,
childp > printflag , childp -> propfraction );
}
# endif DEBUG
+# endif /* DEBUG /
if ( ! childp -> printflag ) {
/
* printflag is off
@ -855,7 +855,7 @
printf( "time %f propself %f printtime %f\n" ,
childp > time , childp -> propself , printtime );
}
# endif DEBUG
+# endif /* DEBUG */
}
}

Index: dfn.c ===================================================================
RCS file: /home/dcvs/src/usr.bin/gprof/dfn.c,v
retrieving revision 1.3
diff u -r1.3 dfn.c
--
dfn.c 4 Oct 2003 20:36:45 0000 1.3
++ dfn.c 19 Jan 2006 03:03:31 -0000
@ -70,7 +70,7 @
printname( parentp );
printf( ")\n" );
}
# endif DEBUG
# endif /* DEBUG /
/
* if we're already numbered, no need to look any furthur.
/
@ -122,7 +122,7 @
printname( parentp );
printf( "\n" );
}
-# endif DEBUG
+# endif /
DEBUG */
}

/*
@ -179,7 +179,7 @
printname( cycleheadp );
printf( "\n" );
}
-# endif DEBUG
+# endif /* DEBUG /
if ( cycletop == dfn_depth ) {
/
* this is previous function, e.g. this calls itself
@ -201,7 +201,7 @
printname( tailp );
printf( "\n" );
}
-# endif DEBUG
+# endif /* DEBUG /
}
/
* if what we think is the top of the cycle
@ -216,7 +216,7 @
printname( cycleheadp );
printf( "\n" );
}
# endif DEBUG
# endif /* DEBUG /
}
for ( index = cycletop + 1 ; index <= dfn_depth ; index += 1 ) {
childp = dfn_stack[ index ].nlentryp;
@ -235,7 +235,7 @
printname( cycleheadp );
printf( "\n" );
}
# endif DEBUG
# endif /
DEBUG */
for ( tailp = childp ; tailp->cnext ; tailp = tailp->cnext ) {
tailp -> cnext -> cyclehead = cycleheadp;
  1. ifdef DEBUG
    @ -246,7 +246,7 @
    printname( cycleheadp );
    printf( "\n" );
    }
    # endif DEBUG
    # endif /* DEBUG /
    }
    } else if ( childp -> cyclehead != cycleheadp /
    firewall / ) {
    fprintf( stderr ,
    @ -272,7 +272,7 @
    printname( parentp );
    printf( "\n" );
    }
    # endif DEBUG
    # endif /
    DEBUG */
    }
  2. ifdef DEBUG
    if ( debug & DFNDEBUG ) {
    printf( "[dfn_post_visit]\t\tis part of a cycle\n" );
    }
    -# endif DEBUG
    +# endif /* DEBUG */
    }
    dfn_depth -= 1;
    }
/*
@ -290,7 +290,7 @
printname( parentp );
printf( "\n" );
}
-# endif DEBUG
+# endif /* DEBUG /
/
* number functions and things in their cycles * unless the function is itself part of a cycle
@ -305,14 +305,14 @
printname( memberp );
printf( " > toporder = %d\n" , dfn_counter );
}
# endif DEBUG
+# endif /* DEBUG */
}
} else {

Index: gprof.c ===================================================================
RCS file: /home/dcvs/src/usr.bin/gprof/gprof.c,v
retrieving revision 1.4
diff u -r1.4 gprof.c
--
gprof.c 10 Apr 2005 20:55:38 -0000 1.4
+++ gprof.c 19 Jan 2006 03:21:36 -0000
@ -83,9 +83,9 @
debug |= ANYDEBUG; # ifdef DEBUG
printf("[main] debug = %d\n", debug);
# else not DEBUG
# else /* not DEBUG /
printf("gprof: -d ignored\n");
# endif DEBUG
# endif /
DEBUG /
break;
case 'E':
+argv;
@ -240,7 +240,7 @
printf( "[getpfile] frompc 0x%x selfpc 0x%x count %d\n" ,
arc.raw_frompc , arc.raw_selfpc , arc.raw_count );
}
-# endif DEBUG
# endif /
DEBUG /
/
* add this arc
/
@ -303,7 +303,7 @
sampbytes , nsamples );
printf( "[openpfile] sample rate %d\n" , hz );
}
-# endif DEBUG
+# endif /
DEBUG */
return(pfile);
}

@ -327,7 +327,7 @
printf( "[tally] arc from %s to %s traversed %d times\n" ,
parentp > name , childp -> name , rawp -> raw_count );
}
# endif DEBUG
+# endif /* DEBUG */
addarc( parentp , childp , rawp -> raw_count );
}

@ -376,7 +376,7 @
printf( "[dumpsum] frompc 0x%x selfpc 0x%x count d\n" ,
arc.raw_frompc , arc.raw_selfpc , arc.raw_count );
}
# endif DEBUG
# endif /* DEBUG /
}
}
fclose( sfile );
@ -479,7 +479,7 @
printf( "[asgnsamples] pcl 0x%x pch 0x%x ccnt %d\n" ,
pcl , pch , ccnt );
}
# endif DEBUG
# endif /
DEBUG /
totime = time;
for (j = j - 1; j < nname; j
+) {
svalue0 = nl[j].svalue;
@ -505,7 +505,7 @
nl[j].name,
overlap * time / scale, overlap);
}
# endif DEBUG
# endif /
DEBUG /
nl[j].time += overlap * time / scale;
}
}
@ -514,7 +514,7 @
if (debug x%x
SAMPLEDEBUG) {
printf("[asgnsamples] totime %f\n", totime);
}
# endif DEBUG
# endif /
DEBUG */
}

@ -556,7 +556,7 @
printf("[alignentries] pushing svalue 0x%x to 0x%x\n",
nlp->svalue, nlp->svalue + UNITS_TO_CODE);
}
# endif DEBUG
+# endif /* DEBUG */
nlp
>svalue += UNITS_TO_CODE;
}
}

Index: lookup.c ===================================================================
RCS file: /home/dcvs/src/usr.bin/gprof/lookup.c,v
retrieving revision 1.4
diff u -r1.4 lookup.c
--
lookup.c 10 Apr 2005 20:55:38 -0000 1.4
+++ lookup.c 19 Jan 2006 03:04:01 -0000
@ -52,18 +52,18 @
int probes;

probes = 0;
-# endif DEBUG
+# endif /* DEBUG */
for ( low = 0 , high = nname - 1 ; low != high ; ) {
  1. ifdef DEBUG
    probes = 1;
    -# endif DEBUG
    # endif /* DEBUG */
    middle = ( high + low ) >> 1;
    if ( nl[ middle ].value <= address && nl[ middle+1 ].value > address ) {
  2. ifdef DEBUG
    if ( debug & LOOKUPDEBUG ) {
    printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 );
    }
    # endif DEBUG
    # endif /* DEBUG /
    return &nl[ middle ];
    }
    if ( nl[ middle ].value > address ) {
    @ -77,7 +77,7 @
    fprintf( stderr , "[nllookup] (%d) binary search fails\n" ,
    nname-1 );
    }
    # endif DEBUG
    # endif /
    DEBUG */
    return 0;
    }

@ -95,7 +95,7 @
printf( "[arclookup] parent %s child %s\n" ,
parentp > name , childp -> name );
}
# endif DEBUG
+# endif /* DEBUG */
for ( arcp = parentp -> children ; arcp ; arcp = arcp -> arc_childlist ) { # ifdef DEBUG
if ( debug & LOOKUPDEBUG ) {
@ -103,7 +103,7 @
arcp > arc_parentp -> name ,
arcp -> arc_childp -> name );
}
# endif DEBUG
+# endif /* DEBUG */
if ( arcp -> arc_childp childp ) {
return arcp;
}

Index: printgprof.c
=================================================================
RCS file: /home/dcvs/src/usr.bin/gprof/printgprof.c,v
retrieving revision 1.4
diff u -r1.4 printgprof.c
--
printgprof.c 10 Apr 2005 20:55:38 0000 1.4
++ printgprof.c 19 Jan 2006 03:13:28 -0000
@ -366,7 +366,7 @
if ( debug & PROPDEBUG ) {
printf( "%5.2f%% " , selfp -> propfraction );
}
# endif DEBUG
# endif /* DEBUG /
}
if ( selfp > cycleno != 0 ) {
printf( " <cycle %d>" , selfp -> cycleno );
@ -595,7 +595,7 @
thatp -> arc_count , thatchildp -> ncall );
printf( "\n" );
}
# endif DEBUG
+# endif /
DEBUG /
if ( thisparentp == thischildp ) {
/
this is a self call */
return LESSTHAN;

Actions #1

Updated by corecode about 18 years ago

kevin kane wrote:

More of the same:
gprof.c:86:12: warning: extra tokens at end of #else directive
etc.. etc..

the diff is broken, it has tabs converted to spaces. please resubmit as
attachment.

Actions #2

Updated by swildner about 18 years ago

kevin kane wrote:

More of the same:
gprof.c:86:12: warning: extra tokens at end of #else directive
etc.. etc..

Committed (along with the other utilities that had these warnings).

Next time please ensure that your patch is working. :)

Sascha

Actions

Also available in: Atom PDF