Skip to content

Commit

Permalink
NITWORK: Fix wrong comment for NOLINTBEGIN and implicit conversion 'i…
Browse files Browse the repository at this point in the history
…nt' -> bool

PATCH
  • Loading branch information
romainpanno committed Oct 4, 2023
1 parent 542eca6 commit cc4fa9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Nitwork/ANitwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ namespace Nitwork {
startReceiveHandler();
return;
}
// NOLINT BEGIN(cppcoreguidelines-pro-type-reinterpret-cast)
// NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast)
auto *header = reinterpret_cast<struct header_s *>(_receiveBuffer.data());
// NOLINT END(cppcoreguidelines-pro-type-reinterpret-cast)
// NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast)

if (header->magick1 != HEADER_CODE1 || header->magick2 != HEADER_CODE2) {
std::cerr << "Error: header magick not valid" << std::endl;
Expand Down Expand Up @@ -163,7 +163,7 @@ namespace Nitwork {
}
std::reverse(ids.begin(), ids.end());
for (std::size_t index = 0; index < _packetsSent.size(); index++) {
if (!ids[index]) {
if (ids[index] == 0) {
auto packet = std::find_if(_packetsSent.begin(), _packetsSent.end(), [header, index](auto &packet) {
return std::size_t(packet.second.id) == header.last_id_received - index;
});
Expand Down
4 changes: 2 additions & 2 deletions src/Nitwork/NitworkServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ namespace Nitwork {

void NitworkServer::handleBodyAction(const struct header_s &header, const boost::asio::ip::udp::endpoint & /* unused */)
{
// NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast)
// NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast, cppcoreguidelines-pro-bounds-pointer-arithmetic)
auto *action = reinterpret_cast<struct action_s *>(_receiveBuffer.data() + sizeof(struct header_s));
// NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast)
// NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast, cppcoreguidelines-pro-bounds-pointer-arithmetic)
auto it = _actionsHandlers.find(action->magick);

if (it == _actionsHandlers.end()) {
Expand Down

0 comments on commit cc4fa9a

Please sign in to comment.