File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments