diff --git a/td/telegram/BackgroundManager.cpp b/td/telegram/BackgroundManager.cpp index ffd4cdd9d..2eaa98fc0 100644 --- a/td/telegram/BackgroundManager.cpp +++ b/td/telegram/BackgroundManager.cpp @@ -320,7 +320,7 @@ class BackgroundManager::BackgroundLogEvent { void BackgroundManager::start_up() { for (int i = 0; i < 2; i++) { - bool for_dark_theme = static_cast(i); + bool for_dark_theme = i != 0; auto logevent_string = G()->td_db()->get_binlog_pmc()->get(get_background_database_key(for_dark_theme)); if (!logevent_string.empty()) { BackgroundLogEvent logevent; diff --git a/td/telegram/DialogParticipant.h b/td/telegram/DialogParticipant.h index beec2ab1e..286c23aa6 100644 --- a/td/telegram/DialogParticipant.h +++ b/td/telegram/DialogParticipant.h @@ -48,7 +48,7 @@ class RestrictedRights { } bool can_invite_users() const { - return (flags_ & CAN_INVITE_USERS); + return (flags_ & CAN_INVITE_USERS) != 0; } bool can_pin_messages() const { diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index e96b27bfc..6c253706e 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2464,7 +2464,7 @@ class CliClient final : public Actor { auto chat = as_chat_id(chat_id); send_request(td_api::make_object(chat, as_chat_id(from_chat_id), as_message_ids(message_ids), false, false, op[2] == 'g', - op[0] == 'c', static_cast(Random::fast(0, 1)))); + op[0] == 'c', Random::fast(0, 1) == 1)); } else if (op == "resend") { string chat_id; string message_ids;