From 5160e083b0da8c73c1a40181b6ba888d97d6b251 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 9 Nov 2018 15:38:41 +0300 Subject: [PATCH] Move STORE/PARSE FLAGS to a dedicated block. GitOrigin-RevId: c682b9b2a444a4b86c7c3c09736d3489c4e4f297 --- td/generate/scheme/td_api.tl | 4 ++-- td/generate/scheme/td_api.tlo | Bin 137412 -> 137412 bytes tdutils/td/utils/tl_helpers.h | 36 +++++++++++++++++++++------------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 6351507e..ba95ab2c 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2218,8 +2218,8 @@ updateChatDraftMessage chat_id:int53 draft_message:draftMessage order:int64 = Up //@description A list of active notifications in a notification group has changed @notification_group_id Unique notification group identifier @chat_id Identifier of a chat to which all notifications in the group belong //@notification_settings_chat_id Chat identifier, which notification settings must be applied @silent True, if the notifications should be shown without sound -//@total_count Total number of active notifications in the group @new_notifications List of new group notifications @edited_notifications List of edited group notifications @deleted_notification_ids Identifiers of deleted group notifications -updateNotificationGroup chat_id:int53 notification_group_id:int32 notification_settings_chat_id:int53 silent:Bool total_count:int32 new_notifications:vector edited_notifications:vector deleted_notification_ids:vector = Update; +//@total_count Total number of active notifications in the group @new_notifications List of new group notifications @edited_notifications List of edited group notifications @removed_notification_ids Identifiers of removed group notifications +updateNotificationGroup chat_id:int53 notification_group_id:int32 notification_settings_chat_id:int53 silent:Bool total_count:int32 new_notifications:vector edited_notifications:vector removed_notification_ids:vector = Update; //@description Contains active notifications that was shown on previous application launches. This update is sent only if a message database is used. In that case it comes once before any updateNotificationGroup update @groups Lists of active notification groups updateActiveNotifications groups:vector = Update; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index a5b619129764e984c1f125204e0d49e2345ebd56..35be095348cf2b955bb7caefca5daa05b6522d0b 100644 GIT binary patch delta 1592 z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qGW^+h`&Cb1=vf;#keOti-VZR`NWK@7Zabxv4_dxLK73T4YyR(f~rQqXqivADYhePoI diff --git a/tdutils/td/utils/tl_helpers.h b/tdutils/td/utils/tl_helpers.h index 7cb0b671..2e0db461 100644 --- a/tdutils/td/utils/tl_helpers.h +++ b/tdutils/td/utils/tl_helpers.h @@ -19,34 +19,42 @@ #include #define BEGIN_STORE_FLAGS() \ - uint32 flags_store = 0; \ + do { \ + uint32 flags_store = 0; \ uint32 bit_offset_store = 0 #define STORE_FLAG(flag) \ flags_store |= (flag) << bit_offset_store; \ bit_offset_store++ -#define END_STORE_FLAGS() \ - CHECK(bit_offset_store < 31); \ - td::store(flags_store, storer) +#define END_STORE_FLAGS() \ + CHECK(bit_offset_store < 31); \ + td::store(flags_store, storer); \ + } \ + while (false) -#define BEGIN_PARSE_FLAGS() \ - uint32 flags_parse; \ - uint32 bit_offset_parse = 0; \ +#define BEGIN_PARSE_FLAGS() \ + do { \ + uint32 flags_parse; \ + uint32 bit_offset_parse = 0; \ td::parse(flags_parse, parser) #define PARSE_FLAG(flag) \ flag = ((flags_parse >> bit_offset_parse) & 1) != 0; \ bit_offset_parse++ -#define END_PARSE_FLAGS() \ - CHECK(bit_offset_parse < 31); \ - CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) \ - << flags_parse << " " << bit_offset_parse << " " << parser.version(); +#define END_PARSE_FLAGS() \ + CHECK(bit_offset_parse < 31); \ + CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) \ + << flags_parse << " " << bit_offset_parse << " " << parser.version(); \ + } \ + while (false) -#define END_PARSE_FLAGS_GENERIC() \ - CHECK(bit_offset_parse < 31); \ - CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) << flags_parse << " " << bit_offset_parse; +#define END_PARSE_FLAGS_GENERIC() \ + CHECK(bit_offset_parse < 31); \ + CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) << flags_parse << " " << bit_offset_parse; \ + } \ + while (false) namespace td { template