fixes for msvc level4 warnings

[SVN r20199]
This commit is contained in:
Jeff Garland
2003-09-27 21:42:58 +00:00
parent 9241531a49
commit c46cecccd4
2 changed files with 12 additions and 12 deletions

View File

@@ -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,

View File

@@ -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--;