Fix g++9 warnings.

GitOrigin-RevId: 5f0565bfaefff9bf41f372f2f249489650985fae
This commit is contained in:
levlam 2019-05-01 20:03:27 +03:00
parent fca3eacf4b
commit 21dee3b1d9
3 changed files with 8 additions and 3 deletions

View File

@ -228,6 +228,11 @@ endif()
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too much false positives add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too much false positives
endif() 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} -isystem /usr/include/c++/v1")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")

View File

@ -7582,7 +7582,7 @@ void ContactsManager::on_get_channel_participants_success(
total_count = static_cast<int32>(result.size()); 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 = auto participant_count =
filter.is_recent() && total_count != 0 && total_count < max_participant_count ? total_count : -1; filter.is_recent() && total_count != 0 && total_count < max_participant_count ? total_count : -1;
int32 administrator_count = filter.is_administrators() ? total_count : -1; int32 administrator_count = filter.is_administrators() ? total_count : -1;

View File

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