mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Fix various warnings
-Wunused-parameter -Wreorder -Wsign-compare -Wunused-private-field
This commit is contained in:
parent
811e716731
commit
72f5cdef58
|
@ -23,8 +23,6 @@ Sink::Sink()
|
||||||
: fMaxIterations(0)
|
: fMaxIterations(0)
|
||||||
, fNumIterations1(0)
|
, fNumIterations1(0)
|
||||||
, fNumIterations2(0)
|
, fNumIterations2(0)
|
||||||
, fReceived1(false)
|
|
||||||
, fReceived2(false)
|
|
||||||
{
|
{
|
||||||
// register a handler for data arriving on "data" channel
|
// register a handler for data arriving on "data" channel
|
||||||
OnData("data1", &Sink::HandleData1);
|
OnData("data1", &Sink::HandleData1);
|
||||||
|
|
|
@ -36,8 +36,6 @@ class Sink : public FairMQDevice
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations;
|
||||||
uint64_t fNumIterations1;
|
uint64_t fNumIterations1;
|
||||||
uint64_t fNumIterations2;
|
uint64_t fNumIterations2;
|
||||||
bool fReceived1;
|
|
||||||
bool fReceived2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace example_multiple_transports
|
} // namespace example_multiple_transports
|
||||||
|
|
|
@ -38,7 +38,7 @@ void Sampler::InitTask()
|
||||||
fRegion = FairMQUnmanagedRegionPtr(NewUnmanagedRegionFor("data",
|
fRegion = FairMQUnmanagedRegionPtr(NewUnmanagedRegionFor("data",
|
||||||
0,
|
0,
|
||||||
10000000,
|
10000000,
|
||||||
[this](void* data, size_t size, void* hint) { // callback to be called when message buffers no longer needed by transport
|
[this](void* /*data*/, size_t /*size*/, void* /*hint*/) { // callback to be called when message buffers no longer needed by transport
|
||||||
--fNumUnackedMsgs;
|
--fNumUnackedMsgs;
|
||||||
if (fMaxIterations > 0)
|
if (fMaxIterations > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,7 @@ FairMQChannel::FairMQChannel()
|
||||||
, fType("unspecified")
|
, fType("unspecified")
|
||||||
, fMethod("unspecified")
|
, fMethod("unspecified")
|
||||||
, fAddress("unspecified")
|
, fAddress("unspecified")
|
||||||
|
, fTransportType(fair::mq::Transport::DEFAULT)
|
||||||
, fSndBufSize(1000)
|
, fSndBufSize(1000)
|
||||||
, fRcvBufSize(1000)
|
, fRcvBufSize(1000)
|
||||||
, fSndKernelSize(0)
|
, fSndKernelSize(0)
|
||||||
|
@ -35,7 +36,6 @@ FairMQChannel::FairMQChannel()
|
||||||
, fRateLogging(1)
|
, fRateLogging(1)
|
||||||
, fName("")
|
, fName("")
|
||||||
, fIsValid(false)
|
, fIsValid(false)
|
||||||
, fTransportType(fair::mq::Transport::DEFAULT)
|
|
||||||
, fTransportFactory(nullptr)
|
, fTransportFactory(nullptr)
|
||||||
, fMultipart(false)
|
, fMultipart(false)
|
||||||
, fModified(true)
|
, fModified(true)
|
||||||
|
@ -48,6 +48,7 @@ FairMQChannel::FairMQChannel(const string& type, const string& method, const str
|
||||||
, fType(type)
|
, fType(type)
|
||||||
, fMethod(method)
|
, fMethod(method)
|
||||||
, fAddress(address)
|
, fAddress(address)
|
||||||
|
, fTransportType(fair::mq::Transport::DEFAULT)
|
||||||
, fSndBufSize(1000)
|
, fSndBufSize(1000)
|
||||||
, fRcvBufSize(1000)
|
, fRcvBufSize(1000)
|
||||||
, fSndKernelSize(0)
|
, fSndKernelSize(0)
|
||||||
|
@ -55,7 +56,6 @@ FairMQChannel::FairMQChannel(const string& type, const string& method, const str
|
||||||
, fRateLogging(1)
|
, fRateLogging(1)
|
||||||
, fName("")
|
, fName("")
|
||||||
, fIsValid(false)
|
, fIsValid(false)
|
||||||
, fTransportType(fair::mq::Transport::DEFAULT)
|
|
||||||
, fTransportFactory(nullptr)
|
, fTransportFactory(nullptr)
|
||||||
, fMultipart(false)
|
, fMultipart(false)
|
||||||
, fModified(true)
|
, fModified(true)
|
||||||
|
@ -68,6 +68,7 @@ FairMQChannel::FairMQChannel(const string& name, const string& type, std::shared
|
||||||
, fType(type)
|
, fType(type)
|
||||||
, fMethod("unspecified")
|
, fMethod("unspecified")
|
||||||
, fAddress("unspecified")
|
, fAddress("unspecified")
|
||||||
|
, fTransportType(factory->GetType())
|
||||||
, fSndBufSize(1000)
|
, fSndBufSize(1000)
|
||||||
, fRcvBufSize(1000)
|
, fRcvBufSize(1000)
|
||||||
, fSndKernelSize(0)
|
, fSndKernelSize(0)
|
||||||
|
@ -75,7 +76,6 @@ FairMQChannel::FairMQChannel(const string& name, const string& type, std::shared
|
||||||
, fRateLogging(1)
|
, fRateLogging(1)
|
||||||
, fName(name)
|
, fName(name)
|
||||||
, fIsValid(false)
|
, fIsValid(false)
|
||||||
, fTransportType(factory->GetType())
|
|
||||||
, fTransportFactory(factory)
|
, fTransportFactory(factory)
|
||||||
, fMultipart(false)
|
, fMultipart(false)
|
||||||
, fModified(true)
|
, fModified(true)
|
||||||
|
@ -88,6 +88,7 @@ FairMQChannel::FairMQChannel(const FairMQChannel& chan)
|
||||||
, fType(chan.fType)
|
, fType(chan.fType)
|
||||||
, fMethod(chan.fMethod)
|
, fMethod(chan.fMethod)
|
||||||
, fAddress(chan.fAddress)
|
, fAddress(chan.fAddress)
|
||||||
|
, fTransportType(chan.fTransportType)
|
||||||
, fSndBufSize(chan.fSndBufSize)
|
, fSndBufSize(chan.fSndBufSize)
|
||||||
, fRcvBufSize(chan.fRcvBufSize)
|
, fRcvBufSize(chan.fRcvBufSize)
|
||||||
, fSndKernelSize(chan.fSndKernelSize)
|
, fSndKernelSize(chan.fSndKernelSize)
|
||||||
|
@ -95,7 +96,6 @@ FairMQChannel::FairMQChannel(const FairMQChannel& chan)
|
||||||
, fRateLogging(chan.fRateLogging)
|
, fRateLogging(chan.fRateLogging)
|
||||||
, fName(chan.fName)
|
, fName(chan.fName)
|
||||||
, fIsValid(false)
|
, fIsValid(false)
|
||||||
, fTransportType(chan.fTransportType)
|
|
||||||
, fTransportFactory(nullptr)
|
, fTransportFactory(nullptr)
|
||||||
, fMultipart(chan.fMultipart)
|
, fMultipart(chan.fMultipart)
|
||||||
, fModified(chan.fModified)
|
, fModified(chan.fModified)
|
||||||
|
|
|
@ -501,7 +501,7 @@ void FairMQDevice::RunWrapper()
|
||||||
while (CheckCurrentState(RUNNING) && ConditionalRun())
|
while (CheckCurrentState(RUNNING) && ConditionalRun())
|
||||||
{
|
{
|
||||||
if (fRate > 0.001) {
|
if (fRate > 0.001) {
|
||||||
auto timespan = chrono::duration_cast<TimeScale>(Clock::now() - reftime).count() - fLastTime;
|
auto timespan = static_cast<TimeScale::rep>(chrono::duration_cast<TimeScale>(Clock::now() - reftime).count() - fLastTime);
|
||||||
if (timespan < period) {
|
if (timespan < period) {
|
||||||
TimeScale sleepfor(period - timespan);
|
TimeScale sleepfor(period - timespan);
|
||||||
this_thread::sleep_for(sleepfor);
|
this_thread::sleep_for(sleepfor);
|
||||||
|
|
|
@ -72,8 +72,7 @@ struct Machine_ : public msmf::state_machine_def<Machine_>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Machine_()
|
Machine_()
|
||||||
: fState()
|
: fWork()
|
||||||
, fWork()
|
|
||||||
, fWorkAvailableCondition()
|
, fWorkAvailableCondition()
|
||||||
, fWorkDoneCondition()
|
, fWorkDoneCondition()
|
||||||
, fWorkMutex()
|
, fWorkMutex()
|
||||||
|
@ -83,6 +82,7 @@ struct Machine_ : public msmf::state_machine_def<Machine_>
|
||||||
, fStateChangeSignal()
|
, fStateChangeSignal()
|
||||||
, fStateChangeSignalsMap()
|
, fStateChangeSignalsMap()
|
||||||
, fTerminationRequested(false)
|
, fTerminationRequested(false)
|
||||||
|
, fState()
|
||||||
, fWorkerThread()
|
, fWorkerThread()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -521,8 +521,8 @@ _Pragma("GCC diagnostic pop")
|
||||||
using namespace fair::mq::fsm;
|
using namespace fair::mq::fsm;
|
||||||
|
|
||||||
FairMQStateMachine::FairMQStateMachine()
|
FairMQStateMachine::FairMQStateMachine()
|
||||||
: fFsm(new FairMQFSM)
|
: fChangeStateMutex()
|
||||||
, fChangeStateMutex()
|
, fFsm(new FairMQFSM)
|
||||||
{
|
{
|
||||||
static_pointer_cast<FairMQFSM>(fFsm)->fInitWrapperHandler = bind(&FairMQStateMachine::InitWrapper, this);
|
static_pointer_cast<FairMQFSM>(fFsm)->fInitWrapperHandler = bind(&FairMQStateMachine::InitWrapper, this);
|
||||||
static_pointer_cast<FairMQFSM>(fFsm)->fInitTaskWrapperHandler = bind(&FairMQStateMachine::InitTaskWrapper, this);
|
static_pointer_cast<FairMQFSM>(fFsm)->fInitTaskWrapperHandler = bind(&FairMQStateMachine::InitTaskWrapper, this);
|
||||||
|
|
|
@ -52,8 +52,8 @@ struct IofN
|
||||||
, fEntries()
|
, fEntries()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
int fI;
|
unsigned int fI;
|
||||||
int fN;
|
unsigned int fN;
|
||||||
std::vector<std::string> fEntries;
|
std::vector<std::string> fEntries;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -238,7 +238,7 @@ int FairMQSocketSHM::ReceiveImpl(FairMQMessagePtr& msg, const int flags, const i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t FairMQSocketSHM::SendImpl(vector<FairMQMessagePtr>& msgVec, const int flags, const int timeout)
|
int64_t FairMQSocketSHM::SendImpl(vector<FairMQMessagePtr>& msgVec, const int flags, const int /*timeout*/)
|
||||||
{
|
{
|
||||||
const unsigned int vecSize = msgVec.size();
|
const unsigned int vecSize = msgVec.size();
|
||||||
int64_t totalSize = 0;
|
int64_t totalSize = 0;
|
||||||
|
@ -318,7 +318,7 @@ int64_t FairMQSocketSHM::SendImpl(vector<FairMQMessagePtr>& msgVec, const int fl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int64_t FairMQSocketSHM::ReceiveImpl(vector<FairMQMessagePtr>& msgVec, const int flags, const int timeout)
|
int64_t FairMQSocketSHM::ReceiveImpl(vector<FairMQMessagePtr>& msgVec, const int flags, const int /*timeout*/)
|
||||||
{
|
{
|
||||||
int64_t totalSize = 0;
|
int64_t totalSize = 0;
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <FairMQDevice.h>
|
#include <FairMQDevice.h>
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
namespace fair
|
namespace fair
|
||||||
|
@ -53,7 +54,7 @@ class PairLeft : public FairMQDevice
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
auto content = std::string{static_cast<char*>(msg6->GetData()), msg6->GetSize()};
|
auto content = std::string{static_cast<char*>(msg6->GetData()), msg6->GetSize()};
|
||||||
LOG(info) << ret << ", " << msg6->GetSize() << ", '" << content << "'";
|
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";
|
if (counter == 6) LOG(info) << "Simple message with short text data successfull";
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#include <FairMQDevice.h>
|
#include <FairMQDevice.h>
|
||||||
|
#include <cstddef>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
@ -51,7 +52,7 @@ class PairRight : public FairMQDevice
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
auto content = std::string{static_cast<char*>(msg5->GetData()), msg5->GetSize()};
|
auto content = std::string{static_cast<char*>(msg5->GetData()), msg5->GetSize()};
|
||||||
LOG(info) << ret << ", " << msg5->GetSize() << ", '" << content << "'";
|
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"));
|
auto msg6(NewSimpleMessageFor("data", 0, "testdata1234"));
|
||||||
if (Send(msg6, "data") >= 0) counter++;
|
if (Send(msg6, "data") >= 0) counter++;
|
||||||
|
|
|
@ -63,7 +63,7 @@ TEST_F(PluginServices, ConfigCallbacks)
|
||||||
if (key == "chans.data.0.address") { ASSERT_EQ(value, "tcp://localhost:4321"); }
|
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") {
|
if(key == "chans.data.0.rcvBufSize") {
|
||||||
FAIL(); // should not be called because we unsubscribed
|
FAIL(); // should not be called because we unsubscribed
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ TEST(PluginManager, LoadPluginStatic)
|
||||||
|
|
||||||
// program options
|
// program options
|
||||||
auto count = 0;
|
auto count = 0;
|
||||||
mgr.ForEachPluginProgOptions([&count](const options_description& d){ ++count; });
|
mgr.ForEachPluginProgOptions([&count](const options_description&){ ++count; });
|
||||||
ASSERT_EQ(count, 1);
|
ASSERT_EQ(count, 1);
|
||||||
|
|
||||||
mgr.WaitForPluginsToReleaseDeviceControl();
|
mgr.WaitForPluginsToReleaseDeviceControl();
|
||||||
|
|
|
@ -38,7 +38,7 @@ TEST(StateMachine, RegularFSM)
|
||||||
ASSERT_NO_THROW(fsm.ChangeState(T::Automatic));
|
ASSERT_NO_THROW(fsm.ChangeState(T::Automatic));
|
||||||
|
|
||||||
int cnt{0};
|
int cnt{0};
|
||||||
fsm.SubscribeToStateQueued("test", [&](S newState, S lastState){
|
fsm.SubscribeToStateQueued("test", [&](S /*newState*/, S /*lastState*/){
|
||||||
++cnt;
|
++cnt;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user