diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/opmaps.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/opmaps.cpp index 86660fd3e..3b858d82f 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/opmaps.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/opmaps.cpp @@ -43,6 +43,8 @@ namespace core { LanguageStr=LanguageType().toShortString(Language); Cache::Instance(); +// OPMaps::MemoryCache(); + } diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojection.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojection.cpp index 18688ca06..27fd90808 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojection.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojection.cpp @@ -91,6 +91,7 @@ Size PlateCarreeProjection::GetTileMatrixMaxXY(const int &zoom) Size PlateCarreeProjection::GetTileMatrixMinXY(const int &zoom) { + Q_UNUSED(zoom); return Size(0, 0); } } diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojectionpergo.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojectionpergo.cpp index 106674ad2..89d598bd6 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojectionpergo.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/projections/platecarreeprojectionpergo.cpp @@ -90,6 +90,7 @@ Size PlateCarreeProjectionPergo::GetTileMatrixMaxXY(const int &zoom) Size PlateCarreeProjectionPergo::GetTileMatrixMinXY(const int &zoom) { + Q_UNUSED(zoom) return Size(0, 0); } } diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/homeitem.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/homeitem.cpp index 6dad1e034..09ef9d497 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/homeitem.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/homeitem.cpp @@ -28,7 +28,7 @@ namespace mapcontrol { HomeItem::HomeItem(MapGraphicItem* map,OPMapWidget* parent):safe(true),map(map),mapwidget(parent), - showsafearea(true),safearea(1000),altitude(0),isDragging(false),toggleRefresh(true) + showsafearea(true),toggleRefresh(true),safearea(1000),altitude(0),isDragging(false) { pic.load(QString::fromUtf8(":/markers/images/home2.svg")); pic=pic.scaled(30,30,Qt::IgnoreAspectRatio); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp index 30eea862d..bdc60225d 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp @@ -34,7 +34,7 @@ namespace mapcontrol { OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config):QGraphicsView(parent),configuration(config),UAV(0),GPS(0),Home(0) - ,followmouse(true),compass(0),showuav(false),showhome(false),showDiag(false),diagGraphItem(0),diagTimer(0),overlayOpacity(1) + ,followmouse(true),compass(0),showuav(false),showhome(false),diagTimer(0),diagGraphItem(0),showDiag(false),overlayOpacity(1) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); core=new internals::Core; @@ -392,7 +392,6 @@ namespace mapcontrol } void OPMapWidget::WPDeleteAll() { - int x=0; foreach(QGraphicsItem* i,map->childItems()) { WayPointItem* w=qgraphicsitem_cast(i); @@ -419,7 +418,9 @@ namespace mapcontrol } } } + return false; } + void OPMapWidget::deleteAllOverlays() { foreach(QGraphicsItem* i,map->childItems()) diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/trailitem.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/trailitem.cpp index fabf6ee9a..ae13de21b 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/trailitem.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/trailitem.cpp @@ -37,6 +37,9 @@ TrailItem::TrailItem(internals::PointLatLng const& coord,int const& altitude, QB void TrailItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option); + Q_UNUSED(widget); + painter->setBrush(m_brush); painter->drawEllipse(-2,-2,4,4); } diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp index 9f045a701..aad50ef0b 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp @@ -60,6 +60,9 @@ int WayPointCircle::type() const void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option); + Q_UNUSED(widget); + QPointF p1; QPointF p2; p1=QPointF(line.p1().x(),line.p1().y()+line.length()); diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp index 527ca46f9..ad245cbc1 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointline.cpp @@ -75,6 +75,8 @@ QPainterPath WayPointLine::shape() const } void WayPointLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option); + Q_UNUSED(widget); QPen myPen = pen(); myPen.setColor(myColor); diff --git a/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.cpp b/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.cpp index 7192aabe1..10b0db0bc 100644 --- a/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.cpp +++ b/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.cpp @@ -492,7 +492,7 @@ QString QScienceSpinBox::stripped(const QString &t, int *pos) const } // reimplemented function, copied from qspinbox.cpp -static bool isIntermediateValueHelper(qint64 num, qint64 min, qint64 max, qint64 *match) +bool QScienceSpinBox::isIntermediateValueHelper(qint64 num, qint64 min, qint64 max, qint64 *match) { QSBDEBUG("%lld %lld %lld", num, min, max); diff --git a/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.h b/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.h index 812447840..8b2ab98ed 100644 --- a/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.h +++ b/ground/openpilotgcs/src/libs/qscispinbox/QScienceSpinBox.h @@ -11,7 +11,6 @@ #include #include -static bool isIntermediateValueHelper(qint64 num, qint64 minimum, qint64 maximum, qint64 *match = 0); class QScienceSpinBox : public QDoubleSpinBox { @@ -24,6 +23,7 @@ public: QString textFromValue ( double value ) const; double valueFromText ( const QString & text ) const; + static bool isIntermediateValueHelper(qint64 num, qint64 minimum, qint64 maximum, qint64 *match = 0); private: int dispDecimals; diff --git a/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp b/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp index 19d568702..3db71a316 100644 --- a/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp +++ b/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp @@ -116,6 +116,8 @@ void MyTabbedStackWidget::showWidget(int index) void MyTabbedStackWidget::insertCornerWidget(int index, QWidget *widget) { + Q_UNUSED(index); + widget->hide(); } diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp index 7234ffbf4..2262316e2 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp @@ -206,6 +206,7 @@ ConfigCcpmWidget::~ConfigCcpmWidget() void ConfigCcpmWidget::setupUI(QString frameType) { + Q_UNUSED(frameType); } void ConfigCcpmWidget::ResetActuators(GUIConfigDataUnion* configData) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp index ecc933eec..615ca2ef6 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp @@ -290,7 +290,7 @@ bool ConfigFixedWingWidget::setupFrameFixedWing(QString airframeType) int channel; //disable all - for (channel=0; channel<(int)VehicleConfig::CHANNEL_NUMELEM; channel++) + for (channel=0; (unsigned int) channel < VehicleConfig::CHANNEL_NUMELEM; channel++) { setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_DISABLED); resetMixerVector(mixer, channel); @@ -370,7 +370,7 @@ bool ConfigFixedWingWidget::setupFrameElevon(QString airframeType) int channel; double value; //disable all - for (channel=0; channel<(int)VehicleConfig::CHANNEL_NUMELEM; channel++) + for (channel=0; (unsigned int) channel < VehicleConfig::CHANNEL_NUMELEM; channel++) { setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_DISABLED); resetMixerVector(mixer, channel); @@ -448,7 +448,7 @@ bool ConfigFixedWingWidget::setupFrameVtail(QString airframeType) int channel; double value; //disable all - for (channel=0; channel<(int)VehicleConfig::CHANNEL_NUMELEM; channel++) + for (channel=0; (unsigned int) channel < VehicleConfig::CHANNEL_NUMELEM; channel++) { setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_DISABLED); resetMixerVector(mixer, channel); diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configgroundvehiclewidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configgroundvehiclewidget.cpp index a5df943c8..45e94dd8e 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configgroundvehiclewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configgroundvehiclewidget.cpp @@ -230,7 +230,7 @@ QString ConfigGroundVehicleWidget::updateConfigObjectsFromWidgets() void ConfigGroundVehicleWidget::refreshWidgetsValues(QString frameType) { UAVDataObject* obj; - UAVObjectField *field; +// UAVObjectField *field; GUIConfigDataUnion config = GetConfigData(); @@ -298,7 +298,7 @@ bool ConfigGroundVehicleWidget::setupGroundVehicleMotorcycle(QString airframeTyp int channel; //disable all - for (channel=0; channel<(int)VehicleConfig::CHANNEL_NUMELEM; channel++) { + for (channel=0; (unsigned int) channel < VehicleConfig::CHANNEL_NUMELEM; channel++) { setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_DISABLED); resetMixerVector(mixer, channel); } @@ -355,7 +355,7 @@ bool ConfigGroundVehicleWidget::setupGroundVehicleDifferential(QString airframeT int channel; //disable all - for (channel=0; channel<(int)VehicleConfig::CHANNEL_NUMELEM; channel++) { + for (channel=0; (unsigned int) channel < VehicleConfig::CHANNEL_NUMELEM; channel++) { setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_DISABLED); resetMixerVector(mixer, channel); } @@ -410,7 +410,7 @@ bool ConfigGroundVehicleWidget::setupGroundVehicleCar(QString airframeType) int channel; //disable all - for (channel=0; channel<(int)VehicleConfig::CHANNEL_NUMELEM; channel++) { + for (channel=0; (unsigned int) channel < VehicleConfig::CHANNEL_NUMELEM; channel++) { setMixerType(mixer,channel,VehicleConfig::MIXERTYPE_DISABLED); resetMixerVector(mixer, channel); } diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp index c466df760..b512a2642 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp @@ -218,6 +218,8 @@ void ConfigGadgetWidget::tabAboutToChange(int i,bool * proceed) */ void ConfigGadgetWidget::updatePipXStatus(UAVObject *object) { + Q_UNUSED(object); + // Restart the disconnection timer. pipxTimeout->start(5000); if (!pipxConnected) diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index 887184cfa..f4e41f9ef 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -266,7 +266,9 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) */ void ConfigPipXtremeWidget::updateSettings(UAVObject *object) { - if (!settingsUpdated) + Q_UNUSED(object); + + if (!settingsUpdated) { settingsUpdated = true; enableControls(true); diff --git a/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp b/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp index 77cbeb5db..f5c19a8af 100644 --- a/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp @@ -68,8 +68,8 @@ public: ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) : ConfigTaskWidget(parent), collectingData(false), - position(-1), - m_ui(new Ui_RevoSensorsWidget()) + m_ui(new Ui_RevoSensorsWidget()), + position(-1) { m_ui->setupUi(this); diff --git a/ground/openpilotgcs/src/plugins/coreplugin/modemanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/modemanager.cpp index a4479bae2..aa5356705 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/modemanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/modemanager.cpp @@ -84,6 +84,8 @@ void ModeManager::init() void ModeManager::addWidget(QWidget *widget) { + Q_UNUSED(widget); + // We want the actionbar to stay on the bottom // so m_modeStack->cornerWidgetCount() -1 inserts it at the position immediately above // the actionbar @@ -220,6 +222,8 @@ void ModeManager::aboutToRemoveObject(QObject *obj) void ModeManager::addAction(Command *command, int priority, QMenu *menu) { + Q_UNUSED(menu); + m_actions.insert(command, priority); // Count the number of commands with a higher priority diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp index b95082fb9..485cd7b31 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadget.cpp @@ -198,6 +198,8 @@ void GCSControlGadget::sticksChangedLocally(double leftX, double leftY, double r void GCSControlGadget::gamepads(quint8 count) { + Q_UNUSED(count); + // sdlGamepad.setGamepad(0); // sdlGamepad.setTickRate(JOYSTICK_UPDATE_RATE); } @@ -291,7 +293,7 @@ double GCSControlGadget::constrain(double value) void GCSControlGadget::buttonState(ButtonNumber number, bool pressed) { - int state; +// int state; if ((buttonSettings[number].ActionID>0)&&(buttonSettings[number].FunctionID>0)&&(pressed)) {//this button is configured ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadgetoptionspage.cpp index 1a68c6be6..d85390725 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/gcscontrolgadgetoptionspage.cpp @@ -71,6 +71,8 @@ void GCSControlGadgetOptionsPage::buttonState(ButtonNumber number, bool pressed) void GCSControlGadgetOptionsPage::gamepads(quint8 count) { + Q_UNUSED(count); + /*options_page->AvailableControllerList->clear(); for (int i=0;igetObject(); UAVDataObject* flightStatus = dynamic_cast( objManager->getObject(QString("FlightStatus")) ); diff --git a/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp index 10d89d26e..e6e9c49d1 100644 --- a/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp @@ -165,6 +165,8 @@ return s1.portNamesetupUi(optionsPageWidget); diff --git a/ground/openpilotgcs/src/plugins/gpsdisplay/nmeaparser.cpp b/ground/openpilotgcs/src/plugins/gpsdisplay/nmeaparser.cpp index e856251ab..cca79a565 100644 --- a/ground/openpilotgcs/src/plugins/gpsdisplay/nmeaparser.cpp +++ b/ground/openpilotgcs/src/plugins/gpsdisplay/nmeaparser.cpp @@ -301,7 +301,7 @@ void NMEAParser::nmeaProcessGPGSV(char *packet) const int sentence_total = tokenslist.at(1).toInt(); // Number of sentences for full data const int sentence_index = tokenslist.at(2).toInt(); // sentence x of y - const int sat_count = tokenslist.at(3).toInt(); // Number of satellites in view +// const int sat_count = tokenslist.at(3).toInt(); // Number of satellites in view int sats = (tokenslist.size() - 4) /4; for(int sat = 0; sat < sats; sat++) { diff --git a/ground/openpilotgcs/src/plugins/gpsdisplay/telemetryparser.cpp b/ground/openpilotgcs/src/plugins/gpsdisplay/telemetryparser.cpp index e08d2be52..b0db7f291 100644 --- a/ground/openpilotgcs/src/plugins/gpsdisplay/telemetryparser.cpp +++ b/ground/openpilotgcs/src/plugins/gpsdisplay/telemetryparser.cpp @@ -117,7 +117,7 @@ void TelemetryParser::updateSats( UAVObject* object1) { UAVObjectField* azimuth = object1->getField(QString("Azimuth")); UAVObjectField* snr = object1->getField(QString("SNR")); - for (int i=0;i< prn->getNumElements();i++) { + for (unsigned int i=0;i< prn->getNumElements();i++) { emit satellite(i,prn->getValue(i).toInt(),elevation->getValue(i).toInt(), azimuth->getValue(i).toInt(), snr->getValue(i).toInt()); } diff --git a/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionconfiguration.cpp b/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionconfiguration.cpp index e90f52ab2..2fabfa8bb 100644 --- a/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionconfiguration.cpp +++ b/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionconfiguration.cpp @@ -34,6 +34,8 @@ IPconnectionConfiguration::IPconnectionConfiguration(QString classId, QSettings* m_Port(1000), m_UseTCP(1) { + Q_UNUSED(qSettings); + settings = Core::ICore::instance()->settings(); } diff --git a/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionplugin.cpp b/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionplugin.cpp index 5d166584c..04339b713 100644 --- a/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionplugin.cpp +++ b/ground/openpilotgcs/src/plugins/ipconnection/ipconnectionplugin.cpp @@ -73,7 +73,6 @@ void IPConnection::onOpenDevice(QString HostName, int Port, bool UseTCP) { QAbstractSocket *ipSocket; const int Timeout = 5 * 1000; - int state; ipConMutex.lock(); if (UseTCP) { @@ -177,6 +176,8 @@ QList IPconnectionConnection::availableDevices() QIODevice *IPconnectionConnection::openDevice(const QString &deviceName) { + Q_UNUSED(deviceName); + QString HostName; int Port; bool UseTCP; @@ -211,6 +212,8 @@ QIODevice *IPconnectionConnection::openDevice(const QString &deviceName) void IPconnectionConnection::closeDevice(const QString &deviceName) { + Q_UNUSED(deviceName); + if (ipSocket){ ipConMutex.lock(); emit CloseSocket(ipSocket); diff --git a/ground/openpilotgcs/src/plugins/opmap/flightdatamodel.cpp b/ground/openpilotgcs/src/plugins/opmap/flightdatamodel.cpp index 04bcdd93c..4bf2f664e 100644 --- a/ground/openpilotgcs/src/plugins/opmap/flightdatamodel.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/flightdatamodel.cpp @@ -169,6 +169,7 @@ bool flightDataModel::setColumnByIndex(pathPlanData *row,const int index,const default: return false; } + return false; } QVariant flightDataModel::getColumnByIndex(const pathPlanData *row,const int index) const { diff --git a/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp b/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp index 406d8e23d..a802d69f8 100644 --- a/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/modelmapproxy.cpp @@ -60,6 +60,8 @@ void modelMapProxy::WPValuesChanged(WayPointItem * wp) void modelMapProxy::currentRowChanged(QModelIndex current, QModelIndex previous) { + Q_UNUSED(previous); + QList list; WayPointItem * wp=findWayPointNumber(current.row()); if(!wp) @@ -202,6 +204,8 @@ WayPointItem * modelMapProxy::findWayPointNumber(int number) void modelMapProxy::rowsRemoved(const QModelIndex &parent, int first, int last) { + Q_UNUSED(parent); + for(int x=last;x>first-1;x--) { myMap->WPDelete(x); @@ -211,6 +215,8 @@ void modelMapProxy::rowsRemoved(const QModelIndex &parent, int first, int last) void modelMapProxy::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { + Q_UNUSED(bottomRight); + WayPointItem * item=findWayPointNumber(topLeft.row()); if(!item) return; diff --git a/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp b/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp index cab739b8e..11df41f88 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmap_edit_waypoint_dialog.cpp @@ -287,5 +287,7 @@ void opmap_edit_waypoint_dialog::enableEditWidgets(bool value) void opmap_edit_waypoint_dialog::currentRowChanged(QModelIndex current, QModelIndex previous) { + Q_UNUSED(previous); + mapper->setCurrentIndex(current.row()); } diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp index b5fb5b273..2d8e01506 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp @@ -1773,7 +1773,7 @@ void OPMapGadgetWidget::onAddWayPointAct_triggered(internals::PointLatLng coord) if (m_map_mode != Normal_MapMode) return; - float alt=15; + mapProxy->createWayPoint(coord); } diff --git a/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.cpp index 89a877a0f..4268742e9 100644 --- a/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.cpp @@ -46,6 +46,7 @@ PFDGadgetOptionsPage::PFDGadgetOptionsPage(PFDGadgetConfiguration *config, QObje //creates options page widget (uses the UI file) QWidget *PFDGadgetOptionsPage::createPage(QWidget *parent) { + Q_UNUSED(parent); options_page = new Ui::PFDGadgetOptionsPage(); //main widget diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetoptionspage.cpp index 8cc110d1a..f88299cdb 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetoptionspage.cpp @@ -46,6 +46,7 @@ QmlViewGadgetOptionsPage::QmlViewGadgetOptionsPage(QmlViewGadgetConfiguration *c //creates options page widget (uses the UI file) QWidget *QmlViewGadgetOptionsPage::createPage(QWidget *parent) { + Q_UNUSED(parent); options_page = new Ui::QmlViewGadgetOptionsPage(); //main widget diff --git a/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp b/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp index 382c43829..490ea2fdd 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp +++ b/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp @@ -90,7 +90,7 @@ static void hid_close(hid_t *); static void attach_callback(void *, IOReturn, void *, IOHIDDeviceRef); static void detach_callback(void *, IOReturn, void *hid_mgr, IOHIDDeviceRef dev); static void input_callback(void *, IOReturn, void *, IOHIDReportType, uint32_t, uint8_t *, CFIndex); -static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len); +//static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len); static void timeout_callback(CFRunLoopTimerRef, void *); @@ -173,7 +173,7 @@ int pjrc_rawhid::open(int max, int vid, int pid, int usage_page, int usage) IOHIDManagerRegisterDeviceRemovalCallback(hid_manager, detach_callback, NULL); ret = IOHIDManagerOpen(hid_manager, kIOHIDOptionsTypeNone); if (ret != kIOReturnSuccess) { - printf("Could not start IOHIDManager"); + qDebug()<< "Could not start IOHIDManager"; IOHIDManagerUnscheduleFromRunLoop(hid_manager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); CFRelease(hid_manager); @@ -181,7 +181,7 @@ int pjrc_rawhid::open(int max, int vid, int pid, int usage_page, int usage) } // Set the run loop reference: the_correct_runloop = CFRunLoopGetCurrent(); - printf("run loop\n"); + qDebug() << "run loop"; // let it do the callback for all devices while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource) ; // count up how many were added by the callback @@ -240,7 +240,7 @@ int pjrc_rawhid::receive(int num, void *buf, int len, int timeout) break; } if (!hid->open) { - printf("pjrc_rawhid_recv, device not open\n"); + qDebug() << "pjrc_rawhid_recv, device not open\n"; ret = -1; break; } @@ -263,6 +263,8 @@ int pjrc_rawhid::receive(int num, void *buf, int len, int timeout) // int pjrc_rawhid::send(int num, void *buf, int len, int timeout) { + Q_UNUSED(timeout); + hid_t *hid; int result=-100; @@ -287,6 +289,7 @@ int pjrc_rawhid::send(int num, void *buf, int len, int timeout) #endif #if 0 +#define TIMEOUT_FIXED // No matter what I tried this never actually sends an output // report and output_callback never gets called. Why?? // Did I miss something? This is exactly the same params as @@ -315,7 +318,7 @@ int pjrc_rawhid::send(int num, void *buf, int len, int timeout) QString pjrc_rawhid::getserial(int num) { hid_t *hid; - char buf[128]; +// char buf[128]; hid = get_hid(num); @@ -358,6 +361,9 @@ void pjrc_rawhid::close(int num) // static void input_callback(void *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len) { + Q_UNUSED(type); + Q_UNUSED(id); + buffer_t *n; hid_t *hid; @@ -365,7 +371,7 @@ static void input_callback(void *context, IOReturn ret, void *sender, IOHIDRepor if (ret != kIOReturnSuccess || len < 1) return; hid = (hid_t*)context; if (!hid || hid->ref != sender) return; - printf("Processing packet"); + qDebug() << "Processing packet"; n = (buffer_t *)malloc(sizeof(buffer_t)); if (!n) return; if (len > BUFFER_SIZE) len = BUFFER_SIZE; @@ -385,6 +391,8 @@ static void input_callback(void *context, IOReturn ret, void *sender, IOHIDRepor static void timeout_callback(CFRunLoopTimerRef timer, void *info) { + Q_UNUSED(timer); + //qDebug("timeout_callback\n"); *(int *)info = 1; //qDebug() << "Stop CFRunLoop from timeout_callback" << CFRunLoopGetCurrent(); @@ -440,9 +448,13 @@ static void hid_close(hid_t *hid) static void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev) { + Q_UNUSED(context); + Q_UNUSED(r); + Q_UNUSED(hid_mgr); + hid_t *p; - printf("detach callback\n"); + qDebug()<< "detach callback"; for (p = first_hid; p; p = p->next) { if (p->ref == dev) { p->open = 0; @@ -454,9 +466,13 @@ static void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDevic static void attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev) { + Q_UNUSED(context); + Q_UNUSED(r); + Q_UNUSED(hid_mgr); + struct hid_struct *h; - printf("attach callback\n"); + qDebug() << "attach callback"; if (IOHIDDeviceOpen(dev, kIOHIDOptionsTypeNone) != kIOReturnSuccess) return; h = (hid_t *)malloc(sizeof(hid_t)); if (!h) return; @@ -468,15 +484,22 @@ static void attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDevic add_hid(h); } +#ifdef TIMEOUT_FIXED static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len) { - printf("output_callback, r=%d\n", ret); - if (ret == kIOReturnSuccess) { - *(int *)context = len; - } else { - // timeout if not success? - *(int *)context = 0; - } - CFRunLoopStop(CFRunLoopGetCurrent()); -} + Q_UNUSED(sender); + Q_UNUSED(type); + Q_UNUSED(id); + Q_UNUSED(data); + qDebug()<< QString("output_callback, r=%1").arg(ret); +// printf("output_callback, r=%d\n", ret); + if (ret == kIOReturnSuccess) { + *(int *)context = len; + } else { + // timeout if not success? + *(int *)context = 0; + } + CFRunLoopStop(CFRunLoopGetCurrent()); +} +#endif diff --git a/ground/openpilotgcs/src/plugins/rawhid/usbmonitor_mac.cpp b/ground/openpilotgcs/src/plugins/rawhid/usbmonitor_mac.cpp index 51fd6cce7..2f04b4b37 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/usbmonitor_mac.cpp +++ b/ground/openpilotgcs/src/plugins/rawhid/usbmonitor_mac.cpp @@ -45,8 +45,6 @@ static bool HID_GetStrProperty(IOHIDDeviceRef dev, CFStringRef property, QString */ USBMonitor::USBMonitor(QObject *parent): QThread(parent) { hid_manager=NULL; - CFMutableDictionaryRef dict; - CFNumberRef num; IOReturn ret; m_instance = this; @@ -117,6 +115,10 @@ void USBMonitor::removeDevice(IOHIDDeviceRef dev) { */ void USBMonitor::detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev) { + Q_UNUSED(context); + Q_UNUSED(r); + Q_UNUSED(hid_mgr); + qDebug() << "USBMonitor: Device detached event"; instance()->removeDevice(dev); } @@ -129,9 +131,12 @@ void USBMonitor::addDevice(USBPortInfo info) { void USBMonitor::attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev) { + Q_UNUSED(context); + Q_UNUSED(r); + Q_UNUSED(hid_mgr); + bool got_properties = true; - CFTypeRef prop; USBPortInfo deviceInfo; deviceInfo.dev_handle = dev; diff --git a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp index 789085596..75510f52c 100644 --- a/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp +++ b/ground/openpilotgcs/src/plugins/serialconnection/serialpluginconfiguration.cpp @@ -38,6 +38,8 @@ SerialPluginConfiguration::SerialPluginConfiguration(QString classId, QSettings* IUAVGadgetConfiguration(classId, parent), m_speed("57600") { + Q_UNUSED(qSettings); + settings = Core::ICore::instance()->settings(); } diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index be81befb7..1c69c63e9 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -268,7 +268,7 @@ QByteArray UAVObjectUtilManager::getBoardCPUSerial() QByteArray cpuSerial; FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap(); - for (int i = 0; i < FirmwareIAPObj::CPUSERIAL_NUMELEM; i++) + for (unsigned int i = 0; i < FirmwareIAPObj::CPUSERIAL_NUMELEM; i++) cpuSerial.append(firmwareIapData.CPUSerial[i]); return cpuSerial; @@ -288,7 +288,7 @@ QByteArray UAVObjectUtilManager::getBoardDescription() QByteArray ret; FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap(); - for (int i = 0; i < FirmwareIAPObj::DESCRIPTION_NUMELEM; i++) + for (unsigned int i = 0; i < FirmwareIAPObj::DESCRIPTION_NUMELEM; i++) ret.append(firmwareIapData.Description[i]); return ret; diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 5d3264d16..ddad8c88a 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -32,7 +32,7 @@ /** * Constructor */ -ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL),allowWidgetUpdates(true) +ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),allowWidgetUpdates(true),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL) { pm = ExtensionSystem::PluginManager::instance(); objManager = pm->getObject(); diff --git a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp index 5bb4d1939..da98bee98 100644 --- a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp +++ b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp @@ -495,7 +495,7 @@ bool UAVTalk::processInputByte(quint8 rxbyte) default: rxState = STATE_SYNC; stats.rxErrors++; - UAVTALK_QXTLOG_DEBUG("UAVTalk: ???->Sync"); + UAVTALK_QXTLOG_DEBUG("UAVTalk: \?\?\?->Sync"); //Use the escape character for '?' so that the tripgraph isn't triggered. } // Done diff --git a/ground/openpilotgcs/src/plugins/uploader/SSP/port.h b/ground/openpilotgcs/src/plugins/uploader/SSP/port.h index ff4725b99..1521ab412 100644 --- a/ground/openpilotgcs/src/plugins/uploader/SSP/port.h +++ b/ground/openpilotgcs/src/plugins/uploader/SSP/port.h @@ -43,7 +43,7 @@ public: uint8_t maxRetryCount; // max. times to try to transmit the 'send' packet uint16_t max_retry; // Maximum number of retrys for a single transmit. int32_t timeoutLen; // how long to wait for each retry to succeed - int32_t timeout; // current timeout. when 'time' reaches this point we have timed out + uint32_t timeout; // current timeout. when 'time' reaches this point we have timed out uint8_t txSeqNo; // current 'send' packet sequence number uint16_t rxBufPos; // current buffer position in the receive packet uint16_t rxBufLen; // number of 'data' bytes in the buffer diff --git a/ground/openpilotgcs/src/plugins/uploader/SSP/qssp.cpp b/ground/openpilotgcs/src/plugins/uploader/SSP/qssp.cpp index 356cb3604..b5eb5b1b7 100644 --- a/ground/openpilotgcs/src/plugins/uploader/SSP/qssp.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/SSP/qssp.cpp @@ -802,6 +802,8 @@ qssp::qssp(port * info,bool debug):debug(debug) } void qssp::pfCallBack( uint8_t * buf, uint16_t size) { + Q_UNUSED(size); + if (debug) qDebug()<<"receive callback"<