aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-09-05 10:08:45 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-09-05 08:08:45 +0000
commitd1c772b9bb4053ff15ddbf2fadf8f6ad8210dc4e (patch)
tree2516ad639cdfd103fce5f92e81e2786e7614be94 /gcc/gcov.c
parent3d043c51f5356d614ce8cc6678dff874a9c1f4f2 (diff)
downloadgcc-d1c772b9bb4053ff15ddbf2fadf8f6ad8210dc4e.zip
gcc-d1c772b9bb4053ff15ddbf2fadf8f6ad8210dc4e.tar.gz
gcc-d1c772b9bb4053ff15ddbf2fadf8f6ad8210dc4e.tar.bz2
GCOV: Print one decimal place in human readable mode.
2018-09-05 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Update documentation of humar readable mode. * gcov.c (format_count): Print one decimal place, it provides more fine number of situations like '1G' vs. '1.4G'. 2018-09-05 Martin Liska <mliska@suse.cz> * g++.dg/gcov/loop.C: Update test to support new format. From-SVN: r264112
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r--gcc/gcov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c
index ff4020c..6a24a32 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -2216,8 +2216,8 @@ format_count (gcov_type count)
if (count + divisor / 2 < 1000 * divisor)
break;
}
- gcov_type r = (count + divisor / 2) / divisor;
- sprintf (buffer, "%" PRId64 "%c", r, units[i]);
+ float r = 1.0f * count / divisor;
+ sprintf (buffer, "%.1f%c", r, units[i]);
return buffer;
}