diff options
Diffstat (limited to 'gprof/hist.c')
-rw-r--r-- | gprof/hist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gprof/hist.c b/gprof/hist.c index d987656..08aae2e 100644 --- a/gprof/hist.c +++ b/gprof/hist.c @@ -463,7 +463,7 @@ hist_print () { Sym **time_sorted_syms, *top_dog, *sym; unsigned int index; - int log_scale; + unsigned log_scale; double top_time, time; bfd_vma addr; @@ -528,11 +528,12 @@ hist_print () { top_time /= hz; - while (SItab[log_scale].scale * top_time < 1000.0 - && ((size_t) log_scale - < sizeof (SItab) / sizeof (SItab[0]) - 1)) + for (log_scale = 0; log_scale < ARRAY_SIZE (SItab); log_scale ++) { - ++log_scale; + double scaled_value = SItab[log_scale].scale * top_time; + + if (scaled_value >= 1.0 && scaled_value < 1000.0) + break; } } } |