]> sigrok.org Git - pulseview.git/commitdiff
Fix the build - catch exceptions by reference
authorBrian Starkey <redacted>
Sat, 21 Jul 2018 17:08:45 +0000 (18:08 +0100)
committerUwe Hermann <redacted>
Tue, 24 Jul 2018 18:54:26 +0000 (20:54 +0200)
Fix the following build errors seen with gcc 8.1.1:

 error: catching polymorphic type ‘class std::out_of_range’ by value
 error: catching polymorphic type ‘class boost::archive::archive_exception’ by value

Signed-off-by: Brian Starkey <redacted>
pv/devices/inputfile.cpp
pv/views/trace/analogsignal.cpp
pv/views/trace/view.cpp

index 8e973f0561718d33fcd58afbc40659696e41417a..46886ed516399eaebb7b624edf951a70775b7b01 100644 (file)
@@ -86,7 +86,7 @@ InputFile::InputFile(const shared_ptr<sigrok::Context> &context,
                        settings.endGroup();
                }
 
-       } catch (out_of_range) {
+       } catch (out_of_range&) {
                qWarning() << "Could not find input format" << format_name <<
                        "needed to restore session input file";
        }
index 2a2e2305b1b7e9b05c6ab4ed0240c7e61d010bcc..0994d92ed0eba4e30484abc79af17f8fec9512b0 100644 (file)
@@ -1013,7 +1013,7 @@ void AnalogSignal::hover_point_changed(const QPoint &hp)
        } else {
                try {
                        value_at_hover_pos_ = value_at_pixel_pos_.at(hp.x());
-               } catch (out_of_range) {
+               } catch (out_of_range&) {
                        value_at_hover_pos_ = std::numeric_limits<float>::quiet_NaN();
                }
        }
index 0070c743e8d13de97747b356aeb49d287cc847cc..98fd46d2ad4684fb81051956c0995f579abc49d0 100644 (file)
@@ -385,7 +385,7 @@ void View::restore_settings(QSettings &settings)
                        boost::archive::text_iarchive ia(ss);
                        ia >> boost::serialization::make_nvp("ruler_shift", shift);
                        ruler_shift_ = shift;
-               } catch (boost::archive::archive_exception) {
+               } catch (boost::archive::archive_exception&) {
                        qDebug() << "Could not restore the view ruler shift";
                }
        }
@@ -400,7 +400,7 @@ void View::restore_settings(QSettings &settings)
                        ia >> boost::serialization::make_nvp("offset", offset);
                        // This also updates ruler_offset_
                        set_offset(offset);
-               } catch (boost::archive::archive_exception) {
+               } catch (boost::archive::archive_exception&) {
                        qDebug() << "Could not restore the view offset";
                }
        }