using c++ cast

This commit is contained in:
ValKmjolnir
2023-09-15 00:04:19 +08:00
parent 36a2aa67ef
commit b77d7fafb1
11 changed files with 126 additions and 95 deletions

View File

@@ -47,7 +47,7 @@ void codestream::dump(std::ostream& out) const {
auto num = code.num;
out << hex << "0x"
<< setw(6) << setfill('0') << index << " "
<< setw(2) << setfill('0') << (u32)op << " "
<< setw(2) << setfill('0') << static_cast<u32>(op) << " "
<< setw(2) << setfill('0') << ((num>>16)&0xff) << " "
<< setw(2) << setfill('0') << ((num>>8)&0xff) << " "
<< setw(2) << setfill('0') << (num&0xff) << " "
@@ -92,7 +92,8 @@ void codestream::dump(std::ostream& out) const {
out << hex << "0x" << num << dec; break;
case op_callb:
out << hex << "0x" << num << " <" << natives[num].name
<< "@0x" << (u64)natives[num].func << dec << ">"; break;
<< "@0x" << reinterpret_cast<u64>(natives[num].func)
<< dec << ">"; break;
case op_upval: case op_mupval:
case op_loadu:
out << hex << "0x" << ((num>>16)&0xffff)