-
-
Notifications
You must be signed in to change notification settings - Fork 226
cppcheck fixes #537
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
base: master
Are you sure you want to change the base?
cppcheck fixes #537
Conversation
There was a problem hiding this 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/1)
| inline void fill_write_buffer(); | ||
|
|
||
| uint32_t m_skipLength; | ||
| uint32_t m_skipLength{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid case style for private member m_skipLength
| uint32_t m_skipLength{}; | |
| uint32_t m_skip_length{}; |
b5e9fed to
c673cba
Compare
src/net/data_buffer.h
Outdated
| inline DataBuffer | ||
| DataBuffer::release() { | ||
| set_data(nullptr, 0, false); | ||
| return *this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes behavior.
src/protocol/extensions.cc
Outdated
|
|
||
| memcpy(m_pending.end(), buffer + (piece << metadata_piece_shift), length); | ||
| m_pending.set(m_pending.data(), m_pending.end() + length, m_pending.owned()); | ||
| m_pending.set_data(m_pending.data(), length, m_pending.owned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect lenght.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
src/torrent/error.cc
Outdated
| const char* | ||
| strerror(int err) { | ||
| if (err < 0 || err > e_last) | ||
| if (err < 0 || err >= e_last) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, we use e_last+1 above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
Found with useStlAlgorithm Signed-off-by: Rosen Penev <rosenp@gmail.com>
No need to specify the typename. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with derefInvalidIteratorRedundantCheck Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with derefInvalidIterator Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with noConstructor Signed-off-by: Rosen Penev <rosenp@gmail.com>
Avoids having to pass nullptr. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
No description provided.