summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-02-23 05:31:57 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-02-23 05:31:57 +0000
commit4f61ba333e790bdc6816fd9a2a21850e98b65c3a (patch)
treed5bdeef4dce93ef8794b70f5547317d20ebd0a20
parent91c0adef9337dd4e9e4b501ca19493ecf50922bd (diff)
downloadATCD-4f61ba333e790bdc6816fd9a2a21850e98b65c3a.tar.gz
ack: had to add casts from double to ACE_hrtime_t
-rw-r--r--ace/High_Res_Timer.cpp18
-rw-r--r--ace/High_Res_Timer.i2
2 files changed, 9 insertions, 11 deletions
diff --git a/ace/High_Res_Timer.cpp b/ace/High_Res_Timer.cpp
index 28919373da5..b670b68123d 100644
--- a/ace/High_Res_Timer.cpp
+++ b/ace/High_Res_Timer.cpp
@@ -34,8 +34,8 @@ void
ACE_High_Res_Timer::elapsed_time (ACE_Time_Value &tv)
{
if (scale_factor_ > 0) {
- tv.sec ((this->end_ - this->start_) / 1000000L / scale_factor_);
- tv.usec ((this->end_ - this->start_) % 1000000L / scale_factor_);
+ tv.sec ((ACE_hrtime_t) ((this->end_ - this->start_) / 1000000L / scale_factor_));
+ tv.usec ((ACE_hrtime_t) ((this->end_ - this->start_) % 1000000L / scale_factor_));
} else {
tv.sec ((this->end_ - this->start_) / 1000000L);
tv.usec ((this->end_ - this->start_) % 1000000L);
@@ -47,10 +47,8 @@ void
ACE_High_Res_Timer::elapsed_time (struct timespec &elapsed_time)
{
if (scale_factor_ > 0) {
- elapsed_time.tv_sec = (this->end_ - this->start_) / (1000 * 1000 * 1000) /
- scale_factor_;
- elapsed_time.tv_nsec = (this->end_ - this->start_) % (1000 * 1000 * 1000) /
- scale_factor_;
+ elapsed_time.tv_sec = (ACE_hrtime_t) ((this->end_ - this->start_) / (1000 * 1000 * 1000) / scale_factor_);
+ elapsed_time.tv_nsec = (ACE_hrtime_t) ((this->end_ - this->start_) % (1000 * 1000 * 1000) / scale_factor_);
} else {
elapsed_time.tv_sec = (this->end_ - this->start_) / (1000 * 1000 * 1000);
elapsed_time.tv_nsec = (this->end_ - this->start_) % (1000 * 1000 * 1000);
@@ -62,8 +60,8 @@ void
ACE_High_Res_Timer::elapsed_time_incr (ACE_Time_Value &tv)
{
if (scale_factor_ > 0) {
- tv.sec (this->total_ / 1000000L / scale_factor_);
- tv.usec (this->total_ % 1000000L / scale_factor_);
+ tv.sec ((ACE_hrtime_t) (this->total_ / 1000000L / scale_factor_));
+ tv.usec ((ACE_hrtime_t) (this->total_ % 1000000L / scale_factor_));
} else {
tv.sec (this->total_ / 1000000L);
tv.usec (this->total_ % 1000000L);
@@ -76,7 +74,7 @@ ACE_High_Res_Timer::print_ave (const char *str, const int count, ACE_HANDLE hand
ACE_TRACE ("ACE_High_Res_Timer::print_ave");
ACE_hrtime_t total;
if (scale_factor_ > 0)
- total = (this->end_ - this->start_) /scale_factor_;
+ total = (ACE_hrtime_t) ((this->end_ - this->start_) /scale_factor_);
else
total = this->end_ - this->start_;
ACE_hrtime_t total_secs = total / (1000 * 1000 * 1000);
@@ -104,7 +102,7 @@ ACE_High_Res_Timer::print_total (const char *str, const int count, ACE_HANDLE ha
ACE_TRACE ("ACE_High_Res_Timer::print_total");
ACE_hrtime_t total_secs;
if (scale_factor_ > 0)
- total_secs = this->total_ / (1000 * 1000 * 1000) / scale_factor_;
+ total_secs = (ACE_hrtime_t) (this->total_ / (1000 * 1000 * 1000) / scale_factor_);
else
total_secs = this->total_ / (1000 * 1000 * 1000);
u_long extra_nsecs = this->total_ % (1000 * 1000 * 1000);
diff --git a/ace/High_Res_Timer.i b/ace/High_Res_Timer.i
index 286990f3ede..d36e2b36815 100644
--- a/ace/High_Res_Timer.i
+++ b/ace/High_Res_Timer.i
@@ -49,7 +49,7 @@ ACE_INLINE void
ACE_High_Res_Timer::elapsed_microseconds (ACE_hrtime_t &usecs) const
{
if (scale_factor_ > 0) {
- usecs = (this->end_ - this->start_) / 1000L / scale_factor_;
+ usecs = (ACE_hrtime_t) ((this->end_ - this->start_) / 1000L / scale_factor_);
} else {
usecs = (this->end_ - this->start_) / 1000L;
}