Commit 721c502d authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent a14c4f92
...@@ -721,6 +721,9 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment