mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Decoder: 64-bit shift to avoid UB
Shifting a value by more than the size of its type is UB. This was actually causing mangled serial numbers with optimization on using Clang 12 on Linux.
This commit is contained in:
@@ -16,7 +16,7 @@ namespace icsneo {
|
||||
|
||||
class Decoder {
|
||||
public:
|
||||
static uint64_t GetUInt64FromLEBytes(uint8_t* bytes);
|
||||
static uint64_t GetUInt64FromLEBytes(const uint8_t* bytes);
|
||||
|
||||
Decoder(device_eventhandler_t report) : report(report) {}
|
||||
bool decode(std::shared_ptr<Message>& result, const std::shared_ptr<Packet>& packet);
|
||||
|
||||
Reference in New Issue
Block a user