dinput: Remove superfluous pointer casts.
This commit is contained in:
parent
7111ca5506
commit
c0d2a21dd1
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue