From a3e865ad63a1c0d634001d9d2e86c425bc5094e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 23 Aug 2018 23:58:32 +0200 Subject: Fix a signed/unsigned mismatch --- src/irc/irc_client.cpp | 2 +- src/irc/irc_client.hpp | 2 +- src/utils/tokens_bucket.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 2835a33..0b5715e 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -1248,7 +1248,7 @@ void IrcClient::on_channel_mode(const IrcMessage& message) } } -void IrcClient::set_throttle_limit(std::size_t limit) +void IrcClient::set_throttle_limit(long int limit) { this->tokens_bucket.set_limit(limit); } diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index 1653225..416eb30 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -301,7 +301,7 @@ public: const std::vector& get_sorted_user_modes() const { return this->sorted_user_modes; } std::set get_chantypes() const { return this->chantypes; } - void set_throttle_limit(std::size_t limit); + void set_throttle_limit(long int limit); /** * Store the history limit that the client asked when joining this room. */ diff --git a/src/utils/tokens_bucket.hpp b/src/utils/tokens_bucket.hpp index 2992e21..263359a 100644 --- a/src/utils/tokens_bucket.hpp +++ b/src/utils/tokens_bucket.hpp @@ -19,7 +19,7 @@ class TokensBucket public: TokensBucket(long int max_size, std::chrono::milliseconds fill_duration, std::function callback, std::string name): limit(max_size), - tokens(limit), + tokens(static_cast(limit)), callback(std::move(callback)) { log_debug("creating TokensBucket with max size: ", max_size); -- cgit v1.2.3