Missing member init (#1467)

initialize members of piece_block and use default member initialization.
This commit is contained in:
Pavel Pimenov 2016-12-29 17:55:58 +03:00 committed by Arvid Norberg
parent af126fe507
commit 98cdc3192d
3 changed files with 10 additions and 17 deletions

View File

@ -121,10 +121,6 @@ namespace libtorrent
struct listen_socket_t
{
listen_socket_t()
: tcp_external_port(0)
, udp_external_port(0)
, ssl(false)
, udp_write_blocked(false)
{
tcp_port_mapping[0] = -1;
tcp_port_mapping[1] = -1;
@ -146,7 +142,7 @@ namespace libtorrent
// this is the port that was originally specified to listen on
// it may be different from local_endpoint.port() if we could
// had to retry binding with a higher port
int original_port;
int original_port = 0;
// this is typically set to the same as the local
// listen port. In case a NAT port forward was
@ -155,21 +151,21 @@ namespace libtorrent
// on the NAT box itself. This is the port that has
// to be published to peers, since this is the port
// the client is reachable through.
int tcp_external_port;
int udp_external_port;
int tcp_external_port = 0;
int udp_external_port = 0;
// 0 is natpmp 1 is upnp
int tcp_port_mapping[2];
int udp_port_mapping[2];
// set to true if this is an SSL listen socket
bool ssl;
bool ssl = false;
// this is true when the udp socket send() has failed with EAGAIN or
// EWOULDBLOCK. i.e. we're currently waiting for the socket to become
// writeable again. Once it is, we'll set it to false and notify the utp
// socket manager
bool udp_write_blocked;
bool udp_write_blocked = false;
// the actual sockets (TCP listen socket and UDP socket)
// An entry does not necessarily have a UDP or TCP socket. One of these

View File

@ -41,14 +41,14 @@ namespace libtorrent
{
static const piece_block invalid;
piece_block() : piece_index(0) {}
piece_block() = default;
piece_block(piece_index_t p_index, int b_index)
: piece_index(p_index)
, block_index(b_index)
{
}
piece_index_t piece_index;
int block_index;
piece_index_t piece_index {0};
int block_index = 0;
bool operator<(piece_block const& b) const
{

View File

@ -285,9 +285,6 @@ namespace libtorrent
, public storage_piece_set
, boost::noncopyable
{
// hidden
storage_interface(): m_settings(0) {}
// This function is called when the storage is to be initialized. The
// default storage will create directories and empty files at this point.
@ -448,11 +445,11 @@ namespace libtorrent
virtual ~storage_interface() {}
// initialized in disk_io_thread::perform_async_job
aux::session_settings* m_settings;
aux::session_settings* m_settings = nullptr;
private:
bool m_need_tick = false;
file_storage const* m_files;
file_storage const* m_files = nullptr;
// the reason for this to be a void pointer
// is to avoid creating a dependency on the