From e03bcf0d4078469128337dbbd880ea2135dc4718 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 2 Jul 1999 17:44:41 +0000 Subject: [PATCH] * Fixed Apple IEEE conversion git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/extended.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/extended.c b/src/common/extended.c index 1dae07e953..3380060505 100644 --- a/src/common/extended.c +++ b/src/common/extended.c @@ -87,16 +87,16 @@ void ConvertToIeeeExtended(double num, unsigned char *bytes) #pragma warning(disable: 4244) #endif /* Visual C++ */ - 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; + 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) -- 2.45.2