Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67767 - sandbox/chrono/boost/chrono/detail/inlined/mac
From: vicente.botet_at_[hidden]
Date: 2011-01-08 03:35:55


Author: viboes
Date: 2011-01-08 03:35:53 EST (Sat, 08 Jan 2011)
New Revision: 67767
URL: http://svn.boost.org/trac/boost/changeset/67767

Log:
Boost.Chrono: Try to solve issue

 Test output:
Rev 67766 / Sat, 8 Jan 2011 01:49:47 +0000
Report Time: Sat, 8 Jan 2011 04:55:15 +0000

Compile [2011-01-08 02:36:12 UTC]: fail

    "/usr/bin/g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -pedantic -g -dynamic -no-cpp-precomp -gdwarf-2 -Wno-long-double -fPIC -Wextra -Wno-long-long -pedantic -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_USE_WINDOWS_H -I".." -c -o "/Volumes/Scratch/kbelco/boost/results/boost/bin.v2/libs/chrono/build/darwin-4.0.1/debug/chrono.o" "../libs/chrono/src/chrono.cpp"

../boost/chrono/detail/inlined/mac/chrono.hpp: In static member function 'static boost::chrono::time_point<boost::chrono::steady_clock, boost::chrono::nanoseconds> boost::chrono::steady_clock::now()':
../boost/chrono/detail/inlined/mac/chrono.hpp:197: error: invalid conversion from 'int_least64_t (*)()' to 'int_least64_t (*)(boost::system::error_code&)'
../boost/chrono/detail/inlined/mac/chrono.hpp:206: error: too few arguments to function
../boost/chrono/detail/inlined/mac/chrono.hpp: In static member function 'static boost::chrono::time_point<boost::chrono::steady_clock, boost::chrono::nanoseconds> boost::chrono::steady_clock::now(boost::system::error_code&)':
../boost/chrono/detail/inlined/mac/chrono.hpp:213: error: invalid conversion from 'int_least64_t (*)()' to 'int_least64_t (*)(boost::system::error_code&)'
../boost/chrono/detail/inlined/mac/chrono.hpp: At global scope:
../boost/chrono/detail/inlined/mac/chrono.hpp:176: warning: 'int_least64_t (* boost::chrono::chrono_detail::init_steady_clock_ec(kern_return_t&))(boost::system::error_code&)' defined but not used

TinyUrl
Text files modified:
   sandbox/chrono/boost/chrono/detail/inlined/mac/chrono.hpp | 68 ++++++++++++++++++++--------------------
   1 files changed, 34 insertions(+), 34 deletions(-)

