activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r920368 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/commands/ main/activemq/core/ main/activemq/io/ main/activemq/wireformat/openwire/utils/ main/activemq/wireformat/stomp/ main/decaf/internal/util/ main/decaf/io/ main...
Date Mon, 08 Mar 2010 16:04:56 GMT
Author: tabish
Date: Mon Mar  8 16:04:55 2010
New Revision: 920368

URL: http://svn.apache.org/viewvc?rev=920368&view=rev
Log:
Fix a bunch of implicit type conversion warnings that show up under Visual C++ and GCC when
you add the -Wconversion option.  

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessageTemplate.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompHelper.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/ByteArrayAdapter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Double.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Float.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Math.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CheckedInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Deflater.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Inflater.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/Adler32Test.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessageTemplate.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessageTemplate.h?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessageTemplate.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessageTemplate.h
Mon Mar  8 16:04:55 2010
@@ -636,7 +636,7 @@
          * @throw CMSException
          */
         virtual void setCMSPriority( int priority ) throw( cms::CMSException ) {
-            this->setPriority( priority );
+            this->setPriority( (unsigned char)priority );
         }
 
         /**

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp Mon
Mar  8 16:04:55 2010
@@ -700,7 +700,7 @@
     Pointer<MessageAck> oldPendingAck = pendingAck;
     pendingAck.reset( new MessageAck() );
     pendingAck->setConsumerId( dispatch->getConsumerId() );
-    pendingAck->setAckType( ackType );
+    pendingAck->setAckType( (unsigned char)ackType );
     pendingAck->setDestination( dispatch->getDestination() );
     pendingAck->setLastMessageId( dispatch->getMessage()->getMessageId() );
     pendingAck->setMessageCount( deliveredCounter );
@@ -739,7 +739,7 @@
             Pointer<MessageDispatch> dispatched = dispatchedMessages.front();
 
             Pointer<MessageAck> ack( new MessageAck() );
-            ack->setAckType( type );
+            ack->setAckType( (unsigned char)type );
             ack->setConsumerId( dispatched->getConsumerId() );
             ack->setDestination( dispatched->getDestination() );
             ack->setMessageCount( (int)dispatchedMessages.size() );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp Mon
Mar  8 16:04:55 2010
@@ -889,7 +889,7 @@
     std::string priorityStr =
         core::ActiveMQConstants::toString( core::ActiveMQConstants::CONSUMER_PRIORITY );
     if( options.hasProperty( priorityStr ) ) {
-        info->setPriority( Integer::parseInt( options.getProperty( priorityStr ) ) );
+        info->setPriority( (unsigned char)Integer::parseInt( options.getProperty( priorityStr
) ) );
     }
 
     std::string dispatchAsyncStr =

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp Mon
Mar  8 16:04:55 2010
@@ -39,7 +39,7 @@
 int LoggingInputStream::doReadByte() throw ( IOException ) {
     try {
 
-        unsigned char c = FilterInputStream::doReadByte();
+        unsigned char c = (unsigned char)FilterInputStream::doReadByte();
         log( &c, 1 );
         return c;
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp
Mon Mar  8 16:04:55 2010
@@ -74,7 +74,7 @@
         }
 
         if( value ) {
-            data[arrayPos] |= ( 0x01 << bytePos );
+            data[arrayPos] |= (unsigned char)( 0x01 << bytePos );
         }
 
         bytePos++;
@@ -126,8 +126,8 @@
             dataOut.push_back( ( unsigned char ) arrayLimit );
         } else {
             dataOut.push_back( ( unsigned char ) 0x80 );
-            dataOut.push_back( arrayLimit >> 8 );   // High Byte
-            dataOut.push_back( arrayLimit & 0xFF ); // Low Byte
+            dataOut.push_back( ( unsigned char )( arrayLimit >> 8 ) );   // High Byte
+            dataOut.push_back( ( unsigned char )( arrayLimit & 0xFF ) ); // Low Byte
         }
 
         // Insert all data from data into the passed buffer

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp
Mon Mar  8 16:04:55 2010
@@ -76,7 +76,7 @@
                         "This method only supports encoded ASCII values of (0-255)." );
                 }
 
-                result[index++] = ( ( a & 0x1F ) << 6 ) | ( b & 0x3F );
+                result[index++] = (unsigned char)( ( ( a & 0x1F ) << 6 ) | ( b
& 0x3F ) );
 
             } else if( ( a & 0xF0 ) == 0xE0 ) {
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompHelper.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompHelper.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompHelper.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompHelper.cpp
Mon Mar  8 16:04:55 2010
@@ -55,7 +55,7 @@
     }
 
     if( frame->hasProperty( StompCommandConstants::HEADER_JMSPRIORITY ) ) {
-        message->setPriority( Integer::parseInt(
+        message->setPriority( (unsigned char)Integer::parseInt(
             frame->removeProperty( StompCommandConstants::HEADER_JMSPRIORITY ) ) );
     }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/ByteArrayAdapter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/ByteArrayAdapter.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/ByteArrayAdapter.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/ByteArrayAdapter.cpp
Mon Mar  8 16:04:55 2010
@@ -505,7 +505,7 @@
         short value = 0;
         unsigned char buffer[sizeof(value)] = {0};
         this->read( buffer, index, sizeof(value) );
-        value |= (buffer[0] << 8 | buffer[1] << 0);
+        value |= (short)(buffer[0] << 8 | buffer[1] << 0);
 
         return value;
     }
@@ -691,10 +691,10 @@
 
         unsigned char buffer[sizeof(value)];
 
-        buffer[0] = (value & 0xFF000000) >> 24;
-        buffer[1] = (value & 0x00FF0000) >> 16;
-        buffer[2] = (value & 0x0000FF00) >> 8;
-        buffer[3] = (value & 0x000000FF) >> 0;
+        buffer[0] = (unsigned char)((value & 0xFF000000) >> 24);
+        buffer[1] = (unsigned char)((value & 0x00FF0000) >> 16);
+        buffer[2] = (unsigned char)((value & 0x0000FF00) >> 8);
+        buffer[3] = (unsigned char)((value & 0x000000FF) >> 0);
 
         this->write( buffer, index, sizeof(value) );
 
@@ -733,8 +733,8 @@
 
         unsigned char buffer[sizeof(value)];
 
-        buffer[0] = (value & 0xFF00) >> 8;
-        buffer[1] = (value & 0x00FF) >> 0;
+        buffer[0] = (unsigned char)((value & 0xFF00) >> 8);
+        buffer[1] = (unsigned char)((value & 0x00FF) >> 0);
 
         this->write( buffer, index, sizeof(value) );
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp Mon
Mar  8 16:04:55 2010
@@ -336,7 +336,7 @@
             streamBuffer->advance( copylength );
 
             if( copylength == length || inputStream->available() == 0 ) {
-                return copylength;
+                return (int)copylength;
             }
 
             offset += copylength;
@@ -355,13 +355,13 @@
 
                 read = inputStream->read( buffer, size, offset, required );
                 if( read == -1 ) {
-                    return required == length ? -1 : length - required;
+                    return required == length ? -1 : (int)( length - required );
                 }
 
             } else {
 
                 if( bufferData( inputStream, streamBuffer ) == -1 ) {
-                    return required == length ? -1 : length - required;
+                    return required == length ? -1 : (int)( length - required );
                 }
 
                 // Stream might have closed while we were buffering.
@@ -371,7 +371,7 @@
                         "BufferedInputStream::bufferData - Stream is closed" );
                 }
 
-                read = streamBuffer->available() >= required ? required : streamBuffer->available();
+                read = (int)( streamBuffer->available() >= required ? required : streamBuffer->available()
);
                 System::arraycopy( streamBuffer->getBuffer(), streamBuffer->getPos(),
                                    buffer, offset, read );
                 streamBuffer->advance( read );
@@ -380,11 +380,11 @@
             required -= read;
 
             if( required == 0 ) {
-                return length;
+                return (int)length;
             }
 
             if( inputStream->available() == 0 ) {
-                return length - required;
+                return (int)( length - required );
             }
 
             offset += read;
@@ -421,7 +421,7 @@
             return amount;
         }
 
-        int read = streamBuffer->available();
+        int read = (int)streamBuffer->available();
 
         streamBuffer->advance( streamBuffer->getCount() );
 
@@ -439,7 +439,7 @@
                 }
 
                 // Couldn't get all the bytes, skip what we read
-                read += streamBuffer->available();
+                read += (int)streamBuffer->available();
                 streamBuffer->advance( streamBuffer->getCount() );
 
                 return read;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.cpp Mon
Mar  8 16:04:55 2010
@@ -188,11 +188,8 @@
             }
 
             // Get the number of bytes left to write.
-            std::size_t bytesToWrite = Math::min( (long long)( bufferSize - tail ),
-                                                  (long long)( length - pos ) );
-
-            // Copy the data.
-            //memcpy( this->buffer+tail, buffer+offset+pos, bytesToWrite );
+            std::size_t bytesToWrite = Math::min( (int)( bufferSize - tail ),
+                                                  (int)( length - pos ) );
 
             System::arraycopy( buffer, offset + pos, this->buffer, this->tail, bytesToWrite
);
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp Mon Mar
 8 16:04:55 2010
@@ -92,7 +92,7 @@
     try {
         short value = 0;
         readAllData( buffer, sizeof(short) );
-        value |= (buffer[0] << 8 | buffer[1] << 0);
+        value |= (short)(buffer[0] << 8 | buffer[1] << 0);
         return value;
     }
     DECAF_CATCH_RETHROW( EOFException )
@@ -106,7 +106,7 @@
     try {
         unsigned short value = 0;
         readAllData( buffer, sizeof(unsigned short) );
-        value |= (buffer[0] << 8 | buffer[1] << 0);
+        value |= (unsigned short)(buffer[0] << 8 | buffer[1] << 0);
         return value;
     }
     DECAF_CATCH_RETHROW( EOFException )
@@ -281,7 +281,7 @@
                         "This method only supports encoded ASCII values of (0-255)." );
                 }
 
-                result[index++] = ( ( a & 0x1F ) << 6 ) | ( b & 0x3F );
+                result[index++] = (unsigned char)( ( ( a & 0x1F ) << 6 ) | ( b
& 0x3F ) );
 
             } else if( ( a & 0xF0 ) == 0xE0 ) {
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp Mon Mar
 8 16:04:55 2010
@@ -181,8 +181,8 @@
                 "DataOutputStream::write - Base stream is Null");
         }
 
-        buffer[0] = (value & 0xFF00) >> 8;
-        buffer[1] = (value & 0x00FF) >> 0;
+        buffer[0] = (unsigned char)((value & 0xFF00) >> 8);
+        buffer[1] = (unsigned char)((value & 0x00FF) >> 0);
 
         outputStream->write( buffer, sizeof(value), 0, sizeof(value) );
         written += sizeof( value );
@@ -203,8 +203,8 @@
                 "DataOutputStream::write - Base stream is Null");
         }
 
-        buffer[0] = (value & 0xFF00) >> 8;
-        buffer[1] = (value & 0x00FF) >> 0;
+        buffer[0] = (unsigned char)((value & 0xFF00) >> 8);
+        buffer[1] = (unsigned char)((value & 0x00FF) >> 0);
 
         outputStream->write( buffer, sizeof(value), 0, sizeof(value) );
         written += sizeof( value );
@@ -223,10 +223,10 @@
                 "DataOutputStream::write - Base stream is Null");
         }
 
-        buffer[0] = (value & 0xFF000000) >> 24;
-        buffer[1] = (value & 0x00FF0000) >> 16;
-        buffer[2] = (value & 0x0000FF00) >> 8;
-        buffer[3] = (value & 0x000000FF) >> 0;
+        buffer[0] = (unsigned char)((value & 0xFF000000) >> 24);
+        buffer[1] = (unsigned char)((value & 0x00FF0000) >> 16);
+        buffer[2] = (unsigned char)((value & 0x0000FF00) >> 8);
+        buffer[3] = (unsigned char)((value & 0x000000FF) >> 0);
 
         outputStream->write( buffer, sizeof(value), 0, sizeof(value) );
         written += sizeof( value );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.cpp Mon Mar  8
16:04:55 2010
@@ -179,18 +179,18 @@
             int c;
             try {
                 if( ( c = doReadByte() ) == -1 ) {
-                    return i == 0 ? -1 : i;
+                    return i == 0 ? -1 : (int)i;
                 }
             } catch( IOException& e ) {
                 if( i != 0 ) {
-                    return i;
+                    return (int)i;
                 }
                 throw e;
             }
             buffer[offset + i] = (unsigned char)c;
         }
 
-        return length;
+        return (int)length;
     }
     DECAF_CATCH_RETHROW( IOException )
     DECAF_CATCH_RETHROW( IndexOutOfBoundsException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp Mon
Mar  8 16:04:55 2010
@@ -227,19 +227,19 @@
 
         // Have we copied enough?
         if( copyLength == length ) {
-            return length;
+            return (int)length;
         }
 
         int inCopied = inputStream->read( buffer, size, newOffset, length - copiedBytes
);
         if( inCopied > 0 ) {
-            return inCopied + copiedBytes;
+            return (int)( inCopied + copiedBytes );
         }
 
         if( copiedBytes == 0 ) {
             return inCopied;
         }
 
-        return copiedBytes;
+        return (int)copiedBytes;
     }
     DECAF_CATCH_RETHROW( IOException )
     DECAF_CATCH_RETHROW( IndexOutOfBoundsException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Double.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Double.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Double.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Double.cpp Mon Mar  8 16:04:55
2010
@@ -202,7 +202,7 @@
 
         // if there are digits left, then insert some '0' chars first
         if( significand != 0 && fractionDigits > hexSignificand.length() ) {
-            int digitDiff = fractionDigits - hexSignificand.length();
+            int digitDiff = fractionDigits - (int)hexSignificand.length();
             while( digitDiff-- != 0 ) {
                 hexString.append( "0" );
             }
@@ -226,7 +226,7 @@
 
         // if there are digits left, then insert some '0' chars first
         if( significand != 0 && fractionDigits > hexSignificand.length() ) {
-            int digitDiff = fractionDigits - hexSignificand.length();
+            int digitDiff = fractionDigits - (int)hexSignificand.length();
             while( digitDiff-- != 0 ) {
                 hexString.append( "0" );
             }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Float.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Float.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Float.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Float.cpp Mon Mar  8 16:04:55
2010
@@ -210,7 +210,7 @@
 
         // if there are digits left, then insert some '0' chars first
         if( significand != 0 && fractionDigits > hexSignificand.length() ) {
-            unsigned int digitDiff = fractionDigits - hexSignificand.length();
+            unsigned int digitDiff = fractionDigits - (int)hexSignificand.length();
             while( digitDiff-- != 0 ) {
                 hexString.append( "0" );
             }
@@ -233,7 +233,7 @@
 
         // if there are digits left, then insert some '0' chars first
         if( significand != 0 && fractionDigits > hexSignificand.length() ) {
-            unsigned int digitDiff = fractionDigits - hexSignificand.length();
+            unsigned int digitDiff = fractionDigits - (int)hexSignificand.length();
             while( digitDiff-- != 0 ) {
                 hexString.append( "0" );
             }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Math.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Math.h?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Math.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Math.h Mon Mar  8 16:04:55
2010
@@ -369,7 +369,7 @@
          * @param b - another argument.
          * @return the smaller of <code>a</code> and <code>b</code>.
          */
