From cf1c8f188c64ffe6cce941027190ef3cd90abf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sun, 21 May 2017 12:23:10 +0200 Subject: [PATCH] Remove a few warnings occuring in some build config --- src/bridge/bridge.cpp | 6 ++++++ tests/xmpp.cpp | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index f2d782c..4a41b50 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -25,6 +25,8 @@ static std::string in_encoding_for(const Bridge& bridge, const Iid& iid) auto options = Database::get_irc_channel_options_with_server_default(jid, iid.get_server(), iid.get_local()); return options.encodingIn.value(); #else + (void)bridge; + (void)iid; return {"ISO-8859-1"}; #endif } @@ -1000,6 +1002,10 @@ void Bridge::send_room_history(const std::string& hostname, std::string chan_nam this->xmpp.send_history_message(chan_name, line.nick.value(), line.body.value(), this->user_jid + "/" + resource, seconds); } +#else + (void)hostname; + (void)chan_name; + (void)resource; #endif } diff --git a/tests/xmpp.cpp b/tests/xmpp.cpp index 7ea03a9..14c51da 100644 --- a/tests/xmpp.cpp +++ b/tests/xmpp.cpp @@ -30,15 +30,16 @@ TEST_CASE("Test basic XML parsing") // And do the same checks on moved-constructed stanza Stanza moved(std::move(copy)); }); - xml.feed(doc.data(), doc.size(), true); + CHECK(doc.size() <= std::numeric_limits::max()); + xml.feed(doc.data(), static_cast(doc.size()), true); const std::string doc2 = "coucou\r\n\a"; xml.add_stanza_callback([](const Stanza& stanza) { CHECK(stanza.get_inner() == "coucou\r\n"); }); - - xml.feed(doc2.data(), doc.size(), true); + CHECK(doc.size() <= std::numeric_limits::max()); + xml.feed(doc2.data(), static_cast(doc.size()), true); } TEST_CASE("XML escape") @@ -68,4 +69,4 @@ TEST_CASE("substanzas") CHECK(b.has_children()); } CHECK(a.has_children()); -} \ No newline at end of file +} -- 2.45.2