[0.4.9][XDK][PSDK][WINE] Unify ARRAY_SIZE definition for Wine modules. CORE-15127
authorJoachim Henze <Joachim.Henze@reactos.org>
Mon, 14 Mar 2022 00:01:19 +0000 (01:01 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Mon, 14 Mar 2022 00:01:19 +0000 (01:01 +0100)
I need this for the following commits to be able to fix more compiler warnings
without having to introduce additional diff for better code from newer branches, that
also uses this macro. The older the branch, the less of duplication we have for this
macro.

picked from 0.4.11-dev-258-g 82faa151e52e235dc0bebea2ecd49ef6b46847ad

dll/directx/wine/d3dx9_36/d3dx9_36_private.h
dll/directx/wine/ddraw/ddraw_private.h
dll/win32/comctl32/comctl32.h
dll/win32/msi/tokenize.c
dll/win32/msxml3/msxml_private.h
dll/win32/scrrun/scrrun_private.h
dll/win32/wshom.ocx/wshom_private.h
dll/win32/xmllite/xmllite_private.h
sdk/include/xdk/winnt_old.h

index ddc3822..f4c59e6 100644 (file)
@@ -49,8 +49,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
 
 #define ULONG64_MAX (~(ULONG64)0)
 
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof(*array))
-
 struct vec4
 {
     float x, y, z, w;
index 04ee59c..0b1637c 100644 (file)
@@ -44,8 +44,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 extern const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HIDDEN;
 extern DWORD force_refresh_rate DECLSPEC_HIDDEN;
 
index 083c376..4274697 100644 (file)
@@ -45,8 +45,6 @@
 extern HMODULE COMCTL32_hModule DECLSPEC_HIDDEN;
 extern HBRUSH  COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN;
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 /* Property sheet / Wizard */
 #define IDD_PROPSHEET 1006
 #define IDD_WIZARD    1020
index 1656fd8..d1c2da9 100644 (file)
@@ -77,8 +77,6 @@ static const WCHAR updateW[] = {'U','P','D','A','T','E'};
 static const WCHAR valuesW[] = {'V','A','L','U','E','S'};
 static const WCHAR whereW[] = {'W','H','E','R','E'};
 
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
-
 /*
 ** These are the keywords
 ** They MUST be in alphabetical order
index d703927..94ef66b 100644 (file)
@@ -31,8 +31,6 @@
 # error You must include config.h to use this header
 #endif
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 typedef enum {
     MSXML_DEFAULT = 0,
     MSXML2        = 20,
index d9ff241..5083d30 100644 (file)
@@ -18,8 +18,6 @@
 #ifndef _SCRRUN_PRIVATE_H_
 #define _SCRRUN_PRIVATE_H_
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 extern HRESULT WINAPI FileSystem_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
 extern HRESULT WINAPI Dictionary_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
 
index a3fa3b0..951599f 100644 (file)
@@ -27,8 +27,6 @@
 #include "ole2.h"
 #include "olectl.h"
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 /* typelibs */
 typedef enum tid_t {
     NULL_tid,
index 381dec4..7884e27 100644 (file)
@@ -23,8 +23,6 @@
 
 #include "wine/heap.h"
 
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
-
 static inline void *m_alloc(IMalloc *imalloc, size_t len)
 {
     if (imalloc)
index 59076df..07c8118 100644 (file)
@@ -4308,6 +4308,10 @@ typedef struct _TP_CALLBACK_ENVIRON_V1 {
 } TP_CALLBACK_ENVIRON_V1, TP_CALLBACK_ENVIRON, *PTP_CALLBACK_ENVIRON;
 #endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN7) */
 
+#ifdef __WINESRC__
+# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif