From 1431278aba3347fdb55ec461008a07d9010aea7a Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 9 Sep 2005 09:12:37 +0000 Subject: 2005-09-09 Martin Hunt * stat-common.c (_stp_stat_print_valtype): Use _stp_div64(). * arith.c (_stp_div64): Check error before writing to it. Remove check against 32-bit LONG_MIN and -1. That only applies to 64-bit. (_stp_mod64): Ditto. --- runtime/stat-common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'runtime/stat-common.c') diff --git a/runtime/stat-common.c b/runtime/stat-common.c index ff19662b..55f2ad38 100644 --- a/runtime/stat-common.c +++ b/runtime/stat-common.c @@ -173,10 +173,8 @@ static void _stp_stat_print_valtype (char *fmt, Stat st, struct stat_data *sd, i case 'A': { int64_t avg = 0; - if (sd->count) { - avg = sd->sum; - do_div (avg, (int)sd->count); /* FIXME: check for overflow */ - } + if (sd->count) + avg = _stp_div64 (NULL, sd->sum, sd->count); _stp_printf("%lld", avg); break; } -- cgit