From 3d3ddf655b295b7054f7cab43a6e6bdb93751a02 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 30 Sep 2020 22:21:32 +0300 Subject: [PATCH] Explicitly convert int64 to double. GitOrigin-RevId: afdf35ee316ebb7e317921d4e4734582203783e3 --- td/telegram/CallActor.cpp | 6 +++--- td/telegram/Td.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/td/telegram/CallActor.cpp b/td/telegram/CallActor.cpp index e12abf0f7..0ca317618 100644 --- a/td/telegram/CallActor.cpp +++ b/td/telegram/CallActor.cpp @@ -371,7 +371,7 @@ Status CallActor::do_update_call(telegram_api::phoneCallWaiting &call) { call_state_.is_received = true; call_state_need_flush_ = true; int64 call_ring_timeout_ms = G()->shared_config().get_option_integer("call_ring_timeout_ms", 90000); - set_timeout_in(call_ring_timeout_ms * 0.001); + set_timeout_in(static_cast(call_ring_timeout_ms) * 0.001); } } @@ -454,7 +454,7 @@ void CallActor::on_begin_exchanging_key() { call_state_.type = CallState::Type::ExchangingKey; call_state_need_flush_ = true; int64 call_receive_timeout_ms = G()->shared_config().get_option_integer("call_receive_timeout_ms", 20000); - double timeout = call_receive_timeout_ms * 0.001; + double timeout = static_cast(call_receive_timeout_ms) * 0.001; LOG(INFO) << "Set call timeout to " << timeout; set_timeout_in(timeout); } @@ -632,7 +632,7 @@ void CallActor::try_send_request_query() { auto query = G()->net_query_creator().create(tl_query); state_ = State::WaitRequestResult; int64 call_receive_timeout_ms = G()->shared_config().get_option_integer("call_receive_timeout_ms", 20000); - double timeout = call_receive_timeout_ms * 0.001; + double timeout = static_cast(call_receive_timeout_ms) * 0.001; LOG(INFO) << "Set call timeout to " << timeout; set_timeout_in(timeout); query->total_timeout_limit_ = max(timeout, 10.0); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 122679327..9b58b5952 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3129,8 +3129,9 @@ void Td::on_online_updated(bool force, bool send_update) { update_status_query_ = create_handler()->send(!is_online_); } if (is_online_) { - alarm_timeout_.set_timeout_in(ONLINE_ALARM_ID, - G()->shared_config().get_option_integer("online_update_period_ms", 210000) * 1e-3); + alarm_timeout_.set_timeout_in( + ONLINE_ALARM_ID, + static_cast(G()->shared_config().get_option_integer("online_update_period_ms", 210000)) * 1e-3); } else { alarm_timeout_.cancel_timeout(ONLINE_ALARM_ID); }