Update BytecodeBuilder.cpp

Clean up casts
This commit is contained in:
Arseny Kapoulkine 2022-01-12 08:24:57 -08:00 committed by GitHub
parent 3c01448312
commit 690a0ba649
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -714,7 +714,7 @@ void BytecodeBuilder::writeLineInfo(std::string& ss) const
// third pass: write resulting data
int logspan = log2(span);
writeByte(ss, static_cast<unsigned char>(logspan));
writeByte(ss, uint8_t(logspan));
uint8_t lastOffset = 0;
@ -724,8 +724,8 @@ void BytecodeBuilder::writeLineInfo(std::string& ss) const
// Check delta if is a valid byte value
LUAU_ASSERT(delta >= 0 && delta <= 255);
writeByte(ss, static_cast<uint8_t>(delta) - lastOffset);
lastOffset = static_cast<uint8_t>(delta);
writeByte(ss, uint8_t(delta) - lastOffset);
lastOffset = uint8_t(delta);
}
int lastLine = 0;