diff --git a/td/mtproto/AuthData.cpp b/td/mtproto/AuthData.cpp index 00c946f99..ed744ad15 100644 --- a/td/mtproto/AuthData.cpp +++ b/td/mtproto/AuthData.cpp @@ -100,7 +100,7 @@ std::vector AuthData::get_future_salts() const { int64 AuthData::next_message_id(double now) { double server_time = get_server_time(now); - auto t = static_cast(server_time * (1ll << 32)); + auto t = static_cast(server_time * (static_cast(1) << 32)); // randomize lower bits for clocks with low precision // TODO(perf) do not do this for systems with good precision?.. @@ -119,13 +119,13 @@ int64 AuthData::next_message_id(double now) { bool AuthData::is_valid_outbound_msg_id(int64 id, double now) const { double server_time = get_server_time(now); - auto id_time = static_cast(id) / static_cast(1ll << 32); + auto id_time = static_cast(id) / static_cast(static_cast(1) << 32); return server_time - 150 < id_time && id_time < server_time + 30; } bool AuthData::is_valid_inbound_msg_id(int64 id, double now) const { double server_time = get_server_time(now); - auto id_time = static_cast(id) / static_cast(1ll << 32); + auto id_time = static_cast(id) / static_cast(static_cast(1) << 32); return server_time - 300 < id_time && id_time < server_time + 30; } diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 900c25e0d..fd59f4bae 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -4890,10 +4890,10 @@ void Td::on_request(uint64 id, td_api::addNetworkStatistics &request) { if (entry.net_type == NetType::None) { return send_error_raw(id, 400, "Network statistics entry can't be increased for NetworkTypeNone"); } - if (entry.rx > (1ll << 40) || entry.rx < 0) { + if (entry.rx > (static_cast(1) << 40) || entry.rx < 0) { return send_error_raw(id, 400, "Wrong received bytes value"); } - if (entry.tx > (1ll << 40) || entry.tx < 0) { + if (entry.tx > (static_cast(1) << 40) || entry.tx < 0) { return send_error_raw(id, 400, "Wrong sent bytes value"); } if (entry.count > (1 << 30) || entry.count < 0) { diff --git a/td/telegram/UserId.h b/td/telegram/UserId.h index b373c98bd..18ea4612d 100644 --- a/td/telegram/UserId.h +++ b/td/telegram/UserId.h @@ -20,7 +20,7 @@ class UserId { int64 id = 0; public: - static constexpr int64 MAX_USER_ID = (1ll << 40) - 1; + static constexpr int64 MAX_USER_ID = (static_cast(1) << 40) - 1; UserId() = default;