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/evoral/src | |
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/evoral/src')
-rw-r--r-- | libs/evoral/src/ControlList.cpp | 2 | ||||
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index 3f70cde274..deabd9d1cc 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -1199,7 +1199,7 @@ ControlList::unlocked_eval (double x) const return multipoint_eval (x); } - /*NOTREACHED*/ /* stupid gcc */ + abort(); /*NOTREACHED*/ /* stupid gcc */ return _default_value; } diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index 4487bc43c4..1cc8ff6e0f 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -1346,8 +1346,7 @@ Sequence<Time>::get_notes_by_pitch (Notes& n, NoteOperator op, uint8_t val, int default: //fatal << string_compose (_("programming error: %1 %2", X_("get_notes_by_pitch() called with illegal operator"), op)) << endmsg; - abort (); - /* NOTREACHED*/ + abort(); /* NOTREACHED*/ } } } @@ -1392,8 +1391,7 @@ Sequence<Time>::get_notes_by_velocity (Notes& n, NoteOperator op, uint8_t val, i break; default: // fatal << string_compose (_("programming error: %1 %2", X_("get_notes_by_velocity() called with illegal operator"), op)) << endmsg; - abort (); - /* NOTREACHED*/ + abort(); /* NOTREACHED*/ } } |