mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
Kernel+LibC: Turn errno codes into a strongly typed enum
..and allow implicit creation of KResult and KResultOr from ErrnoCode. This means that kernel functions that return those types can finally do "return EINVAL;" and it will just work. There's a handful of functions that still deal with signed integers that should be converted to return KResults.
This commit is contained in:
@@ -51,7 +51,7 @@ KResult PerformanceEventBuffer::append(int type, FlatPtr arg1, FlatPtr arg2)
|
||||
KResult PerformanceEventBuffer::append_with_eip_and_ebp(u32 eip, u32 ebp, int type, FlatPtr arg1, FlatPtr arg2)
|
||||
{
|
||||
if (count() >= capacity())
|
||||
return KResult(-ENOBUFS);
|
||||
return ENOBUFS;
|
||||
|
||||
PerformanceEvent event;
|
||||
event.type = type;
|
||||
@@ -67,7 +67,7 @@ KResult PerformanceEventBuffer::append_with_eip_and_ebp(u32 eip, u32 ebp, int ty
|
||||
event.data.free.ptr = arg1;
|
||||
break;
|
||||
default:
|
||||
return KResult(-EINVAL);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
auto current_thread = Thread::current();
|
||||
|
||||
Reference in New Issue
Block a user