Skip to content

Commit 42961bd

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Avoid ARRAY_SIZE-like macros.
Signed-off-by: Michael Stefaniuc <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 74b0dec3c1be0e16c7c2d487e0780a150d15e75c by Michael Stefaniuc <[email protected]>
1 parent 0d762dc commit 42961bd

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

modules/rostests/winetests/msi/db.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,8 +3033,6 @@ static const struct {
30333033
{ name9, data9, sizeof data9 },
30343034
};
30353035

3036-
#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3037-
30383036
static void generate_transform_manual(void)
30393037
{
30403038
IStorage *stg = NULL;
@@ -3056,7 +3054,7 @@ static void generate_transform_manual(void)
30563054
r = IStorage_SetClass( stg, &CLSID_MsiTransform );
30573055
ok(r == S_OK, "failed to set storage type\n");
30583056

3059-
for (i=0; i<NUM_TRANSFORM_TABLES; i++)
3057+
for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
30603058
{
30613059
r = IStorage_CreateStream( stg, table_transform_data[i].name,
30623060
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );

modules/rostests/winetests/msi/install.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3671,8 +3671,6 @@ static const struct {
36713671
{ name3, data3, sizeof data3 },
36723672
};
36733673

3674-
#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
3675-
36763674
static void generate_transform_manual(void)
36773675
{
36783676
IStorage *stg = NULL;
@@ -3694,7 +3692,7 @@ static void generate_transform_manual(void)
36943692
r = IStorage_SetClass(stg, &CLSID_MsiTransform);
36953693
ok(r == S_OK, "failed to set storage type\n");
36963694

3697-
for (i=0; i<NUM_TRANSFORM_TABLES; i++)
3695+
for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
36983696
{
36993697
r = IStorage_CreateStream(stg, table_transform_data[i].name,
37003698
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);

modules/rostests/winetests/msi/patch.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,6 @@ static const struct table_data table_patch_data[] = {
446446
{ p_name6, p_data6, sizeof p_data6 }
447447
};
448448

449-
#define NUM_PATCH_TABLES (sizeof table_patch_data/sizeof table_patch_data[0])
450-
451449
static const WCHAR t1_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */
452450
static const WCHAR t1_name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
453451
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[] = {
519517
{ t1_name3, t1_data3, sizeof t1_data3 }
520518
};
521519

522-
#define NUM_TRANSFORM1_TABLES (sizeof table_transform1_data/sizeof table_transform1_data[0])
523-
524520
static const WCHAR t2_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */
525521
static const WCHAR t2_name1[] = { 0x4840, 0x4216, 0x4327, 0x4824, 0 }; /* Media */
526522
static const WCHAR t2_name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }; /* _Columns */
@@ -644,8 +640,6 @@ static const struct table_data table_transform2_data[] = {
644640
{ t2_name9, t2_data9, sizeof t2_data9 }
645641
};
646642

647-
#define NUM_TRANSFORM2_TABLES (sizeof table_transform2_data/sizeof table_transform2_data[0])
648-
649643
static void write_tables( IStorage *stg, const struct table_data *tables, UINT num_tables )
650644
{
651645
IStream *stm;
@@ -692,15 +686,15 @@ static void create_patch( const char *filename )
692686
r = IStorage_SetClass( stg, &CLSID_MsiPatch );
693687
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
694688

695-
write_tables( stg, table_patch_data, NUM_PATCH_TABLES );
689+
write_tables( stg, table_patch_data, ARRAY_SIZE( table_patch_data ));
696690

697691
r = IStorage_CreateStorage( stg, p_name7, mode, 0, 0, &stg1 );
698692
ok( r == S_OK, "failed to create substorage 0x%08x\n", r );
699693

700694
r = IStorage_SetClass( stg1, &CLSID_MsiTransform );
701695
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
702696

703-
write_tables( stg1, table_transform1_data, NUM_TRANSFORM1_TABLES );
697+
write_tables( stg1, table_transform1_data, ARRAY_SIZE( table_transform1_data ));
704698
IStorage_Release( stg1 );
705699

706700
r = IStorage_CreateStorage( stg, p_name8, mode, 0, 0, &stg2 );
@@ -709,7 +703,7 @@ static void create_patch( const char *filename )
709703
r = IStorage_SetClass( stg2, &CLSID_MsiTransform );
710704
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
711705

712-
write_tables( stg2, table_transform2_data, NUM_TRANSFORM2_TABLES );
706+
write_tables( stg2, table_transform2_data, ARRAY_SIZE( table_transform2_data ));
713707
IStorage_Release( stg2 );
714708
IStorage_Release( stg );
715709
}

0 commit comments

Comments
 (0)