summaryrefslogtreecommitdiffstats
path: root/runtime/map-values.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-05-18 00:25:31 +0000
committerhunt <hunt>2005-05-18 00:25:31 +0000
commitf1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994 (patch)
tree3218fc90339d9f3ba7cb543d4992a6b27f5bd206 /runtime/map-values.c
parent042803219fdd22aed9a134d46788ed01d29e1d7c (diff)
downloadsystemtap-steved-f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994.tar.gz
systemtap-steved-f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994.tar.xz
systemtap-steved-f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994.zip
2005-05-17 Martin Hunt <hunt@redhat.com>
* map.c (needed_space): Use do_div(). (_stp_map_print_histogram): Ditto. (_stp_map_print): Ditto. * map-values.c (_stp_map_add_int64_stat): Use do_div() when computing histogram bucket. * map-keys.c (_stp_map_key): Fix some warnings on 32-bit machines by using key_data casts.
Diffstat (limited to 'runtime/map-values.c')
-rw-r--r--runtime/map-values.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/map-values.c b/runtime/map-values.c
index 3d6af134..6f8adf11 100644
--- a/runtime/map-values.c
+++ b/runtime/map-values.c
@@ -103,7 +103,10 @@ void VALSYM(_stp_map_add_int64) (MAP map, int64_t val)
d->histogram[n]++;
break;
case HIST_LINEAR:
- n = (val - map->hist_start) / map->hist_int;
+ /* n = (val - map->hist_start) / map->hist_int; */
+ val -= map->hist_start;
+ do_div (val, map->hist_int);
+ n = val;
if (n < 0)
n = 0;
if (n >= map->hist_buckets)