You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by nm...@apache.org on 2007/01/21 17:01:50 UTC

svn commit: r498391 - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq: connector/openwire/utils/OpenwireStringSupport.cpp exceptions/ActiveMQException.cpp exceptions/ActiveMQException.h transport/ResponseCorrelator.h

Author: nmittler
Date: Sun Jan 21 08:01:49 2007
New Revision: 498391

URL: http://svn.apache.org/viewvc?view=rev&rev=498391
Log:
[AMQCPP-49] - cleanup of several warnings under cygwin gcc 3.x

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.h
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp?view=diff&rev=498391&r1=498390&r2=498391
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/OpenwireStringSupport.cpp Sun Jan 21 08:01:49 2007
@@ -42,7 +42,7 @@
             value.resize( utflen );
             dataIn.readFully( value );            
 
-            int c, char2, char3;
+            int c;//, char2, char3;
             int count = 0;
             
             while( count < utflen )
@@ -134,7 +134,7 @@
                     Integer::toString( str->size() ) + " characters long." ).c_str() );
             }
             
-            short strlen = (short)str->size();
+            //short strlen = (short)str->size();
             short utflen = 0;
             int c, count = 0;
             

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.cpp?view=diff&rev=498391&r1=498390&r2=498391
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.cpp Sun Jan 21 08:01:49 2007
@@ -23,6 +23,40 @@
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
+ActiveMQException::ActiveMQException(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQException::ActiveMQException( const ActiveMQException& ex )
+: cms::CMSException()
+{
+    *this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQException::ActiveMQException( const char* file, const int lineNumber, 
+                   const char* msg, ... )
+{
+    va_list vargs;
+    va_start( vargs, msg ) ;
+    buildMessage( msg, vargs );
+    
+    // Set the first mark for this exception.
+    setMark( file, lineNumber );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQException::~ActiveMQException(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQException::setMessage( const char* msg, ... ){
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ActiveMQException::buildMessage(const char* format, va_list& vargs)
 {
     // Allocate buffer with a guess of it's size
@@ -71,5 +105,48 @@
     //logger.log( stream.str() );    
 }
 
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQException* ActiveMQException::clone() const{
+    return new ActiveMQException( *this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector< std::pair< std::string, int> > ActiveMQException::getStackTrace() const{ 
+    return stackTrace; 
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQException::printStackTrace() const{
+    printStackTrace( std::cerr );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQException::printStackTrace( std::ostream& stream ) const{
+    stream << getStackTraceString();
+}
 
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQException::getStackTraceString() const{
+    
+    // Create the output stream.
+    std::ostringstream stream;
+    
+    // Write the message and each stack entry.
+    stream << message << std::endl;
+    for( unsigned int ix=0; ix<stackTrace.size(); ++ix ){
+        stream << "\tFILE: " << stackTrace[ix].first;
+        stream << ", LINE: " << stackTrace[ix].second;
+        stream << std::endl;                    
+    }
+    
+    // Return the string from the output stream.
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQException& ActiveMQException::operator =( const ActiveMQException& ex ){
+    this->message = ex.message;
+    this->stackTrace = ex.stackTrace;
+    return *this;
+}
 

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.h?view=diff&rev=498391&r1=498390&r2=498391
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/exceptions/ActiveMQException.h Sun Jan 21 08:01:49 2007
@@ -47,16 +47,12 @@
         /**
          * Default Constructor
          */
-        ActiveMQException() {}
+        ActiveMQException();
        
         /**
          * Copy Constructor
          */
-        ActiveMQException( const ActiveMQException& ex )
-        : cms::CMSException()
-        {
-            *this = ex;
-        }
+        ActiveMQException( const ActiveMQException& ex );
        
         /**
          * Constructor - Initializes the file name and line number where
@@ -68,17 +64,9 @@
          * @param list of primitives that are formatted into the message
          */
         ActiveMQException( const char* file, const int lineNumber, 
-                           const char* msg, ... )
-        {
-            va_list vargs;
-            va_start( vargs, msg ) ;
-            buildMessage( msg, vargs );
-            
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+                           const char* msg, ... );
 
-        virtual ~ActiveMQException(){}
+        virtual ~ActiveMQException();
    
         /**
          * Gets the message for this exception.
@@ -93,11 +81,7 @@
          * @param msg the format string for the msg.
          * @param variable - params to format into the string
          */
-        virtual void setMessage( const char* msg, ... ){
-            va_list vargs;
-            va_start(vargs, msg);
-            buildMessage(msg, vargs);
-        }
+        virtual void setMessage( const char* msg, ... );
         
         /**
          * Adds a file/line number to the stack trace.
@@ -112,9 +96,7 @@
          * All subclasses should override.
          * @return Copy of this Exception object
          */
-        virtual ActiveMQException* clone() const{
-            return new ActiveMQException( *this );
-        }
+        virtual ActiveMQException* clone() const;
         
         /**
          * Provides the stack trace for every point where
@@ -123,55 +105,30 @@
          * was set (e.g. where the exception was created).  
          * @return the stack trace.
          */
-        virtual std::vector< std::pair< std::string, int> > getStackTrace() const{ 
-            return stackTrace; 
-        }
+        virtual std::vector< std::pair< std::string, int> > getStackTrace() const;
 
         /**
          * Prints the stack trace to std::err
          */
-        virtual void printStackTrace() const{
-            printStackTrace( std::cerr );
-        }
+        virtual void printStackTrace() const;
         
         /**
          * Prints the stack trace to the given output stream.
          * @param stream the target output stream.
          */
-        virtual void printStackTrace( std::ostream& stream ) const{
-            stream << getStackTraceString();
-        }
+        virtual void printStackTrace( std::ostream& stream ) const;
         
         /**
          * Gets the stack trace as one contiguous string.
          * @return string with formatted stack trace data
          */
-        virtual std::string getStackTraceString() const{
-            
-            // Create the output stream.
-            std::ostringstream stream;
-            
-            // Write the message and each stack entry.
-            stream << message << std::endl;
-            for( unsigned int ix=0; ix<stackTrace.size(); ++ix ){
-                stream << "\tFILE: " << stackTrace[ix].first;
-                stream << ", LINE: " << stackTrace[ix].second;
-                stream << std::endl;                    
-            }
-            
-            // Return the string from the output stream.
-            return stream.str();
-        }
+        virtual std::string getStackTraceString() const;
         
         /**
          * Assignment operator.
          * @param const reference to another ActiveMQException
          */
-        virtual ActiveMQException& operator =( const ActiveMQException& ex ){
-            this->message = ex.message;
-            this->stackTrace = ex.stackTrace;
-            return *this;
-        }
+        virtual ActiveMQException& operator =( const ActiveMQException& ex );
         
     protected:
    

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h?view=diff&rev=498391&r1=498390&r2=498391
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h Sun Jan 21 08:01:49 2007
@@ -269,7 +269,8 @@
                 }
                 
                 // Get the future response (if it's in the map, it's not NULL).
-                FutureResponse* futureResponse = iter->second;
+                FutureResponse* futureResponse = NULL;
+                futureResponse = iter->second;
                 
                 // If it's an exception response, notify the exception listener.
                 ExceptionResponse* exResp =