summaryrefslogtreecommitdiff
path: root/boost/date_time
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:24:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:25:39 +0900
commit4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch)
treefd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/date_time
parentb5c87084afaef42b2d058f68091be31988a6a874 (diff)
downloadboost-upstream/1.65.0.tar.gz
boost-upstream/1.65.0.tar.bz2
boost-upstream/1.65.0.zip
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/date_time')
-rw-r--r--boost/date_time/dst_rules.hpp12
-rw-r--r--boost/date_time/locale_config.hpp4
-rw-r--r--boost/date_time/posix_time/conversion.hpp20
-rw-r--r--boost/date_time/time_resolution_traits.hpp16
4 files changed, 26 insertions, 26 deletions
diff --git a/boost/date_time/dst_rules.hpp b/boost/date_time/dst_rules.hpp
index 32290190d9..73a98996d8 100644
--- a/boost/date_time/dst_rules.hpp
+++ b/boost/date_time/dst_rules.hpp
@@ -106,12 +106,12 @@ namespace boost {
const time_duration_type& dst_end_offset,
const time_duration_type& dst_length_minutes)
{
- unsigned int start_minutes =
- dst_start_offset.hours() * 60 + dst_start_offset.minutes();
- unsigned int end_minutes =
- dst_end_offset.hours() * 60 + dst_end_offset.minutes();
- long length_minutes =
- dst_length_minutes.hours() * 60 + dst_length_minutes.minutes();
+ unsigned int start_minutes = static_cast<unsigned>(
+ dst_start_offset.hours() * 60 + dst_start_offset.minutes());
+ unsigned int end_minutes = static_cast<unsigned>(
+ dst_end_offset.hours() * 60 + dst_end_offset.minutes());
+ long length_minutes = static_cast<long>(
+ dst_length_minutes.hours() * 60 + dst_length_minutes.minutes());
return local_is_dst(current_day, time_of_day,
dst_start_day, start_minutes,
diff --git a/boost/date_time/locale_config.hpp b/boost/date_time/locale_config.hpp
index 42a2b73043..26a928f7bc 100644
--- a/boost/date_time/locale_config.hpp
+++ b/boost/date_time/locale_config.hpp
@@ -22,7 +22,9 @@
//This file basically becomes a noop if locales are not properly supported
#if (defined(BOOST_NO_STD_LOCALE) \
|| (BOOST_WORKAROUND( BOOST_MSVC, < 1300)) \
- || (BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x581 )) ) )
+ || (BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x581 )) ) \
+ || (BOOST_WORKAROUND( BOOST_XLCPP_ZOS, BOOST_TESTED_AT( 0x42010000 )) ) /* <cctype> "shadows" the locale enabled overloads from <locale> */ \
+ )
#define BOOST_DATE_TIME_NO_LOCALE
#endif
diff --git a/boost/date_time/posix_time/conversion.hpp b/boost/date_time/posix_time/conversion.hpp
index ed3d4867e9..42a9894af7 100644
--- a/boost/date_time/posix_time/conversion.hpp
+++ b/boost/date_time/posix_time/conversion.hpp
@@ -10,6 +10,7 @@
*/
#include <cstring>
+#include <boost/cstdint.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/date_time/filetime_functions.hpp>
@@ -21,21 +22,18 @@ namespace boost {
namespace posix_time {
-
//! Function that converts a time_t into a ptime.
inline
ptime from_time_t(std::time_t t)
{
- ptime start(gregorian::date(1970,1,1));
- return start + seconds(static_cast<long>(t));
+ return ptime(gregorian::date(1970,1,1)) + seconds(static_cast<long>(t));
}
//! Function that converts a ptime into a time_t
inline
std::time_t to_time_t(ptime pt)
{
- time_duration dur = pt - ptime(gregorian::date(1970,1,1));
- return std::time_t(dur.total_seconds());
+ return (pt - ptime(gregorian::date(1970,1,1))).total_seconds();
}
//! Convert a time to a tm structure truncating any fractional seconds
@@ -43,9 +41,9 @@ namespace posix_time {
std::tm to_tm(const boost::posix_time::ptime& t) {
std::tm timetm = boost::gregorian::to_tm(t.date());
boost::posix_time::time_duration td = t.time_of_day();
- timetm.tm_hour = td.hours();
- timetm.tm_min = td.minutes();
- timetm.tm_sec = td.seconds();
+ timetm.tm_hour = static_cast<int>(td.hours());
+ timetm.tm_min = static_cast<int>(td.minutes());
+ timetm.tm_sec = static_cast<int>(td.seconds());
timetm.tm_isdst = -1; // -1 used when dst info is unknown
return timetm;
}
@@ -54,9 +52,9 @@ namespace posix_time {
std::tm to_tm(const boost::posix_time::time_duration& td) {
std::tm timetm;
std::memset(&timetm, 0, sizeof(timetm));
- timetm.tm_hour = date_time::absolute_value(td.hours());
- timetm.tm_min = date_time::absolute_value(td.minutes());
- timetm.tm_sec = date_time::absolute_value(td.seconds());
+ timetm.tm_hour = static_cast<int>(date_time::absolute_value(td.hours()));
+ timetm.tm_min = static_cast<int>(date_time::absolute_value(td.minutes()));
+ timetm.tm_sec = static_cast<int>(date_time::absolute_value(td.seconds()));
timetm.tm_isdst = -1; // -1 used when dst info is unknown
return timetm;
}
diff --git a/boost/date_time/time_resolution_traits.hpp b/boost/date_time/time_resolution_traits.hpp
index 3b6134cf1c..7ba42c20b5 100644
--- a/boost/date_time/time_resolution_traits.hpp
+++ b/boost/date_time/time_resolution_traits.hpp
@@ -9,7 +9,7 @@
* $Date$
*/
-
+#include <ctime>
#include <boost/cstdint.hpp>
#include <boost/date_time/time_defs.hpp>
#include <boost/date_time/int_adapter.hpp>
@@ -68,7 +68,7 @@ namespace date_time {
typename frac_sec_type::int_type resolution_adjust,
#endif
unsigned short frac_digits,
- typename var_type = boost::int32_t >
+ typename var_type = std::time_t >
class time_resolution_traits {
public:
typedef typename frac_sec_type::int_type fractional_seconds_type;
@@ -120,14 +120,14 @@ namespace date_time {
minutes = absolute_value(minutes);
seconds = absolute_value(seconds);
fs = absolute_value(fs);
- return (((((fractional_seconds_type(hours)*3600)
- + (fractional_seconds_type(minutes)*60)
- + seconds)*res_adjust()) + fs) * -1);
+ return static_cast<tick_type>(((((fractional_seconds_type(hours)*3600)
+ + (fractional_seconds_type(minutes)*60)
+ + seconds)*res_adjust()) + fs) * -1);
}
- return (((fractional_seconds_type(hours)*3600)
- + (fractional_seconds_type(minutes)*60)
- + seconds)*res_adjust()) + fs;
+ return static_cast<tick_type>((((fractional_seconds_type(hours)*3600)
+ + (fractional_seconds_type(minutes)*60)
+ + seconds)*res_adjust()) + fs);
}
};