summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bridge/bridge.cpp2
-rw-r--r--src/bridge/bridge.hpp2
-rw-r--r--src/bridge/colors.cpp2
-rw-r--r--src/config/config.cpp7
-rw-r--r--src/config/config.hpp8
-rw-r--r--src/irc/irc_channel.cpp2
-rw-r--r--src/irc/irc_channel.hpp2
-rw-r--r--src/network/poller.cpp2
-rw-r--r--src/test.cpp2
-rw-r--r--src/utils/encoding.cpp1
-rw-r--r--src/xmpp/adhoc_commands_handler.cpp4
-rw-r--r--src/xmpp/adhoc_commands_handler.hpp2
-rw-r--r--src/xmpp/xmpp_component.cpp1
-rw-r--r--src/xmpp/xmpp_stanza.hpp2
14 files changed, 11 insertions, 28 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index a7d8fe6..c925f9e 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -480,7 +480,7 @@ void Bridge::send_user_join(const std::string& hostname,
affiliation, role, this->user_jid, self);
}
-void Bridge::send_topic(const std::string& hostname, const std::string& chan_name, const std::string topic)
+void Bridge::send_topic(const std::string& hostname, const std::string& chan_name, const std::string& topic)
{
this->xmpp->send_topic(chan_name + "%" + hostname, this->make_xmpp_body(topic), this->user_jid);
}
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp
index cf39545..c20bba2 100644
--- a/src/bridge/bridge.hpp
+++ b/src/bridge/bridge.hpp
@@ -114,7 +114,7 @@ public:
/**
* Send the topic of the MUC to the user
*/
- void send_topic(const std::string& hostname, const std::string& chan_name, const std::string topic);
+ void send_topic(const std::string& hostname, const std::string& chan_name, const std::string& topic);
/**
* Send a MUC message from some participant
*/
diff --git a/src/bridge/colors.cpp b/src/bridge/colors.cpp
index 3aed07c..3d40ac4 100644
--- a/src/bridge/colors.cpp
+++ b/src/bridge/colors.cpp
@@ -166,10 +166,8 @@ Xmpp::body irc_format_to_xhtmlim(const std::string& s)
{
current_node->close();
result->add_child(current_node);
- current_node = result.get();
}
-
result->close();
Xmpp::body body_res = std::make_tuple(cleaned, std::move(result));
return body_res;
diff --git a/src/config/config.cpp b/src/config/config.cpp
index e2e027b..b870339 100644
--- a/src/config/config.cpp
+++ b/src/config/config.cpp
@@ -28,13 +28,6 @@ int Config::get_int(const std::string& option, const int& def)
return def;
}
-void Config::set_int(const std::string& option, const int& value, bool save)
-{
- std::ostringstream os;
- os << value;
- Config::set(option, os.str(), save);
-}
-
void Config::set(const std::string& option, const std::string& value, bool save)
{
Config* self = Config::instance().get();
diff --git a/src/config/config.hpp b/src/config/config.hpp
index ea28388..e070816 100644
--- a/src/config/config.hpp
+++ b/src/config/config.hpp
@@ -53,14 +53,6 @@ public:
*/
static void set(const std::string&, const std::string&, bool save = false);
/**
- * Set a value for the given option. And write all the config
- * in the file from which it was read if boolean is set.
- * @param option The option to set
- * @param value The value to use
- * @param save if true, save the config file
- */
- static void set_int(const std::string&, const int&, bool save = false);
- /**
* Adds a function to a list. This function will be called whenever a
* configuration change occurs.
*/
diff --git a/src/irc/irc_channel.cpp b/src/irc/irc_channel.cpp
index 2c0f8b1..b1b3983 100644
--- a/src/irc/irc_channel.cpp
+++ b/src/irc/irc_channel.cpp
@@ -12,7 +12,7 @@ void IrcChannel::set_self(const std::string& name)
}
IrcUser* IrcChannel::add_user(const std::string& name,
- const std::map<char, char> prefix_to_mode)
+ const std::map<char, char>& prefix_to_mode)
{
this->users.emplace_back(std::make_unique<IrcUser>(name, prefix_to_mode));
return this->users.back().get();
diff --git a/src/irc/irc_channel.hpp b/src/irc/irc_channel.hpp
index 1c074b5..568de0a 100644
--- a/src/irc/irc_channel.hpp
+++ b/src/irc/irc_channel.hpp
@@ -21,7 +21,7 @@ public:
void set_self(const std::string& name);
IrcUser* get_self() const;
IrcUser* add_user(const std::string& name,
- const std::map<char, char> prefix_to_mode);
+ const std::map<char, char>& prefix_to_mode);
IrcUser* find_user(const std::string& name) const;
void remove_user(const IrcUser* user);
void remove_all_users();
diff --git a/src/network/poller.cpp b/src/network/poller.cpp
index d89e50f..29c4bce 100644
--- a/src/network/poller.cpp
+++ b/src/network/poller.cpp
@@ -133,7 +133,7 @@ void Poller::stop_watching_send_events(SocketHandler* socket_handler)
int Poller::poll(const std::chrono::milliseconds& timeout)
{
- if (this->socket_handlers.size() == 0)
+ if (this->socket_handlers.empty())
return -1;
#if POLLER == POLL
int nb_events = ::poll(this->fds, this->nfds, timeout.count());
diff --git a/src/test.cpp b/src/test.cpp
index 2f29e01..a4371b2 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -222,7 +222,7 @@ int main()
IrcUser user2("coucou!~other@host.bla", prefixes);
assert(user2.nick == "coucou");
assert(user2.host == "~other@host.bla");
- assert(user2.modes.size() == 0);
+ assert(user2.modes.empty());
assert(user2.modes.find('a') == user2.modes.end());
/**
diff --git a/src/utils/encoding.cpp b/src/utils/encoding.cpp
index dc0101c..3e3580c 100644
--- a/src/utils/encoding.cpp
+++ b/src/utils/encoding.cpp
@@ -197,6 +197,7 @@ namespace utils
case E2BIG:
// This should never happen
done = true;
+ break;
default:
// This should happen even neverer
done = true;
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<const std::string, const AdhocCommand>& 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 <command/> 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::milliseconds>(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 <stream::stream/>, and the ones about 2 are just the
+ * level 1 ones are the <stream::stream/>, and the ones above 2 are just the
* content of the stanzas)
*/
typedef XmlNode Stanza;