activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r553195 - in /activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils: BooleanStream.cpp OpenwireStringSupport.cpp
Date Wed, 04 Jul 2007 13:03:12 GMT
Author: tabish
Date: Wed Jul  4 06:03:11 2007
New Revision: 553195

URL: http://svn.apache.org/viewvc?view=rev&rev=553195
Log:
minor code cleanup

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.cpp?view=diff&rev=553195&r1=553194&r2=553195
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/BooleanStream.cpp
Wed Jul  4 06:03:11 2007
@@ -44,7 +44,6 @@
 bool BooleanStream::readBoolean() throw ( IOException ) {
 
     try {
-        //assert arrayPos <= arrayLimit;
         unsigned char b = data[arrayPos];
         bool rc = ( ( b >> bytePos ) & 0x01 ) != 0;
         bytePos++;
@@ -67,7 +66,7 @@
         if( bytePos == 0 ) {
             arrayLimit++;
 
-            if( (size_t)arrayLimit >= data.capacity() ) {
+            if( (size_t)arrayLimit >= data.size() ) {
                 // re-grow the array if necessary
                 data.resize( data.size() * 2 );
             }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp?view=diff&rev=553195&r1=553194&r2=553195
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp
Wed Jul  4 06:03:11 2007
@@ -30,21 +30,21 @@
 ////////////////////////////////////////////////////////////////////////////////
 std::string OpenwireStringSupport::readString( io::DataInputStream& dataIn )
     throw ( io::IOException ) {
-        
+
     try {
 
         short utflen = dataIn.readShort();
-        
+
         if( utflen > -1 )
         {
             // Let the stream get us all that data.
             std::vector<unsigned char> value;
             value.resize( utflen );
-            dataIn.readFully( value );            
+            dataIn.readFully( value );
 
-            int c;//, char2, char3;
+            int c = 0;
             int count = 0;
-            
+
             while( count < utflen )
             {
                 c = value[count] & 0xff;
@@ -113,11 +113,11 @@
         return "";
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )        
+    AMQ_CATCHALL_THROW( ActiveMQException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void OpenwireStringSupport::writeString( io::DataOutputStream& dataOut, 
+void OpenwireStringSupport::writeString( io::DataOutputStream& dataOut,
                                          const std::string* str )
                                             throw ( io::IOException ) {
 
@@ -129,17 +129,17 @@
                 throw IOException(
                     __FILE__,
                     __LINE__,
-                    ( std::string( "OpenwireStringSupport::writeString - Cannot marshall
" ) + 
+                    ( std::string( "OpenwireStringSupport::writeString - Cannot marshall
" ) +
                     "string longer than: 65536 characters, supplied steing was: " +
                     Integer::toString( (int)str->size() ) + " characters long." ).c_str()
);
             }
-            
+
             //short strlen = (short)str->size();
             short utflen = 0;
             int c, count = 0;
-            
+
             std::string::const_iterator iter = str->begin();
-            
+
             for(; iter != str->end(); ++iter ) {
                 c = *iter;
                 if( (c >= 0x0001) && (c <= 0x007F) ) {
@@ -150,7 +150,7 @@
                     utflen += 2;
                 }
             }
-            
+
             dataOut.writeShort( utflen );
             std::vector<unsigned char> byteArr;
             byteArr.resize( utflen );
@@ -178,5 +178,5 @@
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )        
-} 
+    AMQ_CATCHALL_THROW( ActiveMQException )
+}



Mime
View raw message