1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes

This commit is contained in:
Brian Gianforcaro 2021-08-31 23:44:55 -07:00 committed by Andreas Kling
parent f3baa5d8c9
commit 668c429900
11 changed files with 58 additions and 55 deletions

View file

@ -58,10 +58,10 @@ Kernel::KResultOr<size_t> ConsoleDevice::write(FileDescription&, u64, const Kern
if (!size)
return 0;
return data.read_buffered<256>(size, [&](u8 const* bytes, size_t bytes_count) {
for (size_t i = 0; i < bytes_count; i++)
put_char((char)bytes[i]);
return bytes_count;
return data.read_buffered<256>(size, [&](ReadonlyBytes readonly_bytes) {
for (const auto& byte : readonly_bytes)
put_char(byte);
return readonly_bytes.size();
});
}