[gnoduino: 202/237] Protecting the version of parseInt() and parseFloat(). (Paul Stoffregen)



commit 88ad62dccfd5e1e259303d67d9af0c925815558e
Author: David A. Mellis <d mellis arduino cc>
Date:   Sat Oct 29 17:40:23 2011 -0400

    Protecting the version of parseInt() and parseFloat().  (Paul Stoffregen)
    
    This should allow us more flexibility in determining how to handle these functions later.  For example, in specifying that initial characters shouldn't be skipped.
    
    http://code.google.com/p/arduino/issues/detail?id=698

 arduino/cores/arduino/Stream.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/arduino/cores/arduino/Stream.h b/arduino/cores/arduino/Stream.h
index 8f2de1e..a3b25c5 100644
--- a/arduino/cores/arduino/Stream.h
+++ b/arduino/cores/arduino/Stream.h
@@ -71,14 +71,8 @@ class Stream : public Print
   // initial characters that are not digits (or the minus sign) are skipped
   // integer is terminated by the first character that is not a digit.
 
-  long parseInt(char skipChar); // as above but the given skipChar is ignored
-  // as above but the given skipChar is ignored
-  // this allows format characters (typically commas) in values to be ignored
-
   float parseFloat();               // float version of parseInt
 
-  float parseFloat(char skipChar);  // as above but the given skipChar is ignored
-
   int readBytes( char *buffer, size_t length); // read chars from stream into buffer
   // terminates if length characters have been read or timeout (see setTimeout)
   // returns the number of characters placed in the buffer (0 means no valid data found)
@@ -89,6 +83,12 @@ class Stream : public Print
 
   // Arduino String functions to be added here
 
+  protected:
+  long parseInt(char skipChar); // as above but the given skipChar is ignored
+  // as above but the given skipChar is ignored
+  // this allows format characters (typically commas) in values to be ignored
+
+  float parseFloat(char skipChar);  // as above but the given skipChar is ignored
 };
 
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]