-        static int min( unsigned int a, unsigned int b ) {
+        static unsigned int min( unsigned int a, unsigned int b ) {
             return ( a <= b ? a : b );
         }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp Mon Mar  8 16:04:55
2010
@@ -93,7 +93,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 short Short::reverseBytes( short value ) {
     unsigned short temp = value;
-    temp = ( ( temp & 0xFF00 ) >> 8 ) | ( ( temp & 0x00FF ) << 8 );
+    temp = (unsigned short)( ( ( temp & 0xFF00 ) >> 8 ) | ( ( temp & 0x00FF
) << 8 ) );
     return temp;
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp Mon Mar  8 16:04:55
2010
@@ -345,7 +345,7 @@
 
     // returns number of online(_SC_NPROCESSORS_ONLN) processors, number configured(_SC_NPROCESSORS_CONF)
     // may be more than online
-    numCpus = sysconf( _SC_NPROCESSORS_ONLN );
+    numCpus = (int)sysconf( _SC_NPROCESSORS_ONLN );
 
 #endif
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp Mon Mar 
8 16:04:55 2010
@@ -66,7 +66,7 @@
 
     // Create the Address Info for the Socket
     result = apr_sockaddr_info_get(
-        &socketAddress, host, APR_INET, port, 0, apr_pool.getAprPool() );
+        &socketAddress, host, APR_INET, (apr_port_t)port, 0, apr_pool.getAprPool() );
 
     if( result != APR_SUCCESS ) {
         socketHandle = NULL;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp Mon Mar  8 16:04:55
2010
@@ -95,7 +95,7 @@
 
         // Create the Address data
         checkResult( apr_sockaddr_info_get(
-            &socketAddress, host, APR_INET, port, 0, apr_pool.getAprPool() ) );
+            &socketAddress, host, APR_INET, (apr_port_t)port, 0, apr_pool.getAprPool()
) );
 
         // Create the actual socket.
         checkResult( apr_socket_create(

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp Mon Mar  8 16:04:55
2010
@@ -61,7 +61,7 @@
     long long divisor = 1LL;
     divisor <<= 31;
     divisor <<= 22;
-    return ((((long long) next(26) << 27) + next(27)) / (double) divisor);
+    return ( (double)( ( (long long) next(26) << 27) + next(27)) / (double) divisor);
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Adler32.cpp Mon Mar 
8 16:04:55 2010
@@ -76,5 +76,5 @@
             __FILE__, __LINE__, "Given offset + length exceeds the length of the buffer."
);
     }
 
