From dafb757549b5238f67c49b2c8c0a1b44aedf0bd4 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 12 Dec 2025 09:27:10 +0100 Subject: chore: make Ref `operator bool` explicit, remove useless `MUST_PASS` in TLS.inl, use `CFRef` in LaunchHelpers. Signed-off-by: Amlal El Mahrouss --- public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h | 14 ++++++++++++-- public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'public') diff --git a/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h b/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h index b20ca17e..cba2e7c4 100644 --- a/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h +++ b/public/frameworks/LaunchHelpers.fwrk/headers/Foundation.h @@ -20,17 +20,27 @@ inline constexpr auto kMaxArgs = 256; struct LHLaunchInfo final { CF::CFString fExecutablePath{kMaxPath}; CF::CFString fWorkingDirectory{kMaxPath}; - CF::CFString fArguments[kMaxArgs]; + CF::CFRef fArguments[kMaxArgs]; CF::CFString fEnvironment{kMaxPath}; CF::CFInteger64 fUID{0}; CF::CFInteger64 fGID{0}; + LHLaunchInfo() = default; + ~LHLaunchInfo() = default; + + LIBSYS_COPY_DELETE(LHLaunchInfo) + explicit operator bool() { return fUID && fGID; } + + CF::CFRef* begin() { return fArguments; } + CF::CFRef* end() { return fArguments + kMaxArgs; } + + SizeT size() { return kMaxArgs; } }; using LHLaunchInfoPtr = LHLaunchInfo*; /// @brief Get launch information. /// @return the launch information structure. -LHLaunchInfo* LHGetLaunchInfo(Void); +CF::CFRef LHGetLaunchInfo(Void); } // namespace LaunchHelpers \ No newline at end of file diff --git a/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc b/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc index 6cc3bff3..159ea243 100644 --- a/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc +++ b/public/frameworks/LaunchHelpers.fwrk/src/Foundation.cc @@ -9,7 +9,7 @@ /// @brief Get launch information. /// @return the launch information structure. -LaunchHelpers::LHLaunchInfo* LaunchHelpers::LHGetLaunchInfo(Void) { +CF::CFRef LaunchHelpers::LHGetLaunchInfo(Void) { return static_cast( - libsys_syscall_arg_1(libsys_hash_64("__LHGetLaunchInfo"))); + libsys_syscall_arg_1(libsys_hash_64("__LHGetLaunchInfoRef"))); } \ No newline at end of file -- cgit v1.2.3