Everywhere: Remove all KERNEL #defines

This commit is contained in:
Tim Ledbetter
2024-06-17 23:12:53 +01:00
committed by Andreas Kling
parent de99dd2c89
commit 5ca2f4dfd7
73 changed files with 116 additions and 808 deletions

View File

@@ -76,27 +76,6 @@ UUID::UUID(StringView uuid_string_view, Endianness endianness)
VERIFY_NOT_REACHED();
}
#ifdef KERNEL
ErrorOr<NonnullOwnPtr<Kernel::KString>> UUID::to_string() const
{
StringBuilder builder(36);
auto nibble0 = TRY(encode_hex(m_uuid_buffer.span().trim(4)));
TRY(builder.try_append(nibble0->view()));
TRY(builder.try_append('-'));
auto nibble1 = TRY(encode_hex(m_uuid_buffer.span().slice(4).trim(2)));
TRY(builder.try_append(nibble1->view()));
TRY(builder.try_append('-'));
auto nibble2 = TRY(encode_hex(m_uuid_buffer.span().slice(6).trim(2)));
TRY(builder.try_append(nibble2->view()));
TRY(builder.try_append('-'));
auto nibble3 = TRY(encode_hex(m_uuid_buffer.span().slice(8).trim(2)));
TRY(builder.try_append(nibble3->view()));
TRY(builder.try_append('-'));
auto nibble4 = TRY(encode_hex(m_uuid_buffer.span().slice(10).trim(6)));
TRY(builder.try_append(nibble4->view()));
return Kernel::KString::try_create(builder.string_view());
}
#else
ErrorOr<String> UUID::to_string() const
{
auto buffer_span = m_uuid_buffer.span();
@@ -112,7 +91,6 @@ ErrorOr<String> UUID::to_string() const
TRY(builder.try_append(encode_hex(buffer_span.slice(10, 6))));
return builder.to_string();
}
#endif
bool UUID::is_zero() const
{