From 1bb48a087b0b51d7cc640d82dd1666af1b09eb1f Mon Sep 17 00:00:00 2001 From: Neil Horne Date: Tue, 6 Dec 2022 20:45:39 +1100 Subject: [PATCH] chore(cpn): Remove some compiler warnings (#2752) --- companion/src/firmwares/edgetx/yaml_rawsource.cpp | 2 +- companion/src/firmwares/radiodata.cpp | 6 +++--- companion/src/mdichild.cpp | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/companion/src/firmwares/edgetx/yaml_rawsource.cpp b/companion/src/firmwares/edgetx/yaml_rawsource.cpp index 3b78b06a3..e5ca56626 100644 --- a/companion/src/firmwares/edgetx/yaml_rawsource.cpp +++ b/companion/src/firmwares/edgetx/yaml_rawsource.cpp @@ -285,7 +285,7 @@ RawSource YamlRawSourceDecode(const std::string& src_str) } if (node.IsScalar() && node.as().size() == 12 && node.as().substr(0, 11) == "SPACEMOUSE_") { - int sm_idx; + int sm_idx = 0; node >> spacemouseLut >> sm_idx; if (sm_idx >= 0) { rhs.type = SOURCE_TYPE_SPACEMOUSE; diff --git a/companion/src/firmwares/radiodata.cpp b/companion/src/firmwares/radiodata.cpp index 2d72339a5..76b831218 100644 --- a/companion/src/firmwares/radiodata.cpp +++ b/companion/src/firmwares/radiodata.cpp @@ -157,7 +157,7 @@ bool RadioData::deleteLabel(int index) bool RadioData::renameLabel(QString from, QString to) { - bool success = true; + bool success = true; QString csvFrom = escapeCSV(from); QString csvTo = escapeCSV(to); int lengthdiff = csvTo.size() - csvFrom.size(); @@ -218,7 +218,7 @@ void RadioData::swapLabel(int indFrom, int indTo) bool RadioData::addLabelToModel(int index, QString label) { - if (index >= models.size()) return false; + if ((unsigned int)index >= models.size()) return false; label = escapeCSV(label); char *modelLabelCsv = models[index].labels; @@ -237,7 +237,7 @@ bool RadioData::addLabelToModel(int index, QString label) bool RadioData::removeLabelFromModel(int index, QString label) { - if (index >= models.size()) return false; + if ((unsigned int)index >= models.size()) return false; QStringList lbls = fromCSV(QString::fromUtf8(models[index].labels)); if (lbls.indexOf(label) >= 0) { diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index 7f13d6e4a..cbb4454e2 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -507,8 +507,6 @@ void MdiChild::adjustToolbarLayout() void MdiChild::initModelsList() { - Board::Type board = firmware->getBoard(); - if (modelsListModel) delete modelsListModel;