From 5e5ddd5b7bad93f2f9571dea7b5eac69a524ccf4 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Wed, 7 Sep 2016 10:23:38 +0200 Subject: [PATCH] Fix further effc++ and reorder warnings. --- fairmq/FairMQDevice.cxx | 2 +- fairmq/nanomsg/FairMQSocketNN.cxx | 4 ++-- fairmq/tools/FairMQDDSTools.h | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/fairmq/FairMQDevice.cxx b/fairmq/FairMQDevice.cxx index 955b9012..d7f99f5d 100644 --- a/fairmq/FairMQDevice.cxx +++ b/fairmq/FairMQDevice.cxx @@ -47,7 +47,6 @@ static void CallSignalHandler(int signal) FairMQDevice::FairMQDevice() : fChannels() - , fConfig(nullptr) , fId() , fNetworkInterface() , fMaxInitializationAttempts(120) @@ -57,6 +56,7 @@ FairMQDevice::FairMQDevice() , fLogIntervalInMs(1000) , fCmdSocket(nullptr) , fTransportFactory(nullptr) + , fConfig(nullptr) , fInitialValidationFinished(false) , fInitialValidationCondition() , fInitialValidationMutex() diff --git a/fairmq/nanomsg/FairMQSocketNN.cxx b/fairmq/nanomsg/FairMQSocketNN.cxx index 86bff39c..6f0ce1ba 100644 --- a/fairmq/nanomsg/FairMQSocketNN.cxx +++ b/fairmq/nanomsg/FairMQSocketNN.cxx @@ -165,7 +165,7 @@ int64_t FairMQSocketNN::Send(const vector>& msgVec, co msgpack::packer packer(&sbuf); // pack all parts into a single msgpack simple buffer - for (int i = 0; i < msgVec.size(); ++i) + for (unsigned int i = 0; i < msgVec.size(); ++i) { static_cast(msgVec[i].get())->fReceiving = false; packer.pack_bin(msgVec[i]->GetSize()); @@ -270,7 +270,7 @@ int64_t FairMQSocketNN::Receive(vector>& msgVec, const // offset to be used by msgpack to handle separate chunks size_t offset = 0; - while (offset != nbytes) // continue until all parts have been read + while (offset != static_cast(nbytes)) // continue until all parts have been read { // vector of chars to hold blob (unlike char*/void* this type can be converted to by msgpack) std::vector buf; diff --git a/fairmq/tools/FairMQDDSTools.h b/fairmq/tools/FairMQDDSTools.h index 8f19484c..8ac8b521 100644 --- a/fairmq/tools/FairMQDDSTools.h +++ b/fairmq/tools/FairMQDDSTools.h @@ -21,6 +21,11 @@ using namespace dds::intercom_api; // container to hold channel config and corresponding dds key values struct DDSConfig { + DDSConfig() + : subChannels() + , ddsValues() + {} + // container of sub channels, e.g. 'i' in data[i] vector subChannels; // dds values for the channel @@ -111,7 +116,7 @@ void HandleConfigViaDDS(TMQDevice& device) if (mi->second.subChannels.size() == mi->second.ddsValues.size()) { auto it = mi->second.ddsValues.begin(); - for (int i = 0; i < mi->second.subChannels.size(); ++i) + for (unsigned int i = 0; i < mi->second.subChannels.size(); ++i) { mi->second.subChannels.at(i)->UpdateAddress(it->second); ++it;