summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-07 11:10:51 +0200
committerlouiz’ <louiz@louiz.org>2017-04-07 11:10:51 +0200
commit8a912ea3a3a74f6c4d2cb67adf3f60b4ec0a1c9f (patch)
tree1a5a65ae1ebf2bd76e6d472a189ede0ffe67ebfa /src
parent0dfeb5a94c0da9b25f0d6ed4bd27f3f6ffc5035f (diff)
downloadbiboumi-8a912ea3a3a74f6c4d2cb67adf3f60b4ec0a1c9f.tar.gz
biboumi-8a912ea3a3a74f6c4d2cb67adf3f60b4ec0a1c9f.tar.bz2
biboumi-8a912ea3a3a74f6c4d2cb67adf3f60b4ec0a1c9f.tar.xz
biboumi-8a912ea3a3a74f6c4d2cb67adf3f60b4ec0a1c9f.zip
Apply a few clang-tidy cppcoreguidelines-* fixes
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
-rw-r--r--src/network/poller.cpp2
-rw-r--r--src/network/tcp_client_socket_handler.cpp6
-rw-r--r--src/utils/system.cpp2
-rw-r--r--src/xmpp/xmpp_parser.hpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2fa72d5..2db89cc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -99,7 +99,7 @@ int main(int ac, char** av)
// Block the signals we want to manage. They will be unblocked only during
// the epoll_pwait or ppoll calls. This avoids some race conditions,
// explained in man 2 pselect on linux
- sigset_t mask;
+ sigset_t mask{};
sigemptyset(&mask);
sigaddset(&mask, SIGINT);
sigaddset(&mask, SIGTERM);
diff --git a/src/network/poller.cpp b/src/network/poller.cpp
index 9f62e36..ca49180 100644
--- a/src/network/poller.cpp
+++ b/src/network/poller.cpp
@@ -198,7 +198,7 @@ int Poller::poll(const std::chrono::milliseconds& timeout)
static const size_t max_events = 12;
struct epoll_event revents[max_events];
// Unblock all signals, only during the epoll_pwait call
- sigset_t empty_signal_set;
+ sigset_t empty_signal_set{};
sigemptyset(&empty_signal_set);
const int nb_events = ::epoll_pwait(this->epfd, revents, max_events, timeout.count(),
&empty_signal_set);
diff --git a/src/network/tcp_client_socket_handler.cpp b/src/network/tcp_client_socket_handler.cpp
index 7181c9d..35f2446 100644
--- a/src/network/tcp_client_socket_handler.cpp
+++ b/src/network/tcp_client_socket_handler.cpp
@@ -35,7 +35,7 @@ void TCPClientSocketHandler::init_socket(const struct addrinfo* rp)
// Convert the address from string format to a sockaddr that can be
// used in bind()
struct addrinfo* result;
- struct addrinfo hints;
+ struct addrinfo hints{};
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_NUMERICHOST;
hints.ai_family = AF_UNSPEC;
@@ -161,14 +161,14 @@ void TCPClientSocketHandler::connect(const std::string& address, const std::stri
this->local_port = static_cast<uint16_t>(-1);
if (rp->ai_family == AF_INET6)
{
- struct sockaddr_in6 a;
+ struct sockaddr_in6 a{};
socklen_t l = sizeof(a);
if (::getsockname(this->socket, (struct sockaddr*)&a, &l) != -1)
this->local_port = ntohs(a.sin6_port);
}
else if (rp->ai_family == AF_INET)
{
- struct sockaddr_in a;
+ struct sockaddr_in a{};
socklen_t l = sizeof(a);
if (::getsockname(this->socket, (struct sockaddr*)&a, &l) != -1)
this->local_port = ntohs(a.sin_port);
diff --git a/src/utils/system.cpp b/src/utils/system.cpp
index c0bee11..d821dec 100644
--- a/src/utils/system.cpp
+++ b/src/utils/system.cpp
@@ -9,7 +9,7 @@ namespace utils
{
std::string get_system_name()
{
- struct utsname uts;
+ struct utsname uts{};
const int res = ::uname(&uts);
if (res == -1)
{
diff --git a/src/xmpp/xmpp_parser.hpp b/src/xmpp/xmpp_parser.hpp
index 9d67228..ec42f9a 100644
--- a/src/xmpp/xmpp_parser.hpp
+++ b/src/xmpp/xmpp_parser.hpp
@@ -106,7 +106,7 @@ private:
/**
* Expat structure.
*/
- XML_Parser parser;
+ XML_Parser parser{};
/**
* The current depth in the XML document
*/