Module: wine Branch: master Commit: 664e7938cbe9c5d945dd41b24ddf8c7acb2a4e9b URL: http://source.winehq.org/git/wine.git/?a=commit;h=664e7938cbe9c5d945dd41b24d...
Author: Andrew Eikum aeikum@codeweavers.com Date: Fri Sep 6 07:13:11 2013 -0500
oleaut32: Improve TYPEDESC encoding for unknown VARTYPEs.
It's not worth printing a FIXME for every VARTYPE we don't happen to list in the switch statement.
---
dlls/oleaut32/typelib.c | 57 +++++++++++++++------------------------------- 1 files changed, 19 insertions(+), 38 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index a27f5f4..9c1127f 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -9142,41 +9142,6 @@ static DWORD WMSFT_append_typedesc(TYPEDESC *desc, WMSFT_TLBFile *file, DWORD *o out_size = &junk2;
vt = desc->vt & VT_TYPEMASK; - switch(vt){ - case VT_INT: - subtype = VT_I4; - break; - case VT_UINT: - subtype = VT_UI4; - break; - case VT_VOID: - subtype = VT_EMPTY; - break; - default: - subtype = vt; - break; - } - - switch(vt){ - case VT_INT: - case VT_UINT: - case VT_I1: - case VT_UI1: - case VT_I2: - case VT_UI2: - case VT_I4: - case VT_UI4: - case VT_BOOL: - case VT_R4: - case VT_ERROR: - case VT_BSTR: - case VT_HRESULT: - case VT_CY: - case VT_VOID: - case VT_VARIANT: - *out_mix = subtype; - return 0x80000000 | (subtype << 16) | desc->vt; - }
if(vt == VT_PTR || vt == VT_SAFEARRAY){ DWORD mix; @@ -9193,9 +9158,25 @@ static DWORD WMSFT_append_typedesc(TYPEDESC *desc, WMSFT_TLBFile *file, DWORD *o encoded[1] = desc->u.hreftype; *out_mix = 0x7FFF; /* FIXME: Should get TYPEKIND of the hreftype, e.g. TKIND_ENUM => VT_I4 */ }else{ - FIXME("Don't know what to do! VT: 0x%x\n", desc->vt); - *out_mix = desc->vt; - return 0x80000000 | (desc->vt << 16) | desc->vt; + TRACE("Mixing in-place, VT: 0x%x\n", desc->vt); + + switch(vt){ + case VT_INT: + subtype = VT_I4; + break; + case VT_UINT: + subtype = VT_UI4; + break; + case VT_VOID: + subtype = VT_EMPTY; + break; + default: + subtype = vt; + break; + } + + *out_mix = subtype; + return 0x80000000 | (subtype << 16) | desc->vt; }
data = file->typdesc_seg.data;