Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
91c3e8eb
Commit
91c3e8eb
authored
Jun 07, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
741037ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
device.c
dlls/dinput8/tests/device.c
+6
-6
dinput.c
dlls/dinput8/tests/dinput.c
+9
-9
No files found.
dlls/dinput8/tests/device.c
View file @
91c3e8eb
...
...
@@ -317,8 +317,8 @@ static void test_action_mapping(void)
memset
(
&
af
,
0
,
sizeof
(
af
));
af
.
dwSize
=
sizeof
(
af
);
af
.
dwActionSize
=
sizeof
(
DIACTIONA
);
af
.
dwDataSize
=
4
*
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]
);
af
.
dwNumActions
=
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]
);
af
.
dwDataSize
=
4
*
ARRAY_SIZE
(
actionMapping
);
af
.
dwNumActions
=
ARRAY_SIZE
(
actionMapping
);
af
.
rgoAction
=
actionMapping
;
af
.
guidActionMap
=
ACTION_MAPPING_GUID
;
af
.
dwGenre
=
0x01000000
;
/* DIVIRTUAL_DRIVING_RACE */
...
...
@@ -357,8 +357,8 @@ static void test_action_mapping(void)
hr
=
IDirectInputDevice8_SetActionMap
(
data
.
keyboard
,
data
.
lpdiaf
,
NULL
,
0
);
ok
(
hr
==
DI_NOEFFECT
,
"SetActionMap should have no effect with no actions to map hr=%08x
\n
"
,
hr
);
af
.
dwDataSize
=
4
*
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]
);
af
.
dwNumActions
=
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]
);
af
.
dwDataSize
=
4
*
ARRAY_SIZE
(
actionMapping
);
af
.
dwNumActions
=
ARRAY_SIZE
(
actionMapping
);
/* test DIDSAM_NOUSER */
dps
.
diph
.
dwSize
=
sizeof
(
dps
);
...
...
@@ -448,8 +448,8 @@ static void test_save_settings(void)
memset
(
&
af
,
0
,
sizeof
(
af
));
af
.
dwSize
=
sizeof
(
af
);
af
.
dwActionSize
=
sizeof
(
DIACTIONA
);
af
.
dwDataSize
=
4
*
sizeof
(
actions
)
/
sizeof
(
actions
[
0
]
);
af
.
dwNumActions
=
sizeof
(
actions
)
/
sizeof
(
actions
[
0
]
);
af
.
dwDataSize
=
4
*
ARRAY_SIZE
(
actions
);
af
.
dwNumActions
=
ARRAY_SIZE
(
actions
);
af
.
rgoAction
=
actions
;
af
.
guidActionMap
=
mapping_guid
;
af
.
dwGenre
=
0x01000000
;
/* DIVIRTUAL_DRIVING_RACE */
...
...
dlls/dinput8/tests/dinput.c
View file @
91c3e8eb
...
...
@@ -82,7 +82,7 @@ static void test_preinitialization(void)
return
;
}
for
(
i
=
0
;
i
<
sizeof
(
create_device_tests
)
/
sizeof
(
create_device_tests
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
create_device_tests
);
i
++
)
{
if
(
create_device_tests
[
i
].
pdev
)
pDID
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectInput8_CreateDevice
(
pDI
,
create_device_tests
[
i
].
rguid
,
...
...
@@ -93,7 +93,7 @@ static void test_preinitialization(void)
ok
(
pDID
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pDID
);
}
for
(
i
=
0
;
i
<
sizeof
(
enum_devices_tests
)
/
sizeof
(
enum_devices_tests
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
enum_devices_tests
);
i
++
)
{
hr
=
IDirectInput8_EnumDevices
(
pDI
,
enum_devices_tests
[
i
].
dwDevType
,
enum_devices_tests
[
i
].
lpCallback
,
...
...
@@ -186,7 +186,7 @@ static void test_DirectInput8Create(void)
IUnknown
*
pUnk
;
HRESULT
hr
;
for
(
i
=
0
;
i
<
sizeof
(
invalid_param_list
)
/
sizeof
(
invalid_param_list
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
invalid_param_list
);
i
++
)
{
if
(
invalid_param_list
[
i
].
ppdi
)
pUnk
=
(
void
*
)
0xdeadbeef
;
hr
=
DirectInput8Create
(
invalid_param_list
[
i
].
hinst
?
hInstance
:
NULL
,
...
...
@@ -199,7 +199,7 @@ static void test_DirectInput8Create(void)
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
}
for
(
i
=
0
;
i
<
sizeof
(
no_interface_list
)
/
sizeof
(
no_interface_list
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
no_interface_list
);
i
++
)
{
pUnk
=
(
void
*
)
0xdeadbeef
;
hr
=
DirectInput8Create
(
hInstance
,
DIRECTINPUT_VERSION
,
no_interface_list
[
i
],
(
void
**
)
&
pUnk
,
NULL
);
...
...
@@ -207,7 +207,7 @@ static void test_DirectInput8Create(void)
ok
(
pUnk
==
NULL
,
"[%d] Output interface pointer is %p
\n
"
,
i
,
pUnk
);
}
for
(
i
=
0
;
i
<
sizeof
(
iid_list
)
/
sizeof
(
iid_list
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
iid_list
);
i
++
)
{
pUnk
=
NULL
;
hr
=
DirectInput8Create
(
hInstance
,
DIRECTINPUT_VERSION
,
iid_list
[
i
],
(
void
**
)
&
pUnk
,
NULL
);
...
...
@@ -268,7 +268,7 @@ static void test_QueryInterface(void)
hr
=
IDirectInput8_QueryInterface
(
pDI
,
&
IID_IUnknown
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IDirectInput8_QueryInterface returned 0x%08x
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
iid_list
)
/
sizeof
(
iid_list
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
iid_list
);
i
++
)
{
pUnk
=
NULL
;
hr
=
IDirectInput8_QueryInterface
(
pDI
,
iid_list
[
i
],
(
void
**
)
&
pUnk
);
...
...
@@ -277,7 +277,7 @@ static void test_QueryInterface(void)
if
(
pUnk
)
{
int
j
;
for
(
j
=
0
;
j
<
sizeof
(
iid_list
)
/
sizeof
(
iid_list
[
0
]
);
j
++
)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
iid_list
);
j
++
)
{
IUnknown
*
pUnk1
=
NULL
;
hr
=
IDirectInput8_QueryInterface
(
pUnk
,
iid_list
[
j
],
(
void
**
)
&
pUnk1
);
...
...
@@ -289,7 +289,7 @@ static void test_QueryInterface(void)
}
}
for
(
i
=
0
;
i
<
sizeof
(
no_interface_list
)
/
sizeof
(
no_interface_list
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
no_interface_list
);
i
++
)
{
pUnk
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectInput8_QueryInterface
(
pDI
,
no_interface_list
[
i
].
riid
,
(
void
**
)
&
pUnk
);
...
...
@@ -527,7 +527,7 @@ static void test_EnumDevicesBySemantics(void)
memset
(
&
diaf
,
0
,
sizeof
(
diaf
));
diaf
.
dwSize
=
sizeof
(
diaf
);
diaf
.
dwActionSize
=
sizeof
(
DIACTIONA
);
diaf
.
dwNumActions
=
sizeof
(
actionMapping
)
/
sizeof
(
actionMapping
[
0
]
);
diaf
.
dwNumActions
=
ARRAY_SIZE
(
actionMapping
);
diaf
.
dwDataSize
=
4
*
diaf
.
dwNumActions
;
diaf
.
rgoAction
=
actionMapping
;
diaf
.
guidActionMap
=
ACTION_MAPPING_GUID
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment