summaryrefslogtreecommitdiff
path: root/libs/midi++2
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-07-01 15:02:54 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-07-01 15:02:54 +0000
commitd4db53e5540bbfc1d44c654acbcfd9120ce86a0e (patch)
tree499cbb65de94874d227a4c6f3346c0e244f59878 /libs/midi++2
parentd3a4655ddd24cb575cf6ecac5a0f0b33a487bedf (diff)
fix gcc4.4 compile warnings
git-svn-id: svn://localhost/ardour2/branches/3.0@7348 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2')
-rw-r--r--libs/midi++2/jack_midiport.cc4
-rw-r--r--libs/midi++2/parser.cc6
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<double> >::rw_vector vec;
+ RingBuffer< Evoral::Event<double> >::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<double> >::rw_vector vec;
+ RingBuffer< Evoral::Event<double> >::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<int> 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 */