diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-11-28 01:33:47 +0300 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-12-01 11:57:33 -0500 |
commit | 98c783852039061db8c1611742660aaded0eab77 (patch) | |
tree | 687432f0b432ea3f70ae7b6d457c8571844e5f71 /tapset-timers.cxx | |
parent | 5f4fd35709b9b3e94873c6e38c574066c470a9e3 (diff) | |
download | systemtap-steved-98c783852039061db8c1611742660aaded0eab77.tar.gz systemtap-steved-98c783852039061db8c1611742660aaded0eab77.tar.xz systemtap-steved-98c783852039061db8c1611742660aaded0eab77.zip |
Use proper types for do_div
do_div accepts unsigned 64-bit integer type for dividend, signed types
would cause do_div's typecheck fail:
stat-common.c: In function 'needed_space':
stat-common.c:50: error: comparison of distinct pointer types lacks a cast
...same errors in time.c and tapset-timers.cxx's generated code...
A fix for time.c is special, on ppc32 cycles_t is 32-bit, so technically
we don't need do_div, but since the whole _stp_gettimeofday_ns() operates
on 64-bit types we'd better be safe and use uint64_t for the math.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Diffstat (limited to 'tapset-timers.cxx')
-rw-r--r-- | tapset-timers.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tapset-timers.cxx b/tapset-timers.cxx index 65746266..7195cfaf 100644 --- a/tapset-timers.cxx +++ b/tapset-timers.cxx @@ -241,7 +241,7 @@ hrtimer_derived_probe_group::emit_interval (translator_output* o) { o->line() << "({"; o->newline(1) << "unsigned long nsecs;"; - o->newline() << "int64_t i = stp->intrv;"; + o->newline() << "uint64_t i = stp->intrv;"; o->newline() << "if (stp->rnd != 0) {"; // XXX: why not use stp_random_pm instead of this? o->newline(1) << "int64_t r;"; |