From 4ab8728c67228de07c5b3fb4ce2a2dbbdf630728 Mon Sep 17 00:00:00 2001 From: Francois Best Date: Sat, 29 Oct 2016 16:09:04 +0200 Subject: [PATCH] Removed unreacheable code, inlined stuff. --- src/MIDI.hpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/MIDI.hpp b/src/MIDI.hpp index 6011fe5..06a96c2 100644 --- a/src/MIDI.hpp +++ b/src/MIDI.hpp @@ -882,7 +882,7 @@ bool MidiInterface::parse() } default: - break; + break; // LCOV_EXCL_LINE - Coverage blind spot } } @@ -983,9 +983,6 @@ inline bool MidiInterface::inputFilter(Channel inChannel) // This method handles recognition of channel // (to know if the message is destinated to the Arduino) - if (mMessage.type == InvalidType) - return false; - // First, check if the received message is Channel if (mMessage.type >= NoteOff && mMessage.type <= PitchBend) { @@ -1265,36 +1262,33 @@ void MidiInterface::launchCallback() @see Thru::Mode */ template -void MidiInterface::setThruFilterMode(Thru::Mode inThruFilterMode) +inline void MidiInterface::setThruFilterMode(Thru::Mode inThruFilterMode) { mThruFilterMode = inThruFilterMode; - if (mThruFilterMode != Thru::Off) - mThruActivated = true; - else - mThruActivated = false; + mThruActivated = mThruFilterMode != Thru::Off; } template -Thru::Mode MidiInterface::getFilterMode() const +inline Thru::Mode MidiInterface::getFilterMode() const { return mThruFilterMode; } template -bool MidiInterface::getThruState() const +inline bool MidiInterface::getThruState() const { return mThruActivated; } template -void MidiInterface::turnThruOn(Thru::Mode inThruFilterMode) +inline void MidiInterface::turnThruOn(Thru::Mode inThruFilterMode) { mThruActivated = true; mThruFilterMode = inThruFilterMode; } template -void MidiInterface::turnThruOff() +inline void MidiInterface::turnThruOff() { mThruActivated = false; mThruFilterMode = Thru::Off; @@ -1387,8 +1381,9 @@ void MidiInterface::thruFilter(Channel inChannel) case TimeCodeQuarterFrame: sendTimeCodeQuarterFrame(mMessage.data1,mMessage.data2); break; + default: - break; + break; // LCOV_EXCL_LINE - Unreacheable code, but prevents unhandled case warning. } } }