diff options
author | Robin Gareus <robin@gareus.org> | 2014-11-17 03:49:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-11-17 03:49:19 +0100 |
commit | ad739cd018df8d746de77cbe7feb8e52fb315114 (patch) | |
tree | d64f7a8665fd860f2fe4b9e1de5a7a905d4a8965 /libs | |
parent | 47f4005dbc7f9f8074dd18c806bcd621a38ae277 (diff) |
add some assert() messages.
as hints clang static analyzer "Called C++ object pointer is null"
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/tempo.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 5e50e8e02b..6f3f734116 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -765,6 +765,8 @@ TempoMap::recompute_map (bool reassign_tempo_bbt, framepos_t end) } } + assert(meter); + for (Metrics::iterator i = metrics.begin(); i != metrics.end(); ++i) { TempoSection* ts; @@ -774,6 +776,8 @@ TempoMap::recompute_map (bool reassign_tempo_bbt, framepos_t end) } } + assert(tempo); + /* assumes that the first meter & tempo are at frame zero */ current_frame = 0; meter->set_frame (0); @@ -1840,6 +1844,7 @@ TempoMap::framepos_plus_beats (framepos_t pos, Evoral::MusicalTime beats) const tempo -> the Tempo for "pos" next_tempo -> first tempo after "pos", possibly metrics.end() */ + assert(tempo); DEBUG_TRACE (DEBUG::TempoMath, string_compose ("frame %1 plus %2 beats, start with tempo = %3 @ %4\n", @@ -1941,6 +1946,7 @@ TempoMap::framepos_minus_beats (framepos_t pos, Evoral::MusicalTime beats) const } } + assert(tempo); DEBUG_TRACE (DEBUG::TempoMath, string_compose ("frame %1 minus %2 beats, start with tempo = %3 @ %4 prev at beg? %5\n", pos, beats, *((const Tempo*)tempo), tempo->frame(), @@ -2169,7 +2175,6 @@ TempoMap::framewalk_to_beats (framepos_t pos, framecnt_t distance) const tempo -> the Tempo for "pos" next_tempo -> the next tempo after "pos", possibly metrics.end() */ - assert (tempo); DEBUG_TRACE (DEBUG::TempoMath, |