From 6b3a8915f3c50f7220121fcb9202ec20144389c4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 14 Nov 2014 10:47:43 +0100 Subject: add abort() to non-reached code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This cleans up a lot of false-positives in static analysis and also helps compilers to optimize code paths in general. (tagging the fatal stingstream operator as ‘noreturn’ is far less trivial) --- libs/ardour/midi_playlist_source.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/ardour/midi_playlist_source.cc') diff --git a/libs/ardour/midi_playlist_source.cc b/libs/ardour/midi_playlist_source.cc index 68e0a478df..cd5362c3da 100644 --- a/libs/ardour/midi_playlist_source.cc +++ b/libs/ardour/midi_playlist_source.cc @@ -142,7 +142,7 @@ MidiPlaylistSource::write_unlocked (MidiRingBuffer&, framecnt_t) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::write_unlocked() called - should be impossible") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return 0; } @@ -150,14 +150,14 @@ void MidiPlaylistSource::append_event_unlocked_beats(const Evoral::Event& /*ev*/) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_unlocked_beats() called - should be impossible") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } void MidiPlaylistSource::append_event_unlocked_frames(const Evoral::Event& /* ev */, framepos_t /*source_start*/) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_unlocked_frames() called - should be impossible") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } void -- cgit v1.2.3