Nikolay Sivov : ole32: Simplify static IMalloc instance initialization.

Alexandre Julliard julliard at winehq.org
Mon Apr 20 15:48:20 CDT 2020


Module: wine
Branch: master
Commit: 0a35f0053ab8ddd771126d617dbe15c916d21c18
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0a35f0053ab8ddd771126d617dbe15c916d21c18

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Apr 20 10:59:22 2020 +0300

ole32: Simplify static IMalloc instance initialization.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/ifs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/ole32/ifs.c b/dlls/ole32/ifs.c
index 62007800e3..a144833c7a 100644
--- a/dlls/ole32/ifs.c
+++ b/dlls/ole32/ifs.c
@@ -47,17 +47,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(olemalloc);
 /* set the vtable later */
 static const IMallocVtbl VT_IMalloc32;
 
-typedef struct {
+struct allocator
+{
         IMalloc IMalloc_iface;
 	IMallocSpy * pSpy;          /* the spy when active */
 	DWORD SpyedAllocationsLeft; /* number of spyed allocations left */
 	BOOL SpyReleasePending;     /* CoRevokeMallocSpy called with spyed allocations left*/
         LPVOID * SpyedBlocks;       /* root of the table */
         DWORD SpyedBlockTableLength;/* size of the table*/
-} _Malloc32;
+};
 
-/* this is the static object instance */
-static _Malloc32 Malloc32 = {{&VT_IMalloc32}, NULL, 0, 0, NULL, 0};
+static struct allocator Malloc32 = { .IMalloc_iface.lpVtbl = &VT_IMalloc32 };
 
 /* with a spy active all calls from pre to post methods are threadsafe */
 static CRITICAL_SECTION IMalloc32_SpyCS;




More information about the wine-cvs mailing list