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