From 8f45a259fc9f8180b366cbaccac1af6d368e3b3a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 30 Sep 2019 08:57:01 +0200 Subject: ByteBuffer: Remove pointer() in favor of data() We had two ways to get the data inside a ByteBuffer. That was silly. --- Kernel/FileSystem/DiskBackedFileSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Kernel/FileSystem/DiskBackedFileSystem.cpp') diff --git a/Kernel/FileSystem/DiskBackedFileSystem.cpp b/Kernel/FileSystem/DiskBackedFileSystem.cpp index 51b193f3b8..59d51ff4b4 100644 --- a/Kernel/FileSystem/DiskBackedFileSystem.cpp +++ b/Kernel/FileSystem/DiskBackedFileSystem.cpp @@ -107,7 +107,7 @@ ByteBuffer DiskBackedFS::read_block(unsigned index) const auto buffer = ByteBuffer::create_uninitialized(block_size()); //kprintf("created block buffer with size %u\n", block_size()); DiskOffset base_offset = static_cast(index) * static_cast(block_size()); - auto* buffer_pointer = buffer.pointer(); + auto* buffer_pointer = buffer.data(); bool success = device().read(base_offset, block_size(), buffer_pointer); ASSERT(success); ASSERT(buffer.size() == block_size()); @@ -126,13 +126,13 @@ ByteBuffer DiskBackedFS::read_blocks(unsigned index, unsigned count) const if (count == 1) return read_block(index); auto blocks = ByteBuffer::create_uninitialized(count * block_size()); - u8* out = blocks.pointer(); + u8* out = blocks.data(); for (unsigned i = 0; i < count; ++i) { auto block = read_block(index + i); if (!block) return nullptr; - memcpy(out, block.pointer(), block.size()); + memcpy(out, block.data(), block.size()); out += block_size(); } -- cgit v1.2.3