From 75176687d7447b3bb91565035e82c9e5283214d1 Mon Sep 17 00:00:00 2001 From: Joachim Faulhaber Date: Tue, 22 Sep 2015 13:50:16 +0200 Subject: [PATCH 1/2] Warning fix: Implicit conversion loses integer precision. --- include/boost/date_time/int_adapter.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/date_time/int_adapter.hpp b/include/boost/date_time/int_adapter.hpp index 81f68f645..d6afabc3c 100644 --- a/include/boost/date_time/int_adapter.hpp +++ b/include/boost/date_time/int_adapter.hpp @@ -279,7 +279,7 @@ class int_adapter { return int_adapter::pos_infinity(); } } - return int_adapter(value_ - rhs.as_number()); + return int_adapter(value_ - int_type(rhs.as_number())); } int_adapter operator-(const int_type rhs) const { From 03c419d8b692218080f4c95658158e3ffe42d77a Mon Sep 17 00:00:00 2001 From: Joachim Faulhaber Date: Wed, 23 Sep 2015 16:12:10 +0200 Subject: [PATCH 2/2] Corrected warning fix: added static cast --- include/boost/date_time/int_adapter.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/date_time/int_adapter.hpp b/include/boost/date_time/int_adapter.hpp index d6afabc3c..e6d4862e9 100644 --- a/include/boost/date_time/int_adapter.hpp +++ b/include/boost/date_time/int_adapter.hpp @@ -279,7 +279,7 @@ class int_adapter { return int_adapter::pos_infinity(); } } - return int_adapter(value_ - int_type(rhs.as_number())); + return int_adapter(value_ - static_cast(rhs.as_number())); } int_adapter operator-(const int_type rhs) const {