qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r1133166 - in /qpid/trunk/qpid/cpp/src: qmf/engine/ qpid/broker/ qpid/cluster/ qpid/console/ qpid/sys/ qpid/sys/posix/ tests/
Date Tue, 07 Jun 2011 21:33:47 GMT
Author: astitcher
Date: Tue Jun  7 21:33:46 2011
New Revision: 1133166

URL: http://svn.apache.org/viewvc?rev=1133166&view=rev
Log:
QPID-3284: Eliminated warnings from gcc 4.6 compiler
- Removed a bunch of variables set but not further used.
- Rejigged some asserts which would now have unused vars
  if compiler -DNDEBUG

Modified:
    qpid/trunk/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/qpid/console/SessionManager.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
    qpid/trunk/qpid/cpp/src/tests/ForkedBroker.cpp

Modified: qpid/trunk/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/engine/ResilientConnection.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/engine/ResilientConnection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qmf/engine/ResilientConnection.cpp Tue Jun  7 21:33:46 2011
@@ -334,8 +334,7 @@ void ResilientConnectionImpl::notify()
 {
     if (notifyFd != -1)
     {
-        int unused_ret;    //Suppress warnings about ignoring return value.
-        unused_ret = ::write(notifyFd, ".", 1);
+        (void) ::write(notifyFd, ".", 1);
     }
 }
 
@@ -432,8 +431,7 @@ void ResilientConnectionImpl::EnqueueEve
 
     if (notifyFd != -1)
     {
-        int unused_ret;    //Suppress warnings about ignoring return value.
-        unused_ret = ::write(notifyFd, ".", 1);
+        (void) ::write(notifyFd, ".", 1);
     }
 }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp Tue Jun  7 21:33:46 2011
@@ -258,7 +258,6 @@ void ConnectionHandler::Handler::start(c
                                                   false ); // disallow interaction
     }
     std::string supportedMechanismsList;
-    bool requestedMechanismIsSupported = false;
     Array::const_iterator i;
 
     /*
@@ -271,11 +270,9 @@ void ConnectionHandler::Handler::start(c
             if (i != supportedMechanisms.begin())
                 supportedMechanismsList += SPACE;
             supportedMechanismsList += (*i)->get<std::string>();
-            requestedMechanismIsSupported = true;
         }
     }
     else {
-        requestedMechanismIsSupported = false;
         /*
           The caller has requested a mechanism.  If it's available,
           make sure it ends up at the head of the list.
@@ -284,7 +281,6 @@ void ConnectionHandler::Handler::start(c
             string currentMechanism = (*i)->get<std::string>();
 
             if ( requestedMechanism == currentMechanism ) {
-                requestedMechanismIsSupported = true;
                 supportedMechanismsList = currentMechanism + SPACE + supportedMechanismsList;
             } else {
                 if (i != supportedMechanisms.begin())

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp Tue Jun  7 21:33:46 2011
@@ -93,11 +93,10 @@ void Daemon::fork()
         catch (const exception& e) {
             QPID_LOG(critical, "Unexpected error: " << e.what());
             uint16_t port = 0;
-            int unused_ret;    //Supress warning about ignoring return value.
-            unused_ret = write(pipeFds[1], &port, sizeof(uint16_t));
+            (void) write(pipeFds[1], &port, sizeof(uint16_t));
 
             std::string pipeFailureMessage = e.what();
-            unused_ret = write ( pipeFds[1], 
+            (void) write ( pipeFds[1], 
                     pipeFailureMessage.c_str(), 
                     strlen(pipeFailureMessage.c_str())
                   );

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp Tue Jun  7 21:33:46 2011
@@ -167,7 +167,8 @@ void QueueFlowLimit::enqueued(const Queu
         msg.payload->getIngressCompletion().startCompleter();    // don't complete until
flow resumes
         bool unique;
         unique = index.insert(std::pair<framing::SequenceNumber, boost::intrusive_ptr<Message>
>(msg.position, msg.payload)).second;
-        assert(unique);
+        // Like this to avoid tripping up unused variable warning when NDEBUG set
+        if (!unique) assert(unique);
     }
 }
 
@@ -379,7 +380,8 @@ void QueueFlowLimit::setState(const qpid
                 QueuedMessage msg(queue->find(seq));   // fyi: msg.payload may be null
if msg is delivered & unacked
                 bool unique;
                 unique = index.insert(std::pair<framing::SequenceNumber, boost::intrusive_ptr<Message>
>(seq, msg.payload)).second;
-                assert(unique);
+                // Like this to avoid tripping up unused variable warning when NDEBUG set
+                if (!unique) assert(unique);
             }
         }
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Tue Jun  7 21:33:46 2011
@@ -365,7 +365,8 @@ void Cluster::addShadowConnection(const 
     assert(discarding);
     pair<ConnectionMap::iterator, bool> ib
         = connections.insert(ConnectionMap::value_type(c->getId(), c));
-    assert(ib.second);
+    // Like this to avoid tripping up unused variable warning when NDEBUG set
+    if (!ib.second) assert(ib.second);
 }
 
 void Cluster::erase(const ConnectionId& id) {

Modified: qpid/trunk/qpid/cpp/src/qpid/console/SessionManager.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/console/SessionManager.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/console/SessionManager.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/console/SessionManager.cpp Tue Jun  7 21:33:46 2011
@@ -362,12 +362,11 @@ void SessionManager::handleCommandComple
 
 void SessionManager::handleClassInd(Broker* broker, Buffer& inBuffer, uint32_t)
 {
-    uint8_t kind;
     string packageName;
     string className;
     uint8_t hash[16];
 
-    kind = inBuffer.getOctet();
+    /*kind*/ (void) inBuffer.getOctet();
     inBuffer.getShortString(packageName);
     inBuffer.getShortString(className);
     inBuffer.getBin128(hash);

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp Tue Jun  7 21:33:46 2011
@@ -211,10 +211,9 @@ void RdmaIOHandler::readbuff(Rdma::Async
     if (readError) {
         return;
     }
-    size_t decoded = 0;
     try {
         if (codec) {
-            decoded = codec->decode(buff->bytes(), buff->dataCount());
+            (void) codec->decode(buff->bytes(), buff->dataCount());
         }else{
             // Need to start protocol processing
             initProtocolIn(buff);
@@ -229,9 +228,7 @@ void RdmaIOHandler::readbuff(Rdma::Async
 void RdmaIOHandler::initProtocolIn(Rdma::Buffer* buff) {
     framing::Buffer in(buff->bytes(), buff->dataCount());
     framing::ProtocolInitiation protocolInit;
-    size_t decoded = 0;
     if (protocolInit.decode(in)) {
-        decoded = in.getPosition();
         QPID_LOG(debug, "Rdma: RECV [" << identifier << "] INIT(" << protocolInit
<< ")");
 
         codec = factory->create(protocolInit.getVersion(), *this, identifier, SecuritySettings());
@@ -346,12 +343,6 @@ uint16_t RdmaIOProtocolFactory::getPort(
 }
 
 void RdmaIOProtocolFactory::accept(Poller::shared_ptr poller, ConnectionCodec::Factory* fact)
{
-    ::sockaddr_in sin;
-
-    sin.sin_family = AF_INET;
-    sin.sin_port = htons(listeningPort);
-    sin.sin_addr.s_addr = INADDR_ANY;
-
     listener.reset(
         new Rdma::Listener(
             Rdma::ConnectionParams(65536, Rdma::DEFAULT_WR_ENTRIES),

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/LockFile.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/LockFile.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/LockFile.cpp Tue Jun  7 21:33:46 2011
@@ -58,8 +58,7 @@ LockFile::~LockFile() {
     if (impl) {
         int f = impl->fd;
         if (f >= 0) {
-            int unused_ret;
-            unused_ret = ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return
value.
+            (void) ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
             ::close(f);
             impl->fd = -1;
         }

Modified: qpid/trunk/qpid/cpp/src/tests/ForkedBroker.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ForkedBroker.cpp?rev=1133166&r1=1133165&r2=1133166&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ForkedBroker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/ForkedBroker.cpp Tue Jun  7 21:33:46 2011
@@ -68,8 +68,7 @@ ForkedBroker::~ForkedBroker() {
     }
     if (!dataDir.empty())
     {
-        int unused_ret; // Suppress warnings about ignoring return value.
-        unused_ret = ::system(("rm -rf "+dataDir).c_str());
+        (void) ::system(("rm -rf "+dataDir).c_str());
     }
 }
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message