diff options
author | Robin Gareus <robin@gareus.org> | 2014-11-14 10:47:43 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-11-14 11:30:08 +0100 |
commit | 6b3a8915f3c50f7220121fcb9202ec20144389c4 (patch) | |
tree | 08e7ae373859e5ca15b8fa0ca075b18b65915a22 /libs/ardour/utils.cc | |
parent | 5d5d9cb9e262498dc0831dc362fbcb3f92bcdb9f (diff) |
add abort() to non-reached code
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)
Diffstat (limited to 'libs/ardour/utils.cc')
-rw-r--r-- | libs/ardour/utils.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 9c0aea885b..6d6511bb9f 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -429,7 +429,7 @@ ARDOUR::string_to_edit_mode (string str) return Lock; } fatal << string_compose (_("programming error: unknown edit mode string \"%1\""), str) << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return Slide; } @@ -468,7 +468,7 @@ ARDOUR::string_to_sync_source (string str) } fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return Engine; } @@ -577,7 +577,7 @@ ARDOUR::string_to_auto_state (std::string str) } fatal << string_compose (_("programming error: %1 %2"), "illegal AutoState string: ", str) << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return Touch; } @@ -601,7 +601,7 @@ ARDOUR::auto_state_to_string (AutoState as) } fatal << string_compose (_("programming error: %1 %2"), "illegal AutoState type: ", as) << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return ""; } @@ -615,7 +615,7 @@ ARDOUR::string_to_auto_style (std::string str) } fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle string: ", str) << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return Trim; } @@ -634,7 +634,7 @@ ARDOUR::auto_style_to_string (AutoStyle as) } fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle type: ", as) << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return ""; } @@ -669,7 +669,7 @@ ARDOUR::native_header_format_extension (HeaderFormat hf, const DataType& type) } fatal << string_compose (_("programming error: unknown native header format: %1"), hf); - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return ".wav"; } |