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/tempo.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/tempo.cc')
-rw-r--r-- | libs/ardour/tempo.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 621d1e2c74..5e50e8e02b 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -677,7 +677,7 @@ TempoMap::first_meter () const } fatal << _("programming error: no tempo section in tempo map!") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return *m; } @@ -693,7 +693,7 @@ TempoMap::first_tempo () const } fatal << _("programming error: no tempo section in tempo map!") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ return *t; } @@ -807,7 +807,7 @@ TempoMap::recompute_map (bool reassign_tempo_bbt, framepos_t end) rmeter = ms; } else { fatal << _("programming error: unhandled MetricSection type") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } } } @@ -1489,8 +1489,7 @@ TempoMap::round_to_type (framepos_t frame, int dir, BBTPointType type) break; } - /* NOTREACHED */ - assert (false); + abort(); /* NOTREACHED */ return 0; } @@ -1532,6 +1531,7 @@ TempoMap::tempo_section_at (framepos_t frame) const if (prev == 0) { fatal << endmsg; + abort(); /*NOTREACHED*/ } return *prev; @@ -1785,7 +1785,7 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount) // cerr << "NEW METER, frame = " << (*i)->frame() << " start = " << (*i)->start() <<endl; } else { fatal << _("programming error: unhandled MetricSection type") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } prev = (*i); |