Consistent use of abort() /* NOTREACHED */
authorRobin Gareus <robin@gareus.org>
Wed, 18 Sep 2019 03:57:26 +0000 (05:57 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 18 Sep 2019 03:57:26 +0000 (05:57 +0200)
This fixes some static analysis warnings:
PBD::fatal transmitter needs to be connected to a function
that aborts. This is usually the case with GUI

libs/ardour/audiosource.cc
libs/ardour/disk_reader.cc
libs/ardour/session.cc
libs/ardour/transport_master_manager.cc
libs/pbd/debug.cc
libs/surfaces/mackie/gui.cc
libs/surfaces/us2400/gui.cc

index 43cbcb7464e5803fe0c5b1c15725ac2666d005fc..cd061ef0ef0706d21204f05661f280d011f9bf1d 100644 (file)
@@ -396,7 +396,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, samplecnt_t npeaks, samplepos
                        }
                        if (statbuf.st_size < expected_file_size) {
                                fatal << "peak file is still truncated after rebuild" << endmsg;
-                               /*NOTREACHED*/
+                               abort (); /*NOTREACHED*/
                        }
                }
        }
index 828019f28a3c43bf40695e19e9f6481055359399..0128fb7e622eb5224c097f9e8d50e1193a808f34 100644 (file)
@@ -350,8 +350,8 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
                                        internal_playback_seek (start_sample - playback_sample);
                                } else {
                                        cerr << owner()->name() << " playback at " << speed << " not possible: ss = " << start_sample << " ps = " << playback_sample << endl;
-                                       abort (); // XXX -- now what?
-                                       /*NOTREACHED*/
+                                       // XXX -- now what?
+                                       abort (); /*NOTREACHED*/
                                }
                        }
 
index 6935150ab6703a8c3c783eccb695af06eae4b457..f96f59e5169e636112137959004064697497ab74 100644 (file)
@@ -3345,7 +3345,7 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
 
                                if (!find_route_name (name_base.c_str(), ++number, name, (being_added > 1))) {
                                        fatal << _("Session: UINT_MAX routes? impossible!") << endmsg;
-                                       /*NOTREACHED*/
+                                       abort(); /*NOTREACHED*/
                                }
 
                        } else {
index 93db2113ee913a53b390af0d9ed776ab2df3fa77..66c99db8e9f9d3a2f325648a5ff1659929339de8 100644 (file)
@@ -133,7 +133,7 @@ TransportMasterManager::instance()
 {
        if (!_instance) {
                fatal << string_compose (_("programming error:%1"), X_("TransportMasterManager::instance() called without an instance!")) << endmsg;
-               /* NOTREACHED */
+               abort (); /* NOTREACHED */
        }
        return *_instance;
 }
index 1c28b86b5d1c0894542b7958a7ce35069b71a3e9..39fa600899d47419cefea1c724f6c60ce91c2763 100644 (file)
@@ -87,8 +87,7 @@ PBD::new_debug_bit (const char* name)
 
        if (_debug_bit >= debug_bits.size()) {
                cerr << "Too many debug bits defined, offender was " << name << endl;
-               abort ();
-               /*NOTREACHED*/
+               abort (); /*NOTREACHED*/
        }
 
        ret.set (_debug_bit++, 1);
index 7209ef93f9d4e25c79971021ae53ce70576468f2..74e314b2e7c766057bdc160f9067dfc76cbfed14 100644 (file)
@@ -371,7 +371,7 @@ MackieControlProtocolGUI::device_dependent_widget ()
 
                        if (!surface) {
                                PBD::fatal << string_compose (_("programming error: %1\n"), string_compose ("n=%1 surface not found!", n)) << endmsg;
-                               /*NOTREACHED*/
+                               abort (); /*NOTREACHED*/
                        }
 
                        Gtk::ComboBox* input_combo = manage (new Gtk::ComboBox);
index 3ef7923286b0313a9ddf5424135a91347992c8d2..6fe51c9988c41ce02142c6a097a10304fa6910a3 100644 (file)
@@ -275,7 +275,7 @@ US2400ProtocolGUI::device_dependent_widget ()
 
                if (!surface) {
                        PBD::fatal << string_compose (_("programming error: %1\n"), string_compose ("n=%1 surface not found!", n)) << endmsg;
-                       /*NOTREACHED*/
+                       abort (); /*NOTREACHED*/
                }
 
                Gtk::ComboBox* input_combo = manage (new Gtk::ComboBox);