From c46cecccd45e51902c1500292ffd34c6eac99eed Mon Sep 17 00:00:00 2001 From: Jeff Garland Date: Sat, 27 Sep 2003 21:42:58 +0000 Subject: [PATCH] fixes for msvc level4 warnings [SVN r20199] --- .../boost/date_time/c_local_time_adjustor.hpp | 6 +++--- include/boost/date_time/wrapping_int.hpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/boost/date_time/c_local_time_adjustor.hpp b/include/boost/date_time/c_local_time_adjustor.hpp index 2275336..3d017cd 100644 --- a/include/boost/date_time/c_local_time_adjustor.hpp +++ b/include/boost/date_time/c_local_time_adjustor.hpp @@ -3,7 +3,7 @@ #define DATE_TIME_C_LOCAL_TIME_ADJUSTOR_HPP__ /* Copyright (c) 2002 CrystalClear Software, Inc. * Disclaimer & Full Copyright at end of file - * Author: Jeff Garland + * Author: Jeff Garland, Bart Garst */ /*! @file c_local_time_adjustor.hpp @@ -40,8 +40,8 @@ namespace date_time { std::time_t t2 = dd.days()*86400 + td.hours()*3600 + td.minutes()*60 + td.seconds(); std::tm* tms = std::localtime(&t2); date_type d(tms->tm_year + 1900, - tms->tm_mon + 1, - tms->tm_mday); + static_cast(tms->tm_mon + 1), + static_cast(tms->tm_mday)); time_duration_type td2(tms->tm_hour, tms->tm_min, tms->tm_sec, diff --git a/include/boost/date_time/wrapping_int.hpp b/include/boost/date_time/wrapping_int.hpp index 26b7ed3..de47493 100644 --- a/include/boost/date_time/wrapping_int.hpp +++ b/include/boost/date_time/wrapping_int.hpp @@ -28,9 +28,9 @@ public: int_type add(int_type v) { //take the mod here and assign it.... - int_type remainder = v % wrap_val; - int_type overflow = v / wrap_val; - value_ += remainder; + int_type remainder = static_cast(v % wrap_val); + int_type overflow = static_cast(v / wrap_val); + value_ = static_cast(value_ + remainder); if ((value_) >= wrap_val) { value_ -= wrap_val; overflow++; @@ -98,9 +98,9 @@ public: //!Add, return number of wraps performed int_type add(int_type v) { - int_type remainder = v % (wrap_max - wrap_min + 1); - int_type overflow = v / (wrap_max - wrap_min + 1); - value_ += remainder; + int_type remainder = static_cast(v % (wrap_max - wrap_min + 1)); + int_type overflow = static_cast(v / (wrap_max - wrap_min + 1)); + value_ = static_cast(value_ + remainder); if ((value_) > wrap_max) { overflow++; @@ -111,9 +111,9 @@ public: //! Subtract will return '-d' if wrapping took place ('d' is the number of wraps) int_type subtract(int_type v) { - int_type remainder = v % (wrap_max - wrap_min + 1); - int_type underflow = -(v / (wrap_max - wrap_min + 1)); - value_ -= remainder; + int_type remainder = static_cast(v % (wrap_max - wrap_min + 1)); + int_type underflow = static_cast(-(v / (wrap_max - wrap_min + 1))); + value_ = static_cast(value_ - remainder); if ((value_) < wrap_min) { underflow--;