This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: gprof-related patches


Hi Frank,

> Index: gprof/ChangeLog
> 2002-02-18  Frank Ch. Eigler  <fche@redhat.com>
> 
> 	* hist.c (hist_print): Rewrite log_scale calculation loop.

This patch seems a little heavy handed:

>         if (top_dog && top_dog->ncalls != 0 && top_time > 0.0)
>   	{
> + 	  int min_log_scale = 0;

What is the purpose of the declaraion of the min_log_scale ?

> + 	  int max_log_scale = sizeof (SItab) / sizeof (SItab[0]) - 1;

Why not use the ARRAY_SIZE macro in libiberty.h here ?  In fact, why
have a variable at all ?

> ! 	      float scaled_value = SItab[log_scale].scale * top_time;
> ! 	      if (scaled_value >= 1.0 && scaled_value < 1000.0) 
> ! 		break;

Why use 'float' arithmetic here ?  Since 'scale' and 'top_time' are
doubles why not keep everything in double format ?

Also please put a blank line between the variable declaration and the
body of the loop.

Cheers
        Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]