From 720e31a5113c25e48d7754bb812ab84c6c31d1d9 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 17 Dec 2014 13:37:57 +0100 Subject: Fix a few issues reported by static analyzers --- src/xmpp/adhoc_commands_handler.cpp | 4 ++-- src/xmpp/adhoc_commands_handler.hpp | 2 +- src/xmpp/xmpp_component.cpp | 1 - src/xmpp/xmpp_stanza.hpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/xmpp') diff --git a/src/xmpp/adhoc_commands_handler.cpp b/src/xmpp/adhoc_commands_handler.cpp index 7e1738a..a0defdd 100644 --- a/src/xmpp/adhoc_commands_handler.cpp +++ b/src/xmpp/adhoc_commands_handler.cpp @@ -29,7 +29,7 @@ const std::map& AdhocCommandsHandler::get return this->commands; } -XmlNode&& AdhocCommandsHandler::handle_request(const std::string& executor_jid, XmlNode command_node) +XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, XmlNode command_node) { std::string action = command_node.get_tag("action"); if (action.empty()) @@ -127,7 +127,7 @@ XmlNode&& AdhocCommandsHandler::handle_request(const std::string& executor_jid, command_node.add_child(std::move(error)); } } - return std::move(command_node); + return command_node; } void AdhocCommandsHandler::remove_session(const std::string& session_id, const std::string& initiator_jid) diff --git a/src/xmpp/adhoc_commands_handler.hpp b/src/xmpp/adhoc_commands_handler.hpp index 87d4d3d..7ddad47 100644 --- a/src/xmpp/adhoc_commands_handler.hpp +++ b/src/xmpp/adhoc_commands_handler.hpp @@ -36,7 +36,7 @@ public: * Takes a copy of the node so we can actually edit it and use * it as our return value. */ - XmlNode&& handle_request(const std::string& executor_jid, XmlNode command_node); + XmlNode handle_request(const std::string& executor_jid, XmlNode command_node); /** * Remove the session from the list. This is done to avoid filling the * memory with waiting session (for example due to a client that starts diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index 5a5aed4..a1585d7 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -286,7 +286,6 @@ void XmppComponent::handle_handshake(const Stanza& stanza) uint64_t usec; if (sd_watchdog_enabled(0, &usec) > 0) { - std::chrono::microseconds delay(usec); TimedEventsManager::instance().add_event(TimedEvent( std::chrono::duration_cast(std::chrono::microseconds(usec / 2)), []() { sd_notify(0, "WATCHDOG=1"); })); diff --git a/src/xmpp/xmpp_stanza.hpp b/src/xmpp/xmpp_stanza.hpp index a34ef50..9229ae6 100644 --- a/src/xmpp/xmpp_stanza.hpp +++ b/src/xmpp/xmpp_stanza.hpp @@ -151,7 +151,7 @@ private: /** * An XMPP stanza is just an XML node of level 2 in the XMPP document (the - * level 1 ones are the , and the ones about 2 are just the + * level 1 ones are the , and the ones above 2 are just the * content of the stanzas) */ typedef XmlNode Stanza; -- cgit v1.2.3