https://git.reactos.org/?p=reactos.git;a=commitdiff;h=42961bd8b08fbad89e845…
commit 42961bd8b08fbad89e8456a3d38f72cfbaf2109b
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 16:34:08 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:54 2022 +0100
[WINESYNC] msi/tests: Avoid ARRAY_SIZE-like macros.
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 74b0dec3c1be0e16c7c2d487e0780a150d15e75c by Michael Stefaniuc
<mstefani(a)winehq.org>
---
modules/rostests/winetests/msi/db.c | 4 +---
modules/rostests/winetests/msi/install.c | 4 +---
modules/rostests/winetests/msi/patch.c | 12 +++---------
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c
index 477ab0ad399..ff54a95ab11 100644
--- a/modules/rostests/winetests/msi/db.c
+++ b/modules/rostests/winetests/msi/db.c
@@ -3033,8 +3033,6 @@ static const struct {
{ name9, data9, sizeof data9 },
};
-#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof
table_transform_data[0])
-
static void generate_transform_manual(void)
{
IStorage *stg = NULL;
@@ -3056,7 +3054,7 @@ static void generate_transform_manual(void)
r = IStorage_SetClass( stg, &CLSID_MsiTransform );
ok(r == S_OK, "failed to set storage type\n");
- for (i=0; i<NUM_TRANSFORM_TABLES; i++)
+ for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
{
r = IStorage_CreateStream( stg, table_transform_data[i].name,
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
diff --git a/modules/rostests/winetests/msi/install.c
b/modules/rostests/winetests/msi/install.c
index 3eb6c804221..951f0e72221 100644
--- a/modules/rostests/winetests/msi/install.c
+++ b/modules/rostests/winetests/msi/install.c
@@ -3671,8 +3671,6 @@ static const struct {
{ name3, data3, sizeof data3 },
};
-#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof
table_transform_data[0])
-
static void generate_transform_manual(void)
{
IStorage *stg = NULL;
@@ -3694,7 +3692,7 @@ static void generate_transform_manual(void)
r = IStorage_SetClass(stg, &CLSID_MsiTransform);
ok(r == S_OK, "failed to set storage type\n");
- for (i=0; i<NUM_TRANSFORM_TABLES; i++)
+ for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
{
r = IStorage_CreateStream(stg, table_transform_data[i].name,
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
diff --git a/modules/rostests/winetests/msi/patch.c
b/modules/rostests/winetests/msi/patch.c
index b6e990b461e..a09084002e0 100644
--- a/modules/rostests/winetests/msi/patch.c
+++ b/modules/rostests/winetests/msi/patch.c
@@ -446,8 +446,6 @@ static const struct table_data table_patch_data[] = {
{ p_name6, p_data6, sizeof p_data6 }
};
-#define NUM_PATCH_TABLES (sizeof table_patch_data/sizeof table_patch_data[0])
-
static const WCHAR t1_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */
static const WCHAR t1_name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824,
0 }; /* _StringData */
static const WCHAR t1_name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f,
0 }; /* _StringPool */
@@ -519,8 +517,6 @@ static const struct table_data table_transform1_data[] = {
{ t1_name3, t1_data3, sizeof t1_data3 }
};
-#define NUM_TRANSFORM1_TABLES (sizeof table_transform1_data/sizeof
table_transform1_data[0])
-
static const WCHAR t2_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */
static const WCHAR t2_name1[] = { 0x4840, 0x4216, 0x4327, 0x4824, 0 }; /* Media */
static const WCHAR t2_name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }; /*
_Columns */
@@ -644,8 +640,6 @@ static const struct table_data table_transform2_data[] = {
{ t2_name9, t2_data9, sizeof t2_data9 }
};
-#define NUM_TRANSFORM2_TABLES (sizeof table_transform2_data/sizeof
table_transform2_data[0])
-
static void write_tables( IStorage *stg, const struct table_data *tables, UINT num_tables
)
{
IStream *stm;
@@ -692,7 +686,7 @@ static void create_patch( const char *filename )
r = IStorage_SetClass( stg, &CLSID_MsiPatch );
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
- write_tables( stg, table_patch_data, NUM_PATCH_TABLES );
+ write_tables( stg, table_patch_data, ARRAY_SIZE( table_patch_data ));
r = IStorage_CreateStorage( stg, p_name7, mode, 0, 0, &stg1 );
ok( r == S_OK, "failed to create substorage 0x%08x\n", r );
@@ -700,7 +694,7 @@ static void create_patch( const char *filename )
r = IStorage_SetClass( stg1, &CLSID_MsiTransform );
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
- write_tables( stg1, table_transform1_data, NUM_TRANSFORM1_TABLES );
+ write_tables( stg1, table_transform1_data, ARRAY_SIZE( table_transform1_data ));
IStorage_Release( stg1 );
r = IStorage_CreateStorage( stg, p_name8, mode, 0, 0, &stg2 );
@@ -709,7 +703,7 @@ static void create_patch( const char *filename )
r = IStorage_SetClass( stg2, &CLSID_MsiTransform );
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
- write_tables( stg2, table_transform2_data, NUM_TRANSFORM2_TABLES );
+ write_tables( stg2, table_transform2_data, ARRAY_SIZE( table_transform2_data ));
IStorage_Release( stg2 );
IStorage_Release( stg );
}