changeset 1273:ff92dea1b818

* src/emulate.cxx (get_hw_seconds): Modified the ticks-to-seconds conversion in the wallclock emulator's get_hw_seconds() function. The previous implementation would easily overflow for any reasonable date/tick-resolution combinations.
author asl
date Sat, 04 Oct 2003 19:47:17 +0000
parents 548125f9b000
children 2ac0ba640590
files packages/io/wallclock/current/ChangeLog packages/io/wallclock/current/src/emulate.cxx
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/io/wallclock/current/ChangeLog
+++ b/packages/io/wallclock/current/ChangeLog
@@ -1,3 +1,10 @@
+2003-09-23  Dan Jakubiec <firstname.lastname@systech.com>
+
+	* src/emulate.cxx (get_hw_seconds): Modified the ticks-to-seconds
+	conversion in the wallclock emulator's get_hw_seconds() function.
+	The previous implementation would easily overflow for any
+	reasonable date/tick-resolution combinations.
+
 2003-09-19  Gary Thomas  <gary@mlbassoc.com>
 
 	* tests/wallclock.cxx: Allow test to complete, even if it looses sync.
--- a/packages/io/wallclock/current/src/emulate.cxx
+++ b/packages/io/wallclock/current/src/emulate.cxx
@@ -85,7 +85,7 @@ Cyg_WallClock::get_hw_seconds( void )
     cyg_tick_count secs = Cyg_Clock::real_time_clock->current_value()
         - epoch_ticks;
 
-    secs = ( secs * res.dividend ) / ( res.divisor * 1000000000LL ) ;
+    secs = secs / ( ( res.divisor * 1000000000LL ) / res.dividend );
 
     return secs;
 }