diff --git a/hardware/arduino/avr/cores/arduino/Stream.cpp b/hardware/arduino/avr/cores/arduino/Stream.cpp index d2846316d34..17e96e986a6 100644 --- a/hardware/arduino/avr/cores/arduino/Stream.cpp +++ b/hardware/arduino/avr/cores/arduino/Stream.cpp @@ -139,7 +139,7 @@ long Stream::parseInt(LookaheadMode lookahead, char ignore) return 0; // zero returned if timeout do{ - if(c == ignore) + if((char)c == ignore) ; // ignore this character else if(c == '-') isNegative = true; @@ -148,7 +148,7 @@ long Stream::parseInt(LookaheadMode lookahead, char ignore) read(); // consume the character we got with peek c = timedPeek(); } - while( (c >= '0' && c <= '9') || c == ignore ); + while( (c >= '0' && c <= '9') || (char)c == ignore ); if(isNegative) value = -value; @@ -170,7 +170,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore) return 0; // zero returned if timeout do{ - if(c == ignore) + if((char)c == ignore) ; // ignore else if(c == '-') isNegative = true; @@ -184,7 +184,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore) read(); // consume the character we got with peek c = timedPeek(); } - while( (c >= '0' && c <= '9') || (c == '.' && !isFraction) || c == ignore ); + while( (c >= '0' && c <= '9') || (c == '.' && !isFraction) || (char)c == ignore ); if(isNegative) value = -value; @@ -222,7 +222,7 @@ size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length) size_t index = 0; while (index < length) { int c = timedRead(); - if (c < 0 || c == terminator) break; + if (c < 0 || (char)c == terminator) break; *buffer++ = (char)c; index++; } @@ -245,7 +245,7 @@ String Stream::readStringUntil(char terminator) { String ret; int c = timedRead(); - while (c >= 0 && c != terminator) + while (c >= 0 && (char)c != terminator) { ret += (char)c; c = timedRead(); @@ -268,7 +268,7 @@ 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 ((char)c == t->str[t->index]) { if (++t->index == t->len) return t - targets; else @@ -286,7 +286,7 @@ int Stream::findMulti( struct Stream::MultiTarget *targets, int tCount) { do { --t->index; // first check if current char works against the new current index - if (c != t->str[t->index]) + if ((char)c != t->str[t->index]) continue; // if it's the only char then we're good, nothing more to check