Skip to content

Commit

Permalink
Replace C 'fabs' by 'std::abs'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lgt2x committed Oct 28, 2024
1 parent f8a06f7 commit deb9749
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ddio/sdlcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,34 +335,34 @@ ct_config_data sdlgameController::get_controller_value(ct_type type_req) {

if (m_ControlList[i].flags & CTF_V_AXIS) {
pos = get_axis_value(i, CT_V_AXIS, ctAnalog);
if (fabs(pos) >= 0.50f)
if (std::abs(pos) >= 0.50f)
val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_V_AXIS, NULL_BINDING));
}
if (m_ControlList[i].flags & CTF_U_AXIS) {
pos = get_axis_value(i, CT_U_AXIS, ctAnalog);
if (fabs(pos) >= 0.50f)
if (std::abs(pos) >= 0.50f)
val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_U_AXIS, NULL_BINDING));
}
if (m_ControlList[i].flags & CTF_R_AXIS) {
pos = get_axis_value(i, CT_R_AXIS, ctAnalog);
if (fabs(pos) >= 0.90f)
if (std::abs(pos) >= 0.90f)
val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_R_AXIS, NULL_BINDING));
}
if (m_ControlList[i].flags & CTF_Z_AXIS) {
pos = get_axis_value(i, CT_Z_AXIS, ctAnalog);
if (fabs(pos) >= 0.50f)
if (std::abs(pos) >= 0.50f)
val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_Z_AXIS, NULL_BINDING));
}
if (m_ControlList[i].flags & CTF_Y_AXIS) {
pos = get_axis_value(i, CT_Y_AXIS, ctAnalog);
// mprintf(0, "y=%.2f ", pos);
if (fabs(pos) >= 0.90f)
if (std::abs(pos) >= 0.90f)
val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_Y_AXIS, NULL_BINDING));
}
if (m_ControlList[i].flags & CTF_X_AXIS) {
pos = get_axis_value(i, CT_X_AXIS, ctAnalog);
// mprintf(0, "x=%.2f\n", pos);
if (fabs(pos) >= 0.90f)
if (std::abs(pos) >= 0.90f)
val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_X_AXIS, NULL_BINDING));
}
} break;
Expand Down Expand Up @@ -417,7 +417,7 @@ void sdlgameController::get_controller_axis_value(int controllerId, unsigned int
? 0.80f
: (m_ControlList[controllerId].sens[axis_ct_flag - 1] / 2);
float pos = get_axis_value(controllerId, axis_ct_flag, ctAnalog);
if (fabs(pos) > limit)
if (std::abs(pos) > limit)
*val = MAKE_CONFIG_DATA(CONTROLLER_CTL_INFO(controllerId, NULL_CONTROLLER),
CONTROLLER_CTL_VALUE(axis_ct_flag, NULL_BINDING));
}
Expand Down

0 comments on commit deb9749

Please sign in to comment.