-    this->value = adler32( this->value, (const Bytef*)( buffer + offset ), length );
+    this->value = (long long)adler32( this->value, (const Bytef*)( buffer + offset
), (uInt)length );
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CRC32.cpp Mon Mar  8
16:04:55 2010
@@ -76,7 +76,7 @@
             __FILE__, __LINE__, "Given offset + length exceeds the length of the buffer."
);
     }
 
-    this->value = crc32( this->value, (const Bytef*)( buffer + offset ), length );
+    this->value = (long long)crc32( this->value, (const Bytef*)( buffer + offset ),
(uInt)length );
 }
 
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CheckedInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CheckedInputStream.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CheckedInputStream.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/CheckedInputStream.cpp
Mon Mar  8 16:04:55 2010
@@ -55,7 +55,7 @@
         }
 
         // Perform smaller reads then the indicated amount
-        std::size_t remaining = Math::min( num, 2048 );
+        std::size_t remaining = Math::min( (int)num, 2048 );
         std::size_t skipped = 0;
 
         std::vector<unsigned char> buffer( remaining );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Deflater.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Deflater.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Deflater.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Deflater.cpp Mon Mar
 8 16:04:55 2010
@@ -208,7 +208,7 @@
             deflateParams( this->data->stream, this->data->level, this->data->strategy
);
         }
 
-        this->data->stream->avail_in = length;
+        this->data->stream->avail_in = (uInt)length;
         this->data->stream->next_in = (Bytef*)( buffer + offset );
     }
     DECAF_CATCH_RETHROW( NullPointerException )
@@ -264,7 +264,7 @@
         // (such as NULL dictionary) or the stream state is inconsistent (for example if
deflate has
         // already been called for this stream or if the compression method is bsort).
         // deflateSetDictionary does not perform any compression: this will be done by deflate().
-        if( deflateSetDictionary( this->data->stream, buffer + offset, length ) !=
Z_OK ) {
+        if( deflateSetDictionary( this->data->stream, buffer + offset, (uInt)length
) != Z_OK ) {
             throw IllegalStateException(
                 __FILE__, __LINE__, "Deflator could not accept the dictionary." );
         }
@@ -375,7 +375,7 @@
         std::size_t outStart = this->data->stream->total_out;
 
         this->data->stream->next_out = buffer + offset;
-        this->data->stream->avail_out = length;
+        this->data->stream->avail_out = (uInt)length;
 
         // Call ZLib and then process the resulting data to figure out what happened.
         int result = ::deflate( this->data->stream, this->data->flush );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Inflater.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Inflater.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Inflater.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/Inflater.cpp Mon Mar
 8 16:04:55 2010
@@ -172,7 +172,7 @@
                 __FILE__, __LINE__, "The offset + length given is greater than the specified
buffer size." );
         }
 
