diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-02-25 15:55:16 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-02-25 15:55:16 +0100 |
| commit | a3c9ed0849640dec7dc672447e539695eddea2f5 (patch) | |
| tree | d53ef400ad606a608aeebb9ea3a90c40cd3a7b1f /src/libSystem | |
| parent | 7621c39f13f9d3d9e6dddd7fe70158dfe4ab983c (diff) | |
chore: lib{DDK, System}: Update formatting of source files.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/libSystem')
| -rw-r--r-- | src/libSystem/src/JailCalls.cpp | 5 | ||||
| -rw-r--r-- | src/libSystem/src/SystemCalls.cpp | 20 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/libSystem/src/JailCalls.cpp b/src/libSystem/src/JailCalls.cpp index 7a3218bf..e5bfc345 100644 --- a/src/libSystem/src/JailCalls.cpp +++ b/src/libSystem/src/JailCalls.cpp @@ -10,6 +10,5 @@ using namespace LibSystem; -IMPORT_C struct JAIL* JailGetCurrent(Void) { - return (struct JAIL*) libsys_syscall_arg_1(SYSCALL_HASH("JailGetCurrent")); -}
\ No newline at end of file +IMPORT_C struct JAIL* JailGetCurrent(Void) { return (struct JAIL*) libsys_syscall_arg_1(SYSCALL_HASH("JailGetCurrent")); } + diff --git a/src/libSystem/src/SystemCalls.cpp b/src/libSystem/src/SystemCalls.cpp index 07f5241b..b9044f43 100644 --- a/src/libSystem/src/SystemCalls.cpp +++ b/src/libSystem/src/SystemCalls.cpp @@ -11,8 +11,7 @@ using namespace LibSystem; IMPORT_C Char* StrFmt(const Char* fmt, ...) { if (!fmt || *fmt == 0) return const_cast<Char*>("(null)"); - - return const_cast<Char*>(""); + return const_cast<Char*>("(null)"); } // memmove-style copy @@ -125,9 +124,7 @@ IMPORT_C Ref IoOpenFile(_Input const Char* path, _Input const Char* drv_letter) Verify::sys_safe_cast<Char, Void>(drv_letter))); } -IMPORT_C Void IoCloseFile(_Input Ref desc) { - libsys_syscall_arg_2(SYSCALL_HASH("IoCloseFile"), static_cast<VoidPtr>(desc)); -} +IMPORT_C Void IoCloseFile(_Input Ref desc) { libsys_syscall_arg_2(SYSCALL_HASH("IoCloseFile"), static_cast<VoidPtr>(desc)); } IMPORT_C UInt64 IoSeekFile(_Input Ref desc, _Input UInt64 off) { auto ret_ptr = libsys_syscall_arg_3(SYSCALL_HASH("IoSeekFile"), static_cast<VoidPtr>(desc), @@ -136,14 +133,18 @@ IMPORT_C UInt64 IoSeekFile(_Input Ref desc, _Input UInt64 off) { if (!ret_ptr) return ~0UL; auto ret = static_cast<volatile UInt64*>(ret_ptr); + UInt64 result = *ret; MUST_PASS(result != ~0UL); + return result; } IMPORT_C UInt64 IoTellFile(_Input Ref desc) { auto ret_ptr = libsys_syscall_arg_2(SYSCALL_HASH("IoTellFile"), static_cast<VoidPtr>(desc)); + if (!ret_ptr) return ~0UL; + auto ret = static_cast<volatile UInt64*>(ret_ptr); return *ret; } @@ -151,14 +152,13 @@ IMPORT_C UInt64 IoTellFile(_Input Ref desc) { IMPORT_C SInt32 PrintRelease(_Input IORef buf) { SInt32* ret = static_cast<SInt32*>( libsys_syscall_arg_2(SYSCALL_HASH("PrintRelease"), static_cast<VoidPtr>(buf))); + if (!ret) return -kErrorInvalidData; return static_cast<SInt32>(*ret); } -IMPORT_C IORef PrintCreate(Void) { - return static_cast<IORef>(libsys_syscall_arg_1(SYSCALL_HASH("PrintCreate"))); -} +IMPORT_C IORef PrintCreate(Void) { return static_cast<IORef>(libsys_syscall_arg_1(SYSCALL_HASH("PrintCreate"))); } IMPORT_C VoidPtr MmCreateHeap(UInt64 initial_size, UInt32 max_size) { return static_cast<VoidPtr>(libsys_syscall_arg_3(SYSCALL_HASH("MmCreateHeap"), @@ -219,6 +219,6 @@ IMPORT_C SInt32 PrintOut(_Input IORef desc, const Char* fmt, ...) { } IMPORT_C UInt64 PrintSize(IORef ref) { - MUST_PASS(ref); return *static_cast<UInt64*>(libsys_syscall_arg_2(SYSCALL_HASH("PrintSize"), ref)); -}
\ No newline at end of file +} + |
