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 20:27:27 UTC
svn commit: r564708 - in
/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util:
BigInt.cpp FloatingPointParser.cpp
Author: tabish
Date: Fri Aug 10 11:27:26 2007
New Revision: 564708
URL: http://svn.apache.org/viewvc?view=rev&rev=564708
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/BigInt.cpp
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/BigInt.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/BigInt.cpp?view=diff&rev=564708&r1=564707&r2=564708
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/BigInt.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/BigInt.cpp Fri Aug 10 11:27:26 2007
@@ -71,26 +71,25 @@
unsigned int BigInt::simpleAppendDecimalDigitHighPrecision(
unsigned long long* arg1, int length, unsigned long long digit ) {
- // assumes digit is less than 32 bits
- unsigned long long arg;
- int index = 0;
+ // assumes digit is less than 32 bits
+ unsigned long long arg;
+ int index = 0;
- digit <<= 32;
- do
- {
- arg = arg1[index] & BitOps::LONG_LO_MASK;
- digit = ( digit >> 32 ) + BitOps::TIMES_TEN( arg );
- BitOps::LOW_U32_FROM_LONG64_PTR( arg1 + index ) =
- BitOps::LOW_U32_FROM_LONG64( digit );
+ digit <<= 32;
+ do {
+ arg = arg1[index] & BitOps::LONG_LO_MASK;
+ digit = ( digit >> 32 ) + BitOps::TIMES_TEN( arg );
+ ((BitOps::LONG_UNION*)(arg1 + index ))->intValue[BitOps::LoWord] =
+ (int)digit & BitOps::LONG_LO_MASK;
- arg = arg1[index] >> 32;
- digit = ( digit >> 32 ) + BitOps::TIMES_TEN( arg );
- BitOps::HIGH_U32_FROM_LONG64_PTR( arg1 + index ) =
- BitOps::LOW_U32_FROM_LONG64( digit );
- }
- while (++index < length);
+ arg = arg1[index] >> 32;
+ digit = ( digit >> 32 ) + BitOps::TIMES_TEN( arg );
+ ((BitOps::LONG_UNION*)(arg1 + index ))->intValue[BitOps::HiWord] =
+ (int)digit & BitOps::LONG_LO_MASK;
- return BitOps::HIGH_U32_FROM_LONG64( digit );
+ } while( ++index < length );
+
+ return digit >> 32;
}
////////////////////////////////////////////////////////////////////////////////
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=564708&r1=564707&r2=564708
==============================================================================
--- 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 11:27:26 2007
@@ -470,8 +470,8 @@
unsigned long long* f = def;
unsigned long long* fNoOverflow = defBackup;
unsigned long long* tempBackup = NULL;
- unsigned int overflow;
- unsigned int result;
+ unsigned int overflow = 0;
+ unsigned int result = 0;
int index = 1;
int unprocessedDigits = 0;
std::string::const_iterator sIter = s.begin();