diff --git a/tdactor/test/actors_simple.cpp b/tdactor/test/actors_simple.cpp index 2a5b71a71..caed5d891 100644 --- a/tdactor/test/actors_simple.cpp +++ b/tdactor/test/actors_simple.cpp @@ -396,22 +396,22 @@ class LinkTokenMasterActor : public Actor { } void loop() override { for (int i = 0; i < 100 && cnt_ > 0; cnt_--, i++) { + auto token = static_cast(cnt_ + 1); switch (i % 4) { case 0: { - send_closure(ActorShared(child_, cnt_ + 1), &LinkTokenSlave::add, cnt_ + 1); + send_closure(ActorShared(child_, token), &LinkTokenSlave::add, token); break; } case 1: { - send_closure_later(ActorShared(child_, cnt_ + 1), &LinkTokenSlave::add, cnt_ + 1); + send_closure_later(ActorShared(child_, token), &LinkTokenSlave::add, token); break; } case 2: { - EventCreator::closure(ActorShared(child_, cnt_ + 1), &LinkTokenSlave::add, cnt_ + 1) - .try_emit(); + EventCreator::closure(ActorShared(child_, token), &LinkTokenSlave::add, token).try_emit(); break; } case 3: { - EventCreator::closure(ActorShared(child_, cnt_ + 1), &LinkTokenSlave::add, cnt_ + 1) + EventCreator::closure(ActorShared(child_, token), &LinkTokenSlave::add, token) .try_emit_later(); break; } diff --git a/tdnet/td/net/NetStats.h b/tdnet/td/net/NetStats.h index 5f5ecc11b..18df11112 100644 --- a/tdnet/td/net/NetStats.h +++ b/tdnet/td/net/NetStats.h @@ -132,7 +132,7 @@ class NetStats { void on_change(LocalNetStats &stats, uint64 size) { stats.unsync_size += size; auto now = Time::now(); - if (stats.unsync_size > 10000 || now - stats.last_update > 5 * 60) { + if (stats.unsync_size > 10000 || now - stats.last_update > 300) { stats.unsync_size = 0; stats.last_update = now; callback_->on_stats_updated(); diff --git a/tdutils/td/utils/misc.h b/tdutils/td/utils/misc.h index 417e7de1b..ee6f8ea84 100644 --- a/tdutils/td/utils/misc.h +++ b/tdutils/td/utils/misc.h @@ -208,7 +208,7 @@ std::enable_if_t::value, T> to_integer(Slice str) { begin++; } while (begin != end && is_digit(*begin)) { - integer_value = static_cast(integer_value * 10 + (*begin++ - '0')); + integer_value = static_cast(integer_value * 10 + static_cast(*begin++ - '0')); } if (integer_value > static_cast(std::numeric_limits::max())) { static_assert(~0 + 1 == 0, "Two's complement"); @@ -230,7 +230,7 @@ std::enable_if_t::value, T> to_integer(Slice str) { auto begin = str.begin(); auto end = str.end(); while (begin != end && is_digit(*begin)) { - integer_value = static_cast(integer_value * 10 + (*begin++ - '0')); + integer_value = static_cast(integer_value * 10 + static_cast(*begin++ - '0')); } return integer_value; }