Fix a signed/unsigned mismatch

This commit is contained in:
louiz’
2018-08-24 22:49:31 +02:00
parent 7d0df9b6dd
commit a3e865ad63
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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); this->tokens_bucket.set_limit(limit);
} }
+1 -1
View File
@@ -301,7 +301,7 @@ public:
const std::vector<char>& get_sorted_user_modes() const { return this->sorted_user_modes; } const std::vector<char>& get_sorted_user_modes() const { return this->sorted_user_modes; }
std::set<char> get_chantypes() const { return this->chantypes; } std::set<char> 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. * Store the history limit that the client asked when joining this room.
*/ */
+1 -1
View File
@@ -19,7 +19,7 @@ class TokensBucket
public: public:
TokensBucket(long int max_size, std::chrono::milliseconds fill_duration, std::function<bool()> callback, std::string name): TokensBucket(long int max_size, std::chrono::milliseconds fill_duration, std::function<bool()> callback, std::string name):
limit(max_size), limit(max_size),
tokens(limit), tokens(static_cast<std::size_t>(limit)),
callback(std::move(callback)) callback(std::move(callback))
{ {
log_debug("creating TokensBucket with max size: ", max_size); log_debug("creating TokensBucket with max size: ", max_size);