Apply cppcoreguidelines-init-variables

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

View File

@ -147,7 +147,7 @@ auto Control::InteractiveMode() -> void
try {
RunStartupSequence();
char input; // hold the user console input
char input = 0; // hold the user console input
pollfd cinfd[1];
cinfd[0].fd = fileno(stdin);
cinfd[0].events = POLLIN;

View File

@ -390,7 +390,7 @@ void Cmds::Deserialize(const string& str, const Format type)
{
fCmds.clear();
const flatbuffers::Vector<flatbuffers::Offset<FBCommand>>* cmds;
const flatbuffers::Vector<flatbuffers::Offset<FBCommand>>* cmds = nullptr;
if (type == Format::Binary) {
cmds = cmd::GetFBCommands(const_cast<char*>(str.c_str()))->commands();

View File

@ -156,7 +156,7 @@ void sendCommand(const string& commandIn, const string& path, unsigned int timeo
return;
}
char c;
char c = 0;
string command;
TerminalConfig tconfig;
@ -185,7 +185,7 @@ try {
string targetState;
string pKey;
string pVal;
unsigned int timeout;
unsigned int timeout = 0;
fair::Logger::SetConsoleSeverity("debug");
fair::Logger::SetConsoleColor(true);

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) << ")";

View File

@ -40,9 +40,9 @@ namespace fair::mq::tools
map<string, string> getHostIPs()
{
map<string, string> addressMap;
ifaddrs* ifaddr;
ifaddrs* ifa;
int s;
ifaddrs* ifaddr = nullptr;
ifaddrs* ifa = nullptr;
int s = 0;
array<char, NI_MAXHOST> host{};
if (getifaddrs(&ifaddr) == -1) {

View File

@ -31,7 +31,7 @@ class TransportFactory final : public FairMQTransportFactory
: FairMQTransportFactory(id)
, fCtx(nullptr)
{
int major, minor, patch;
int major = 0, minor = 0, patch = 0;
zmq_version(&major, &minor, &patch);
LOG(debug) << "Transport: Using ZeroMQ library, version: " << major << "." << minor << "." << patch;