From ed645761d0708e4c18eb17ae153b8c55cb8a8ace Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 21 Jun 2022 18:35:24 -0600 Subject: [PATCH] fix optimized unused variable warning --- libs/ardour/disk_reader.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 5d8c50dcda..1d34b647e5 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -1483,7 +1483,11 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("playback buffer LOOP read, from %1 to %2 (%3)\n", effective_start, effective_end, this_read)); - size_t events_read = rtmb->read (*target, effective_start, effective_end, _tracker, offset); +#ifndef NDEBUG + size_t events_read = +#endif + rtmb->read (*target, effective_start, effective_end, _tracker, offset); + cnt -= this_read; effective_start += this_read; offset += this_read; @@ -1502,7 +1506,10 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample } else { DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("playback buffer read, from %1 to %2 (%3)\n", start_sample, end_sample, nframes)); - size_t events_read = rtmb->read (*target, start_sample, end_sample, _tracker); +#ifndef NDEBUG + size_t events_read = +#endif + rtmb->read (*target, start_sample, end_sample, _tracker); DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("%1 MDS events read %2 range %3 .. %4\n", _name, events_read, playback_sample, playback_sample + nframes)); } }