mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Fixing warnings in Stream (Paul Stoffregen)
http://code.google.com/p/arduino/issues/detail?id=208
This commit is contained in:
@ -67,9 +67,9 @@ int Stream::peekNextDigit()
|
|||||||
// Public Methods
|
// Public Methods
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Stream::setTimeout( long timeout) // sets the maximum number of milliseconds to wait
|
void Stream::setTimeout(unsigned long timeout) // sets the maximum number of milliseconds to wait
|
||||||
{
|
{
|
||||||
this->_timeout = timeout;
|
_timeout = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find returns true if the target string is found
|
// find returns true if the target string is found
|
||||||
@ -165,7 +165,7 @@ long Stream::parseInt(char skipChar)
|
|||||||
// as parseInt but returns a floating point value
|
// as parseInt but returns a floating point value
|
||||||
float Stream::parseFloat()
|
float Stream::parseFloat()
|
||||||
{
|
{
|
||||||
parseFloat(NO_SKIP_CHAR);
|
return parseFloat(NO_SKIP_CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// as above but the given skipChar is ignored
|
// as above but the given skipChar is ignored
|
||||||
@ -174,7 +174,6 @@ float Stream::parseFloat(char skipChar){
|
|||||||
boolean isNegative = false;
|
boolean isNegative = false;
|
||||||
boolean isFraction = false;
|
boolean isFraction = false;
|
||||||
long value = 0;
|
long value = 0;
|
||||||
float fValue;
|
|
||||||
char c;
|
char c;
|
||||||
float fraction = 1.0;
|
float fraction = 1.0;
|
||||||
|
|
||||||
@ -223,7 +222,7 @@ int Stream::readBytes( char *buffer, size_t length)
|
|||||||
|
|
||||||
int Stream::readBytesUntil( char terminator, char *buffer, size_t length)
|
int Stream::readBytesUntil( char terminator, char *buffer, size_t length)
|
||||||
{
|
{
|
||||||
int index = 0;
|
unsigned int index = 0;
|
||||||
*buffer = 0;
|
*buffer = 0;
|
||||||
while(index < length-1 ){
|
while(index < length-1 ){
|
||||||
int c = timedRead();
|
int c = timedRead();
|
||||||
|
@ -38,8 +38,8 @@ readBytesBetween( pre_string, terminator, buffer, length)
|
|||||||
class Stream : public Print
|
class Stream : public Print
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
long _timeout; // number of milliseconds to wait for the next char before aborting timed read
|
unsigned long _timeout; // number of milliseconds to wait for the next char before aborting timed read
|
||||||
long _startMillis; // used for timeout measurement
|
unsigned long _startMillis; // used for timeout measurement
|
||||||
int timedRead(); // private method to read stream with timeout
|
int timedRead(); // private method to read stream with timeout
|
||||||
int timedPeek(); // private method to peek stream with timeout
|
int timedPeek(); // private method to peek stream with timeout
|
||||||
int peekNextDigit(); // returns the next numeric digit in the stream or -1 if timeout
|
int peekNextDigit(); // returns the next numeric digit in the stream or -1 if timeout
|
||||||
@ -54,7 +54,7 @@ class Stream : public Print
|
|||||||
|
|
||||||
// parsing methods
|
// parsing methods
|
||||||
|
|
||||||
void setTimeout(long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
|
void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
|
||||||
|
|
||||||
bool find(char *target); // reads data from the stream until the target string is found
|
bool find(char *target); // reads data from the stream until the target string is found
|
||||||
// returns true if target string is found, false if timed out (see setTimeout)
|
// returns true if target string is found, false if timed out (see setTimeout)
|
||||||
|
Reference in New Issue
Block a user