Modified: sandbox/chrono/boost/chrono/detail/inlined/mac/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/detail/inlined/mac/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/detail/inlined/mac/chrono.hpp 2011-01-08 03:35:53 EST (Sat, 08 Jan 2011)
@@ -64,9 +64,9 @@
 namespace chrono_detail
 {
 
-// monotonic_clock
+// steady_clock
 
-// Note, in this implementation monotonic_clock and high_resolution_clock
+// Note, in this implementation steady_clock and high_resolution_clock
 // are the same clock. They are both based on mach_absolute_time().
 // mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
 // nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
@@ -76,15 +76,15 @@
 // MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
 // for that case as an optimization.
 BOOST_CHRONO_STATIC
-monotonic_clock::rep
-monotonic_simplified()
+steady_clock::rep
+steady_simplified()
 {
     return mach_absolute_time();
 }
 
 BOOST_CHRONO_STATIC
-monotonic_clock::rep
-monotonic_simplified_ec(system::error_code & ec)
+steady_clock::rep
+steady_simplified_ec(system::error_code & ec)
 {
     if (!BOOST_CHRONO_IS_THROWS(ec))
         ec.clear();
@@ -95,7 +95,7 @@
 
 BOOST_CHRONO_STATIC
 double
-compute_monotonic_factor(kern_return_t& err)
+compute_steady_factor(kern_return_t& err)
 {
     mach_timebase_info_data_t MachInfo;
     err = mach_timebase_info(&MachInfo);
@@ -106,23 +106,23 @@
 }
 
 BOOST_CHRONO_STATIC
-monotonic_clock::rep
-monotonic_full()
+steady_clock::rep
+steady_full()
 {
     static kern_return_t err;
- static const double factor = chrono_detail::compute_monotonic_factor(err);
+ static const double factor = chrono_detail::compute_steady_factor(err);
     if (err != 0)
       boost::throw_exception(
- system::system_error( err, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::monotonic_clock" ));
- return static_cast<monotonic_clock::rep>(mach_absolute_time() * factor);
+ system::system_error( err, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::steady_clock" ));
+ return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
 }
 
 BOOST_CHRONO_STATIC
-monotonic_clock::rep
-monotonic_full_ec(system::error_code & ec)
+steady_clock::rep
+steady_full_ec(system::error_code & ec)
 {
     static kern_return_t err;
- static const double factor = chrono_detail::compute_monotonic_factor(err);
+ static const double factor = chrono_detail::compute_steady_factor(err);
     if (err != 0) {
         if (BOOST_CHRONO_IS_THROWS(ec))
         {
@@ -130,27 +130,27 @@
                     system::system_error(
                             err,
                             BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::monotonic_clock" ));
+ "chrono::steady_clock" ));
         }
         else
         {
             ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
- return monotonic_clock::rep();
+ return steady_clock::rep();
         }
     }
     if (!BOOST_CHRONO_IS_THROWS(ec))
         ec.clear();
     }
- return static_cast<monotonic_clock::rep>(mach_absolute_time() * factor);
+ return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
 }
 
-typedef monotonic_clock::rep (*FP)();
-typedef monotonic_clock::rep (*FP_ec)(system::error_code &);
+typedef steady_clock::rep (*FP)();
+typedef steady_clock::rep (*FP_ec)(system::error_code &);
 
 
 BOOST_CHRONO_STATIC
 FP
-init_monotonic_clock(kern_return_t & err)
+init_steady_clock(kern_return_t & err)
 {
     mach_timebase_info_data_t MachInfo;
     err = mach_timebase_info(&MachInfo);
@@ -159,13 +159,13 @@
     }
 
     if (MachInfo.numer == MachInfo.denom)
- return &chrono_detail::monotonic_simplified;
- return &chrono_detail::monotonic_full;
+ return &chrono_detail::steady_simplified;
+ return &chrono_detail::steady_full;
 }
 
 BOOST_CHRONO_STATIC
 FP_ec
-init_monotonic_clock_ec(kern_return_t & err)
+init_steady_clock_ec(kern_return_t & err)
 {
     mach_timebase_info_data_t MachInfo;
     err = mach_timebase_info(&MachInfo);
@@ -174,30 +174,30 @@
     }
 
     if (MachInfo.numer == MachInfo.denom)
- return &chrono_detail::monotonic_simplified_ec;
- return &chrono_detail::monotonic_full_ec;
+ return &chrono_detail::steady_simplified_ec;
+ return &chrono_detail::steady_full_ec;
 }
 }
-monotonic_clock::time_point
-monotonic_clock::now()
+steady_clock::time_point
+steady_clock::now()
 {
     static kern_return_t err;
- static chrono_detail::FP_ec fp = chrono_detail::init_monotonic_clock(err);
+ static chrono_detail::FP fp = chrono_detail::init_steady_clock(err);
     if( err != 0 ) {
         boost::throw_exception(
                 system::system_error(
                         err,
                         BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::monotonic_clock" ));
+ "chrono::steady_clock" ));
     }
     return time_point(duration(fp()));
 }
 
-monotonic_clock::time_point
-monotonic_clock::now(system::error_code & ec)
+steady_clock::time_point
+steady_clock::now(system::error_code & ec)
 {
     static kern_return_t err;
- static chrono_detail::FP_ec fp = chrono_detail::init_monotonic_clock(err);
+ static chrono_detail::FP_ec fp = chrono_detail::init_steady_clock_ec(err);
     if( err != 0 ) {
         if (BOOST_CHRONO_IS_THROWS(ec))
         {
@@ -205,7 +205,7 @@
                     system::system_error(
                             err,
                             BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::monotonic_clock" ));
+ "chrono::steady_clock" ));
         }
         else
         {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk