activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r500371 - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq: connector/openwire/commands/ connector/stomp/ core/ io/ network/
Date Fri, 26 Jan 2007 21:53:11 GMT
Author: nmittler
Date: Fri Jan 26 13:53:10 2007
New Revision: 500371

URL: http://svn.apache.org/viewvc?view=rev&rev=500371
Log:
[AMQCPP-56] - fixing compiler warnings/errors on gcc

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/DataInputStream.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketOutputStream.cpp

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
Fri Jan 26 13:53:10 2007
@@ -417,7 +417,7 @@
          */
         virtual void setBodyBytes( 
             const unsigned char* buffer, 
-            const unsigned long long numBytes ) 
+            std::size_t numBytes ) 
                 throw( cms::CMSException );
             
         /**
@@ -433,7 +433,7 @@
          * Returns the number of bytes contained in the body of this message.
          * @return number of bytes.
          */
-        virtual unsigned long long getBodyLength(void) const;
+        virtual std::size_t getBodyLength(void) const;
         
         /**
          * Puts the message body in read-only mode and repositions the stream 
@@ -492,7 +492,7 @@
          *          been reached
          * @throws CMSException if an error occurs.
          */
-        virtual int readBytes( std::vector<unsigned char>& value ) 
+        virtual std::size_t readBytes( std::vector<unsigned char>& value ) 
             throw ( cms::CMSException );
 
         /**
@@ -528,7 +528,7 @@
          *          been reached
          * @throws CMSException
          */
-        virtual int readBytes( unsigned char*& buffer, int length ) 
+        virtual std::size_t readBytes( unsigned char*& buffer, std::size_t length ) 
             throw ( cms::CMSException );
 
         /**
@@ -540,8 +540,8 @@
          * @throws CMSException
          */
         virtual void writeBytes( const unsigned char* value,
-                                 int offset,
-                                 int length ) throw ( cms::CMSException );
+                                 std::size_t offset,
+                                 std::size_t length ) throw ( cms::CMSException );
 
         /**
          * Reads a Char from the Bytes message stream

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.cpp?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompCommandReader.cpp
Fri Jan 26 13:53:10 2007
@@ -98,12 +98,12 @@
             readStompHeaderLine();
     
             // Ignore all white space before the command.
-            std::size_t offset = -1;
+            long long offset = -1;
             for( size_t ix = 0; ix < buffer.size()-1; ++ix )
             {
                 // Find the first non whitespace character
                 if( !Character::isWhitespace(buffer[ix]) ){
-                    offset = ix;
+                    offset = (long long)ix;
                     break;
                 }
             }
@@ -111,7 +111,7 @@
             if( offset >= 0 )
             {
                 // Set the command in the frame - copy the memory.
-                frame.setCommand( reinterpret_cast<char*>(&buffer[offset]) );
+                frame.setCommand( reinterpret_cast<char*>(&buffer[(size_t)offset])
);
                 break;
             }
         

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Fri Jan 26 13:53:10 2007
@@ -22,8 +22,6 @@
 #include <activemq/core/ActiveMQConsumer.h>
 #include <activemq/exceptions/NullPointerException.h>
 
-#include <activemq/util/Config.h>
-
 using namespace cms;
 using namespace activemq;
 using namespace activemq::core;
@@ -119,7 +117,7 @@
             cms::Session* session = allSessions[ix];
             try{
                 session->close();
-            } catch( cms::CMSException& ex AMQCPP_UNUSED ){
+            } catch( cms::CMSException& ex ){
                 /* Absorb */
             }
         }

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
Fri Jan 26 13:53:10 2007
@@ -27,8 +27,6 @@
 
 #include <activemq/connector/TransactionInfo.h>
 
-#include <activemq/util/Config.h>
-
 using namespace std;
 using namespace cms;
 using namespace activemq;
@@ -95,7 +93,7 @@
             cms::Closeable* resource = allResources[ix];
             try{
                 resource->close();
-            } catch( cms::CMSException& ex AMQCPP_UNUSED ){
+            } catch( cms::CMSException& ex ){
                 /* Absorb */
             }
         }

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp
Fri Jan 26 13:53:10 2007
@@ -89,7 +89,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 void BufferedOutputStream::write( const unsigned char c ) throw ( IOException ){
     
-    if( tail >= (int)bufferSize ){
+    if( tail >= bufferSize ){
         emptyBuffer();
     }
     
@@ -103,7 +103,7 @@
     // Iterate until all the data is written.
     for( std::size_t pos=0; pos < len; ){
         
-        if( tail >= (int)bufferSize ){
+        if( tail >= bufferSize ){
             emptyBuffer();
         }
     

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/DataInputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/DataInputStream.cpp?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/DataInputStream.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/DataInputStream.cpp
Fri Jan 26 13:53:10 2007
@@ -302,7 +302,7 @@
         std::size_t n = 0;
         while( n < length ) {
             std::size_t count = inputStream->read( &buffer[offset + n], (length -
n) );
-            if( count == -1 ) {
+            if( count == (std::size_t)-1 ) {
                 throw EOFException(
                     __FILE__, __LINE__,
                     "DataInputStream::readFully - Reached EOF" );

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketOutputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketOutputStream.cpp?view=diff&rev=500371&r1=500370&r2=500371
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketOutputStream.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketOutputStream.cpp
Fri Jan 26 13:53:10 2007
@@ -28,6 +28,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <iostream>
 
 #if defined(SOCKET_NOSIGNAL)
     #define AMQ_SEND_OPTS SOCKET_NOSIGNAL
@@ -67,20 +68,20 @@
     int sendOpts = AMQ_SEND_OPTS;
 
     if( debug ){
-        printf("SocketOutputStream:write(), numbytes:%d -", len);
+        cout << "SocketOutputStream:write(), numbytes: " << len << " -
";
         for( std::size_t ix=0; ix<len; ++ix ){
             char c = buffer[ix];
             if( c > 20 ){
-                printf("%c", c );
+                cout << c;
             }
-            else printf("[%d]", c );
+            else cout << "[" << c << "]";
         }
-        printf("\n" );
+        cout << endl;
     }
         
     while( remaining > 0 )
     {
-        std::size_t length = (size_t)::send( socket, (const char*)buffer, (int)remaining,
sendOpts );      	
+        int length = ::send( socket, (const char*)buffer, (int)remaining, sendOpts );   
  	
         if( length == -1 ){
             throw IOException( __FILE__, __LINE__, 
                 "activemq::io::SocketOutputStream::write - %s", SocketError::getErrorString().c_str()
);



Mime
View raw message