input_common/CMakeLists: Make some warnings errors

Makes the input_common code warnings consistent with the rest of the
codebase.
This commit is contained in:
Lioncash 2020-10-14 02:51:14 -04:00
parent 72df55f8a5
commit d44d662529
19 changed files with 306 additions and 203 deletions

View file

@ -20,18 +20,22 @@ public:
constexpr float SQRT_HALF = 0.707106781f;
int x = 0, y = 0;
if (right->GetStatus())
if (right->GetStatus()) {
++x;
if (left->GetStatus())
}
if (left->GetStatus()) {
--x;
if (up->GetStatus())
}
if (up->GetStatus()) {
++y;
if (down->GetStatus())
}
if (down->GetStatus()) {
--y;
}
float coef = modifier->GetStatus() ? modifier_scale : 1.0f;
return std::make_tuple(x * coef * (y == 0 ? 1.0f : SQRT_HALF),
y * coef * (x == 0 ? 1.0f : SQRT_HALF));
const float coef = modifier->GetStatus() ? modifier_scale : 1.0f;
return std::make_tuple(static_cast<float>(x) * coef * (y == 0 ? 1.0f : SQRT_HALF),
static_cast<float>(y) * coef * (x == 0 ? 1.0f : SQRT_HALF));
}
bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override {