From 719377a7deb7575764919d21eb1eb76214276faa Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 26 Apr 2019 05:49:48 +0300 Subject: [PATCH] Fix warnings. GitOrigin-RevId: 3d6129e1f99996938316c53b297ced56df14aa23 --- td/telegram/NotificationManager.cpp | 14 +++++++------- td/telegram/StickersManager.cpp | 2 +- td/telegram/StickersManager.h | 2 +- tdutils/test/SharedObjectPool.cpp | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index dfd096dcc..2ccb3e231 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -219,7 +219,7 @@ void NotificationManager::init() { VLOG(notifications) << "Loaded disable_contact_registered_notifications = " << disable_contact_registered_notifications_ << " in state " << sync_state; if (contact_registered_notifications_sync_state_ != SyncState::Completed || - static_cast(sync_state[1] - '0') != disable_contact_registered_notifications_) { + sync_state[1] != static_cast(disable_contact_registered_notifications_) + '0') { run_contact_registered_notifications_sync(); } @@ -443,8 +443,8 @@ NotificationManager::NotificationGroups::iterator NotificationManager::get_group } void NotificationManager::delete_group(NotificationGroups::iterator &&group_it) { - bool is_erased = group_keys_.erase(group_it->first.group_id); - CHECK(is_erased); + auto erased_count = group_keys_.erase(group_it->first.group_id); + CHECK(erased_count > 0); groups_.erase(group_it); } @@ -1662,10 +1662,10 @@ void NotificationManager::on_notification_removed(NotificationId notification_id } temporary_notification_logevent_ids_.erase(add_it); - bool is_erased_notification = temporary_notifications_.erase(temporary_notification_message_ids_[notification_id]); - bool is_erased_message_id = temporary_notification_message_ids_.erase(notification_id); - CHECK(is_erased_notification); - CHECK(is_erased_message_id); + auto erased_notification_count = temporary_notifications_.erase(temporary_notification_message_ids_[notification_id]); + auto erased_message_id_count = temporary_notification_message_ids_.erase(notification_id); + CHECK(erased_notification_count > 0); + CHECK(erased_message_id_count > 0); on_notification_processed(notification_id); } diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index da30f378c..b615484bf 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -3869,7 +3869,7 @@ int32 StickersManager::get_recent_stickers_hash(const vector &sticker_id return get_vector_hash(numbers); } -FileSourceId StickersManager::get_recent_stickers_file_source_id(bool is_attached) { +FileSourceId StickersManager::get_recent_stickers_file_source_id(int is_attached) { if (!recent_stickers_file_source_id_[is_attached].is_valid()) { recent_stickers_file_source_id_[is_attached] = td_->file_reference_manager_->create_recent_stickers_file_source(is_attached); diff --git a/td/telegram/StickersManager.h b/td/telegram/StickersManager.h index f3e7ab9ce..665d5913c 100644 --- a/td/telegram/StickersManager.h +++ b/td/telegram/StickersManager.h @@ -152,7 +152,7 @@ class StickersManager : public Actor { void on_get_recent_stickers_failed(bool is_repair, bool is_attached, Status error); - FileSourceId get_recent_stickers_file_source_id(bool is_attached); + FileSourceId get_recent_stickers_file_source_id(int is_attached); void add_recent_sticker(bool is_attached, const tl_object_ptr &input_file, Promise &&promise); diff --git a/tdutils/test/SharedObjectPool.cpp b/tdutils/test/SharedObjectPool.cpp index 3d24f2ae5..61e4ed51e 100644 --- a/tdutils/test/SharedObjectPool.cpp +++ b/tdutils/test/SharedObjectPool.cpp @@ -58,6 +58,7 @@ TEST(SharedPtr, simple) { CHECK(*ptr2 == "hello"); #if TD_CLANG #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wself-assign-overloaded" #endif ptr2 = ptr2;