Skip to content

Commit

Permalink
Update BytecodeBuilder.cpp
Browse files Browse the repository at this point in the history
Clean up casts
  • Loading branch information
zeux committed Jan 12, 2022
1 parent 3c01448 commit 690a0ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Compiler/src/BytecodeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -723,9 +723,9 @@ void BytecodeBuilder::writeLineInfo(std::string& ss) const
int delta = lines[i] - baseline[i >> logspan];
// 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;
Expand Down

0 comments on commit 690a0ba

Please sign in to comment.