From 1268b9454672251208c7f48180a3c6d889be5da7 Mon Sep 17 00:00:00 2001 From: Bryant Date: Sat, 25 May 2013 16:12:26 -0700 Subject: [PATCH] Fixed warning comparing ints of different signed-ness. Everything should just be unsigned here. --- src/ui/QGCVehicleConfig.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ui/QGCVehicleConfig.cc b/src/ui/QGCVehicleConfig.cc index 13e4511..03c12a8 100644 --- a/src/ui/QGCVehicleConfig.cc +++ b/src/ui/QGCVehicleConfig.cc @@ -1058,9 +1058,9 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete if (minTpl.exactMatch(parameterName)) { bool ok; - int index = parameterName.mid(2, 1).toInt(&ok) - 1; + unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1; //qDebug() << "PARAM:" << parameterName << "index:" << index; - if (ok && (index >= 0) && (index < chanMax)) + if (ok && index < chanMax) { rcMin[index] = value.toInt(); } @@ -1068,8 +1068,8 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete if (maxTpl.exactMatch(parameterName)) { bool ok; - int index = parameterName.mid(2, 1).toInt(&ok) - 1; - if (ok && (index >= 0) && (index < chanMax)) + unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1; + if (ok && index < chanMax) { rcMax[index] = value.toInt(); } @@ -1077,8 +1077,8 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete if (trimTpl.exactMatch(parameterName)) { bool ok; - int index = parameterName.mid(2, 1).toInt(&ok) - 1; - if (ok && (index >= 0) && (index < chanMax)) + unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1; + if (ok && index < chanMax) { rcTrim[index] = value.toInt(); } @@ -1086,8 +1086,8 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete if (revTpl.exactMatch(parameterName)) { bool ok; - int index = parameterName.mid(2, 1).toInt(&ok) - 1; - if (ok && (index >= 0) && (index < chanMax)) + unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1; + if (ok && index < chanMax) { rcRev[index] = (value.toInt() == -1) ? true : false; updateInvertedCheckboxes(index);