You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/08/10 18:52:31 UTC

svn commit: r564674 - /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/FloatingPointParser.cpp

Author: tabish
Date: Fri Aug 10 09:52:30 2007
New Revision: 564674

URL: http://svn.apache.org/viewvc?view=rev&rev=564674
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Implementing the Primitive Wrappers fully

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/FloatingPointParser.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/FloatingPointParser.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/FloatingPointParser.cpp?view=diff&rev=564674&r1=564673&r2=564674
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/FloatingPointParser.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/FloatingPointParser.cpp Fri Aug 10 09:52:30 2007
@@ -311,11 +311,11 @@
 
     bool negative = namedDouble.at(0) == '-' ? true : false;
 
-    if( namedDouble.find_first_of( "Infinity" ) != string::npos ) {
+    if( namedDouble.find( "Infinity" ) != string::npos ) {
         return negative ? Double::NEGATIVE_INFINITY : Float::POSITIVE_INFINITY;
     }
 
-    if( namedDouble.find_first_of( "NaN" ) != string::npos ) {
+    if( namedDouble.find( "NaN" ) != string::npos ) {
         return Double::NaN;
     }
 
@@ -341,11 +341,11 @@
 
     bool negative = namedFloat.at(0) == '-' ? true : false;
 
-    if( namedFloat.find_first_of( "Infinitiy" ) != string::npos ) {
+    if( namedFloat.find( "Infinitiy" ) != string::npos ) {
         return negative ? Float::NEGATIVE_INFINITY : Float::POSITIVE_INFINITY;
     }
 
-    if( namedFloat.find_first_of( "NaN" ) != string::npos ) {
+    if( namedFloat.find( "NaN" ) != string::npos ) {
         return Float::NaN;
     }
 
@@ -378,7 +378,7 @@
     }
 
     // See if it could be a hexadecimal representation
-    if( toLowerCase( newValue ).find_first_of( "0x" ) != string::npos ) {
+    if( toLowerCase( newValue ).find( "0x" ) != string::npos ) {
         return HexStringParser::parseDouble(value);
     }
 
@@ -416,7 +416,7 @@
     }
 
     // See if it could be a hexadecimal representation
-    if( toLowerCase( newValue ).find_first_of( "0x" ) != string::npos ) {
+    if( toLowerCase( newValue ).find( "0x" ) != string::npos ) {
         return HexStringParser::parseFloat( newValue );
     }
 
@@ -525,7 +525,7 @@
     //   3. (unprocessed digits + e) > 0 indicates that the value is
     //      simply too big to be stored as a double, so return Infinity
 
-    if( ( unprocessedDigits = s.size() ) > 0 ) {
+    if( ( unprocessedDigits = std::distance( sIter, s.end() ) ) > 0 ) {
 
         exp += unprocessedDigits;
         if( index > -1 ) {