aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandeep Mistry <s.mistry@arduino.cc>2015-11-23 16:45:29 -0500
committerSandeep Mistry <s.mistry@arduino.cc>2015-11-23 16:45:29 -0500
commite2c80d0389b0aaa8eedc617dd9cb9651cb46b193 (patch)
tree6fb2b2fd927ad658814d256038feb40583ccc85e
parent507f2ee84a04edb8b96cdb15e2a4ab23f450fa2c (diff)
Cleanup some Stream compiler warnings from #3337
-rw-r--r--cores/arduino/Stream.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/cores/arduino/Stream.cpp b/cores/arduino/Stream.cpp
index 758b9d2..f665465 100644
--- a/cores/arduino/Stream.cpp
+++ b/cores/arduino/Stream.cpp
@@ -61,8 +61,8 @@ int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal)
if( c < 0 ||
c == '-' ||
- c >= '0' && c <= '9' ||
- detectDecimal && c == '.') return c;
+ (c >= '0' && c <= '9') ||
+ (detectDecimal && c == '.')) return c;
switch( lookahead ){
case SKIP_NONE: return -1; // Fail code.
@@ -74,6 +74,8 @@ int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal)
case '\n': break;
default: return -1; // Fail code.
}
+ case SKIP_ALL:
+ break;
}
read(); // discard non-numeric
}
@@ -138,7 +140,7 @@ long Stream::parseInt(LookaheadMode lookahead, char ignore)
do{
if(c == ignore)
- ; // ignore this charactor
+ ; // ignore this character
else if(c == '-')
isNegative = true;
else if(c >= '0' && c <= '9') // is c a digit?
@@ -159,7 +161,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore)
bool isNegative = false;
bool isFraction = false;
long value = 0;
- char c;
+ int c;
float fraction = 1.0;
c = peekNextDigit(lookahead, true);
@@ -182,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) || c == ignore );
if(isNegative)
value = -value;