RFA: gprof-related patches

Nick Clifton nickc@cambridge.redhat.com
Tue Feb 19 03:54:00 GMT 2002
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




More information about the Binutils mailing list