summaryrefslogtreecommitdiff
path: root/AK/ByteBuffer.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-10-28 18:20:00 -0400
committerLinus Groh <mail@linusgroh.de>2022-11-01 14:52:59 +0000
commit6d15cbd4119ba79c2eafd24ccccb8f1bc047a236 (patch)
tree967aa1ba2d064e98544a6222d43ee39c48e31489 /AK/ByteBuffer.h
parent6490529ef76ebf37f9e58bf76c6271be6842afa1 (diff)
downloadserenity-6d15cbd4119ba79c2eafd24ccccb8f1bc047a236.zip
AK: Use size_t for ByteBuffer offsets
These should be unsigned values. An east-const conversion was also performed by clang-format 15.
Diffstat (limited to 'AK/ByteBuffer.h')
-rw-r--r--AK/ByteBuffer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h
index 43dec2cc58..9cc534ba5c 100644
--- a/AK/ByteBuffer.h
+++ b/AK/ByteBuffer.h
@@ -126,10 +126,10 @@ public:
[[nodiscard]] ReadonlyBytes bytes() const { return { data(), size() }; }
[[nodiscard]] AK::Span<u8> span() { return { data(), size() }; }
- [[nodiscard]] AK::Span<const u8> span() const { return { data(), size() }; }
+ [[nodiscard]] AK::Span<u8 const> span() const { return { data(), size() }; }
- [[nodiscard]] u8* offset_pointer(int offset) { return data() + offset; }
- [[nodiscard]] u8 const* offset_pointer(int offset) const { return data() + offset; }
+ [[nodiscard]] u8* offset_pointer(size_t offset) { return data() + offset; }
+ [[nodiscard]] u8 const* offset_pointer(size_t offset) const { return data() + offset; }
[[nodiscard]] void* end_pointer() { return data() + m_size; }
[[nodiscard]] void const* end_pointer() const { return data() + m_size; }
@@ -226,7 +226,7 @@ public:
if (data_size == 0)
return {};
VERIFY(data != nullptr);
- int old_size = size();
+ auto old_size = size();
TRY(try_resize(size() + data_size));
__builtin_memcpy(this->data() + old_size, data, data_size);
return {};