activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1412213 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: examples/cmstemplate-stress/ main/decaf/util/concurrent/
Date Wed, 21 Nov 2012 17:53:45 GMT
Author: tabish
Date: Wed Nov 21 17:53:44 2012
New Revision: 1412213

URL: http://svn.apache.org/viewvc?rev=1412213&view=rev
Log:
Fix a bunch of compiler warnings

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Sender.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.cpp?rev=1412213&r1=1412212&r2=1412213&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.cpp
Wed Nov 21 17:53:44 2012
@@ -34,28 +34,29 @@ using namespace activemq::cmsutil;
 using namespace cmstemplate;
 
 ////////////////////////////////////////////////////////////////////////////////
-ThreadPoolExecutor* Receiver::m_threadPoolExecutor=NULL;
+ThreadPoolExecutor* Receiver::m_threadPoolExecutor = NULL;
 
 ////////////////////////////////////////////////////////////////////////////////
 Receiver::Receiver(const string & url, const string & queueOrTopicName,
-                   bool isTopic, long long receiveTimeout, bool useThreadPool) : m_ready(1)
{
+                   bool isTopic, long long receiveTimeout, bool useThreadPool) :
+        m_url(url),
+        m_mutexForCmsTemplate(),
+        m_mutexGeneral(),
+        m_isClosing(false),
+        m_ready(1),
+        m_messageListener(NULL),
+        m_cmsTemplate(NULL),
+        m_asyncReceiverThread(NULL),
+        m_receiveTimeout(receiveTimeout),
+        m_bUseThreadPool(useThreadPool),
+        m_cmsTemplateCreateTime(0),
+        m_numOfMessagingTasks(0) {
 
-    m_url = url;
-    m_messageListener = NULL;
-
-    m_bUseThreadPool = useThreadPool;
-    m_receiveTimeout = receiveTimeout;
-    m_asyncReceiverThread = NULL;
     ConnectionFactory* connectionFactory = ConnectionFactoryMgr::GetConnectionFactory(m_url);
-    m_cmsTemplateCreateTime = System::currentTimeMillis();
     m_cmsTemplate = new CmsTemplate(connectionFactory);
     m_cmsTemplate->setDefaultDestinationName(queueOrTopicName);
     m_cmsTemplate->setPubSubDomain(isTopic);
     m_cmsTemplate->setReceiveTimeout(receiveTimeout);
-
-    m_numOfMessagingTasks = 0;
-
-    m_isClosing = false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.h?rev=1412213&r1=1412212&r2=1412213&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Receiver.h Wed
Nov 21 17:53:44 2012
@@ -37,6 +37,7 @@ namespace cmstemplate {
         typedef void (DECAF_STDCALL *RecvMessageListener)( const std::string& message);
 
     private:
+
         std::string m_url;
         decaf::util::concurrent::Mutex m_mutexForCmsTemplate;
         decaf::util::concurrent::Mutex m_mutexGeneral;
@@ -59,6 +60,8 @@ namespace cmstemplate {
         static decaf::util::concurrent::ThreadPoolExecutor* m_threadPoolExecutor;
         long m_numOfMessagingTasks; //number of pending messaging tasks created by this receiver
that has been queued in the threadpool
 
+    private:
+
         virtual void WaitUntilReady();
 
         void IncreaseNumOfMessagingTasks();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Sender.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Sender.cpp?rev=1412213&r1=1412212&r2=1412213&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Sender.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/Sender.cpp Wed
Nov 21 17:53:44 2012
@@ -30,12 +30,12 @@ using namespace activemq::cmsutil;
 using namespace cmstemplate;
 
 ////////////////////////////////////////////////////////////////////////////////
-Sender::Sender(const string& url, const string& queueOrTopicName, bool isTopic, bool
isDeliveryPersistent, int timeToLive) {
+Sender::Sender(const string& url, const string& queueOrTopicName, bool isTopic, bool
isDeliveryPersistent, int timeToLive) :
+    m_cmsTemplateMutex(), m_cmsTemplate(NULL) {
 
     ConnectionFactory* connectionFactory = ConnectionFactoryMgr::GetConnectionFactory(url);
 
     m_cmsTemplate = new CmsTemplate(connectionFactory);
-
     m_cmsTemplate->setExplicitQosEnabled(true);
     m_cmsTemplate->setDefaultDestinationName(queueOrTopicName);
     m_cmsTemplate->setPubSubDomain(isTopic);

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.cpp?rev=1412213&r1=1412212&r2=1412213&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.cpp
Wed Nov 21 17:53:44 2012
@@ -40,23 +40,22 @@ void TestSenderAndReceiver::onMessage(co
     }
 }
 
+Sender* m_sender;
+Receiver* m_receiver;
+decaf::lang::Thread* m_senderThread;
+bool m_isClosing;
+int m_sendIndex;
+int m_receiveIndex;
+
 ////////////////////////////////////////////////////////////////////////////////
 TestSenderAndReceiver::TestSenderAndReceiver(const string& url, const string& queueOrTopicName,
bool isTopic,
                                              bool isDeliveryPersistent, int timeToLive, int
receiveTimeout) :
-    m_senderThread(NULL) {
+    m_sender(NULL), m_receiver(NULL), m_senderThread(NULL), m_isClosing(false), m_sendIndex(0),
m_receiveIndex(0) {
 
     m_sender = new Sender(url, queueOrTopicName, isTopic, isDeliveryPersistent, timeToLive);
-
-    //if you do not want to use the thread pool for the receiver, do the following
     m_receiver = new Receiver(url, queueOrTopicName, isTopic, receiveTimeout, true);
-
     ErrorCode errorCode = CMS_SUCCESS;
     m_receiver->RegisterMessageListener(onMessage, errorCode);
-
-    m_sendIndex = 0;
-    m_receiveIndex = 0;
-
-    m_isClosing = false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.h?rev=1412213&r1=1412212&r2=1412213&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/cmstemplate-stress/TestSenderAndReceiver.h
Wed Nov 21 17:53:44 2012
@@ -29,7 +29,6 @@
 namespace cmstemplate {
 
     class TestSenderAndReceiver : public decaf::lang::Runnable {
-
     private:
 
         Sender* m_sender;
@@ -41,6 +40,11 @@ namespace cmstemplate {
 
         static void DECAF_STDCALL onMessage(const std::string& message);
 
+    private:
+
+        TestSenderAndReceiver(const TestSenderAndReceiver&);
+        TestSenderAndReceiver& operator= (const TestSenderAndReceiver&);
+
     public:
 
         TestSenderAndReceiver(const std::string& url, const std::string& queueOrTopicName,

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp?rev=1412213&r1=1412212&r2=1412213&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/CountDownLatch.cpp
Wed Nov 21 17:53:44 2012
@@ -45,6 +45,7 @@ namespace concurrent{
         LatchSync(int count) : AbstractQueuedSynchronizer() {
             this->setState(count);
         }
+
         virtual ~LatchSync() {}
 
         int getCount() const {
@@ -77,7 +78,7 @@ namespace concurrent{
 }}}
 
 ////////////////////////////////////////////////////////////////////////////////
-CountDownLatch::CountDownLatch(int count) {
+CountDownLatch::CountDownLatch(int count) : sync(NULL) {
     if (count < 0) {
         throw IllegalArgumentException(__FILE__, __LINE__, "Count must be non-negative.");
     }



Mime
View raw message