1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:17:35 +00:00

Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>

We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace!
This was a slightly tedious refactoring that took a long time, so it's
not unlikely that some bugs crept in.

Nevertheless, it does pass basic functionality testing, and it's just
real nice to finally see the same pattern in all contexts. :^)
This commit is contained in:
Andreas Kling 2021-11-08 00:51:39 +01:00
parent 7ee10c6926
commit 79fa9765ca
262 changed files with 2415 additions and 2600 deletions

View file

@ -81,7 +81,7 @@ public:
void* get_private() const { return m_private; }
template<typename... Args>
KResult write_to_buffer(UserOrKernelBuffer& buffer, Args... args)
ErrorOr<void> write_to_buffer(UserOrKernelBuffer& buffer, Args... args)
{
if (in_target_context(buffer))
return buffer.write(forward<Args>(args)...);
@ -90,7 +90,7 @@ public:
}
template<size_t BUFFER_BYTES, typename... Args>
KResultOr<size_t> write_to_buffer_buffered(UserOrKernelBuffer& buffer, Args... args)
ErrorOr<size_t> write_to_buffer_buffered(UserOrKernelBuffer& buffer, Args... args)
{
if (in_target_context(buffer))
return buffer.write_buffered<BUFFER_BYTES>(forward<Args>(args)...);
@ -99,7 +99,7 @@ public:
}
template<typename... Args>
KResult read_from_buffer(const UserOrKernelBuffer& buffer, Args... args)
ErrorOr<void> read_from_buffer(const UserOrKernelBuffer& buffer, Args... args)
{
if (in_target_context(buffer))
return buffer.read(forward<Args>(args)...);
@ -108,7 +108,7 @@ public:
}
template<size_t BUFFER_BYTES, typename... Args>
KResultOr<size_t> read_from_buffer_buffered(const UserOrKernelBuffer& buffer, Args... args)
ErrorOr<size_t> read_from_buffer_buffered(const UserOrKernelBuffer& buffer, Args... args)
{
if (in_target_context(buffer))
return buffer.read_buffered<BUFFER_BYTES>(forward<Args>(args)...);