From d4db53e5540bbfc1d44c654acbcfd9120ce86a0e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 1 Jul 2010 15:02:54 +0000 Subject: [PATCH] fix gcc4.4 compile warnings git-svn-id: svn://localhost/ardour2/branches/3.0@7348 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/midi++2/jack_midiport.cc | 4 ++-- libs/midi++2/parser.cc | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/midi++2/jack_midiport.cc b/libs/midi++2/jack_midiport.cc index ba675082a4..eb8b6a072a 100644 --- a/libs/midi++2/jack_midiport.cc +++ b/libs/midi++2/jack_midiport.cc @@ -135,7 +135,7 @@ JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp) if (!is_process_thread()) { Glib::Mutex::Lock lm (output_fifo_lock); - RingBuffer< Evoral::Event >::rw_vector vec; + RingBuffer< Evoral::Event >::rw_vector vec = { { 0, 0 }, { 0, 0} }; output_fifo.get_write_vector (&vec); @@ -206,7 +206,7 @@ JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp) void JACK_MidiPort::flush (void* jack_port_buffer) { - RingBuffer< Evoral::Event >::rw_vector vec; + RingBuffer< Evoral::Event >::rw_vector vec = { { 0, 0 }, { 0, 0 } }; size_t written; output_fifo.get_read_vector (&vec); diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc index 52de52c2d2..cdd23a5306 100644 --- a/libs/midi++2/parser.cc +++ b/libs/midi++2/parser.cc @@ -326,6 +326,7 @@ void Parser::scanner (unsigned char inbyte) { bool statusbit; + boost::optional edit_result; // cerr << "parse: " << hex << (int) inbyte << dec << " state = " << state << " msgindex = " << msgindex << " runnable = " << runnable << endl; @@ -497,7 +498,10 @@ Parser::scanner (unsigned char inbyte) case NEEDONEBYTE: /* We've completed a 1 or 2 byte message. */ - if (edit.empty() || !(*edit (msgbuf, msgindex) == 0)) { + + edit_result = edit (msgbuf, msgindex); + + if (edit_result.get_value_or (1)) { /* message not cancelled by an editor */