Fix warnings produced with -Weffc++ in fairmq, base/MQ and Tutorial3.

Remaining warnings originate from boost::msm and boost::mpl.
Also, warnings with missing initializer list entries for DeviceOptions are false positives, since those are PODs.
This commit is contained in:
Alexey Rybalchenko
2015-01-02 14:04:33 +01:00
committed by Florian Uhlig
parent a8854d36ac
commit ce58ee2302
36 changed files with 116 additions and 50 deletions

View File

@@ -17,6 +17,7 @@
#include <sstream>
FairMQContextZMQ::FairMQContextZMQ(int numIoThreads)
: fContext()
{
fContext = zmq_ctx_new();
if (fContext == NULL)

View File

@@ -20,13 +20,20 @@
class FairMQContextZMQ
{
public:
/// Constructor
FairMQContextZMQ(int numIoThreads);
virtual ~FairMQContextZMQ();
void* GetContext();
void Close();
private:
void* fContext;
/// Copy Constructor
FairMQContextZMQ(const FairMQContextZMQ&);
FairMQContextZMQ operator=(const FairMQContextZMQ&);
};
#endif /* FAIRMQCONTEXTZMQ_H_ */

View File

@@ -18,7 +18,10 @@
#include "FairMQMessageZMQ.h"
#include "FairMQLogger.h"
using namespace std;
FairMQMessageZMQ::FairMQMessageZMQ()
: fMessage()
{
int rc = zmq_msg_init(&fMessage);
if (rc != 0)
@@ -28,6 +31,7 @@ FairMQMessageZMQ::FairMQMessageZMQ()
}
FairMQMessageZMQ::FairMQMessageZMQ(size_t size)
: fMessage()
{
int rc = zmq_msg_init_size(&fMessage, size);
if (rc != 0)
@@ -37,6 +41,7 @@ FairMQMessageZMQ::FairMQMessageZMQ(size_t size)
}
FairMQMessageZMQ::FairMQMessageZMQ(void* data, size_t size, fairmq_free_fn *ffn, void* hint)
: fMessage()
{
int rc = zmq_msg_init_data(&fMessage, data, size, ffn ? ffn : &CleanUp, hint);
if (rc != 0)
@@ -109,7 +114,7 @@ void FairMQMessageZMQ::Copy(FairMQMessage* msg)
// CloseMessage();
// size_t size = msg->GetSize();
// zmq_msg_init_size(&fMessage, size);
// std::memcpy(zmq_msg_data(&fMessage), msg->GetData(), size);
// memcpy(zmq_msg_data(&fMessage), msg->GetData(), size);
}
inline void FairMQMessageZMQ::CloseMessage()

View File

@@ -18,6 +18,8 @@
#include "FairMQLogger.h"
FairMQPollerZMQ::FairMQPollerZMQ(const vector<FairMQSocket*>& inputs)
: items()
, fNumItems()
{
fNumItems = inputs.size();
items = new zmq_pollitem_t[fNumItems];

View File

@@ -20,7 +20,7 @@
#include "FairMQPoller.h"
#include "FairMQSocket.h"
using std::vector;
using namespace std;
class FairMQPollerZMQ : public FairMQPoller
{
@@ -36,6 +36,10 @@ class FairMQPollerZMQ : public FairMQPoller
private:
zmq_pollitem_t* items;
int fNumItems;
/// Copy Constructor
FairMQPollerZMQ(const FairMQPollerZMQ&);
FairMQPollerZMQ operator=(const FairMQPollerZMQ&);
};
#endif /* FAIRMQPOLLERZMQ_H_ */

View File

@@ -20,7 +20,9 @@
boost::shared_ptr<FairMQContextZMQ> FairMQSocketZMQ::fContext = boost::shared_ptr<FairMQContextZMQ>(new FairMQContextZMQ(1));
FairMQSocketZMQ::FairMQSocketZMQ(const string& type, int num, int numIoThreads)
: fBytesTx(0)
: fSocket(NULL)
, fId()
, fBytesTx(0)
, fBytesRx(0)
, fMessagesTx(0)
, fMessagesRx(0)

View File

@@ -61,6 +61,10 @@ class FairMQSocketZMQ : public FairMQSocket
unsigned long fMessagesRx;
static boost::shared_ptr<FairMQContextZMQ> fContext;
/// Copy Constructor
FairMQSocketZMQ(const FairMQSocketZMQ&);
FairMQSocketZMQ operator=(const FairMQSocketZMQ&);
};
#endif /* FAIRMQSOCKETZMQ_H_ */