X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..3527e5324247dca419d71d4e4658b20c6f10340a:/src/msw/ole/automtn.cpp diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 81827a79ef..d0185644ae 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -6,7 +6,7 @@ // Created: 11/6/98 // RCS-ID: $Id$ // Copyright: (c) 1998, Julian Smart -// Licence: wxWindows Licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -24,7 +24,7 @@ // Watcom C++ gives a linker error if this is compiled in. // With Borland C++, all samples crash if this is compiled in. -#if wxUSE_OLE &&!defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) +#if wxUSE_OLE && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) #define _FORCENAMELESSUNION #include "wx/log.h" @@ -599,7 +599,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) { oleVariant.vt = VT_BOOL; // 'bool' required for VC++ 4 apparently -#if defined(__WATCOMC__) || (defined(__VISUALC__) && (__VISUALC__ <= 1000)) +#if (defined(__VISUALC__) && (__VISUALC__ <= 1000)) oleVariant.bool = variant.GetBool(); #else oleVariant.boolVal = variant.GetBool(); @@ -744,7 +744,7 @@ bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) case VT_BOOL: { -#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000) && !defined(__MWERKS__) ) //GC +#if (defined(_MSC_VER) && (_MSC_VER <= 1000) && !defined(__MWERKS__) ) //GC #ifndef HAVE_BOOL // Can't use bool operator if no native bool type variant = (long) (oleVariant.bool != 0); #else @@ -949,7 +949,6 @@ BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest) if (dtSrc > MAX_DATE || dtSrc < MIN_DATE) // about year 100 to about 9999 return FALSE; - long nDays; // Number of days since Dec. 30, 1899 long nDaysAbsolute; // Number of days since 1/1/0 long nSecsInDay; // Time in seconds since midnight long nMinutesInDay; // Minutes in day @@ -964,9 +963,6 @@ BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest) double dblDate = dtSrc; // tempory serial date - // If a valid date, then this conversion should not overflow - nDays = (long)dblDate; - // Round to the second dblDate += ((dtSrc > 0.0) ? HALF_SECOND : -HALF_SECOND); @@ -1053,7 +1049,8 @@ BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest) // Month number always >= n/32, so save some loop time */ for (tmDest.tm_mon = (n4Day >> 5) + 1; - n4Day > rgMonthDays[tmDest.tm_mon]; tmDest.tm_mon++); + n4Day > rgMonthDays[tmDest.tm_mon]; tmDest.tm_mon++) + ; tmDest.tm_mday = (int)(n4Day - rgMonthDays[tmDest.tm_mon-1]); @@ -1261,5 +1258,5 @@ void ShowException(LPOLESTR szMember, HRESULT hr, EXCEPINFO *pexcep, unsigned in #endif -#endif // __WATCOMC__ +#endif // wxUSE_OLE && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__)