From 0d759f85f8f67837c8919c5bb4068c08ae6df971 Mon Sep 17 00:00:00 2001 From: J Reece Wilson Date: Mon, 28 Aug 2023 16:34:21 +0100 Subject: [PATCH] [*] Linux/Clang fixerinos/improvements --- Source/Compression/AuBaseStream.cpp | 6 ++++++ Source/Threading/Primitives/AuConditionEx.cpp | 2 +- Source/Time/AuClock.cpp | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Compression/AuBaseStream.cpp b/Source/Compression/AuBaseStream.cpp index 60f82d7e..9a653429 100644 --- a/Source/Compression/AuBaseStream.cpp +++ b/Source/Compression/AuBaseStream.cpp @@ -12,6 +12,12 @@ #include "AuIngestableReadBase.inl" #include "AuBaseStream.hpp" +#if defined(AURORA_COMPILER_CLANG) + // warning: non-void function does not return a value in all control paths [-Wreturn-type] + #pragma clang diagnostic ignored "-Wreturn-type" + // one of my no returns is broken :( +#endif + namespace Aurora::Compression { AuStreamReadWrittenPair_t BaseStream::ReadEx(const AuMemoryViewWrite &/*optional/nullable*/destination, diff --git a/Source/Threading/Primitives/AuConditionEx.cpp b/Source/Threading/Primitives/AuConditionEx.cpp index b5674b63..4581312e 100644 --- a/Source/Threading/Primitives/AuConditionEx.cpp +++ b/Source/Threading/Primitives/AuConditionEx.cpp @@ -142,7 +142,7 @@ namespace Aurora::Threading::Primitives AuUInt32 uWaitCount {}; AuUInt32 uWaiters {}; - while (uWaiters = AuAtomicLoad(&this->uWaiters_)) + while ((uWaiters = AuAtomicLoad(&this->uWaiters_))) { this->s_.Unlock(uWaiters); uWaitCount = uWaiters; diff --git a/Source/Time/AuClock.cpp b/Source/Time/AuClock.cpp index 40aa6ae2..16540125 100644 --- a/Source/Time/AuClock.cpp +++ b/Source/Time/AuClock.cpp @@ -421,12 +421,12 @@ namespace Aurora::Time #endif - ADD_CLOCK_FAMILY(Process, Process, (ullUser.QuadPart + ullKernel.QuadPart), CLOCK_PROCESS_CPUTIME_ID, (false, EPseudoPosixClock::eAll)); + ADD_CLOCK_FAMILY(Process, Process, (ullUser.QuadPart + ullKernel.QuadPart), /*CLOCK_PROCESS_CPUTIME_ID*/ 0, (false, EPseudoPosixClock::eAll)); ADD_CLOCK_FAMILY(ProcessKernel, Process, (ullKernel.QuadPart), 0, (false, EPseudoPosixClock::eKernel)); - ADD_CLOCK_FAMILY(ProcessUser, Process, (ullUser.QuadPart), CLOCK_PROCESS_CPUTIME_ID, (false, EPseudoPosixClock::eUser)); - ADD_CLOCK_FAMILY(Thread, Thread, (ullUser.QuadPart + ullKernel.QuadPart), CLOCK_THREAD_CPUTIME_ID, (true, EPseudoPosixClock::eAll)); + ADD_CLOCK_FAMILY(ProcessUser, Process, (ullUser.QuadPart), /*CLOCK_PROCESS_CPUTIME_ID*/0, (false, EPseudoPosixClock::eUser)); + ADD_CLOCK_FAMILY(Thread, Thread, (ullUser.QuadPart + ullKernel.QuadPart), /*CLOCK_THREAD_CPUTIME_ID*/0, (true, EPseudoPosixClock::eAll)); ADD_CLOCK_FAMILY(ThreadKernel, Thread, (ullKernel.QuadPart), 0, (true, EPseudoPosixClock::eKernel)); - ADD_CLOCK_FAMILY(ThreadUser, Thread, (ullUser.QuadPart), CLOCK_THREAD_CPUTIME_ID, (true, EPseudoPosixClock::eUser)); + ADD_CLOCK_FAMILY(ThreadUser, Thread, (ullUser.QuadPart), /*CLOCK_THREAD_CPUTIME_ID*/0, (true, EPseudoPosixClock::eUser)); AUKN_SYM AuInt64 ConvertAuroraToUnixMS(AuInt64 in) {