From 41ee08381dcac0d23df94d98d52d13d0eaa717a3 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 1 Nov 2024 16:27:00 +0800 Subject: [PATCH] cond,libcxx,xglobals: Hard-wrap lines (cherry picked from commit ed8bd1b315e07367c8d28ea70f863452f04e084e) Signed-off-by: LIU Hao --- mcfgthread/cond.c | 6 ++++-- mcfgthread/cond.h | 3 ++- mcfgthread/libcxx.h | 6 ++++-- mcfgthread/xglobals.h | 18 +++++++++++++----- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/mcfgthread/cond.c b/mcfgthread/cond.c index e7bcdf9b9..988d6f1b9 100644 --- a/mcfgthread/cond.c +++ b/mcfgthread/cond.c @@ -13,7 +13,8 @@ static __MCF_NEVER_INLINE int -do_unlock_and_wait(_MCF_cond* cond, _MCF_cond_unlock_callback* unlock_opt, intptr_t* unlocked, intptr_t lock_arg, const int64_t* timeout_opt) +do_unlock_and_wait(_MCF_cond* cond, _MCF_cond_unlock_callback* unlock_opt, intptr_t* unlocked, + intptr_t lock_arg, const int64_t* timeout_opt) { __MCF_winnt_timeout nt_timeout; __MCF_initialize_winnt_timeout_v3(&nt_timeout, timeout_opt); @@ -70,7 +71,8 @@ do_unlock_and_wait(_MCF_cond* cond, _MCF_cond_unlock_callback* unlock_opt, intpt __MCF_DLLEXPORT int -_MCF_cond_wait(_MCF_cond* cond, _MCF_cond_unlock_callback* unlock_opt, _MCF_cond_relock_callback* relock_opt, intptr_t lock_arg, const int64_t* timeout_opt) +_MCF_cond_wait(_MCF_cond* cond, _MCF_cond_unlock_callback* unlock_opt, _MCF_cond_relock_callback* relock_opt, + intptr_t lock_arg, const int64_t* timeout_opt) { __MCF_SEH_DEFINE_TERMINATE_FILTER; intptr_t unlocked; diff --git a/mcfgthread/cond.h b/mcfgthread/cond.h index c22e96bbf..2713592ba 100644 --- a/mcfgthread/cond.h +++ b/mcfgthread/cond.h @@ -51,7 +51,8 @@ _MCF_cond_init(_MCF_cond* __cond) __MCF_noexcept; * wakeup, or -1 if the wait operation has timed out. */ __MCF_COND_IMPORT int -_MCF_cond_wait(_MCF_cond* __cond, _MCF_cond_unlock_callback* __unlock_opt, _MCF_cond_relock_callback* __relock_opt, intptr_t __lock_arg, const int64_t* __timeout_opt) __MCF_noexcept; +_MCF_cond_wait(_MCF_cond* __cond, _MCF_cond_unlock_callback* __unlock_opt, _MCF_cond_relock_callback* __relock_opt, + intptr_t __lock_arg, const int64_t* __timeout_opt) __MCF_noexcept; /* Wakes up some or all threads that have been put to sleep on this condition * variable. diff --git a/mcfgthread/libcxx.h b/mcfgthread/libcxx.h index 058cd1eb8..3ed504888 100644 --- a/mcfgthread/libcxx.h +++ b/mcfgthread/libcxx.h @@ -212,7 +212,8 @@ __MCF_libcxx_condvar_wait(__libcpp_condvar_t* __cond, __libcpp_mutex_t* __mtx) _ * `pthread_cond_timedwait()`. */ __MCF_LIBCXX_INLINE int -__MCF_libcxx_condvar_timedwait(__libcpp_condvar_t* __cond, __libcpp_mutex_t* __mtx, const __libcpp_timespec_t* __abs_time) __MCF_noexcept; +__MCF_libcxx_condvar_timedwait(__libcpp_condvar_t* __cond, __libcpp_mutex_t* __mtx, + const __libcpp_timespec_t* __abs_time) __MCF_noexcept; #ifndef __MCF_LIBCXX_NO_ALIASES # define __libcpp_condvar_timedwait __MCF_libcxx_condvar_timedwait @@ -500,7 +501,8 @@ __MCF_libcxx_condvar_wait(__libcpp_condvar_t* __cond, __libcpp_mutex_t* __mtx) _ __MCF_LIBCXX_INLINE int -__MCF_libcxx_condvar_timedwait(__libcpp_condvar_t* __cond, __libcpp_mutex_t* __mtx, const __libcpp_timespec_t* __abs_time) __MCF_noexcept +__MCF_libcxx_condvar_timedwait(__libcpp_condvar_t* __cond, __libcpp_mutex_t* __mtx, + const __libcpp_timespec_t* __abs_time) __MCF_noexcept { int64_t __timeout = __MCF_gthr_timeout_from_timespec(__abs_time); int __err = __MCF_gthr_cond_mutex_wait(__cond, __mtx, &__timeout); diff --git a/mcfgthread/xglobals.h b/mcfgthread/xglobals.h index 836c0988b..dfe33478d 100644 --- a/mcfgthread/xglobals.h +++ b/mcfgthread/xglobals.h @@ -558,7 +558,9 @@ __MCF_is_process_shutting_down(void) /* Create a named section of memory. * https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwcreatesection */ -NTSYSAPI NTSTATUS NTAPI NtCreateSection(HANDLE* OutHandle, ACCESS_MASK DesiredAccess, OBJECT_ATTRIBUTES* Attributes, LARGE_INTEGER* MaximumSize, ULONG Protection, ULONG Allocation, HANDLE File); +NTSYSAPI NTSTATUS NTAPI NtCreateSection(HANDLE* OutHandle, ACCESS_MASK DesiredAccess, + OBJECT_ATTRIBUTES* Attributes, LARGE_INTEGER* MaximumSize, + ULONG Protection, ULONG Allocation, HANDLE File); __MCF_ALWAYS_INLINE HANDLE @@ -572,7 +574,9 @@ __MCF_create_named_section(OBJECT_ATTRIBUTES* Attributes, LONGLONG MaximumSize) /* Creates another handle to an object. * https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-zwduplicateobject */ -NTSYSAPI NTSTATUS NTAPI NtDuplicateObject(HANDLE SourceProcess, HANDLE SourceHandle, HANDLE TargetProcess, HANDLE* TargetHandle, ACCESS_MASK DesiredAccess, ULONG HandleAttributes, ULONG Options); +NTSYSAPI NTSTATUS NTAPI NtDuplicateObject(HANDLE SourceProcess, HANDLE SourceHandle, HANDLE TargetProcess, + HANDLE* TargetHandle, ACCESS_MASK DesiredAccess, + ULONG HandleAttributes, ULONG Options); __MCF_ALWAYS_INLINE HANDLE @@ -598,7 +602,9 @@ __MCF_close_handle(HANDLE Handle) /* Maps a named section of memory into the virtual address space. * https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwmapviewofsection */ -NTSYSAPI NTSTATUS NTAPI NtMapViewOfSection(HANDLE Section, HANDLE Process, PVOID* BaseAddress, ULONG_PTR ZeroBits, SIZE_T CommitSize, LARGE_INTEGER* Offset, SIZE_T* ViewSize, UINT SectionInherit, ULONG Allocation, ULONG Protection); +NTSYSAPI NTSTATUS NTAPI NtMapViewOfSection(HANDLE Section, HANDLE Process, PVOID* BaseAddress, ULONG_PTR ZeroBits, + SIZE_T CommitSize, LARGE_INTEGER* Offset, SIZE_T* ViewSize, + UINT SectionInherit, ULONG Allocation, ULONG Protection); __MCF_ALWAYS_INLINE void @@ -606,7 +612,8 @@ __MCF_map_view_of_section(HANDLE Section, void** BaseAddress, size_t* ViewSize, { HANDLE process = GetCurrentProcess(); UINT inherit = Inheritable ? 1U : 2U; /* ViewShare : ViewUnmap */ - NTSTATUS status = NtMapViewOfSection(Section, process, BaseAddress, 0, 0, __MCF_nullptr, (SIZE_T*) ViewSize, inherit, 0, PAGE_READWRITE); + NTSTATUS status = NtMapViewOfSection(Section, process, BaseAddress, 0, 0, __MCF_nullptr, + (SIZE_T*) ViewSize, inherit, 0, PAGE_READWRITE); __MCF_ASSERT(NT_SUCCESS(status)); } @@ -680,7 +687,8 @@ __MCF_keyed_event_signal(const void* Key, const __MCF_winnt_timeout* Timeout) /* Sends a hard-error LPC message to CSRSS.EXE. This function is useful in a DLL * entry-point function or a TLS callback, where it is not safe to make a call * to `MessageBox()`. */ -NTSYSAPI NTSTATUS NTAPI NtRaiseHardError(NTSTATUS Status, ULONG NumberOfParameters, ULONG UnicodeStringParameterMask, ULONG_PTR* Parameters, ULONG ResponseOption, ULONG* Response); +NTSYSAPI NTSTATUS NTAPI NtRaiseHardError(NTSTATUS Status, ULONG NumberOfParameters, ULONG UnicodeStringParameterMask, + ULONG_PTR* Parameters, ULONG ResponseOption, ULONG* Response); __MCF_ALWAYS_INLINE int