Commit 5d9ea809 authored by Alexandre Julliard's avatar Alexandre Julliard

oleview: Use nameless unions/structs.

parent 52a868a8
......@@ -43,9 +43,9 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
TVINSERTSTRUCTW tvis;
HTREEITEM addPlace = parent;
U(tvis).item.mask = TVIF_TEXT;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszTree;
tvis.item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszTree;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = parent;
......@@ -61,9 +61,9 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
{
if(!i && lstrlenW(wszKeyName) > 1)
{
U(tvis).item.pszText = wszKeyName;
tvis.item.pszText = wszKeyName;
addPlace = TreeView_InsertItemW(details.hReg, &tvis);
U(tvis).item.pszText = wszTree;
tvis.item.pszText = wszTree;
}
break;
}
......@@ -206,9 +206,9 @@ static void CreateReg(WCHAR *buffer)
TVINSERTSTRUCTW tvis;
HTREEITEM addPlace = TVI_ROOT;
U(tvis).item.mask = TVIF_TEXT;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszTree;
tvis.item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszTree;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = TVI_ROOT;
......
......@@ -107,7 +107,7 @@ static INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
IPersistStream_GetSizeMax((IPersistStream *)unk, &size);
IUnknown_Release(unk);
LoadStringW(globals.hMainInst, IDS_BYTES, wszBuf, ARRAY_SIZE(wszBuf));
wsprintfW(wszSize, wszFormat, U(size).LowPart, wszBuf);
wsprintfW(wszSize, wszFormat, size.LowPart, wszBuf);
hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX);
SetWindowTextW(hObject, wszSize);
return TRUE;
......
......@@ -26,12 +26,6 @@
#include <commdlg.h>
#include <unknwn.h>
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
#include "resource.h"
#define MAX_LOAD_STRING 256
......
......@@ -318,26 +318,26 @@ static void CreateTypeInfo(WCHAR *wszAddTo, WCHAR *wszAddAfter, TYPEDESC tdesc,
VTADDTOSTR(VT_DATE);
VTADDTOSTR(VT_R8);
case VT_CARRAY:
for(i=0; i<U(tdesc).lpadesc->cDims; i++)
for(i=0; i<tdesc.lpadesc->cDims; i++)
{
wsprintfW(wszBuf, wszFormat, U(tdesc).lpadesc->rgbounds[i].cElements);
wsprintfW(wszBuf, wszFormat, tdesc.lpadesc->rgbounds[i].cElements);
AddToStrW(wszAddAfter, wszBuf);
}
CreateTypeInfo(wszAddTo, wszAddAfter, U(tdesc).lpadesc->tdescElem, pTypeInfo);
CreateTypeInfo(wszAddTo, wszAddAfter, tdesc.lpadesc->tdescElem, pTypeInfo);
break;
case VT_SAFEARRAY:
AddToStrW(wszAddTo, wszVT_SAFEARRAY);
AddToStrW(wszAddTo, L"(");
CreateTypeInfo(wszAddTo, wszAddAfter, *U(tdesc).lptdesc, pTypeInfo);
CreateTypeInfo(wszAddTo, wszAddAfter, *tdesc.lptdesc, pTypeInfo);
AddToStrW(wszAddTo, L")");
break;
case VT_PTR:
CreateTypeInfo(wszAddTo, wszAddAfter, *U(tdesc).lptdesc, pTypeInfo);
CreateTypeInfo(wszAddTo, wszAddAfter, *tdesc.lptdesc, pTypeInfo);
AddToStrW(wszAddTo, L"*");
break;
case VT_USERDEFINED:
hRes = ITypeInfo_GetRefTypeInfo(pTypeInfo,
U(tdesc).hreftype, &pRefTypeInfo);
tdesc.hreftype, &pRefTypeInfo);
if(SUCCEEDED(hRes))
{
ITypeInfo_GetDocumentation(pRefTypeInfo, MEMBERID_NIL,
......@@ -363,9 +363,9 @@ static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
WCHAR wszText[MAX_LOAD_STRING];
WCHAR wszAfter[MAX_LOAD_STRING];
U(tvis).item.mask = TVIF_TEXT|TVIF_PARAM;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszText;
tvis.item.mask = TVIF_TEXT|TVIF_PARAM;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszText;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = hParent;
......@@ -378,7 +378,7 @@ static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
NULL, NULL, NULL))) continue;
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.lParam = (LPARAM) tld;
if(pVarDesc->memid < MIN_VAR_ID)
{
......@@ -424,9 +424,9 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
WCHAR wszText[MAX_LOAD_STRING];
WCHAR wszAfter[MAX_LOAD_STRING];
U(tvis).item.mask = TVIF_TEXT|TVIF_PARAM;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszText;
tvis.item.mask = TVIF_TEXT|TVIF_PARAM;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszText;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = hParent;
......@@ -439,7 +439,7 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
NULL, NULL, NULL))) continue;
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.lParam = (LPARAM) tld;
memset(wszText, 0, sizeof(wszText));
memset(wszAfter, 0, sizeof(wszAfter));
......@@ -448,7 +448,7 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
{
VARIANT var;
VariantInit(&var);
if (VariantChangeType(&var, U(*pVarDesc).lpvarValue, 0, VT_BSTR) == S_OK)
if (VariantChangeType(&var, pVarDesc->lpvarValue, 0, VT_BSTR) == S_OK)
{
AddToStrW(wszText, wszConst);
AddToStrW(wszText, L" ");
......@@ -488,7 +488,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
WCHAR szRhs[] = {'r','h','s',0}; /* Right-hand side of a propput */
BOOL bFirst;
U(tvis).item.mask = TVIF_TEXT|TVIF_PARAM;
tvis.item.mask = TVIF_TEXT|TVIF_PARAM;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = hParent;
......@@ -512,9 +512,9 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
memset(wszText, 0, sizeof(wszText));
memset(wszAfter, 0, sizeof(wszAfter));
tld = InitializeTLData();
U(tvis).item.cchTextMax = SysStringLen(bstrName);
U(tvis).item.pszText = bstrName;
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.cchTextMax = SysStringLen(bstrName);
tvis.item.pszText = bstrName;
tvis.item.lParam = (LPARAM) tld;
bFirst = TRUE;
if(pFuncDesc->memid < MIN_FUNC_ID || pTypeAttr->wTypeFlags & TYPEFLAG_FDUAL)
{
......@@ -601,7 +601,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
}
bFirst = TRUE;
#define ENUM_PARAM_FLAG(x)\
if(U(pFuncDesc->lprgelemdescParam[j]).paramdesc.wParamFlags & x) \
if(pFuncDesc->lprgelemdescParam[j].paramdesc.wParamFlags & x) \
{\
if(bFirst)\
AddToTLDataStrW(tld, L"[");\
......@@ -619,9 +619,9 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
ENUM_PARAM_FLAG(PARAMFLAG_FOPT);
ENUM_PARAM_FLAG(PARAMFLAG_FHASCUSTDATA);
if(U(pFuncDesc->lprgelemdescParam[j]).paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
if(pFuncDesc->lprgelemdescParam[j].paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
{
VARIANT var, *param=&U(pFuncDesc->lprgelemdescParam[j]).paramdesc.pparamdescex->varDefaultValue;
VARIANT var, *param=&pFuncDesc->lprgelemdescParam[j].paramdesc.pparamdescex->varDefaultValue;
VariantInit(&var);
if(bFirst) AddToTLDataStrW(tld, L"[");
else AddToTLDataStrW(tld, L", ");
......@@ -684,9 +684,9 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
LoadStringW(globals.hMainInst, IDS_INHERITINTERFACES, wszInheritedInterfaces,
ARRAY_SIZE(wszInheritedInterfaces));
U(tvis).item.mask = TVIF_TEXT;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszInheritedInterfaces;
tvis.item.mask = TVIF_TEXT;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszInheritedInterfaces;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = hParent;
......@@ -709,8 +709,8 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
continue;
}
U(tvis).item.cchTextMax = SysStringLen(bstrName);
U(tvis).item.pszText = bstrName;
tvis.item.cchTextMax = SysStringLen(bstrName);
tvis.item.pszText = bstrName;
hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
EnumVars(pRefTypeInfo, pTypeAttr->cVars, hParent);
......@@ -1100,9 +1100,9 @@ static int PopulateTree(void)
WCHAR wszProperties[] = { 'p','r','o','p','e','r','t','i','e','s','\0' };
WCHAR wszMethods[] = { 'm','e','t','h','o','d','s','\0' };
U(tvis).item.mask = TVIF_TEXT|TVIF_PARAM;
U(tvis).item.cchTextMax = MAX_LOAD_STRING;
U(tvis).item.pszText = wszText;
tvis.item.mask = TVIF_TEXT|TVIF_PARAM;
tvis.item.cchTextMax = MAX_LOAD_STRING;
tvis.item.pszText = wszText;
tvis.hInsertAfter = TVI_LAST;
tvis.hParent = TVI_ROOT;
......@@ -1126,7 +1126,7 @@ static int PopulateTree(void)
ITypeLib_GetLibAttr(pTypeLib, &pTLibAttr);
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.lParam = (LPARAM) tld;
AddToTLDataStrW(tld, wszGeneratedInfo);
AddToTLDataStrW(tld, typelib.wszFileName);
AddToTLDataStrW(tld, L"\n\n[\n");
......@@ -1177,7 +1177,7 @@ static int PopulateTree(void)
memset(wszText, 0, sizeof(wszText));
memset(wszAfter, 0, sizeof(wszAfter));
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM)tld;
tvis.item.lParam = (LPARAM)tld;
switch(pTypeAttr->typekind)
{
case TKIND_ENUM:
......@@ -1259,7 +1259,7 @@ static int PopulateTree(void)
lstrcpyW(wszText, wszProperties);
tvis.hParent = hParent;
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.lParam = (LPARAM) tld;
AddToTLDataStrW(tld, wszProperties);
AddToTLDataStrW(tld, L":\n");
tvis.hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
......@@ -1269,7 +1269,7 @@ static int PopulateTree(void)
lstrcpyW(wszText, wszMethods);
tvis.hParent = hParent;
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.lParam = (LPARAM) tld;
AddToTLDataStrW(tld, wszMethods);
AddToTLDataStrW(tld, L":\n");
tvis.hParent = TreeView_InsertItemW(typelib.hTree, &tvis);
......@@ -1293,7 +1293,7 @@ static int PopulateTree(void)
memset(wszText, 0, sizeof(wszText));
tld = InitializeTLData();
U(tvis).item.lParam = (LPARAM) tld;
tvis.item.lParam = (LPARAM) tld;
ITypeInfo_GetRefTypeInfo(pTypeInfo, hRefType, &pRefTypeInfo);
ITypeInfo_GetDocumentation(pRefTypeInfo, MEMBERID_NIL, &bstrName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment