From ae02e58b9dc276b247be84e1d708ca50a1f5bbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 31 Oct 2016 13:54:25 +0100 Subject: Some cleanups --- louloulibs/utils/encoding.cpp | 8 ++------ louloulibs/xmpp/xmpp_component.cpp | 3 +-- src/irc/irc_client.cpp | 2 +- src/main.cpp | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/louloulibs/utils/encoding.cpp b/louloulibs/utils/encoding.cpp index 712028e..cb953c0 100644 --- a/louloulibs/utils/encoding.cpp +++ b/louloulibs/utils/encoding.cpp @@ -196,12 +196,8 @@ namespace utils outbuf_ptr++; done = true; break; - case E2BIG: - // This should never happen - done = true; - break; - default: - // This should happen even neverer + case E2BIG: // This should never happen + default: // This should happen even neverer done = true; break; } diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp index 17fde20..3ac617c 100644 --- a/louloulibs/xmpp/xmpp_component.cpp +++ b/louloulibs/xmpp/xmpp_component.cpp @@ -222,9 +222,8 @@ void XmppComponent::close_document() this->doc_open = false; } -void XmppComponent::handle_handshake(const Stanza& stanza) +void XmppComponent::handle_handshake(const Stanza&) { - (void)stanza; this->authenticated = true; this->ever_auth = true; log_info("Authenticated with the XMPP server"); diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 033671e..b0d3a47 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -942,7 +942,7 @@ void IrcClient::on_nick(const IrcMessage& message) { const std::string new_nick = IrcUser(message.arguments[0]).nick; const std::string current_nick = IrcUser(message.prefix).nick; - const auto change_nick_func = [&](const std::string& chan_name, const IrcChannel* channel) + const auto change_nick_func = [this, &new_nick, ¤t_nick](const std::string& chan_name, const IrcChannel* channel) { IrcUser* user; if (channel->get_self() && channel->get_self()->nick == current_nick) diff --git a/src/main.cpp b/src/main.cpp index 53f3193..5585672 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,9 +14,9 @@ #include // A flag set by the SIGINT signal handler. -static volatile std::atomic stop(false); +static std::atomic stop(false); // Flag set by the SIGUSR1/2 signal handler. -static volatile std::atomic reload(false); +static std::atomic reload(false); // A flag indicating that we are wanting to exit the process. i.e: if this // flag is set and all connections are closed, we can exit properly. static bool exiting = false; -- cgit v1.2.3