forked from premiere/premiere-libtorrent
Missing member init (#1467)
initialize members of piece_block and use default member initialization.
This commit is contained in:
parent
af126fe507
commit
98cdc3192d
|
@ -121,10 +121,6 @@ namespace libtorrent
|
||||||
struct listen_socket_t
|
struct listen_socket_t
|
||||||
{
|
{
|
||||||
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[0] = -1;
|
||||||
tcp_port_mapping[1] = -1;
|
tcp_port_mapping[1] = -1;
|
||||||
|
@ -146,7 +142,7 @@ namespace libtorrent
|
||||||
// this is the port that was originally specified to listen on
|
// this is the port that was originally specified to listen on
|
||||||
// it may be different from local_endpoint.port() if we could
|
// it may be different from local_endpoint.port() if we could
|
||||||
// had to retry binding with a higher port
|
// 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
|
// this is typically set to the same as the local
|
||||||
// listen port. In case a NAT port forward was
|
// 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
|
// on the NAT box itself. This is the port that has
|
||||||
// to be published to peers, since this is the port
|
// to be published to peers, since this is the port
|
||||||
// the client is reachable through.
|
// the client is reachable through.
|
||||||
int tcp_external_port;
|
int tcp_external_port = 0;
|
||||||
int udp_external_port;
|
int udp_external_port = 0;
|
||||||
|
|
||||||
// 0 is natpmp 1 is upnp
|
// 0 is natpmp 1 is upnp
|
||||||
int tcp_port_mapping[2];
|
int tcp_port_mapping[2];
|
||||||
int udp_port_mapping[2];
|
int udp_port_mapping[2];
|
||||||
|
|
||||||
// set to true if this is an SSL listen socket
|
// 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
|
// 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
|
// 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
|
// writeable again. Once it is, we'll set it to false and notify the utp
|
||||||
// socket manager
|
// socket manager
|
||||||
bool udp_write_blocked;
|
bool udp_write_blocked = false;
|
||||||
|
|
||||||
// the actual sockets (TCP listen socket and UDP socket)
|
// the actual sockets (TCP listen socket and UDP socket)
|
||||||
// An entry does not necessarily have a UDP or TCP socket. One of these
|
// An entry does not necessarily have a UDP or TCP socket. One of these
|
||||||
|
|
|
@ -41,14 +41,14 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
static const piece_block invalid;
|
static const piece_block invalid;
|
||||||
|
|
||||||
piece_block() : piece_index(0) {}
|
piece_block() = default;
|
||||||
piece_block(piece_index_t p_index, int b_index)
|
piece_block(piece_index_t p_index, int b_index)
|
||||||
: piece_index(p_index)
|
: piece_index(p_index)
|
||||||
, block_index(b_index)
|
, block_index(b_index)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
piece_index_t piece_index;
|
piece_index_t piece_index {0};
|
||||||
int block_index;
|
int block_index = 0;
|
||||||
|
|
||||||
bool operator<(piece_block const& b) const
|
bool operator<(piece_block const& b) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -285,9 +285,6 @@ namespace libtorrent
|
||||||
, public storage_piece_set
|
, public storage_piece_set
|
||||||
, boost::noncopyable
|
, boost::noncopyable
|
||||||
{
|
{
|
||||||
// hidden
|
|
||||||
storage_interface(): m_settings(0) {}
|
|
||||||
|
|
||||||
|
|
||||||
// This function is called when the storage is to be initialized. The
|
// This function is called when the storage is to be initialized. The
|
||||||
// default storage will create directories and empty files at this point.
|
// default storage will create directories and empty files at this point.
|
||||||
|
@ -448,11 +445,11 @@ namespace libtorrent
|
||||||
virtual ~storage_interface() {}
|
virtual ~storage_interface() {}
|
||||||
|
|
||||||
// initialized in disk_io_thread::perform_async_job
|
// initialized in disk_io_thread::perform_async_job
|
||||||
aux::session_settings* m_settings;
|
aux::session_settings* m_settings = nullptr;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool m_need_tick = false;
|
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
|
// the reason for this to be a void pointer
|
||||||
// is to avoid creating a dependency on the
|
// is to avoid creating a dependency on the
|
||||||
|
|
Loading…
Reference in New Issue