Skip to content

Commit

Permalink
Add cast
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Jan 13, 2025
1 parent 6ee6c9b commit 9358c78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/shared/sg_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void sg_util::SetInt24(span<uint8_t> buf, int offset, int value)
{
assert(buf.size() > static_cast<size_t>(offset) + 2);

buf[offset] = static_cast<uint8_t>(value >> 16);
buf[offset + 1] = static_cast<uint8_t>(value >> 8);
buf[offset] = static_cast<uint8_t>(static_cast<uint32_t>(value) >> 16);
buf[offset + 1] = static_cast<uint8_t>(static_cast<uint32_t>(value) >> 8);
buf[offset + 2] = static_cast<uint8_t>(value);
}

0 comments on commit 9358c78

Please sign in to comment.