mirror of
https://github.com/AntiMicroX/antimicrox.git
synced 2025-12-23 23:29:25 -05:00
chore: Fix infer code warnings
This commit is contained in:
committed by
Paweł Kotiuk
parent
35c0089173
commit
a2dc31c5d4
@@ -194,7 +194,7 @@ void UInputEventHandler::sendMouseButtonEvent(JoyButtonSlot *slot, bool pressed)
|
||||
{
|
||||
if (code <= 3)
|
||||
{
|
||||
unsigned int tempcode = BTN_LEFT;
|
||||
unsigned int tempcode;
|
||||
switch (code)
|
||||
{
|
||||
case 3: {
|
||||
|
||||
@@ -892,7 +892,7 @@ void AdvanceButtonDialog::updateSetSelection()
|
||||
{
|
||||
PadderCommon::inputDaemonMutex.lock();
|
||||
|
||||
int chosen_set = -1;
|
||||
int chosen_set;
|
||||
JoyButton::SetChangeCondition set_selection_condition = JoyButton::SetChangeDisabled;
|
||||
|
||||
if (ui->setSelectionComboBox->currentIndex() > 0)
|
||||
|
||||
@@ -600,11 +600,17 @@ void InputDevice::changeSetAxisButtonAssociation(int button_index, int axis_inde
|
||||
} else if (button_index == 1)
|
||||
{
|
||||
button = getJoystick_sets().value(newset)->getJoyAxis(axis_index)->getPAxisButton();
|
||||
} else
|
||||
{
|
||||
WARN() << "Invalid button_index value: " << button_index;
|
||||
return;
|
||||
}
|
||||
if (button != nullptr)
|
||||
{
|
||||
JoyButton::SetChangeCondition tempmode = static_cast<JoyButton::SetChangeCondition>(mode);
|
||||
button->setChangeSetSelection(originset);
|
||||
button->setChangeSetCondition(tempmode, true);
|
||||
}
|
||||
|
||||
JoyButton::SetChangeCondition tempmode = static_cast<JoyButton::SetChangeCondition>(mode);
|
||||
button->setChangeSetSelection(originset);
|
||||
button->setChangeSetCondition(tempmode, true);
|
||||
}
|
||||
|
||||
void InputDevice::changeSetStickButtonAssociation(int button_index, int stick_index, int originset, int newset, int mode)
|
||||
|
||||
@@ -1140,7 +1140,7 @@ void JoyButton::mouseEvent()
|
||||
|
||||
// Determine the multiplier to use for the current maximum mouse speed
|
||||
// based on how much time has passed.
|
||||
double elapsedDiff = 1.0;
|
||||
double elapsedDiff;
|
||||
if ((easingDuration > 0.0) && ((easingElapsed * .001) < easingDuration))
|
||||
{
|
||||
elapsedDiff = ((easingElapsed * .001) / easingDuration);
|
||||
@@ -1291,7 +1291,7 @@ void JoyButton::mouseEvent()
|
||||
}
|
||||
|
||||
double tempAccel = currentAccelMultiTemp;
|
||||
double elapsedDiff = 1.0;
|
||||
double elapsedDiff;
|
||||
|
||||
if ((elapsedDuration > 0.0) && ((elapsedElapsed * 0.001) < elapsedDuration))
|
||||
{
|
||||
@@ -1305,7 +1305,6 @@ void JoyButton::mouseEvent()
|
||||
updateOldAccelMulti = currentAccelMulti;
|
||||
} else
|
||||
{
|
||||
elapsedDiff = 1.0;
|
||||
currentAccelMulti = 0.0;
|
||||
updateOldAccelMulti = 0.0;
|
||||
accelTravel = 0.0;
|
||||
@@ -3801,8 +3800,6 @@ void JoyButton::moveSpringMouse(int &movedX, int &movedY, bool &hasMoved, int sp
|
||||
|
||||
for (int i = (springXSpeeds->length() - 1); (i >= 0) && !complete; i--)
|
||||
{
|
||||
double tempx = -2.0;
|
||||
double tempy = -2.0;
|
||||
double tempSpringDeadX = 0.0;
|
||||
double tempSpringDeadY = 0.0;
|
||||
|
||||
@@ -3812,8 +3809,8 @@ void JoyButton::moveSpringMouse(int &movedX, int &movedY, bool &hasMoved, int sp
|
||||
infoX = springXSpeeds->takeLast();
|
||||
infoY = springYSpeeds->takeLast();
|
||||
|
||||
tempx = infoX.displacementX;
|
||||
tempy = infoY.displacementY;
|
||||
double tempx = infoX.displacementX;
|
||||
double tempy = infoY.displacementY;
|
||||
tempSpringDeadX = infoX.springDeadX;
|
||||
tempSpringDeadY = infoY.springDeadY;
|
||||
|
||||
|
||||
@@ -1985,7 +1985,6 @@ bool JoyControlStick::hasSameButtonsMouseCurve()
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
JoyButton::JoyMouseCurve initialCurve = JoyButton::LinearCurve;
|
||||
QHash<JoyStickDirections, JoyControlStickButton *> temphash = getApplicableButtons();
|
||||
auto iter = temphash.cbegin();
|
||||
|
||||
@@ -1993,7 +1992,7 @@ bool JoyControlStick::hasSameButtonsMouseCurve()
|
||||
return result;
|
||||
|
||||
JoyControlStickButton *button = iter.value();
|
||||
initialCurve = button->getMouseCurve();
|
||||
JoyButton::JoyMouseCurve initialCurve = button->getMouseCurve();
|
||||
|
||||
while (++iter != temphash.cend())
|
||||
{
|
||||
|
||||
@@ -316,8 +316,6 @@ bool JoyDPad::hasSameButtonsMouseCurve()
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
JoyButton::JoyMouseCurve initialCurve = JoyButton::LinearCurve;
|
||||
|
||||
QHash<int, JoyDPadButton *> temphash = getApplicableButtons();
|
||||
auto iter = temphash.cbegin();
|
||||
|
||||
@@ -325,7 +323,7 @@ bool JoyDPad::hasSameButtonsMouseCurve()
|
||||
return result;
|
||||
|
||||
JoyDPadButton *button = iter.value();
|
||||
initialCurve = button->getMouseCurve();
|
||||
JoyButton::JoyMouseCurve initialCurve = button->getMouseCurve();
|
||||
|
||||
while (++iter != temphash.cend())
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ int SpringModeRegionPreview::adjustSpringSizeWidth(int width)
|
||||
|
||||
int SpringModeRegionPreview::adjustSpringSizeHeight(int height)
|
||||
{
|
||||
int tempheight = size().height();
|
||||
int tempheight;
|
||||
|
||||
if (height >= 2)
|
||||
{
|
||||
|
||||
@@ -554,7 +554,7 @@ QString X11Extras::getWindowClass(Window window)
|
||||
qDebug() << nitems;
|
||||
|
||||
char *null_char = strchr(reinterpret_cast<char *>(prop), '\0');
|
||||
if (((reinterpret_cast<char *>(prop)) + nitems - 1) > null_char)
|
||||
if ((null_char != nullptr) && (((reinterpret_cast<char *>(prop)) + nitems - 1) > null_char))
|
||||
{
|
||||
*(null_char) = ' ';
|
||||
}
|
||||
@@ -654,7 +654,6 @@ void X11Extras::x11ResetMouseAccelerationChange(QString pointerName)
|
||||
checkFeedback(temp, num_feedbacks, feedback_id);
|
||||
|
||||
XFree(feedbacks);
|
||||
feedbacks = temp = nullptr;
|
||||
|
||||
if (feedback_id <= -1)
|
||||
{
|
||||
@@ -750,7 +749,6 @@ struct X11Extras::ptrInformation X11Extras::getPointInformation(QString pointerN
|
||||
}
|
||||
|
||||
XFree(feedbacks);
|
||||
feedbacks = temp = nullptr;
|
||||
XCloseDevice(display, device);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ void JoyButtonSlotXml::readConfig(QXmlStreamReader *xml)
|
||||
tempStringData = QString();
|
||||
extraStringData = QString();
|
||||
slotMixString = QString();
|
||||
firstTimePlus = true;
|
||||
|
||||
xml->readNextStartElement();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user