mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
AK: Rename Stream::{read,write} to Stream::{read_some,write_some}
Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs.
This commit is contained in:
parent
1d5b45f7d9
commit
d5871f5717
109 changed files with 474 additions and 329 deletions
|
@ -53,12 +53,14 @@ static bool pre_interpret_hook(Wasm::Configuration& config, Wasm::InstructionPoi
|
|||
if (always_print_stack)
|
||||
config.dump_stack();
|
||||
if (always_print_instruction) {
|
||||
g_stdout->write(DeprecatedString::formatted("{:0>4} ", ip.value()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(DeprecatedString::formatted("{:0>4} ", ip.value()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
g_printer->print(instr);
|
||||
}
|
||||
if (g_continue)
|
||||
return true;
|
||||
g_stdout->write(DeprecatedString::formatted("{:0>4} ", ip.value()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(DeprecatedString::formatted("{:0>4} ", ip.value()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
g_printer->print(instr);
|
||||
DeprecatedString last_command = "";
|
||||
for (;;) {
|
||||
|
@ -214,7 +216,8 @@ static bool pre_interpret_hook(Wasm::Configuration& config, Wasm::InstructionPoi
|
|||
if (!result.values().is_empty())
|
||||
warnln("Returned:");
|
||||
for (auto& value : result.values()) {
|
||||
g_stdout->write(" -> "sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(" -> "sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
g_printer->print(value);
|
||||
}
|
||||
}
|
||||
|
@ -454,15 +457,18 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto print_func = [&](auto const& address) {
|
||||
Wasm::FunctionInstance* fn = machine.store().get(address);
|
||||
g_stdout->write(DeprecatedString::formatted("- Function with address {}, ptr = {}\n", address.value(), fn).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(DeprecatedString::formatted("- Function with address {}, ptr = {}\n", address.value(), fn).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
if (fn) {
|
||||
g_stdout->write(DeprecatedString::formatted(" wasm function? {}\n", fn->has<Wasm::WasmFunction>()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(DeprecatedString::formatted(" wasm function? {}\n", fn->has<Wasm::WasmFunction>()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
fn->visit(
|
||||
[&](Wasm::WasmFunction const& func) {
|
||||
Wasm::Printer printer { *g_stdout, 3 };
|
||||
g_stdout->write(" type:\n"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(" type:\n"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
printer.print(func.type());
|
||||
g_stdout->write(" code:\n"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
g_stdout->write_some(" code:\n"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
printer.print(func.code());
|
||||
},
|
||||
[](Wasm::HostFunction const&) {});
|
||||
|
@ -526,7 +532,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (!result.values().is_empty())
|
||||
warnln("Returned:");
|
||||
for (auto& value : result.values()) {
|
||||
g_stdout->write(" -> "sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
// FIXME: This should write the entire span.
|
||||
g_stdout->write_some(" -> "sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
g_printer->print(value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue