Merge pull request #105799 from Repiteo/scons/enum-conversion-warnings

SCons: Add enum conversion warning
This commit is contained in:
Thaddeus Crews
2025-04-27 19:21:23 -05:00
14 changed files with 67 additions and 77 deletions

View File

@ -525,17 +525,17 @@ float JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool
return p_trigger ? -1.0f : 0.0f;
}
if (!p_xinput) {
return (float)p_val / MAX_JOY_AXIS;
return p_val / (float)MAX_JOY_AXIS;
}
if (p_trigger) {
// Convert to a value between -1.0f and 1.0f.
return 2.0f * p_val / MAX_TRIGGER - 1.0f;
return 2.0f * p_val / (float)MAX_TRIGGER - 1.0f;
}
float value;
if (p_val < 0) {
value = (float)p_val / MAX_JOY_AXIS;
value = p_val / (float)MAX_JOY_AXIS;
} else {
value = (float)p_val / (MAX_JOY_AXIS - 1);
value = p_val / (float)(MAX_JOY_AXIS - 1);
}
if (p_negate) {
value = -value;