Skip to content

Commit

Permalink
Fix g++9 warnings.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 5f0565bfaefff9bf41f372f2f249489650985fae
  • Loading branch information
levlam committed May 1, 2019
1 parent fca3eac commit 21dee3b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ endif()
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too much false positives
endif()
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0))
# warns about a lot of "return std::move", which are not redundant for compilers without fix for DR 1579, i.e. GCC 4.9 or clang 3.8
# see http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579
add_cxx_compiler_flag("-Wno-redundant-move")
endif()

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem /usr/include/c++/v1")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
Expand Down
2 changes: 1 addition & 1 deletion td/telegram/ContactsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7582,7 +7582,7 @@ void ContactsManager::on_get_channel_participants_success(
total_count = static_cast<int32>(result.size());
}

const auto max_participant_count = get_channel_type(channel_id) == ChannelType::Megagroup ? 9950 : 195;
const auto max_participant_count = get_channel_type(channel_id) == ChannelType::Megagroup ? 9750 : 195;
auto participant_count =
filter.is_recent() && total_count != 0 && total_count < max_participant_count ? total_count : -1;
int32 administrator_count = filter.is_administrators() ? total_count : -1;
Expand Down
4 changes: 2 additions & 2 deletions tdactor/td/actor/impl/Scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void Scheduler::send_lambda(ActorRef actor_ref, EventT &&lambda) {
[&]() {
auto event = Event::lambda(std::forward<EventT>(lambda));
event.set_link_token(actor_ref.token());
return std::move(event);
return event;
});
}

Expand All @@ -251,7 +251,7 @@ void Scheduler::send_closure(ActorRef actor_ref, EventT &&closure) {
[&]() {
auto event = Event::immediate_closure(std::forward<EventT>(closure));
event.set_link_token(actor_ref.token());
return std::move(event);
return event;
});
}

Expand Down

0 comments on commit 21dee3b

Please sign in to comment.