Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65070 - sandbox/chrono/libs/chrono/example
From: vicente.botet_at_[hidden]
Date: 2010-08-28 04:08:21


Author: viboes
Date: 2010-08-28 04:08:15 EDT (Sat, 28 Aug 2010)
New Revision: 65070
URL: http://svn.boost.org/trac/boost/changeset/65070

Log:
eliminate warning long double to double conversion
Text files modified:
   sandbox/chrono/libs/chrono/example/scoped_stopwatch_example.cpp | 2 +-
   sandbox/chrono/libs/chrono/example/suspendible_stopclock_example.cpp | 6 +++---
   2 files changed, 4 insertions(+), 4 deletions(-)

Modified: sandbox/chrono/libs/chrono/example/scoped_stopwatch_example.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/example/scoped_stopwatch_example.cpp (original)
+++ sandbox/chrono/libs/chrono/example/scoped_stopwatch_example.cpp 2010-08-28 04:08:15 EDT (Sat, 28 Aug 2010)
@@ -12,7 +12,7 @@
 #include "sleep_for.hpp"
 
 using namespace boost::chrono;
-double res;
+long double res;
 void f1(long j)
 {
     stopwatch_reporter<stopwatch<> > _(BOOST_CHRONO_STOPWATCH_FUNCTION_FORMAT);

Modified: sandbox/chrono/libs/chrono/example/suspendible_stopclock_example.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/example/suspendible_stopclock_example.cpp (original)
+++ sandbox/chrono/libs/chrono/example/suspendible_stopclock_example.cpp 2010-08-28 04:08:15 EDT (Sat, 28 Aug 2010)
@@ -13,14 +13,14 @@
 #include <cmath>
 
 using namespace boost::chrono;
-double res;
+long double res;
 
 int f1(long j)
 {
     stopclock<suspendible_clock<high_resolution_clock> > a(9);
     //stopclock<high_resolution_clock> b(9);
 
- for ( long i = 0; i < j; ++i )
+ for ( int i = 0; i < j; ++i )
         res+=std::sqrt( res+123.456L+i ); // burn some time
     if (j!=0) f1(j-1);
     //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
@@ -33,7 +33,7 @@
     stopclock<suspendible_clock<high_resolution_clock> > a(9);
     //stopclock<high_resolution_clock> b(9);
 
- for (long i =1; i<= 3; ++i)
+ for (int i =1; i<= 3; ++i)
         f1(i*100);
     std::cout<< res << std::endl;
     return 0;


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