joy.cpl: Avoid pointers to out of scope variables (PVS-Studio).

This commit is contained in:
Michael Stefaniuc 2014-12-04 11:00:43 +01:00 committed by Alexandre Julliard
parent a14c4f92f3
commit 721c502db9
1 changed files with 3 additions and 6 deletions

View File

@ -721,6 +721,9 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef)
DWORD axes[2] = {DIJOFS_X, DIJOFS_Y}; DWORD axes[2] = {DIJOFS_X, DIJOFS_Y};
int direction[2] = {0, 0}; int direction[2] = {0, 0};
struct Joystick *joystick = pvRef; struct Joystick *joystick = pvRef;
DIRAMPFORCE rforce;
DICONSTANTFORCE cforce;
DIPERIODIC pforce;
if (joystick->effects == NULL) if (joystick->effects == NULL)
{ {
@ -744,8 +747,6 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef)
if (IsEqualGUID(&pdei->guid, &GUID_RampForce)) if (IsEqualGUID(&pdei->guid, &GUID_RampForce))
{ {
DIRAMPFORCE rforce;
rforce.lStart = 0; rforce.lStart = 0;
rforce.lEnd = DI_FFNOMINALMAX; rforce.lEnd = DI_FFNOMINALMAX;
@ -755,8 +756,6 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef)
} }
else if (IsEqualGUID(&pdei->guid, &GUID_ConstantForce)) else if (IsEqualGUID(&pdei->guid, &GUID_ConstantForce))
{ {
DICONSTANTFORCE cforce;
cforce.lMagnitude = DI_FFNOMINALMAX; cforce.lMagnitude = DI_FFNOMINALMAX;
dieffect.cbTypeSpecificParams = sizeof(cforce); dieffect.cbTypeSpecificParams = sizeof(cforce);
@ -769,8 +768,6 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef)
IsEqualGUID(&pdei->guid, &GUID_SawtoothUp) || IsEqualGUID(&pdei->guid, &GUID_SawtoothUp) ||
IsEqualGUID(&pdei->guid, &GUID_SawtoothDown)) IsEqualGUID(&pdei->guid, &GUID_SawtoothDown))
{ {
DIPERIODIC pforce;
pforce.dwMagnitude = DI_FFNOMINALMAX; pforce.dwMagnitude = DI_FFNOMINALMAX;
pforce.lOffset = 0; pforce.lOffset = 0;
pforce.dwPhase = 0; pforce.dwPhase = 0;