X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/44c4a3348693414bace13852e50d926c1aa9f08b..5d47c8a0d2773f955261b5f4a78120d9b6394366:/src/common/extended.c diff --git a/src/common/extended.c b/src/common/extended.c index bdf53ebb37..c691e6b1a5 100644 --- a/src/common/extended.c +++ b/src/common/extended.c @@ -1,3 +1,6 @@ +#if !defined(__VISAGECPP__) +# pragma warning(disable:4001) /* non standard extension used: single line comment */ +#endif #include "wx/setup.h" #include @@ -82,16 +85,27 @@ void ConvertToIeeeExtended(double num, unsigned char *bytes) } } - bytes[0] = expon >> 8; - bytes[1] = expon; - 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; + /* disable the warning about 'possible loss of data' & 'conversion between diff types' */ + #ifdef _MSC_VER + #pragma warning(disable: 4244) + #pragma warning(disable: 4135) + #endif /* Visual C++ */ + + bytes[0] = (expon >> 8) & 0xff; + bytes[1] = expon & 0xff; + bytes[2] = (unsigned char) ((hiMant >> 24) & 0xff); + bytes[3] = (unsigned char) ((hiMant >> 16) & 0xff); + bytes[4] = (unsigned char) ((hiMant >> 8) & 0xff); + bytes[5] = (unsigned char) (hiMant & 0xff); + bytes[6] = (unsigned char) ((loMant >> 24) & 0xff); + bytes[7] = (unsigned char) ((loMant >> 16) & 0xff); + bytes[8] = (unsigned char) ((loMant >> 8) & 0xff); + bytes[9] = (unsigned char) (loMant & 0xff); + + #ifdef _MSC_VER + #pragma warning(default: 4244) + #pragma warning(default: 4135) + #endif /* Visual C++ */ } /*