Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
389b962f
Commit
389b962f
authored
Feb 22, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Use a local variable to access hid_device_state.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0bb48fcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
hid.c
dlls/winebus.sys/hid.c
+12
-11
No files found.
dlls/winebus.sys/hid.c
View file @
389b962f
...
...
@@ -237,28 +237,29 @@ BOOL hid_device_add_hatswitch(struct unix_device *iface, INT count)
static
BOOL
hid_device_add_axis_count
(
struct
unix_device
*
iface
,
BOOL
rel
,
BYTE
count
)
{
USHORT
offset
=
iface
->
hid_device_state
.
bit_size
/
8
;
struct
hid_device_state
*
state
=
&
iface
->
hid_device_state
;
USHORT
offset
=
state
->
bit_size
/
8
;
if
(
!
rel
&&
iface
->
hid_device_state
.
rel_axis_count
)
if
(
!
rel
&&
state
->
rel_axis_count
)
ERR
(
"absolute axes should be added before relative axes!
\n
"
);
else
if
(
iface
->
hid_device_state
.
button_count
||
iface
->
hid_device_state
.
hatswitch_count
)
else
if
(
state
->
button_count
||
state
->
hatswitch_count
)
ERR
(
"axes should be added before buttons or hatswitches!
\n
"
);
else
if
((
iface
->
hid_device_state
.
bit_size
%
8
))
else
if
((
state
->
bit_size
%
8
))
ERR
(
"axes should be byte aligned, missing padding!
\n
"
);
else
if
(
iface
->
hid_device_state
.
bit_size
+
32
*
count
>
0x80000
)
else
if
(
state
->
bit_size
+
32
*
count
>
0x80000
)
ERR
(
"report size overflow, too many elements!
\n
"
);
else
if
(
rel
)
{
if
(
!
iface
->
hid_device_state
.
rel_axis_count
)
iface
->
hid_device_state
.
rel_axis_start
=
offset
;
iface
->
hid_device_state
.
rel_axis_count
+=
count
;
iface
->
hid_device_state
.
bit_size
+=
32
*
count
;
if
(
!
state
->
rel_axis_count
)
state
->
rel_axis_start
=
offset
;
state
->
rel_axis_count
+=
count
;
state
->
bit_size
+=
32
*
count
;
return
TRUE
;
}
else
{
if
(
!
iface
->
hid_device_state
.
abs_axis_count
)
iface
->
hid_device_state
.
abs_axis_start
=
offset
;
iface
->
hid_device_state
.
abs_axis_count
+=
count
;
iface
->
hid_device_state
.
bit_size
+=
32
*
count
;
if
(
!
state
->
abs_axis_count
)
state
->
abs_axis_start
=
offset
;
state
->
abs_axis_count
+=
count
;
state
->
bit_size
+=
32
*
count
;
return
TRUE
;
}
...
...
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