From 6e0f1b25133f4cb882fc2fd876c9c55581ddb1ec Mon Sep 17 00:00:00 2001 From: m_thread Date: Mon, 13 Oct 2014 16:30:49 +0200 Subject: [PATCH] OP-1504 Fixed some compiler warnings and uncrustified code. --- .../calibration/sixpointcalibrationmodel.cpp | 8 ++++---- .../config/configvehicletypewidget.cpp | 2 +- .../src/plugins/config/stabilization.ui | 20 +++++++++---------- .../plugins/uavobjectbrowser/fieldtreeitem.h | 1 - .../src/plugins/uavobjectbrowser/treeitem.cpp | 2 +- .../src/plugins/uavobjectbrowser/treeitem.h | 8 +++++++- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp b/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp index 0593600e0..276362643 100644 --- a/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp +++ b/ground/openpilotgcs/src/plugins/config/calibration/sixpointcalibrationmodel.cpp @@ -473,8 +473,8 @@ void SixPointCalibrationModel::compute() revoCalibrationData.MagBiasNullingRate = memento.revoCalibrationData.MagBiasNullingRate;; // Check the mag calibration is good - bool good_calibration = true; - bool good_aux_calibration = true; + bool good_calibration = true; + // bool good_aux_calibration = true; if (calibratingMag) { good_calibration &= !IS_NAN(revoCalibrationData.mag_transform[RevoCalibration::MAG_TRANSFORM_R0C0]); good_calibration &= !IS_NAN(revoCalibrationData.mag_transform[RevoCalibration::MAG_TRANSFORM_R0C1]); @@ -581,7 +581,7 @@ void SixPointCalibrationModel::save() if (calibratingMag) { RevoCalibration::DataFields revoCalibrationData = revoCalibration->getData(); - for (int i = 0; i < RevoCalibration::MAG_TRANSFORM_NUMELEM; i++) { + for (uint i = 0; i < RevoCalibration::MAG_TRANSFORM_NUMELEM; i++) { revoCalibrationData.mag_transform[i] = result.revoCalibrationData.mag_transform[i]; } for (int i = 0; i < 3; i++) { @@ -592,7 +592,7 @@ void SixPointCalibrationModel::save() if (calibratingAuxMag) { AuxMagSettings::DataFields auxCalibrationData = auxMagSettings->getData(); // Note that Revo/AuxMag MAG_TRANSFORM_RxCx are interchangeable, an assertion at initialization enforces the structs are equal - for (int i = 0; i < RevoCalibration::MAG_TRANSFORM_NUMELEM; i++) { + for (uint i = 0; i < RevoCalibration::MAG_TRANSFORM_NUMELEM; i++) { auxCalibrationData.mag_transform[i] = result.auxMagSettingsData.mag_transform[i]; } for (int i = 0; i < 3; i++) { diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 7b227db28..229a2555c 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -292,7 +292,7 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgets() Q_ASSERT(field); QString name = m_aircraft->nameEdit->text(); for (uint i = 0; i < field->getNumElements(); ++i) { - if (i < name.length()) { + if (i < (uint)name.length()) { field->setValue(name.at(i).toLatin1(), i); } else { field->setValue(0, i); diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index f8a4a86b4..889f9f65f 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -95,7 +95,7 @@ QTabWidget::Rounded - 0 + 1 false @@ -136,8 +136,8 @@ 0 0 - 971 - 712 + 973 + 703 @@ -7837,8 +7837,8 @@ border-radius: 5; 0 0 - 954 - 732 + 957 + 782 @@ -10696,7 +10696,7 @@ response (deg) false - + 9 @@ -18055,8 +18055,8 @@ border-radius: 5; 0 0 - 971 - 712 + 973 + 703 @@ -23998,8 +23998,8 @@ font:bold; 0 0 - 971 - 712 + 973 + 703 diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h b/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h index 793291c60..238f7431c 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h @@ -471,7 +471,6 @@ private: { return QVariant(str.toString().at(0).toLatin1()); } - }; #endif // FIELDTREEITEM_H diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.cpp b/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.cpp index d4e5fb968..71b9cf690 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.cpp @@ -250,7 +250,7 @@ QVariant ArrayFieldTreeItem::data(int column) const .arg(m_field->getValue(i).toUInt(&ok), TreeItem::maxHexStringLength(m_field->getType()), 16, QChar('0')).toUpper()); } - QString data = QString("{%1}").arg(dataString); + QString data = QString("{%1}").arg(dataString); return data; } else { return QVariant(); diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.h b/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.h index 08e4b2038..9d6ab8e02 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.h +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/treeitem.h @@ -184,16 +184,22 @@ public: switch (type) { case UAVObjectField::INT8: return 2; + case UAVObjectField::INT16: return 4; + case UAVObjectField::INT32: return 8; + case UAVObjectField::UINT8: return 2; + case UAVObjectField::UINT16: return 4; + case UAVObjectField::UINT32: return 8; + default: Q_ASSERT(false); } @@ -352,7 +358,7 @@ public: QVariant data(int column) const; private: - UAVObjectField*m_field; + UAVObjectField *m_field; }; #endif // TREEITEM_H