Fix various warnings

-Wunused-parameter
-Wreorder
-Wsign-compare
-Wunused-private-field
This commit is contained in:
Dennis Klein
2018-05-24 11:07:39 +02:00
committed by Mohammad Al-Turany
parent 811e716731
commit 72f5cdef58
13 changed files with 22 additions and 24 deletions

View File

@@ -8,6 +8,7 @@
#include <FairMQDevice.h>
#include <cstddef>
#include <thread>
namespace fair
@@ -53,7 +54,7 @@ class PairLeft : public FairMQDevice
if (ret > 0) {
auto content = std::string{static_cast<char*>(msg6->GetData()), msg6->GetSize()};
LOG(info) << ret << ", " << msg6->GetSize() << ", '" << content << "'";
if (msg6->GetSize() == ret && content == "testdata1234") counter++;
if (msg6->GetSize() == static_cast<std::size_t>(ret) && content == "testdata1234") counter++;
}
if (counter == 6) LOG(info) << "Simple message with short text data successfull";

View File

@@ -7,6 +7,7 @@
********************************************************************************/
#include <FairMQDevice.h>
#include <cstddef>
#include <string>
#include <thread>
@@ -51,7 +52,7 @@ class PairRight : public FairMQDevice
if (ret > 0) {
auto content = std::string{static_cast<char*>(msg5->GetData()), msg5->GetSize()};
LOG(info) << ret << ", " << msg5->GetSize() << ", '" << content << "'";
if (msg5->GetSize() == ret && content == "testdata1234") counter++;
if (msg5->GetSize() == static_cast<std::size_t>(ret) && content == "testdata1234") counter++;
}
auto msg6(NewSimpleMessageFor("data", 0, "testdata1234"));
if (Send(msg6, "data") >= 0) counter++;

View File

@@ -63,7 +63,7 @@ TEST_F(PluginServices, ConfigCallbacks)
if (key == "chans.data.0.address") { ASSERT_EQ(value, "tcp://localhost:4321"); }
});
mServices.SubscribeToPropertyChange<int>("test", [](const string& key, int value) {
mServices.SubscribeToPropertyChange<int>("test", [](const string& key, int /*value*/) {
if(key == "chans.data.0.rcvBufSize") {
FAIL(); // should not be called because we unsubscribed
}

View File

@@ -88,7 +88,7 @@ TEST(PluginManager, LoadPluginStatic)
// program options
auto count = 0;
mgr.ForEachPluginProgOptions([&count](const options_description& d){ ++count; });
mgr.ForEachPluginProgOptions([&count](const options_description&){ ++count; });
ASSERT_EQ(count, 1);
mgr.WaitForPluginsToReleaseDeviceControl();

View File

@@ -38,7 +38,7 @@ TEST(StateMachine, RegularFSM)
ASSERT_NO_THROW(fsm.ChangeState(T::Automatic));
int cnt{0};
fsm.SubscribeToStateQueued("test", [&](S newState, S lastState){
fsm.SubscribeToStateQueued("test", [&](S /*newState*/, S /*lastState*/){
++cnt;
});