X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf44735628cecb0326b953c4872260f223fc8769..29f7914424a7941e9374a5445f95574f2f041659:/src/common/extended.c diff --git a/src/common/extended.c b/src/common/extended.c index 90bd43ec72..1dae07e953 100644 --- a/src/common/extended.c +++ b/src/common/extended.c @@ -1,7 +1,7 @@ #include "wx/setup.h" #include -#if USE_APPLE_IEEE +#if wxUSE_APPLE_IEEE /* * C O N V E R T T O I E E E E X T E N D E D @@ -82,16 +82,25 @@ void ConvertToIeeeExtended(double num, unsigned char *bytes) } } + /* disable the warning about 'possible loss of data' */ + #ifdef _MSC_VER + #pragma warning(disable: 4244) + #endif /* Visual C++ */ + bytes[0] = expon >> 8; bytes[1] = expon; - bytes[2] = hiMant >> 24; - bytes[3] = hiMant >> 16; - bytes[4] = hiMant >> 8; - bytes[5] = hiMant; - bytes[6] = loMant >> 24; - bytes[7] = loMant >> 16; - bytes[8] = loMant >> 8; - bytes[9] = loMant; + bytes[2] = (unsigned char) hiMant >> 24; + bytes[3] = (unsigned char) hiMant >> 16; + bytes[4] = (unsigned char) hiMant >> 8; + bytes[5] = (unsigned char) hiMant; + bytes[6] = (unsigned char) loMant >> 24; + bytes[7] = (unsigned char) loMant >> 16; + bytes[8] = (unsigned char) loMant >> 8; + bytes[9] = (unsigned char) loMant; + + #ifdef _MSC_VER + #pragma warning(default: 4244) + #endif /* Visual C++ */ } /* @@ -176,4 +185,4 @@ double ConvertFromIeeeExtended(const unsigned char *bytes) return f; } -#endif USE_APPLE_IEEE +#endif /* wxUSE_APPLE_IEEE */