Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
870a8767
Commit
870a8767
authored
Jul 05, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Avoid ARRAY_SIZE-like macros.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2d8edab6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
data_formats.c
dlls/dinput/data_formats.c
+5
-7
dinput_main.c
dlls/dinput/dinput_main.c
+6
-7
No files found.
dlls/dinput/data_formats.c
View file @
870a8767
...
...
@@ -25,8 +25,6 @@
#include "windef.h"
#include "dinput.h"
#define numObjects(x) (sizeof(x) / sizeof(x[0]))
static
const
DIOBJECTDATAFORMAT
dfDIJoystick
[]
=
{
{
&
GUID_XAxis
,
DIJOFS_X
,
DIDFT_OPTIONAL
|
DIDFT_AXIS
|
DIDFT_ANYINSTANCE
,
0
},
{
&
GUID_YAxis
,
DIJOFS_Y
,
DIDFT_OPTIONAL
|
DIDFT_AXIS
|
DIDFT_ANYINSTANCE
,
0
},
...
...
@@ -79,7 +77,7 @@ const DIDATAFORMAT c_dfDIJoystick = {
sizeof
(
DIOBJECTDATAFORMAT
),
DIDF_ABSAXIS
,
sizeof
(
DIJOYSTATE
),
numObjects
(
dfDIJoystick
),
ARRAY_SIZE
(
dfDIJoystick
),
(
LPDIOBJECTDATAFORMAT
)
dfDIJoystick
};
...
...
@@ -255,7 +253,7 @@ const DIDATAFORMAT c_dfDIJoystick2 = {
sizeof
(
DIOBJECTDATAFORMAT
),
DIDF_ABSAXIS
,
sizeof
(
DIJOYSTATE2
),
numObjects
(
dfDIJoystick2
),
ARRAY_SIZE
(
dfDIJoystick2
),
(
LPDIOBJECTDATAFORMAT
)
dfDIJoystick2
};
...
...
@@ -274,7 +272,7 @@ const DIDATAFORMAT c_dfDIMouse = {
sizeof
(
DIOBJECTDATAFORMAT
),
DIDF_RELAXIS
,
sizeof
(
DIMOUSESTATE
),
numObjects
(
dfDIMouse
),
ARRAY_SIZE
(
dfDIMouse
),
(
LPDIOBJECTDATAFORMAT
)
dfDIMouse
};
...
...
@@ -297,7 +295,7 @@ const DIDATAFORMAT c_dfDIMouse2 = {
sizeof
(
DIOBJECTDATAFORMAT
),
DIDF_RELAXIS
,
sizeof
(
DIMOUSESTATE2
),
numObjects
(
dfDIMouse2
),
ARRAY_SIZE
(
dfDIMouse2
),
(
LPDIOBJECTDATAFORMAT
)
dfDIMouse2
};
...
...
@@ -565,6 +563,6 @@ const DIDATAFORMAT c_dfDIKeyboard = {
sizeof
(
DIOBJECTDATAFORMAT
),
DIDF_RELAXIS
,
256
,
numObjects
(
dfDIKeyboard
),
ARRAY_SIZE
(
dfDIKeyboard
),
(
LPDIOBJECTDATAFORMAT
)
dfDIKeyboard
};
dlls/dinput/dinput_main.c
View file @
870a8767
...
...
@@ -92,7 +92,6 @@ static const struct dinput_device *dinput_devices[] =
&
joystick_linux_device
,
&
joystick_osx_device
};
#define NB_DINPUT_DEVICES (sizeof(dinput_devices)/sizeof(dinput_devices[0]))
static
HINSTANCE
DINPUT_instance
=
NULL
;
...
...
@@ -409,7 +408,7 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices(
if
(
!
This
->
initialized
)
return
DIERR_NOTINITIALIZED
;
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
)
;
i
++
)
{
if
(
!
dinput_devices
[
i
]
->
enum_deviceA
)
continue
;
for
(
j
=
0
,
r
=
S_OK
;
SUCCEEDED
(
r
);
j
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
...
...
@@ -449,7 +448,7 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
if
(
!
This
->
initialized
)
return
DIERR_NOTINITIALIZED
;
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
)
;
i
++
)
{
if
(
!
dinput_devices
[
i
]
->
enum_deviceW
)
continue
;
for
(
j
=
0
,
r
=
S_OK
;
SUCCEEDED
(
r
);
j
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
...
...
@@ -750,7 +749,7 @@ static HRESULT create_device(IDirectInputImpl *This, REFGUID rguid, REFIID riid,
return
DIERR_NOTINITIALIZED
;
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
)
;
i
++
)
{
HRESULT
ret
;
...
...
@@ -1006,7 +1005,7 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
}
/* Enumerate all the joysticks */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
)
;
i
++
)
{
HRESULT
enumSuccess
;
...
...
@@ -1107,7 +1106,7 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
didevi
.
dwSize
=
sizeof
(
didevi
);
/* Enumerate all the joysticks */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
)
;
i
++
)
{
HRESULT
enumSuccess
;
...
...
@@ -1330,7 +1329,7 @@ static HRESULT WINAPI JoyConfig8Impl_GetConfig(IDirectInputJoyConfig8 *iface, UI
#undef X
/* Enumerate all joysticks in order */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
)
;
i
++
)
{
if
(
!
dinput_devices
[
i
]
->
enum_deviceA
)
continue
;
...
...
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