mirror of
https://github.com/boostorg/date_time.git
synced 2026-02-26 04:32:23 +00:00
fixes for msvc level4 warnings
[SVN r20199]
This commit is contained in:
@@ -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<unsigned short>(tms->tm_mon + 1),
|
||||
static_cast<unsigned short>(tms->tm_mday));
|
||||
time_duration_type td2(tms->tm_hour,
|
||||
tms->tm_min,
|
||||
tms->tm_sec,
|
||||
|
||||
@@ -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<int_type>(v % wrap_val);
|
||||
int_type overflow = static_cast<int_type>(v / wrap_val);
|
||||
value_ = static_cast<int_type>(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<int_type>(v % (wrap_max - wrap_min + 1));
|
||||
int_type overflow = static_cast<int_type>(v / (wrap_max - wrap_min + 1));
|
||||
value_ = static_cast<int_type>(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<int_type>(v % (wrap_max - wrap_min + 1));
|
||||
int_type underflow = static_cast<int_type>(-(v / (wrap_max - wrap_min + 1)));
|
||||
value_ = static_cast<int_type>(value_ - remainder);
|
||||
if ((value_) < wrap_min)
|
||||
{
|
||||
underflow--;
|
||||
|
||||
Reference in New Issue
Block a user