diff options
| author | gingerBill <bill@gingerbill.org> | 2024-07-19 12:00:49 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-07-19 12:00:49 +0100 |
| commit | 393ca40c230c9cc1aeb0588c4550ab22db2b604a (patch) | |
| tree | dae7a0f242c7cc0717fc52ea943f8c39d5ec2989 /core/sys/linux | |
| parent | 2f8399fe20c475a9d89fb5e73f011d38b36ea904 (diff) | |
Minor clean ups
Diffstat (limited to 'core/sys/linux')
| -rw-r--r-- | core/sys/linux/helpers.odin | 59 | ||||
| -rw-r--r-- | core/sys/linux/types.odin | 2 |
2 files changed, 32 insertions, 29 deletions
diff --git a/core/sys/linux/helpers.odin b/core/sys/linux/helpers.odin index 75fdd586e..f1abbbf61 100644 --- a/core/sys/linux/helpers.odin +++ b/core/sys/linux/helpers.odin @@ -12,7 +12,7 @@ import "base:intrinsics" @(private) syscall0 :: #force_inline proc "contextless" (nr: uintptr) -> int { - return cast(int) intrinsics.syscall(nr) + return int(intrinsics.syscall(nr)) } @(private) @@ -20,7 +20,7 @@ syscall1 :: #force_inline proc "contextless" (nr: uintptr, p1: $T) -> int where size_of(p1) <= size_of(uintptr) { - return cast(int) intrinsics.syscall(nr, cast(uintptr) p1) + return int(intrinsics.syscall(nr, uintptr(p1))) } @(private) @@ -29,8 +29,7 @@ where size_of(p1) <= size_of(uintptr), size_of(p2) <= size_of(uintptr) { - return cast(int) intrinsics.syscall(nr, - cast(uintptr) p1, cast(uintptr) p2) + return int(intrinsics.syscall(nr, uintptr(p1), uintptr(p2))) } @(private) @@ -40,10 +39,11 @@ where size_of(p2) <= size_of(uintptr), size_of(p3) <= size_of(uintptr) { - return cast(int) intrinsics.syscall(nr, - cast(uintptr) p1, - cast(uintptr) p2, - cast(uintptr) p3) + return int(intrinsics.syscall(nr, + uintptr(p1), + uintptr(p2), + uintptr(p3), + )) } @(private) @@ -54,11 +54,12 @@ where size_of(p3) <= size_of(uintptr), size_of(p4) <= size_of(uintptr) { - return cast(int) intrinsics.syscall(nr, - cast(uintptr) p1, - cast(uintptr) p2, - cast(uintptr) p3, - cast(uintptr) p4) + return int(intrinsics.syscall(nr, + uintptr(p1), + uintptr(p2), + uintptr(p3), + uintptr(p4), + )) } @(private) @@ -70,12 +71,13 @@ where size_of(p4) <= size_of(uintptr), size_of(p5) <= size_of(uintptr) { - return cast(int) intrinsics.syscall(nr, - cast(uintptr) p1, - cast(uintptr) p2, - cast(uintptr) p3, - cast(uintptr) p4, - cast(uintptr) p5) + return int(intrinsics.syscall(nr, + uintptr(p1), + uintptr(p2), + uintptr(p3), + uintptr(p4), + uintptr(p5), + )) } @(private) @@ -88,13 +90,14 @@ where size_of(p5) <= size_of(uintptr), size_of(p6) <= size_of(uintptr) { - return cast(int) intrinsics.syscall(nr, - cast(uintptr) p1, - cast(uintptr) p2, - cast(uintptr) p3, - cast(uintptr) p4, - cast(uintptr) p5, - cast(uintptr) p6) + return int(intrinsics.syscall(nr, + uintptr(p1), + uintptr(p2), + uintptr(p3), + uintptr(p4), + uintptr(p5), + uintptr(p6), + )) } syscall :: proc {syscall0, syscall1, syscall2, syscall3, syscall4, syscall5, syscall6} @@ -113,7 +116,7 @@ where default_value: T return default_value, Errno(-ret) } else { - return cast(T) transmute(U) ret, Errno(.NONE) + return T(transmute(U)ret), Errno(.NONE) } } @@ -123,7 +126,7 @@ errno_unwrap2 :: #force_inline proc "contextless" (ret: $P, $T: typeid) -> (T, E default_value: T return default_value, Errno(-ret) } else { - return cast(T) ret, Errno(.NONE) + return T(ret), Errno(.NONE) } } diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index e3fe67a9b..d373f96f2 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -688,7 +688,7 @@ Sock_Addr_In6 :: struct #packed { } /* - Struct representing Unix Domain Socket address + Struct representing Unix Domain Socket address */ Sock_Addr_Un :: struct #packed { sun_family: Address_Family, |