From 5402a256d1f0ebbeafa32d250d000cf38fe748fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 7 Apr 2017 18:45:24 +0200 Subject: Apply all the clang-tidy modernize-* fixes --- src/xmpp/adhoc_command.cpp | 5 +++-- src/xmpp/adhoc_command.hpp | 2 +- src/xmpp/biboumi_component.cpp | 10 ++++------ src/xmpp/jid.cpp | 2 +- src/xmpp/xmpp_stanza.cpp | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/xmpp') diff --git a/src/xmpp/adhoc_command.cpp b/src/xmpp/adhoc_command.cpp index 825cc92..e02bf35 100644 --- a/src/xmpp/adhoc_command.cpp +++ b/src/xmpp/adhoc_command.cpp @@ -1,11 +1,12 @@ +#include #include #include #include using namespace std::string_literals; -AdhocCommand::AdhocCommand(std::vector&& callbacks, const std::string& name, const bool admin_only): - name(name), +AdhocCommand::AdhocCommand(std::vector&& callbacks, std::string name, const bool admin_only): + name(std::move(name)), callbacks(std::move(callbacks)), admin_only(admin_only) { diff --git a/src/xmpp/adhoc_command.hpp b/src/xmpp/adhoc_command.hpp index ced4549..c00d9e6 100644 --- a/src/xmpp/adhoc_command.hpp +++ b/src/xmpp/adhoc_command.hpp @@ -17,7 +17,7 @@ class AdhocCommand { friend class AdhocSession; public: - AdhocCommand(std::vector&& callbacks, const std::string& name, const bool admin_only); + AdhocCommand(std::vector&& callbacks, std::string name, const bool admin_only); ~AdhocCommand() = default; AdhocCommand(const AdhocCommand&) = default; AdhocCommand(AdhocCommand&&) = default; diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index dc57eeb..b4b6a45 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -83,10 +83,8 @@ BiboumiComponent::BiboumiComponent(std::shared_ptr& poller, const std::s void BiboumiComponent::shutdown() { - for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it) - { - it->second->shutdown("Gateway shutdown"); - } + for (auto& pair: this->bridges) + pair.second->shutdown("Gateway shutdown"); } void BiboumiComponent::clean() @@ -696,8 +694,8 @@ Bridge* BiboumiComponent::find_user_bridge(const std::string& full_jid) std::vector BiboumiComponent::get_bridges() const { std::vector res; - for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it) - res.push_back(it->second.get()); + for (const auto& bridge: this->bridges) + res.push_back(bridge.second.get()); return res; } diff --git a/src/xmpp/jid.cpp b/src/xmpp/jid.cpp index ba8d70b..19d1b55 100644 --- a/src/xmpp/jid.cpp +++ b/src/xmpp/jid.cpp @@ -53,7 +53,7 @@ std::string jidprep(const std::string& original) char local[max_jid_part_len] = {}; memcpy(local, jid.local.data(), std::min(max_jid_part_len, jid.local.size())); - Stringprep_rc rc = static_cast(::stringprep(local, max_jid_part_len, + auto rc = static_cast(::stringprep(local, max_jid_part_len, static_cast(0), stringprep_xmpp_nodeprep)); if (rc != STRINGPREP_OK) { diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp index ac6ce9b..4999851 100644 --- a/src/xmpp/xmpp_stanza.cpp +++ b/src/xmpp/xmpp_stanza.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include std::string xml_escape(const std::string& data) { -- cgit v1.2.3