From 168b540959f3e6b73453630f12c4f8443007e58e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 21 Jun 2022 18:37:43 -0600 Subject: [PATCH] fix optimized unused variable warning --- libs/ardour/midi_ring_buffer.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc index ebd108fb85..a7819a9dc6 100644 --- a/libs/ardour/midi_ring_buffer.cc +++ b/libs/ardour/midi_ring_buffer.cc @@ -223,11 +223,14 @@ MidiRingBuffer::flush (samplepos_t /*start*/, samplepos_t end) while (this->read_space() >= prefix_size) { uint8_t peekbuf[prefix_size]; - bool success; uint32_t ev_size; T ev_time; - success = this->peek (peekbuf, prefix_size); +#ifndef NDEBUG + bool success = +#endif + this->peek (peekbuf, prefix_size); + /* this cannot fail, because we've already verified that there is prefix_space to read */