This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFA: gprof-related patches
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 19 Feb 2002 11:12:09 +0000
- Subject: Re: RFA: gprof-related patches
- References: <20020218130144.C9248@redhat.com>
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