mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 16:53:48 -04:00
libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
This commit is contained in:
parent
e1fbf27398
commit
7ca83c9d3b
160 changed files with 691 additions and 152 deletions
|
@ -142,6 +142,7 @@ namespace ams::os::impl {
|
|||
for (MultiWaitHolderBase &holder_base : this->multi_wait_list) {
|
||||
if (auto handle = holder_base.GetHandle(); handle != os::InvalidNativeHandle) {
|
||||
AMS_ASSERT(count < num);
|
||||
AMS_UNUSED(num);
|
||||
|
||||
out_handles[count] = handle;
|
||||
out_objects[count] = &holder_base;
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
namespace ams::os::impl {
|
||||
|
||||
Result MultiWaitHorizonImpl::WaitSynchronizationN(s32 *out_index, s32 num, NativeHandle arr[], s32 array_size, s64 ns) {
|
||||
AMS_UNUSED(array_size);
|
||||
|
||||
AMS_ASSERT(!(num == 0 && ns == 0));
|
||||
s32 index = MultiWaitImpl::WaitInvalid;
|
||||
|
||||
|
@ -38,6 +40,8 @@ namespace ams::os::impl {
|
|||
}
|
||||
|
||||
Result MultiWaitHorizonImpl::ReplyAndReceiveN(s32 *out_index, s32 num, NativeHandle arr[], s32 array_size, s64 ns, NativeHandle reply_target) {
|
||||
AMS_UNUSED(array_size);
|
||||
|
||||
/* NOTE: Nintendo does not initialize this value, which seems like it can cause incorrect behavior. */
|
||||
s32 index = MultiWaitImpl::WaitInvalid;
|
||||
static_assert(MultiWaitImpl::WaitInvalid != -1);
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ams::os::impl {
|
|||
}
|
||||
|
||||
static ALWAYS_INLINE Result GetProgramId(ncm::ProgramId *out, NativeHandle handle) {
|
||||
return svc::GetInfo(std::addressof(out->value), svc::InfoType_ProgramId, svc::PseudoHandle::CurrentProcess, 0);
|
||||
return svc::GetInfo(std::addressof(out->value), svc::InfoType_ProgramId, handle, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace ams::os::impl {
|
|||
|
||||
s32 count = 0;
|
||||
while (true) {
|
||||
R_TRY_CATCH(::threadCreate(thread->thread_impl, reinterpret_cast<::ThreadFunc>(&InvokeThread), thread, thread->stack, thread->stack_size, ConvertToHorizonPriority(thread->base_priority), ideal_core)) {
|
||||
R_TRY_CATCH(::threadCreate(thread->thread_impl, reinterpret_cast<::ThreadFunc>(reinterpret_cast<void *>(&InvokeThread)), thread, thread->stack, thread->stack_size, ConvertToHorizonPriority(thread->base_priority), ideal_core)) {
|
||||
R_CATCH(svc::ResultOutOfResource) {
|
||||
if ((++count) < 10) {
|
||||
os::SleepThread(TimeSpan::FromMilliSeconds(10));
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace ams::os::impl {
|
|||
|
||||
/* TODO: void GetThreadContextUnsafe(ThreadContextInfo *out_context, const ThreadType *thread); */
|
||||
|
||||
void NotifyThreadNameChangedImpl(const ThreadType *thread) const { /* ... */ }
|
||||
void NotifyThreadNameChangedImpl(const ThreadType *thread) const { AMS_UNUSED(thread); }
|
||||
|
||||
void SetCurrentThread(ThreadType *thread) const {
|
||||
g_current_thread_pointer = thread;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue