fix recent clang warnings

This commit is contained in:
arvidn 2020-02-08 12:14:09 +01:00 committed by Arvid Norberg
parent 3092b7ca44
commit 6d5bdbdb1a
4 changed files with 8 additions and 7 deletions

View File

@ -215,6 +215,9 @@ rule warnings ( properties * )
result += <cflags>-Wno-return-std-move-in-c++11 ;
result += <cflags>-Wno-unknown-warning-option ;
# libtorrent uses alloca() carefully
result += <cflags>-Wno-alloca ;
}
if <toolset>gcc in $(properties)

View File

@ -1714,11 +1714,11 @@ namespace aux {
max_int_setting_internal
};
enum settings_counts_t : std::uint8_t
enum settings_counts_t : int
{
num_string_settings = max_string_setting_internal - string_type_base,
num_bool_settings = max_bool_setting_internal - bool_type_base,
num_int_settings = max_int_setting_internal - int_type_base
num_string_settings = int(max_string_setting_internal) - int(string_type_base),
num_bool_settings = int(max_bool_setting_internal) - int(bool_type_base),
num_int_settings = int(max_int_setting_internal) - int(int_type_base)
};
enum suggest_mode_t : std::uint8_t { no_piece_suggestions = 0, suggest_read_cache = 1 };

View File

@ -69,8 +69,6 @@ int render_lsd_packet(char* dst, int const len, int const listen_port
}
} // anonymous namespace
static error_code dummy;
lsd::lsd(io_service& ios, aux::lsd_callback& cb
, address const& listen_address, address const& netmask)
: m_callback(cb)

View File

@ -1419,7 +1419,7 @@ void upnp::on_upnp_map_response(error_code const& e
if (d.lease_duration > 0)
{
m.expires = aux::time_now()
+ seconds(int(d.lease_duration * 0.75f));
+ seconds(d.lease_duration * 3 / 4);
time_point next_expire = m_refresh_timer.expires_at();
if (next_expire < aux::time_now()
|| next_expire > m.expires)