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
c0d2a21d
Commit
c0d2a21d
authored
Jan 28, 2009
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Remove superfluous pointer casts.
parent
7111ca55
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
17 deletions
+17
-17
device.c
dlls/dinput/device.c
+1
-1
dinput_main.c
dlls/dinput/dinput_main.c
+1
-1
effect_linuxinput.c
dlls/dinput/effect_linuxinput.c
+10
-10
device.c
dlls/dinput/tests/device.c
+1
-1
joystick.c
dlls/dinput/tests/joystick.c
+4
-4
No files found.
dlls/dinput/device.c
View file @
c0d2a21d
...
...
@@ -269,7 +269,7 @@ void fill_DataFormat(void *out, DWORD size, const void *in, const DataFormat *df
{
int
i
;
const
char
*
in_c
=
in
;
char
*
out_c
=
(
char
*
)
out
;
char
*
out_c
=
out
;
memset
(
out
,
0
,
size
);
if
(
df
->
dt
==
NULL
)
{
...
...
dlls/dinput/dinput_main.c
View file @
c0d2a21d
...
...
@@ -869,7 +869,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualCLSID
(
&
IID_IClassFactory
,
riid
)
)
{
*
ppv
=
(
LPVOID
)
&
DINPUT_CF
;
*
ppv
=
&
DINPUT_CF
;
IClassFactory_AddRef
((
IClassFactory
*
)
*
ppv
);
return
S_OK
;
}
...
...
dlls/dinput/effect_linuxinput.c
View file @
c0d2a21d
...
...
@@ -423,19 +423,19 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters(
return
diErr
;
else
{
if
(
This
->
effect
.
type
==
FF_PERIODIC
)
{
LPDIPERIODIC
tsp
=
(
LPDIPERIODIC
)(
peff
->
lpvTypeSpecificParams
)
;
LPDIPERIODIC
tsp
=
peff
->
lpvTypeSpecificParams
;
tsp
->
dwMagnitude
=
(
This
->
effect
.
u
.
periodic
.
magnitude
/
33
)
*
10
;
tsp
->
lOffset
=
(
This
->
effect
.
u
.
periodic
.
offset
/
33
)
*
10
;
tsp
->
dwPhase
=
(
This
->
effect
.
u
.
periodic
.
phase
/
33
)
*
36
;
tsp
->
dwPeriod
=
(
This
->
effect
.
u
.
periodic
.
period
*
1000
);
}
else
if
(
This
->
effect
.
type
==
FF_CONSTANT
)
{
LPDICONSTANTFORCE
tsp
=
(
LPDICONSTANTFORCE
)(
peff
->
lpvTypeSpecificParams
)
;
LPDICONSTANTFORCE
tsp
=
peff
->
lpvTypeSpecificParams
;
tsp
->
lMagnitude
=
(
This
->
effect
.
u
.
constant
.
level
/
33
)
*
10
;
}
else
if
(
This
->
effect
.
type
==
FF_SPRING
||
This
->
effect
.
type
==
FF_FRICTION
||
This
->
effect
.
type
==
FF_INERTIA
||
This
->
effect
.
type
==
FF_DAMPER
)
{
LPDICONDITION
tsp
=
(
LPDICONDITION
)(
peff
->
lpvTypeSpecificParams
)
;
LPDICONDITION
tsp
=
peff
->
lpvTypeSpecificParams
;
int
i
;
for
(
i
=
0
;
i
<
2
;
++
i
)
{
tsp
[
i
].
lOffset
=
(
This
->
effect
.
u
.
condition
[
i
].
center
/
33
)
*
10
;
...
...
@@ -446,7 +446,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters(
tsp
[
i
].
lDeadBand
=
(
This
->
effect
.
u
.
condition
[
i
].
deadband
/
33
)
*
10
;
}
}
else
if
(
This
->
effect
.
type
==
FF_RAMP
)
{
LPDIRAMPFORCE
tsp
=
(
LPDIRAMPFORCE
)(
peff
->
lpvTypeSpecificParams
)
;
LPDIRAMPFORCE
tsp
=
peff
->
lpvTypeSpecificParams
;
tsp
->
lStart
=
(
This
->
effect
.
u
.
ramp
.
start_level
/
33
)
*
10
;
tsp
->
lEnd
=
(
This
->
effect
.
u
.
ramp
.
end_level
/
33
)
*
10
;
}
...
...
@@ -654,7 +654,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
LPCDIPERIODIC
tsp
;
if
(
peff
->
cbTypeSpecificParams
!=
sizeof
(
DIPERIODIC
))
return
DIERR_INVALIDPARAM
;
tsp
=
(
LPCDIPERIODIC
)(
peff
->
lpvTypeSpecificParams
)
;
tsp
=
peff
->
lpvTypeSpecificParams
;
This
->
effect
.
u
.
periodic
.
magnitude
=
(
tsp
->
dwMagnitude
/
10
)
*
32
;
This
->
effect
.
u
.
periodic
.
offset
=
(
tsp
->
lOffset
/
10
)
*
32
;
This
->
effect
.
u
.
periodic
.
phase
=
(
tsp
->
dwPhase
/
9
)
*
8
;
/* == (/ 36 * 32) */
...
...
@@ -663,17 +663,17 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
LPCDICONSTANTFORCE
tsp
;
if
(
peff
->
cbTypeSpecificParams
!=
sizeof
(
DICONSTANTFORCE
))
return
DIERR_INVALIDPARAM
;
tsp
=
(
LPCDICONSTANTFORCE
)(
peff
->
lpvTypeSpecificParams
)
;
tsp
=
peff
->
lpvTypeSpecificParams
;
This
->
effect
.
u
.
constant
.
level
=
(
max
(
min
(
tsp
->
lMagnitude
,
10000
),
-
10000
)
/
10
)
*
32
;
}
else
if
(
type
==
DIEFT_RAMPFORCE
)
{
LPCDIRAMPFORCE
tsp
;
if
(
peff
->
cbTypeSpecificParams
!=
sizeof
(
DIRAMPFORCE
))
return
DIERR_INVALIDPARAM
;
tsp
=
(
LPCDIRAMPFORCE
)(
peff
->
lpvTypeSpecificParams
)
;
tsp
=
peff
->
lpvTypeSpecificParams
;
This
->
effect
.
u
.
ramp
.
start_level
=
(
tsp
->
lStart
/
10
)
*
32
;
This
->
effect
.
u
.
ramp
.
end_level
=
(
tsp
->
lStart
/
10
)
*
32
;
}
else
if
(
type
==
DIEFT_CONDITION
)
{
LPCDICONDITION
tsp
=
(
LPCDICONDITION
)(
peff
->
lpvTypeSpecificParams
)
;
LPCDICONDITION
tsp
=
peff
->
lpvTypeSpecificParams
;
if
(
peff
->
cbTypeSpecificParams
==
sizeof
(
DICONDITION
))
{
/* One condition block. This needs to be rotated to direction,
* and expanded to separate x and y conditions. */
...
...
@@ -879,7 +879,7 @@ HRESULT linuxinput_get_info_A(
info
->
dwDynamicParams
=
info
->
dwStaticParams
;
/* yes, this is windows behavior (print the GUID_Name for name) */
strcpy
(
(
char
*
)
info
->
tszName
,
_dump_dinput_GUID
(
rguid
));
strcpy
(
info
->
tszName
,
_dump_dinput_GUID
(
rguid
));
return
DI_OK
;
}
...
...
@@ -914,7 +914,7 @@ HRESULT linuxinput_get_info_W(
/* yes, this is windows behavior (print the GUID_Name for name) */
MultiByteToWideChar
(
CP_ACP
,
0
,
_dump_dinput_GUID
(
rguid
),
-
1
,
(
WCHAR
*
)
info
->
tszName
,
MAX_PATH
);
info
->
tszName
,
MAX_PATH
);
return
DI_OK
;
}
...
...
dlls/dinput/tests/device.c
View file @
c0d2a21d
...
...
@@ -120,7 +120,7 @@ struct enum_data
static
BOOL
CALLBACK
enum_devices
(
LPCDIDEVICEINSTANCE
lpddi
,
LPVOID
pvRef
)
{
struct
enum_data
*
data
=
(
struct
enum_data
*
)
pvRef
;
struct
enum_data
*
data
=
pvRef
;
LPDIRECTINPUTDEVICE
device
;
HRESULT
hr
;
...
...
dlls/dinput/tests/joystick.c
View file @
c0d2a21d
...
...
@@ -96,7 +96,7 @@ static BOOL CALLBACK EnumAxes(
VOID
*
pContext
)
{
HRESULT
hr
;
JoystickInfo
*
info
=
(
JoystickInfo
*
)
pContext
;
JoystickInfo
*
info
=
pContext
;
if
(
IsEqualIID
(
&
pdidoi
->
guidType
,
&
GUID_XAxis
)
||
IsEqualIID
(
&
pdidoi
->
guidType
,
&
GUID_YAxis
)
||
...
...
@@ -171,7 +171,7 @@ static BOOL CALLBACK EnumJoysticks(
LPVOID
pvRef
)
{
HRESULT
hr
;
UserData
*
data
=
(
UserData
*
)
pvRef
;
UserData
*
data
=
pvRef
;
LPDIRECTINPUTDEVICE
pJoystick
;
DIDATAFORMAT
format
;
DIDEVCAPS
caps
;
...
...
@@ -267,7 +267,7 @@ static BOOL CALLBACK EnumJoysticks(
info
.
lMin
=
0
;
info
.
lMax
=
0xffff
;
/* enumerate objects */
hr
=
IDirectInputDevice_EnumObjects
(
pJoystick
,
EnumAxes
,
(
VOID
*
)
&
info
,
DIDFT_ALL
);
hr
=
IDirectInputDevice_EnumObjects
(
pJoystick
,
EnumAxes
,
&
info
,
DIDFT_ALL
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice_EnumObjects() failed: %08x
\n
"
,
hr
);
ok
(
caps
.
dwAxes
==
info
.
axis
,
"Number of enumerated axes (%d) doesn't match capabilities (%d)
\n
"
,
info
.
axis
,
caps
.
dwAxes
);
...
...
@@ -280,7 +280,7 @@ static BOOL CALLBACK EnumJoysticks(
info
.
lMin
=
-
2000
;
info
.
lMax
=
+
2000
;
info
.
dZone
=
123
;
hr
=
IDirectInputDevice_EnumObjects
(
pJoystick
,
EnumAxes
,
(
VOID
*
)
&
info
,
DIDFT_ALL
);
hr
=
IDirectInputDevice_EnumObjects
(
pJoystick
,
EnumAxes
,
&
info
,
DIDFT_ALL
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice_EnumObjects() failed: %08x
\n
"
,
hr
);
hr
=
IDirectInputDevice_GetDeviceInfo
(
pJoystick
,
0
);
...
...
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