From f3e7a3909d88b57807e2656c3f0c989974d21804 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 21 Apr 2015 00:08:02 +0200 Subject: [PATCH 1/2] Fixed: warning: suggest explicit braces to avoid ambiguous 'else' --- hardware/arduino/avr/cores/arduino/Stream.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hardware/arduino/avr/cores/arduino/Stream.cpp b/hardware/arduino/avr/cores/arduino/Stream.cpp index 14f972a80..9712859ea 100644 --- a/hardware/arduino/avr/cores/arduino/Stream.cpp +++ b/hardware/arduino/avr/cores/arduino/Stream.cpp @@ -265,11 +265,11 @@ int Stream::findMulti( struct Stream::MultiTarget *targets, int tCount) { for (struct MultiTarget *t = targets; t < targets+tCount; ++t) { // the simple case is if we match, deal with that first. - if (c == t->str[t->index]) - if (++t->index == t->len) - return t - targets; - else - continue; + if (c == t->str[t->index]) { + if (++t->index == t->len) + return t - targets; + } else + continue; // if not we need to walk back and see if we could have matched further // down the stream (ie '1112' doesn't match the first position in '11112' From 91489d7ba8f5e4c06140b3be0149d70dbece4baa Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 21 Apr 2015 00:08:11 +0200 Subject: [PATCH 2/2] Fixed: warning: comparison between signed and unsigned integer expressions --- hardware/arduino/avr/cores/arduino/Stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/avr/cores/arduino/Stream.cpp b/hardware/arduino/avr/cores/arduino/Stream.cpp index 9712859ea..7e8bf10e0 100644 --- a/hardware/arduino/avr/cores/arduino/Stream.cpp +++ b/hardware/arduino/avr/cores/arduino/Stream.cpp @@ -293,7 +293,7 @@ int Stream::findMulti( struct Stream::MultiTarget *targets, int tCount) { // otherwise we need to check the rest of the found string int diff = origIndex - t->index; - int i; + size_t i; for (i = 0; i < t->index; ++i) if (t->str[i] != t->str[i + diff]) break;