mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
LibWasm: Remove unnecessary C-style casts
Or replace them with static-cast when necessary.
This commit is contained in:
parent
1ef536194d
commit
b97ad99014
Notes:
github-actions[bot]
2025-08-08 10:55:35 +00:00
Author: https://github.com/alimpfard
Commit: b97ad99014
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5060
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gmta
1 changed files with 6 additions and 6 deletions
|
@ -434,7 +434,7 @@ void BytecodeInterpreter::interpret_impl(Configuration& configuration, Expressio
|
||||||
auto instance = configuration.store().get(address);
|
auto instance = configuration.store().get(address);
|
||||||
auto pages = instance->size() / Constants::page_size;
|
auto pages = instance->size() / Constants::page_size;
|
||||||
dbgln_if(WASM_TRACE_DEBUG, "memory.size -> stack({})", pages);
|
dbgln_if(WASM_TRACE_DEBUG, "memory.size -> stack({})", pages);
|
||||||
configuration.push_to_destination(Value((i32)pages));
|
configuration.push_to_destination(Value(static_cast<i32>(pages)));
|
||||||
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
||||||
}
|
}
|
||||||
case Instructions::memory_grow.value(): {
|
case Instructions::memory_grow.value(): {
|
||||||
|
@ -446,9 +446,9 @@ void BytecodeInterpreter::interpret_impl(Configuration& configuration, Expressio
|
||||||
auto new_pages = entry.to<i32>();
|
auto new_pages = entry.to<i32>();
|
||||||
dbgln_if(WASM_TRACE_DEBUG, "memory.grow({}), previously {} pages...", new_pages, old_pages);
|
dbgln_if(WASM_TRACE_DEBUG, "memory.grow({}), previously {} pages...", new_pages, old_pages);
|
||||||
if (instance->grow(new_pages * Constants::page_size))
|
if (instance->grow(new_pages * Constants::page_size))
|
||||||
entry = Value((i32)old_pages);
|
entry = Value(old_pages);
|
||||||
else
|
else
|
||||||
entry = Value((i32)-1);
|
entry = Value(-1);
|
||||||
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
||||||
}
|
}
|
||||||
// https://webassembly.github.io/spec/core/bikeshed/#exec-memory-fill
|
// https://webassembly.github.io/spec/core/bikeshed/#exec-memory-fill
|
||||||
|
@ -664,9 +664,9 @@ void BytecodeInterpreter::interpret_impl(Configuration& configuration, Expressio
|
||||||
auto previous_size = table->elements().size();
|
auto previous_size = table->elements().size();
|
||||||
auto did_grow = table->grow(size, fill_value.to<Reference>());
|
auto did_grow = table->grow(size, fill_value.to<Reference>());
|
||||||
if (!did_grow) {
|
if (!did_grow) {
|
||||||
configuration.push_to_destination(Value((i32)-1));
|
configuration.push_to_destination(Value(-1));
|
||||||
} else {
|
} else {
|
||||||
configuration.push_to_destination(Value((i32)previous_size));
|
configuration.push_to_destination(Value(static_cast<i32>(previous_size)));
|
||||||
}
|
}
|
||||||
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
||||||
}
|
}
|
||||||
|
@ -674,7 +674,7 @@ void BytecodeInterpreter::interpret_impl(Configuration& configuration, Expressio
|
||||||
auto table_index = instruction->arguments().get<TableIndex>();
|
auto table_index = instruction->arguments().get<TableIndex>();
|
||||||
auto address = configuration.frame().module().tables()[table_index.value()];
|
auto address = configuration.frame().module().tables()[table_index.value()];
|
||||||
auto table = configuration.store().get(address);
|
auto table = configuration.store().get(address);
|
||||||
configuration.push_to_destination(Value((i32)table->elements().size()));
|
configuration.push_to_destination(Value(static_cast<i32>(table->elements().size())));
|
||||||
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
RUN_NEXT_INSTRUCTION(CouldHaveChangedIP::No);
|
||||||
}
|
}
|
||||||
case Instructions::ref_null.value(): {
|
case Instructions::ref_null.value(): {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue