X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d9b77552eeb78e0c7ee903aa265dc187651ff57..afc94fa6b43722d604017798a767fa84ef883b47:/src/common/datetime.cpp diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 53e4d8be68..eae9bc33bf 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1147,9 +1147,6 @@ wxDateTime& wxDateTime::ResetTime() wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const { -#ifdef __VMS__ - int time2; -#endif wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); time_t time = GetTicks(); @@ -1167,9 +1164,9 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const } else { - time += tz.GetOffset(); + time += (time_t)tz.GetOffset(); #ifdef __VMS__ // time is unsigned so avoid warning - time2 = (int) time; + int time2 = (int) time; if ( time2 >= 0 ) #else if ( time >= 0 ) @@ -1379,7 +1376,10 @@ wxDateTime& wxDateTime::SetToLastMonthDay(Month month, int year) { // take the current month/year if none specified - ReplaceDefaultYearMonthWithCurrent(&year, &month); + if ( year == Inv_Year ) + year = GetYear(); + if ( month == Inv_Month ) + month = GetMonth(); return Set(GetNumOfDaysInMonth(year, month), month, year); } @@ -1676,9 +1676,6 @@ wxDateTime& wxDateTime::MakeTimezone(const TimeZone& tz, bool noDST) wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const { -#ifdef __VMS__ - int time2; -#endif wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") ); time_t time = GetTicks(); @@ -1698,8 +1695,8 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const { time += tz.GetOffset(); -#ifdef __VMS__ /* time is unsigned so VMS gives a warning on the original */ - time2 = (int) time; +#ifdef __VMS__ // time is unsigned so avoid the warning + int time2 = (int) time; if ( time2 >= 0 ) #else if ( time >= 0 )