From 053b8391794d0771f51edf6e23fb4dc34ad5a3ff Mon Sep 17 00:00:00 2001 From: Stefan Leichter Date: Fri, 16 May 2003 20:13:50 +0000 Subject: [PATCH] Fixed DECIMAL_SETZERO Removed a workaround for the former problem. --- dlls/oleaut32/variant.c | 9 +++------ include/wtypes.h | 2 +- include/wtypes.idl | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 096b1f08515..7f038ed7e12 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -4593,12 +4593,9 @@ HRESULT WINAPI VarDecFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, { WCHAR *p=strIn; ULONGLONG t; ULONG cy; -#ifdef FIXIT + DECIMAL_SETZERO(pdecOut); -#else - pdecOut->u.s.sign = pdecOut->u.s.scale = UI1_MIN; - pdecOut->Hi32 = pdecOut->u1.s1.Mid32 = pdecOut->u1.s1.Lo32 = UI4_MIN; -#endif + if(*p == (WCHAR)'-')pdecOut->u.s.sign= DECIMAL_NEG; if((*p == (WCHAR)'-') || (*p == (WCHAR)'+')) p++; for(;*p != (WCHAR)0; p++) { @@ -4617,7 +4614,7 @@ HRESULT WINAPI VarDecFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, pdecOut->Hi32 = (ULONG)(t & (ULONGLONG)UI4_MAX); if(cy) goto overflow ; } - TRACE("(4) %s -> sign %02x,hi %08lx,mid %08lx, lo%08lx, scale %08x\n", + TRACE("%s -> sign %02x,hi %08lx,mid %08lx, lo%08lx, scale %08x\n", debugstr_w(strIn), pdecOut->u.s.sign, pdecOut->Hi32, pdecOut->u1.s1.Mid32, pdecOut->u1.s1.Lo32, pdecOut->u.s.scale); diff --git a/include/wtypes.h b/include/wtypes.h index 2d71282b4a5..31c21023617 100644 --- a/include/wtypes.h +++ b/include/wtypes.h @@ -666,7 +666,7 @@ typedef struct tagDEC { } DECIMAL; #endif #define DECIMAL_NEG ((BYTE)0x80) -#define DECIMAL_SETZERO(d) do{ memset(((char*)(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u); }while (0) +#define DECIMAL_SETZERO(d) do{ memset(((char*)(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0) typedef DECIMAL *LPDECIMAL; typedef FLAGGED_WORD_BLOB *wireBSTR; diff --git a/include/wtypes.idl b/include/wtypes.idl index e43a310cfc2..cce309667a1 100644 --- a/include/wtypes.idl +++ b/include/wtypes.idl @@ -620,7 +620,7 @@ cpp_quote(" } DUMMYUNIONNAME1;") cpp_quote("} DECIMAL;") cpp_quote("#endif") cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)") -cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u); }while (0)") +cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)") typedef DECIMAL *LPDECIMAL; -- 2.11.4.GIT