Boost logo

Boost :

From: Guillaume Melquiond (gmelquio_at_[hidden])
Date: 2003-05-18 09:50:05


This patch avoids the use of an integer constant equal to 60 billions.
Since exactly the same method was already used in the test program for
'one_hour_micro' and 'one_hour_nano', I consider the use of
'one_minute_nano' to be a trivial patch (although it doesn't seem so at
first). It also cleans the code.

Index: libs/date_time/test/testtime_resolution_traits.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/date_time/test/testtime_resolution_traits.cpp,v
retrieving revision 1.7
diff -u -r1.7 testtime_resolution_traits.cpp
--- libs/date_time/test/testtime_resolution_traits.cpp 4 Feb 2003 14:25:26 -0000 1.7
+++ libs/date_time/test/testtime_resolution_traits.cpp 18 May 2003 14:41:44 -0000
@@ -45,13 +45,10 @@
         nano_res::to_tick_count(0,0,0,1) == 1);
   check("nano tick calculations",
         nano_res::to_tick_count(0,0,1,1) == 1000000001);
-#if ((defined(__GNUC__) && (__GNUC__ < 3)) || defined(__IBMCPP__))
+ boost::int64_t one_minute_nano = 60*1000*1000;
+ one_minute_nano = one_minute_nano*1000;
   check("nano tick calculations",
- nano_res::to_tick_count(0,1,0,0) == 60000000000LL);
-#else
- check("nano tick calculations",
- nano_res::to_tick_count(0,1,0,0) == 60000000000);
-#endif
+ nano_res::to_tick_count(0,1,0,0) == one_minute_nano);

   //skip io on VC6 b/c of lack of operator<< for int64
 #if (defined(BOOST_MSVC) && (_MSC_VER <= 1200)) // 1200 == VC++ 6.0

Regards,

Guillaume


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk