[asterisk-scf-commits] asterisk-scf/release/servicediscovery.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Apr 15 09:15:43 CDT 2011


branch "master" has been updated
       via  b3da3ccb85932f5668ffb2ff18a67af72a396d93 (commit)
      from  d9ef2a8b4092b1258b81e8df01c1c052edb2517f (commit)

Summary of changes:
 src/ServiceLocator.cpp           |    6 +++---
 src/ServiceLocatorManagement.cpp |   16 ++++++++--------
 src/ServiceManagement.cpp        |   24 ++++++++++++------------
 test/TestComparatorBlocking.cpp  |    4 ++--
 test/TestServiceLocator.cpp      |   10 +++++-----
 5 files changed, 30 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit b3da3ccb85932f5668ffb2ff18a67af72a396d93
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Apr 14 13:25:27 2011 -0500

    Minor fixes for various code constructs that trip up GCC with new warning
    options enabled (-Wextra, -Wconversion, -Wformat, and others).

diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 9c4f70b..4924b0a 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -102,8 +102,8 @@ void ServiceLocatorImpl::locateAll_async(const AMD_ServiceLocator_locateAllPtr&
     mLocatorServiceManagement->locateAll(cb, params);
 }
 
-void ServiceLocatorApp::start(const string& name, const Ice::CommunicatorPtr& communicator,
-    const Ice::StringSeq& args)
+void ServiceLocatorApp::start(const string&, const Ice::CommunicatorPtr& communicator,
+    const Ice::StringSeq&)
 {
     mIceStorm = new AsteriskSCF::ServiceDiscovery::CollocatedIceStorm("AsteriskSCFIceStorm", communicator->getProperties());
 
@@ -210,7 +210,7 @@ void ServiceLocatorApp::stop()
 
 extern "C"
 {
-ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new ServiceLocatorApp;
 }
diff --git a/src/ServiceLocatorManagement.cpp b/src/ServiceLocatorManagement.cpp
index 79fc22e..b4d2943 100644
--- a/src/ServiceLocatorManagement.cpp
+++ b/src/ServiceLocatorManagement.cpp
@@ -174,21 +174,21 @@ class LocateCallback : public IsSupportedCallback
 public:
     LocateCallback(const LocateCollectorPtr& collector,
         const ServiceManagementImplPtr& management) :
-        collector(collector),
-        management(management)
+        mCollector(collector),
+        mManagement(management)
     {
     }
 
-    void result(bool result)
+    void result(bool res)
     {
         // delegation to thread safe object
         // no lock needed
-        collector->invoke(LocateParam(result, management));
-        collector = 0;
+        mCollector->invoke(LocateParam(res, mManagement));
+        mCollector = 0;
     }
 private:
-    LocateCollectorPtr collector;
-    ServiceManagementImplPtr management;
+    LocateCollectorPtr mCollector;
+    ServiceManagementImplPtr mManagement;
 };
 typedef IceUtil::Handle<LocateCallback> LocateCallbackPtr;
 
@@ -368,7 +368,7 @@ void ServiceLocatorManagementImpl::removeCompare(const string& guid, const Ice::
 {
     lg(Info) << "removeCompare(" << guid << ')';
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-    int erased = mImpl->mCompares.erase(guid);
+    std::map<std::string, ServiceLocatorParamsComparePrx>::size_type erased = mImpl->mCompares.erase(guid);
 
     if (!erased)
     {
diff --git a/src/ServiceManagement.cpp b/src/ServiceManagement.cpp
index 6542f01..eeb3fb7 100644
--- a/src/ServiceManagement.cpp
+++ b/src/ServiceManagement.cpp
@@ -189,24 +189,24 @@ class CountedIsSupported :
 {
 public:
     CountedIsSupported(const IsSupportedCallbackPtr& callback, size_t numVotes) :
-        callback(callback)
+        mCallback(callback)
     {
         init(numVotes);
     }
 
-    void result(bool result) { invoke(result); }
+    void result(bool res) { invoke(res); }
 
 protected:
-    void processInvocation(bool result)
+    void processInvocation(bool res)
     {
-        // any affirmitive vote means success
-        if (result)
+        // any affirmative vote means success
+        if (res)
         {
             boost::lock_guard<boost::mutex> guard(mMutex);
-            if (callback)
+            if (mCallback)
             {
-                callback->result(true);
-                callback = 0;
+                mCallback->result(true);
+                mCallback = 0;
             }
         }
     }
@@ -215,15 +215,15 @@ protected:
     {
         boost::lock_guard<boost::mutex> guard(mMutex);
         // all negative votes means failure
-        if (callback)
+        if (mCallback)
         {
-            callback->result(false);
-            callback = 0;
+            mCallback->result(false);
+            mCallback = 0;
         }
     }
 
 private:
-    IsSupportedCallbackPtr callback;
+    IsSupportedCallbackPtr mCallback;
 };
 
 /**
diff --git a/test/TestComparatorBlocking.cpp b/test/TestComparatorBlocking.cpp
index 82294d4..c10b0da 100644
--- a/test/TestComparatorBlocking.cpp
+++ b/test/TestComparatorBlocking.cpp
@@ -90,14 +90,14 @@ class BlockingCallback : public IceUtil::Shared
 public:
     BlockingCallback() : beenCalled(false) {}
 
-    void locateCB(const Ice::ObjectPrx& located)
+    void locateCB(const Ice::ObjectPrx&)
     {
         boost::unique_lock<boost::mutex> lock(mut);
         beenCalled = true;
         cond.notify_one();
     }
 
-    void locateFailureCB(const Ice::Exception& e)
+    void locateFailureCB(const Ice::Exception&)
     {
         boost::unique_lock<boost::mutex> lock(mut);
         beenCalled = true;
diff --git a/test/TestServiceLocator.cpp b/test/TestServiceLocator.cpp
index 3c7292d..e52e1fc 100644
--- a/test/TestServiceLocator.cpp
+++ b/test/TestServiceLocator.cpp
@@ -735,20 +735,20 @@ BOOST_AUTO_TEST_CASE(FindServiceAfterUnregister)
     BOOST_CHECK(!found);
 }
 
-void ServiceLocatorTest::start(std::string const &name,
-    Ice::CommunicatorPtr const &communicator,
-    Ice::StringSeq const &args)
+void ServiceLocatorTest::start(std::string const& name,
+    Ice::CommunicatorPtr const&,
+    Ice::StringSeq const& args)
 {
     std::vector<char const *> argv;
     argv.push_back(name.c_str());
     for (Ice::StringSeq::const_iterator i = args.begin(); i != args.end(); ++i)
     {
         argv.push_back(i->c_str());
+	mCachedArgs.argc++;
     }
     // null terminated list
     argv.push_back((const char*)0);
 
-    mCachedArgs.argc = argv.size() - 1;
     mCachedArgs.argv = (char**)&argv[0];
 
     int r = ::boost::unit_test::unit_test_main(&init_unit_test, mCachedArgs.argc, mCachedArgs.argv);
@@ -761,7 +761,7 @@ void ServiceLocatorTest::stop()
 
 extern "C"
 {
-IceBox::Service* create(Ice::CommunicatorPtr communicator)
+IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new ServiceLocatorTest;
 }

-----------------------------------------------------------------------


-- 
asterisk-scf/release/servicediscovery.git



More information about the asterisk-scf-commits mailing list