Skip to content

Commit 0442528

Browse files
committed
Cleanup some Stream compiler warnings from #3337
1 parent 9697984 commit 0442528

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cores/arduino/Stream.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal )
6161

6262
if( c < 0 ||
6363
c == '-' ||
64-
c >= '0' && c <= '9' ||
65-
detectDecimal && c == '.') return c;
64+
(c >= '0' && c <= '9') ||
65+
(detectDecimal && c == '.')) return c;
6666

6767
switch( lookahead ){
6868
case SKIP_NONE: return -1; // Fail code.
@@ -74,6 +74,8 @@ int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal )
7474
case '\n': break;
7575
default: return -1; // Fail code.
7676
}
77+
case SKIP_ALL:
78+
break;
7779
}
7880
read(); // discard non-numeric
7981
}
@@ -159,7 +161,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore)
159161
bool isNegative = false;
160162
bool isFraction = false;
161163
long value = 0;
162-
char c;
164+
int c;
163165
float fraction = 1.0;
164166

165167
c = peekNextDigit(lookahead, true);
@@ -182,7 +184,7 @@ float Stream::parseFloat(LookaheadMode lookahead, char ignore)
182184
read(); // consume the character we got with peek
183185
c = timedPeek();
184186
}
185-
while( (c >= '0' && c <= '9') || c == '.' && !isFraction || c == ignore );
187+
while( (c >= '0' && c <= '9') || (c == '.' && !isFraction) || c == ignore );
186188

187189
if(isNegative)
188190
value = -value;

0 commit comments

Comments
 (0)