Apply cppcoreguidelines-init-variables

This commit is contained in:
Alexey Rybalchenko
2021-05-26 12:44:04 +02:00
parent 904771e9fa
commit 95b3cdab28
8 changed files with 14 additions and 14 deletions

View File

@@ -313,8 +313,8 @@ void Monitor::ReceiveHeartbeats()
try {
bipc::message_queue mq(bipc::open_or_create, fControlQueueName.c_str(), 1000, 256);
unsigned int priority;
bipc::message_queue::size_type recvdSize;
unsigned int priority = 0;
bipc::message_queue::size_type recvdSize = 0;
char msg[256] = {0};
while (!fTerminating) {
@@ -337,7 +337,7 @@ void Monitor::ReceiveHeartbeats()
void Monitor::Interactive()
{
char c;
char c = 0;
pollfd cinfd[1];
cinfd[0].fd = fileno(stdin);
cinfd[0].events = POLLIN;

View File

@@ -179,8 +179,8 @@ struct Region
}
void ReceiveAcks()
{
unsigned int priority;
boost::interprocess::message_queue::size_type recvdSize;
unsigned int priority = 0;
boost::interprocess::message_queue::size_type recvdSize = 0;
std::unique_ptr<RegionBlock[]> blocks = std::make_unique<RegionBlock[]>(fAckBunchSize);
std::vector<fair::mq::RegionBlock> result;
result.reserve(fAckBunchSize);

View File

@@ -41,7 +41,7 @@ class TransportFactory final : public fair::mq::TransportFactory
, fZmqCtx(zmq_ctx_new())
, fManager(nullptr)
{
int major, minor, patch;
int major = 0, minor = 0, patch = 0;
zmq_version(&major, &minor, &patch);
LOG(debug) << "Transport: Using ZeroMQ (" << major << "." << minor << "." << patch << ") & "
<< "boost::interprocess (" << (BOOST_VERSION / 100000) << "." << (BOOST_VERSION / 100 % 1000) << "." << (BOOST_VERSION % 100) << ")";