Commit 6975f95 1 parent 05e73bd commit 6975f95 Copy full SHA for 6975f95
File tree 1 file changed +4
-3
lines changed
compiler/extensions/cpp/runtime/src/zserio
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -628,7 +628,8 @@ inline void BitStreamWriter::writeVarNum(
628
628
if (hasNextByte)
629
629
{
630
630
numBits--;
631
- byte |= static_cast <uint8_t >(0x01U << numBits); // use bit 6 if signed bit is present, use bit 7 otherwise
631
+ uint8_t add = static_cast <uint8_t >(0x01U << numBits);
632
+ byte = static_cast <uint8_t >(byte | add); // use bit 6 if signed bit is present, use bit 7 otherwise
632
633
}
633
634
else // this is the last byte
634
635
{
@@ -637,8 +638,8 @@ inline void BitStreamWriter::writeVarNum(
637
638
}
638
639
639
640
const size_t shiftBits = (numVarBytes - (i + 1 )) * 7 + ((hasMaxByteRange && hasNextByte) ? 1 : 0 );
640
- uint8_t val = static_cast <uint8_t >((value >> shiftBits) & bitMasks[numBits - 1 ]);
641
- byte = static_cast <uint8_t >(byte | val );
641
+ uint8_t add = static_cast <uint8_t >((value >> shiftBits) & bitMasks[numBits - 1 ]);
642
+ byte = static_cast <uint8_t >(byte | add );
642
643
writeUnsignedBits (byte, 8 );
643
644
}
644
645
}
You can’t perform that action at this time.
0 commit comments