-        this->data->stream->avail_in = length;
+        this->data->stream->avail_in = (uInt)length;
         this->data->stream->next_in = (Bytef*)( buffer + offset );
     }
     DECAF_CATCH_RETHROW( NullPointerException )
@@ -243,7 +243,7 @@
         // as NULL dictionary) or the stream state is inconsistent, Z_DATA_ERROR if the given
dictionary
         // doesn't match the expected one (incorrect adler32 value). inflateSetDictionary
does not
         // perform any decompression: this will be done by subsequent calls of inflate().
-        int result = inflateSetDictionary( this->data->stream, buffer + offset, length
);
+        int result = inflateSetDictionary( this->data->stream, buffer + offset, (uInt)length
);
         if( result != Z_OK ) {
             throw IllegalArgumentException(
                 __FILE__, __LINE__, "Dictionary given does not match required checksum value."
);
@@ -333,7 +333,7 @@
         std::size_t outStart = this->data->stream->total_out;
 
         this->data->stream->next_out = buffer + offset;
-        this->data->stream->avail_out = length;
+        this->data->stream->avail_out = (uInt)length;
 
         // Call ZLib and then process the resulting data to figure out what happened.
         int result = ::inflate( this->data->stream, this->data->flush );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/Adler32Test.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/Adler32Test.cpp?rev=920368&r1=920367&r2=920368&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/Adler32Test.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/Adler32Test.cpp Mon Mar
 8 16:04:55 2010
@@ -145,7 +145,6 @@
     // The value of the adl should be 262148
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "update(unsigned char[],std::size_t,std::size_t) failed
to update the checksum to the correct value ",
                                   262148LL, adl.getValue() );
-    std::size_t r = 0;
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
         "Should have thrown an IndexOutOfBoundsException for lenError",



Mime
View raw message