Fix a compiler warning
authorSoeren Apel <soeren@apelpie.net>
Sun, 17 May 2020 11:56:12 +0000 (13:56 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Thu, 21 May 2020 22:04:23 +0000 (00:04 +0200)
pv/binding/inputoutput.cpp
pv/devices/inputfile.cpp
pv/mainwindow.cpp
pv/views/trace/view.cpp
pv/widgets/exportmenu.cpp
pv/widgets/importmenu.cpp

index f9a061c76e78c7b7e77a33ec1d04250328263b70..9ba387fbc0cb01a01854010463848ae0dbf3c3ce 100644 (file)
@@ -59,7 +59,7 @@ namespace binding {
 InputOutput::InputOutput(
        const map<string, shared_ptr<Option>> &options)
 {
-       for (const pair<string, shared_ptr<Option>>& o : options) {
+       for (const pair<const string, shared_ptr<Option>>& o : options) {
                const shared_ptr<Option> &opt = o.second;
                assert(opt);
 
index 94fb9c82cb6d4df2e2a47d261ff8220bb471ad3e..9cc99f4ec8060abe8a46af815024017b38bc7628 100644 (file)
@@ -101,7 +101,7 @@ void InputFile::save_meta_to_settings(QSettings &settings)
        settings.setValue("options", (int)options_.size());
 
        int i = 0;
-       for (const pair<string, Glib::VariantBase>& option : options_) {
+       for (const pair<const string, Glib::VariantBase>& option : options_) {
                settings.beginGroup("option" + QString::number(i));
                settings.setValue("name", QString::fromStdString(option.first));
                GlobalSettings::store_variantbase(settings, option.second);
index 4c98b490ca8b9854a45954a9ac2d76bfc5b64b9b..3889d480fb0d12e1c2fd4cab880161e2de1c09be 100644 (file)
@@ -881,6 +881,8 @@ void MainWindow::on_show_decoder_selector(Session *session)
        for (shared_ptr<Session>& s : sessions_)
                if (s.get() == session)
                        add_subwindow(subwindows::SubWindowTypeDecoderSelector, *s);
+#else
+       (void)session;
 #endif
 }
 
index a470715b48595d94ec89eff74a3f12ddd34a3a52..ee4a4042fdc072a5de65a089ad0b29c874745167 100644 (file)
@@ -54,6 +54,7 @@
 #include "pv/metadata_obj.hpp"
 #include "pv/data/logic.hpp"
 #include "pv/data/logicsegment.hpp"
+#include "pv/data/signalbase.hpp"
 #include "pv/devices/device.hpp"
 #include "pv/globalsettings.hpp"
 #include "pv/session.hpp"
@@ -63,6 +64,7 @@
 #include "decodetrace.hpp"
 #endif
 
+using pv::data::SignalBase;
 using pv::data::SignalData;
 using pv::data::Segment;
 using pv::util::TimeUnit;
index f5189d129fe02ad422750bb68233c18f38ca0f34..721affe058e9a359579b8caabf43485ffb99625b 100644 (file)
@@ -63,7 +63,7 @@ ExportMenu::ExportMenu(QWidget *parent, shared_ptr<Context> context,
        const map<string, shared_ptr<OutputFormat> > formats =
                context->output_formats();
 
-       for (const pair<string, shared_ptr<OutputFormat> > &f : formats) {
+       for (const pair<const string, shared_ptr<OutputFormat> > &f : formats) {
                if (f.first == "srzip")
                        continue;
 
index f827d35bff3935e69a4f453c04c12e4d78058898..b63256cb923cd36edaf89962975bc4e348147cfd 100644 (file)
@@ -63,7 +63,7 @@ ImportMenu::ImportMenu(QWidget *parent, shared_ptr<Context> context,
        const map<string, shared_ptr<InputFormat> > formats =
                context->input_formats();
 
-       for (const pair<string, shared_ptr<InputFormat> > &f : formats) {
+       for (const pair<const string, shared_ptr<InputFormat> > &f : formats) {
                assert(f.second);
                QAction *const action = addAction(tr("Import %1...")
                        .arg(QString::fromStdString(f.second->description())));