mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:37:34 +00:00
Everywhere: Run clang-format
The following command was used to clang-format these files: clang-format-16 -i $(find . \ -not \( -path "./\.*" -prune \) \ -not \( -path "./Base/*" -prune \) \ -not \( -path "./Build/*" -prune \) \ -not \( -path "./Toolchain/*" -prune \) \ -not \( -path "./Ports/*" -prune \) \ -type f -name "*.cpp" -o -name "*.h")
This commit is contained in:
parent
388d455575
commit
aff81d318b
17 changed files with 49 additions and 54 deletions
|
@ -402,15 +402,16 @@ void Printer::print(Wasm::ImportSection::Import const& import)
|
|||
{
|
||||
TemporaryChange change { m_indent, m_indent + 1 };
|
||||
import.description().visit(
|
||||
[this](auto const& type) { print(type);
|
||||
},
|
||||
[this](auto const& type) {
|
||||
print(type);
|
||||
},
|
||||
[this](TypeIndex const& index) {
|
||||
print_indent();
|
||||
print("(type index {})\n", index.value());
|
||||
print_indent();
|
||||
print("(type index {})\n", index.value());
|
||||
});
|
||||
}
|
||||
print_indent();
|
||||
print(")\n");
|
||||
}
|
||||
print_indent();
|
||||
print(")\n");
|
||||
}
|
||||
|
||||
void Printer::print(Wasm::Instruction const& instruction)
|
||||
|
|
|
@ -930,11 +930,9 @@ struct InvocationOf<impl> {
|
|||
|
||||
return HostFunction(
|
||||
[&self, function_name](Configuration& configuration, Vector<Value>& arguments) -> Wasm::Result {
|
||||
Tuple args = [&]<typename... Ts, auto... Is>(IndexSequence<Is...>)
|
||||
{
|
||||
Tuple args = [&]<typename... Ts, auto... Is>(IndexSequence<Is...>) {
|
||||
return Tuple { ABI::deserialize(ABI::to_compatible_value<Ts>(arguments[Is]))... };
|
||||
}
|
||||
.template operator()<Args...>(MakeIndexSequence<sizeof...(Args)>());
|
||||
}.template operator()<Args...>(MakeIndexSequence<sizeof...(Args)>());
|
||||
|
||||
auto result = args.apply_as_args([&](auto&&... impl_args) { return (self.*impl)(configuration, impl_args...); });
|
||||
dbgln_if(WASI_DEBUG, "WASI: {}({}) = {}", function_name, arguments, result);
|
||||
|
@ -948,8 +946,7 @@ struct InvocationOf<impl> {
|
|||
if constexpr (!IsVoid<R>) {
|
||||
// Return values are passed as pointers, after the arguments
|
||||
if constexpr (requires { &R::serialize_into; }) {
|
||||
constexpr auto ResultCount = []<auto N>(void(R::*)(Array<Bytes, N>) const) { return N; }
|
||||
(&R::serialize_into);
|
||||
constexpr auto ResultCount = []<auto N>(void (R::*)(Array<Bytes, N>) const) { return N; }(&R::serialize_into);
|
||||
ABI::serialize(*value.result(), address_spans<ResultCount>(arguments.span().slice(sizeof...(Args)), configuration));
|
||||
} else {
|
||||
ABI::serialize(*value.result(), address_spans<1>(arguments.span().slice(sizeof...(Args)), configuration));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue