Fixed DECIMAL_SETZERO

Removed a workaround for the former problem.
This commit is contained in:
Stefan Leichter 2003-05-16 20:13:50 +00:00 committed by Alexandre Julliard
parent ce05da50b0
commit 053b839179
3 changed files with 5 additions and 8 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;