Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more clang-tidy fixes #299

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

more clang-tidy fixes #299

wants to merge 8 commits into from

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Jan 20, 2025

No description provided.

neheb added 8 commits January 19, 2025 16:19
Found with modernize-concat-nested-namespaces

Signed-off-by: Rosen Penev <[email protected]>
Found with bugprone-assignment-in-if-condition

Signed-off-by: Rosen Penev <[email protected]>
Found with performance-unnecessary-value-param

Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/9)

size_type m_size;
size_type m_maxSize;
size_type m_size{0};
size_type m_maxSize{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxSize

Suggested change
size_type m_maxSize{0};
size_type m_max_size{0};


priority_type m_priority;
uint32_t m_sendBufferSize;
uint32_t m_receiveBufferSize;
uint32_t m_sendBufferSize{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_sendBufferSize

Suggested change
uint32_t m_sendBufferSize{0};
uint32_t m_send_buffer_size{0};

uint32_t m_sendBufferSize;
uint32_t m_receiveBufferSize;
uint32_t m_sendBufferSize{0};
uint32_t m_receiveBufferSize{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_receiveBufferSize

Suggested change
uint32_t m_receiveBufferSize{0};
uint32_t m_receive_buffer_size{0};

uint32_t m_sizePex;
uint32_t m_maxSizePex;
size_t m_metadataSize;
uint64_t m_uploadedBaseline{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_uploadedBaseline

Suggested change
uint64_t m_uploadedBaseline{0};
uint64_t m_uploaded_baseline{0};

uint32_t m_maxSizePex;
size_t m_metadataSize;
uint64_t m_uploadedBaseline{0};
uint64_t m_completedBaseline{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_completedBaseline

Suggested change
uint64_t m_completedBaseline{0};
uint64_t m_completed_baseline{0};

size_t m_metadataSize;
uint64_t m_uploadedBaseline{0};
uint64_t m_completedBaseline{0};
uint32_t m_sizePex{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_sizePex

Suggested change
uint32_t m_sizePex{0};
uint32_t m_size_pex{0};

uint64_t m_uploadedBaseline{0};
uint64_t m_completedBaseline{0};
uint32_t m_sizePex{0};
uint32_t m_maxSizePex{8};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxSizePex

Suggested change
uint32_t m_maxSizePex{8};
uint32_t m_max_size_pex{8};

uint64_t m_completedBaseline{0};
uint32_t m_sizePex{0};
uint32_t m_maxSizePex{8};
size_t m_metadataSize{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_metadataSize

Suggested change
size_t m_metadataSize{0};
size_t m_metadata_size{0};


uint32_t m_creationDate;
uint32_t m_creationDate{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_creationDate

Suggested change
uint32_t m_creationDate{0};
uint32_t m_creation_date{0};


char m_sync[20];
unsigned int m_syncLength;
unsigned int m_syncLength{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_syncLength

Suggested change
unsigned int m_syncLength{0};
unsigned int m_sync_length{0};

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (2/9)


unsigned int m_lengthIA;
unsigned int m_lengthIA{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_lengthIA

Suggested change
unsigned int m_lengthIA{0};
unsigned int m_length_ia{0};

uint32_t m_notStalled;

state_type m_state{STATE_INCOMPLETE};
uint32_t m_notStalled{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_notStalled

Suggested change
uint32_t m_notStalled{0};
uint32_t m_not_stalled{0};


BlockFailed* m_failedList;
BlockFailed* m_failedList{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_failedList

Suggested change
BlockFailed* m_failedList{};
BlockFailed* m_failed_list{};

uint32_t m_chunkSize;
int m_prot;
uint32_t m_chunkSize{0};
int m_prot{~0};
};

inline Chunk::iterator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
incomplete type torrent::Chunk named in nested name specifier

@@ -56,13 +56,7 @@ class lt_cacheline_aligned ChunkListNode {
public:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
expected expression

@@ -114,8 +114,8 @@ class TransferList : public std::vector<BlockList*> {

completed_list_type m_completedList;

uint32_t m_succeededCount;
uint32_t m_failedCount;
uint32_t m_succeededCount{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_succeededCount

Suggested change
uint32_t m_succeededCount{0};
uint32_t m_succeeded_count{0};

uint32_t m_succeededCount;
uint32_t m_failedCount;
uint32_t m_succeededCount{0};
uint32_t m_failedCount{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_failedCount

Suggested change
uint32_t m_failedCount{0};
uint32_t m_failed_count{0};

@@ -80,11 +80,11 @@ class LIBTORRENT_EXPORT FileManager : private std::vector<File*> {
FileManager(const FileManager&) LIBTORRENT_NO_EXPORT;
void operator = (const FileManager&) LIBTORRENT_NO_EXPORT;

size_type m_maxOpenFiles;
size_type m_maxOpenFiles{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxOpenFiles

Suggested change
size_type m_maxOpenFiles{0};
size_type m_max_open_files{0};

uint64_t m_filesOpenedCounter;
uint64_t m_filesClosedCounter;
uint64_t m_filesFailedCounter;
uint64_t m_filesOpenedCounter{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_filesOpenedCounter

Suggested change
uint64_t m_filesOpenedCounter{0};
uint64_t m_files_opened_counter{0};

uint64_t m_filesClosedCounter;
uint64_t m_filesFailedCounter;
uint64_t m_filesOpenedCounter{0};
uint64_t m_filesClosedCounter{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_filesClosedCounter

Suggested change
uint64_t m_filesClosedCounter{0};
uint64_t m_files_closed_counter{0};

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (3/9)

uint64_t m_filesFailedCounter;
uint64_t m_filesOpenedCounter{0};
uint64_t m_filesClosedCounter{0};
uint64_t m_filesFailedCounter{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_filesFailedCounter

Suggested change
uint64_t m_filesFailedCounter{0};
uint64_t m_files_failed_counter{0};


size_t m_fullCacheLength;
size_t m_fullCacheLength{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_fullCacheLength

Suggested change
size_t m_fullCacheLength{0};
size_t m_full_cache_length{0};

PeerInfo* m_peerInfo;
DownloadMain* m_download;
PeerConnectionBase* m_connection;
PeerInfo* m_peerInfo{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_peerInfo

Suggested change
PeerInfo* m_peerInfo{};
PeerInfo* m_peer_info{};


uint8_t m_readType;
uint8_t m_readType{FIRST_INVALID};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_readType

Suggested change
uint8_t m_readType{FIRST_INVALID};
uint8_t m_read_type{FIRST_INVALID};

char* m_readPos;

MessageType m_pendingType;
MessageType m_pendingType{HANDSHAKE};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_pendingType

Suggested change
MessageType m_pendingType{HANDSHAKE};
MessageType m_pending_type{HANDSHAKE};

@@ -56,13 +56,7 @@ class lt_cacheline_aligned ChunkListNode {
public:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
expected expression

@@ -77,7 +77,7 @@ class ThrottleInternal : public Throttle {
SlaveList m_slaveList;
SlaveList::iterator m_nextSlave;

uint32_t m_unusedQuota;
uint32_t m_unusedQuota{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_unusedQuota

Suggested change
uint32_t m_unusedQuota{0};
uint32_t m_unused_quota{0};

@@ -159,11 +159,11 @@ class LIBTORRENT_EXPORT ResourceManager :

int balance_unchoked(unsigned int weight, unsigned int max_unchoked, bool is_up);

unsigned int m_currentlyUploadUnchoked;
unsigned int m_currentlyDownloadUnchoked;
unsigned int m_currentlyUploadUnchoked{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_currentlyUploadUnchoked

Suggested change
unsigned int m_currentlyUploadUnchoked{0};
unsigned int m_currently_upload_unchoked{0};

unsigned int m_currentlyUploadUnchoked;
unsigned int m_currentlyDownloadUnchoked;
unsigned int m_currentlyUploadUnchoked{0};
unsigned int m_currentlyDownloadUnchoked{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_currentlyDownloadUnchoked

Suggested change
unsigned int m_currentlyDownloadUnchoked{0};
unsigned int m_currently_download_unchoked{0};


unsigned int m_maxUploadUnchoked;
unsigned int m_maxDownloadUnchoked;
unsigned int m_maxUploadUnchoked{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxUploadUnchoked

Suggested change
unsigned int m_maxUploadUnchoked{0};
unsigned int m_max_upload_unchoked{0};

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (4/9)

unsigned int m_maxUploadUnchoked;
unsigned int m_maxDownloadUnchoked;
unsigned int m_maxUploadUnchoked{0};
unsigned int m_maxDownloadUnchoked{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxDownloadUnchoked

Suggested change
unsigned int m_maxDownloadUnchoked{0};
unsigned int m_max_download_unchoked{0};

PeerInfo* m_peerInfo;
DownloadMain* m_download;
PeerInfo* m_peerInfo{};
DownloadMain* m_download{};
Bitfield m_bitfield;

ThrottleList* m_uploadThrottle;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
unknown type name ThrottleList; did you mean Throttle?

Suggested change
ThrottleList* m_uploadThrottle;
Throttle* m_uploadThrottle;

ThrottleList* m_throttle;
State m_state{IDLE};
Protocol m_lastCommand{NONE};
ThrottleList* m_throttle{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
unknown type name ThrottleList; did you mean Throttle?

Suggested change
ThrottleList* m_throttle{};
Throttle* m_throttle{};

uint32_t size_unchoked() const { return m_currently_unchoked; }
uint32_t size_queued() const { return m_currently_queued; }
uint32_t size_total() const { return size_unchoked() + size_queued(); }
m_maxUnchoked(unlimited) {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxUnchoked

Suggested change
m_maxUnchoked(unlimited) {}
m_max_unchoked(unlimited) {}

Comment on lines +115 to +116
bool is_full() const { return !is_unlimited() && size_unchoked() >= m_maxUnchoked; }
bool is_unlimited() const { return m_maxUnchoked == unlimited; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxUnchoked

Suggested change
bool is_full() const { return !is_unlimited() && size_unchoked() >= m_maxUnchoked; }
bool is_unlimited() const { return m_maxUnchoked == unlimited; }
bool is_full() const { return !is_unlimited() && size_unchoked() >= m_max_unchoked; }
bool is_unlimited() const { return m_max_unchoked == unlimited; }

Comment on lines +123 to +125
uint32_t max_unchoked() const { return m_maxUnchoked; }
int32_t max_unchoked_signed() const { return m_maxUnchoked; }
void set_max_unchoked(uint32_t v) { m_maxUnchoked = v; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxUnchoked

Suggested change
uint32_t max_unchoked() const { return m_maxUnchoked; }
int32_t max_unchoked_signed() const { return m_maxUnchoked; }
void set_max_unchoked(uint32_t v) { m_maxUnchoked = v; }
uint32_t max_unchoked() const { return m_max_unchoked; }
int32_t max_unchoked_signed() const { return m_max_unchoked; }
void set_max_unchoked(uint32_t v) { m_max_unchoked = v; }

slot_unchoke m_slotUnchoke;
slot_can_unchoke m_slotCanUnchoke;
slot_connection m_slotConnection;
uint32_t m_maxUnchoked;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxUnchoked

Suggested change
uint32_t m_maxUnchoked;
uint32_t m_max_unchoked;


void modify_currently_queued(int value) { m_currently_queued += value; }
void modify_currently_unchoked(int value) { m_currently_unchoked += value; }
void set_slot_unchoke(slot_unchoke s) { m_slotUnchoke = std::move(s); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_slotUnchoke

Suggested change
void set_slot_unchoke(slot_unchoke s) { m_slotUnchoke = std::move(s); }
void set_slot_unchoke(slot_unchoke s) { m_slot_unchoke = std::move(s); }

uint32_t m_currently_queued{0};
uint32_t m_currently_unchoked{0};

slot_unchoke m_slotUnchoke;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_slotUnchoke

Suggested change
slot_unchoke m_slotUnchoke;
slot_unchoke m_slot_unchoke;

void modify_currently_queued(int value) { m_currently_queued += value; }
void modify_currently_unchoked(int value) { m_currently_unchoked += value; }
void set_slot_unchoke(slot_unchoke s) { m_slotUnchoke = std::move(s); }
void set_slot_can_unchoke(slot_can_unchoke s) { m_slotCanUnchoke = std::move(s); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_slotCanUnchoke

Suggested change
void set_slot_can_unchoke(slot_can_unchoke s) { m_slotCanUnchoke = std::move(s); }
void set_slot_can_unchoke(slot_can_unchoke s) { m_slot_can_unchoke = std::move(s); }

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (5/9)

uint32_t m_currently_unchoked{0};

slot_unchoke m_slotUnchoke;
slot_can_unchoke m_slotCanUnchoke;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_slotCanUnchoke

Suggested change
slot_can_unchoke m_slotCanUnchoke;
slot_can_unchoke m_slot_can_unchoke;

void modify_currently_unchoked(int value) { m_currently_unchoked += value; }
void set_slot_unchoke(slot_unchoke s) { m_slotUnchoke = std::move(s); }
void set_slot_can_unchoke(slot_can_unchoke s) { m_slotCanUnchoke = std::move(s); }
void set_slot_connection(slot_connection s) { m_slotConnection = std::move(s); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_slotConnection

Suggested change
void set_slot_connection(slot_connection s) { m_slotConnection = std::move(s); }
void set_slot_connection(slot_connection s) { m_slot_connection = std::move(s); }


slot_unchoke m_slotUnchoke;
slot_can_unchoke m_slotCanUnchoke;
slot_connection m_slotConnection;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_slotConnection

Suggested change
slot_connection m_slotConnection;
slot_connection m_slot_connection;

@@ -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};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxSize

Suggested change
size_type m_maxSize{1000};
size_type m_max_size{1000};

@@ -146,10 +146,10 @@ class LIBTORRENT_EXPORT FileList : private std::vector<File*> {

download_data m_data;

bool m_isOpen;
bool m_isOpen{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_isOpen

Suggested change
bool m_isOpen{false};
bool m_is_open{false};


uint64_t m_torrentSize;
uint32_t m_chunkSize;
uint64_t m_torrentSize{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_torrentSize

Suggested change
uint64_t m_torrentSize{0};
uint64_t m_torrent_size{0};

uint64_t m_torrentSize;
uint32_t m_chunkSize;
uint64_t m_torrentSize{0};
uint32_t m_chunkSize{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_chunkSize

Suggested change
uint32_t m_chunkSize{0};
uint32_t m_chunk_size{0};

@@ -147,8 +147,8 @@ class LIBTORRENT_EXPORT ConnectionList : private std::vector<Peer*> {

DownloadMain* m_download;

size_type m_minSize;
size_type m_maxSize;
size_type m_minSize{50};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_minSize

Suggested change
size_type m_minSize{50};
size_type m_min_size{50};

size_type m_minSize;
size_type m_maxSize;
size_type m_minSize{50};
size_type m_maxSize{100};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_maxSize

Suggested change
size_type m_maxSize{100};
size_type m_max_size{100};

Delegator* m_delegator;
PeerChunks* m_peerChunks;
Delegator* m_delegator{};
PeerChunks* m_peerChunks{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_peerChunks

Suggested change
PeerChunks* m_peerChunks{};
PeerChunks* m_peer_chunks{};

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (6/9)

@@ -88,9 +88,9 @@ class PeerChunks {
const ThrottleNode* upload_throttle() const { return &m_uploadThrottle; }

private:
PeerInfo* m_peerInfo;
PeerInfo* m_peerInfo{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_peerInfo

Suggested change
PeerInfo* m_peerInfo{};
PeerInfo* m_peer_info{};


bool m_usingCounter;
bool m_usingCounter{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_usingCounter

Suggested change
bool m_usingCounter{false};
bool m_using_counter{false};

@@ -76,7 +76,7 @@ class DownloadConstructor {
void parse_single_file(const Object& b, uint32_t chunkSize);
void parse_multi_files(const Object& b, uint32_t chunkSize);

inline Path create_path(const Object::list_type& plist, const std::string enc);
inline Path create_path(const Object::list_type& plist, const std::string& enc);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
incomplete type torrent::Object named in nested name specifier

@@ -59,9 +57,9 @@ class EncryptionInfo {
void set_decrypt(const RC4& decrypt) { m_decrypt = decrypt; m_decryptValid = true; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_decryptValid

Suggested change
void set_decrypt(const RC4& decrypt) { m_decrypt = decrypt; m_decryptValid = true; }
void set_decrypt(const RC4& decrypt) { m_decrypt = decrypt; m_decrypt_valid = true; }

bool m_decryptValid;
bool m_encrypted{false};
bool m_obfuscated{false};
bool m_decryptValid{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_decryptValid

Suggested change
bool m_decryptValid{false};
bool m_decrypt_valid{false};

@@ -187,7 +187,7 @@ class DhtServer : public SocketDatagram {
unsigned int m_errorsReceived;
unsigned int m_errorsCaught;

bool m_networkUp;
bool m_networkUp{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_networkUp

Suggested change
bool m_networkUp{false};
bool m_network_up{false};

port_type m_port;

int m_portSent;
bool m_canReceive;
int m_portSent{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_portSent

Suggested change
int m_portSent{0};
int m_port_sent{0};

int m_portSent;
bool m_canReceive;
int m_portSent{0};
bool m_canReceive{true};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_canReceive

Suggested change
bool m_canReceive{true};
bool m_can_receive{true};


int64_t m_timeLastChoke;
int64_t m_timeLastChoke{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_timeLastChoke

Suggested change
int64_t m_timeLastChoke{0};
int64_t m_time_last_choke{0};

@@ -74,10 +74,10 @@ class InitialSeeding {
void complete(PeerConnectionBase* pcb);
void unblock_all();

uint32_t m_nextChunk;
uint32_t m_nextChunk{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_nextChunk

Suggested change
uint32_t m_nextChunk{0};
uint32_t m_next_chunk{0};

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (7/9)

uint32_t m_chunksLeft;
DownloadMain* m_download;
PeerInfo** m_peerChunks;
std::unique_ptr<PeerInfo*[]> m_peerChunks;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_peerChunks

Suggested change
std::unique_ptr<PeerInfo*[]> m_peerChunks;
std::unique_ptr<PeerInfo*[]> m_peer_chunks;


int m_numRefresh;
int m_numRefresh{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_numRefresh

Suggested change
int m_numRefresh{0};
int m_num_refresh{0};

uint32_t m_transferCounter;
uint32_t m_lastConnection;
uint32_t m_lastHandshake;
uint32_t m_failedCounter{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_failedCounter

Suggested change
uint32_t m_failedCounter{0};
uint32_t m_failed_counter{0};

uint32_t m_lastConnection;
uint32_t m_lastHandshake;
uint32_t m_failedCounter{0};
uint32_t m_transferCounter{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_transferCounter

Suggested change
uint32_t m_transferCounter{0};
uint32_t m_transfer_counter{0};

uint32_t m_lastHandshake;
uint32_t m_failedCounter{0};
uint32_t m_transferCounter{0};
uint32_t m_lastConnection{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_lastConnection

Suggested change
uint32_t m_lastConnection{0};
uint32_t m_last_connection{0};

uint32_t m_failedCounter{0};
uint32_t m_transferCounter{0};
uint32_t m_lastConnection{0};
uint32_t m_lastHandshake{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_lastHandshake

Suggested change
uint32_t m_lastHandshake{0};
uint32_t m_last_handshake{0};


uint16_t m_listenPort;
uint16_t m_listenPort{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_listenPort

Suggested change
uint16_t m_listenPort{0};
uint16_t m_listen_port{0};

Object* m_bencode;
HashTorrent* m_hashChecker;
Object* m_bencode{};
HashTorrent* m_hashChecker{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_hashChecker

Suggested change
HashTorrent* m_hashChecker{};
HashTorrent* m_hash_checker{};

HashQueue* m_hashQueue;

std::string m_hash;

int m_connectionType;
int m_connectionType{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_connectionType

Suggested change
int m_connectionType{0};
int m_connection_type{0};

@@ -56,13 +56,7 @@ class lt_cacheline_aligned ChunkListNode {
public:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
expected expression

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (8/9)


uint32_t m_action;
uint64_t m_connectionId;
uint32_t m_transactionId;

ReadBuffer* m_readBuffer;
WriteBuffer* m_writeBuffer;
ReadBuffer* m_readBuffer{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_readBuffer

Suggested change
ReadBuffer* m_readBuffer{};
ReadBuffer* m_read_buffer{};

ReadBuffer* m_readBuffer;
WriteBuffer* m_writeBuffer;
ReadBuffer* m_readBuffer{};
WriteBuffer* m_writeBuffer{};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_writeBuffer

Suggested change
WriteBuffer* m_writeBuffer{};
WriteBuffer* m_write_buffer{};

uint32_t m_chunkSize;
int m_prot;
uint32_t m_chunkSize{0};
int m_prot{~0};
};

inline Chunk::iterator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
Chunk is not a class, namespace, or enumeration


bool m_bySeeder;
bool m_bySeeder{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_bySeeder

Suggested change
bool m_bySeeder{false};
bool m_by_seeder{false};

uint32_t m_outstandingQuota;
uint32_t m_unallocatedQuota;
uint32_t m_unusedUnthrottledQuota;
uint32_t m_outstandingQuota{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_outstandingQuota

Suggested change
uint32_t m_outstandingQuota{0};
uint32_t m_outstanding_quota{0};

uint32_t m_unallocatedQuota;
uint32_t m_unusedUnthrottledQuota;
uint32_t m_outstandingQuota{0};
uint32_t m_unallocatedQuota{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_unallocatedQuota

Suggested change
uint32_t m_unallocatedQuota{0};
uint32_t m_unallocated_quota{0};

uint32_t m_unusedUnthrottledQuota;
uint32_t m_outstandingQuota{0};
uint32_t m_unallocatedQuota{0};
uint32_t m_unusedUnthrottledQuota{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_unusedUnthrottledQuota

Suggested change
uint32_t m_unusedUnthrottledQuota{0};
uint32_t m_unused_unthrottled_quota{0};


uint32_t m_rateAdded;
uint32_t m_rateAdded{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_rateAdded

Suggested change
uint32_t m_rateAdded{0};
uint32_t m_rate_added{0};

@@ -148,24 +148,24 @@ class LIBTORRENT_EXPORT ChunkManager : private std::vector<ChunkList*> {

void sync_all(int flags, uint64_t target) LIBTORRENT_NO_EXPORT;

uint64_t m_memoryUsage;
uint64_t m_memoryUsage{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_memoryUsage

Suggested change
uint64_t m_memoryUsage{0};
uint64_t m_memory_usage{0};

uint64_t m_maxMemoryUsage;

uint32_t m_memoryBlockCount;
uint32_t m_memoryBlockCount{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_memoryBlockCount

Suggested change
uint32_t m_memoryBlockCount{0};
uint32_t m_memory_block_count{0};

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (9/9)

bool m_safeSync;
uint32_t m_timeoutSync;
uint32_t m_timeoutSafeSync;
bool m_safeSync{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_safeSync

Suggested change
bool m_safeSync{false};
bool m_safe_sync{false};

uint32_t m_timeoutSync;
uint32_t m_timeoutSafeSync;
bool m_safeSync{false};
uint32_t m_timeoutSync{600};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_timeoutSync

Suggested change
uint32_t m_timeoutSync{600};
uint32_t m_timeout_sync{600};

uint32_t m_timeoutSafeSync;
bool m_safeSync{false};
uint32_t m_timeoutSync{600};
uint32_t m_timeoutSafeSync{900};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_timeoutSafeSync

Suggested change
uint32_t m_timeoutSafeSync{900};
uint32_t m_timeout_safe_sync{900};


uint32_t m_preloadType;
uint32_t m_preloadType{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_preloadType

Suggested change
uint32_t m_preloadType{0};
uint32_t m_preload_type{0};

uint32_t m_preloadMinSize;
uint32_t m_preloadRequiredRate;

uint32_t m_statsPreloaded;
uint32_t m_statsNotPreloaded;
uint32_t m_statsPreloaded{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_statsPreloaded

Suggested change
uint32_t m_statsPreloaded{0};
uint32_t m_stats_preloaded{0};

uint32_t m_statsPreloaded;
uint32_t m_statsNotPreloaded;
uint32_t m_statsPreloaded{0};
uint32_t m_statsNotPreloaded{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_statsNotPreloaded

Suggested change
uint32_t m_statsNotPreloaded{0};
uint32_t m_stats_not_preloaded{0};


int32_t m_timerStarved;
size_type m_lastFreed;
int32_t m_timerStarved{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_timerStarved

Suggested change
int32_t m_timerStarved{0};
int32_t m_timer_starved{0};

int32_t m_timerStarved;
size_type m_lastFreed;
int32_t m_timerStarved{0};
size_type m_lastFreed{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for private member m_lastFreed

Suggested change
size_type m_lastFreed{0};
size_type m_last_freed{0};

uint32_t m_chunkSize;
int m_prot;
uint32_t m_chunkSize{0};
int m_prot{~0};
};

inline Chunk::iterator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
Chunk is not a class, namespace, or enumeration

@@ -56,13 +56,7 @@ class lt_cacheline_aligned ChunkListNode {
public:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
expected expression

@neheb
Copy link
Contributor Author

neheb commented Jan 20, 2025

That m_peerChunks unique_ptr looks like it should be a vector IMO.

@rakshasa
Copy link
Owner

This is too much to review for no real immediate benefit.

While I want code converted as new PR's touch upon them, going through this much just for syntactical cleanup is not worth it.

@neheb
Copy link
Contributor Author

neheb commented Jan 20, 2025

I could reduce the commit count if you want.

@rakshasa
Copy link
Owner

Won't change the fact that most of those changes are not worth the time reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants