Skip to content

Commit c19deb1

Browse files
committed
Remove empty second parameter of static_assert.
1 parent c5dfef6 commit c19deb1

21 files changed

Lines changed: 62 additions & 98 deletions

benchmark/bench_actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class RingBench final : public td::Benchmark {
8787
public:
8888
td::string get_description() const final {
8989
static const char *types[] = {"later", "immediate", "raw", "tail", "lambda"};
90-
static_assert(0 <= type && type < 5, "");
90+
static_assert(0 <= type && type < 5);
9191
return PSTRING() << "Ring (send_" << types[type] << ") (threads_n = " << thread_n_ << ")";
9292
}
9393

@@ -174,7 +174,7 @@ class QueryBench final : public td::Benchmark {
174174
public:
175175
td::string get_description() const final {
176176
static const char *types[] = {"callback", "immediate future", "delayed future", "dummy", "lambda", "lambda_future"};
177-
static_assert(0 <= type && type < 6, "");
177+
static_assert(0 <= type && type < 6);
178178
return PSTRING() << "QueryBench: " << types[type];
179179
}
180180

memprof/memprof.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ void register_xalloc(malloc_info *info, std::int32_t diff) {
213213
extern "C" {
214214

215215
static void *malloc_with_frame(std::size_t size, const Backtrace &frame) {
216-
static_assert(RESERVED_SIZE % alignof(std::max_align_t) == 0, "fail");
217-
static_assert(RESERVED_SIZE >= sizeof(malloc_info), "fail");
216+
static_assert(RESERVED_SIZE % alignof(std::max_align_t) == 0);
217+
static_assert(RESERVED_SIZE >= sizeof(malloc_info));
218218
#if TD_DARWIN
219219
static void *malloc_void = dlsym(RTLD_NEXT, "malloc");
220220
static auto malloc_old = *reinterpret_cast<decltype(malloc) **>(&malloc_void);

memprof/memprof_stat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ static constexpr std::size_t RESERVED_SIZE = 16;
5555
static constexpr std::int32_t MALLOC_INFO_MAGIC = 0x27138373;
5656

5757
static void *do_malloc(std::size_t size) {
58-
static_assert(RESERVED_SIZE % alignof(std::max_align_t) == 0, "fail");
59-
static_assert(RESERVED_SIZE >= sizeof(malloc_info), "fail");
58+
static_assert(RESERVED_SIZE % alignof(std::max_align_t) == 0);
59+
static_assert(RESERVED_SIZE >= sizeof(malloc_info));
6060
#if TD_DARWIN
6161
static void *malloc_void = dlsym(RTLD_NEXT, "malloc");
6262
static auto malloc_old = *reinterpret_cast<decltype(malloc) **>(&malloc_void);

td/telegram/AuthManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,7 @@ void AuthManager::on_send_code_result(NetQueryPtr &&net_query) {
10861086

10871087
void AuthManager::on_set_premium_purchase_transaction_result(NetQueryPtr &&net_query) {
10881088
static_assert(std::is_same<telegram_api::payments_assignAppStoreTransaction::ReturnType,
1089-
telegram_api::payments_assignPlayMarketTransaction::ReturnType>::value,
1090-
"");
1089+
telegram_api::payments_assignPlayMarketTransaction::ReturnType>::value);
10911090
auto result = fetch_result<telegram_api::payments_assignPlayMarketTransaction>(std::move(net_query));
10921091
if (result.is_error()) {
10931092
return on_current_query_error(result.move_as_error());

td/telegram/BotInfoManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,7 @@ class BotInfoManager::AddPreviewMediaQuery final : public Td::ResultHandler {
402402

403403
void on_result(BufferSlice packet) final {
404404
static_assert(std::is_same<telegram_api::bots_addPreviewMedia::ReturnType,
405-
telegram_api::bots_editPreviewMedia::ReturnType>::value,
406-
"");
405+
telegram_api::bots_editPreviewMedia::ReturnType>::value);
407406
auto result_ptr = fetch_result<telegram_api::bots_addPreviewMedia>(packet);
408407
if (result_ptr.is_error()) {
409408
return on_error(result_ptr.move_as_error());

td/telegram/DeviceTokenManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,7 @@ void DeviceTokenManager::on_result(NetQueryPtr net_query) {
421421
CHECK(info.state != TokenInfo::State::Sync);
422422

423423
static_assert(std::is_same<telegram_api::account_registerDevice::ReturnType,
424-
telegram_api::account_unregisterDevice::ReturnType>::value,
425-
"");
424+
telegram_api::account_unregisterDevice::ReturnType>::value);
426425
auto r_flag = fetch_result<telegram_api::account_registerDevice>(std::move(net_query));
427426
if (r_flag.is_ok() && r_flag.ok()) {
428427
if (info.promise) {

td/telegram/DialogId.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ bool DialogId::is_valid() const {
1919

2020
DialogType DialogId::get_type() const {
2121
// check that valid ranges are continuous
22-
static_assert(ZERO_CHANNEL_ID + 1 == -ChatId::MAX_CHAT_ID, "");
23-
static_assert(
24-
ZERO_SECRET_CHAT_ID + std::numeric_limits<int32>::max() + 1 == ZERO_CHANNEL_ID - ChannelId::MAX_CHANNEL_ID, "");
22+
static_assert(ZERO_CHANNEL_ID + 1 == -ChatId::MAX_CHAT_ID);
23+
static_assert(ZERO_SECRET_CHAT_ID + std::numeric_limits<int32>::max() + 1 ==
24+
ZERO_CHANNEL_ID - ChannelId::MAX_CHANNEL_ID);
2525
static_assert(ZERO_CHANNEL_ID - ChannelId::MIN_MONOFORUM_CHANNEL_ID + 1 ==
26-
ZERO_SECRET_CHAT_ID + std::numeric_limits<int32>::min(),
27-
"");
26+
ZERO_SECRET_CHAT_ID + std::numeric_limits<int32>::min());
2827
if (id < 0) {
2928
if (-ChatId::MAX_CHAT_ID <= id) {
3029
return DialogType::Chat;

td/telegram/DialogManager.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ class CheckChannelUsernameQuery final : public Td::ResultHandler {
111111

112112
void on_result(BufferSlice packet) final {
113113
static_assert(std::is_same<telegram_api::bots_checkUsername::ReturnType,
114-
telegram_api::channels_checkUsername::ReturnType>::value,
115-
"");
114+
telegram_api::channels_checkUsername::ReturnType>::value);
116115
auto result_ptr = fetch_result<telegram_api::channels_checkUsername>(packet);
117116
if (result_ptr.is_error()) {
118117
return on_error(result_ptr.move_as_error());
@@ -251,8 +250,7 @@ class EditDialogTitleQuery final : public Td::ResultHandler {
251250

252251
void on_result(BufferSlice packet) final {
253252
static_assert(std::is_same<telegram_api::messages_editChatTitle::ReturnType,
254-
telegram_api::channels_editTitle::ReturnType>::value,
255-
"");
253+
telegram_api::channels_editTitle::ReturnType>::value);
256254
auto result_ptr = fetch_result<telegram_api::messages_editChatTitle>(packet);
257255
if (result_ptr.is_error()) {
258256
return on_error(result_ptr.move_as_error());
@@ -316,8 +314,7 @@ class EditDialogPhotoQuery final : public Td::ResultHandler {
316314

317315
void on_result(BufferSlice packet) final {
318316
static_assert(std::is_same<telegram_api::messages_editChatPhoto::ReturnType,
319-
telegram_api::channels_editPhoto::ReturnType>::value,
320-
"");
317+
telegram_api::channels_editPhoto::ReturnType>::value);
321318
auto result_ptr = fetch_result<telegram_api::messages_editChatPhoto>(packet);
322319
if (result_ptr.is_error()) {
323320
return on_error(result_ptr.move_as_error());
@@ -665,8 +662,7 @@ class UpdatePeerSettingsQuery final : public Td::ResultHandler {
665662

666663
void on_result(BufferSlice packet) final {
667664
static_assert(std::is_same<telegram_api::messages_reportSpam::ReturnType,
668-
telegram_api::messages_hidePeerSettingsBar::ReturnType>::value,
669-
"");
665+
telegram_api::messages_hidePeerSettingsBar::ReturnType>::value);
670666
auto result_ptr = fetch_result<telegram_api::messages_reportSpam>(packet);
671667
if (result_ptr.is_error()) {
672668
return on_error(result_ptr.move_as_error());
@@ -1068,7 +1064,7 @@ class ToggleDialogIsBlockedQuery final : public Td::ResultHandler {
10681064

10691065
void on_result(BufferSlice packet) final {
10701066
static_assert(
1071-
std::is_same<telegram_api::contacts_block::ReturnType, telegram_api::contacts_unblock::ReturnType>::value, "");
1067+
std::is_same<telegram_api::contacts_block::ReturnType, telegram_api::contacts_unblock::ReturnType>::value);
10721068
auto result_ptr = fetch_result<telegram_api::contacts_block>(packet);
10731069
if (result_ptr.is_error()) {
10741070
return on_error(result_ptr.move_as_error());

td/telegram/MessageEntity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int MessageEntity::get_type_priority(Type type) {
5959
99 /*CustomEmoji*/,
6060
0 /*ExpandableBlockQuote*/,
6161
30 /*FormattedDate*/};
62-
static_assert(sizeof(priorities) / sizeof(priorities[0]) == static_cast<size_t>(MessageEntity::Type::Size), "");
62+
static_assert(sizeof(priorities) / sizeof(priorities[0]) == static_cast<size_t>(MessageEntity::Type::Size));
6363
return priorities[static_cast<int32>(type)];
6464
}
6565

td/telegram/MessageQueryManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ class EditMessageFactCheckQuery final : public Td::ResultHandler {
321321

322322
void on_result(BufferSlice packet) final {
323323
static_assert(std::is_same<telegram_api::messages_deleteFactCheck::ReturnType,
324-
telegram_api::messages_editFactCheck::ReturnType>::value,
325-
"");
324+
telegram_api::messages_editFactCheck::ReturnType>::value);
326325
auto result_ptr = fetch_result<telegram_api::messages_editFactCheck>(packet);
327326
if (result_ptr.is_error()) {
328327
return on_error(result_ptr.move_as_error());

0 commit comments

Comments
 (0)