Skip to content

Commit

Permalink
download: default initialize
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Feb 11, 2025
1 parent 116d6d8 commit 79a87bd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 17 deletions.
4 changes: 1 addition & 3 deletions src/download/available_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class AvailableList : private std::vector<rak::socket_address> {
using base_type::rbegin;
using base_type::rend;

AvailableList() : m_maxSize(1000) {}

value_type pop_random();

// Fuzzy size limit.
Expand All @@ -94,7 +92,7 @@ class AvailableList : private std::vector<rak::socket_address> {
AddressList* buffer() { return &m_buffer; }

private:
size_type m_maxSize;
size_type m_maxSize{1000};

AddressList m_buffer;
};
Expand Down
4 changes: 1 addition & 3 deletions src/download/delegator.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class Delegator {

static const unsigned int block_size = 1 << 14;

Delegator() : m_aggressive(false) { }

TransferList* transfer_list() { return &m_transfers; }
const TransferList* transfer_list() const { return &m_transfers; }

Expand All @@ -79,7 +77,7 @@ class Delegator {

TransferList m_transfers;

bool m_aggressive;
bool m_aggressive{false};

// Propably should add a m_slotChunkStart thing, which will take
// care of enabling etc, and will be possible to listen to.
Expand Down
6 changes: 1 addition & 5 deletions src/download/download_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
namespace torrent {

DownloadWrapper::DownloadWrapper() :
m_main(new DownloadMain),

m_bencode(NULL),
m_hashChecker(NULL),
m_connectionType(0) {
m_main(new DownloadMain) {

m_main->delay_download_done().slot() = std::bind(&download_data::call_download_done, data());
m_main->delay_partially_done().slot() = std::bind(&download_data::call_partially_done, data());
Expand Down
6 changes: 3 additions & 3 deletions src/download/download_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ class DownloadWrapper {
void finished_download();

DownloadMain* m_main;
Object* m_bencode;
HashTorrent* m_hashChecker;
Object* m_bencode{};
HashTorrent* m_hashChecker{};
HashQueue* m_hashQueue;

std::string m_hash;

int m_connectionType;
int m_connectionType{0};
};

}
Expand Down
4 changes: 2 additions & 2 deletions src/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Manager::Manager() :
m_client_list(new ClientList),

m_uploadThrottle(Throttle::create_throttle()),
m_downloadThrottle(Throttle::create_throttle()),
m_downloadThrottle(Throttle::create_throttle())

m_ticks(0) {
{

m_hash_queue = std::make_unique<HashQueue>(&m_main_thread_disk);

Expand Down
2 changes: 1 addition & 1 deletion src/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Manager {
Throttle* m_uploadThrottle;
Throttle* m_downloadThrottle;

unsigned int m_ticks;
unsigned int m_ticks{0};
rak::priority_item m_taskTick;
};

Expand Down

0 comments on commit 79a87bd

Please sign in to comment.