ams-libs: AMS_ASSERT no longer invokes expression

This commit is contained in:
Michael Scire
2021-09-29 21:32:40 -07:00
parent 5dc64bc1f7
commit 9b04ff0f54
38 changed files with 82 additions and 23 deletions

View File

@@ -23,7 +23,8 @@ namespace ams::os::impl {
svc::MemoryInfo memory_info;
svc::PageInfo page_info;
const auto result = svc::QueryMemory(std::addressof(memory_info), std::addressof(page_info), address);
AMS_ASSERT(R_SUCCEEDED(result));
R_ASSERT(result);
AMS_UNUSED(result);
return memory_info.state == svc::MemoryState_Free && address + size <= memory_info.addr + memory_info.size;
}

View File

@@ -109,6 +109,7 @@ namespace ams::os::impl {
const auto count = mq->count;
const auto offset = mq->offset;
AMS_ASSERT(count > 0);
AMS_UNUSED(count);
return mq->buffer[offset];
}

View File

@@ -38,8 +38,9 @@ namespace ams::os::impl {
const s64 frac = tick_val % tick_freq;
const TimeSpan ts = TimeSpan::FromSeconds(seconds) + TimeSpan::FromNanoSeconds(frac * NanoSecondsPerSecond / tick_freq);
constexpr TimeSpan ZeroTS = TimeSpan::FromNanoSeconds(0);
constexpr TimeSpan ZeroTS = TimeSpan::FromNanoSeconds(0);
AMS_ASSERT(!((tick_val > 0 && ts < ZeroTS) || (tick_val < 0 && ts > ZeroTS)));
AMS_UNUSED(ZeroTS);
return ts;
}

View File

@@ -49,8 +49,11 @@ namespace ams::os::impl {
WaitableHolderBase *WaitAnyImpl(bool infinite, TimeSpan timeout) {
WaitableHolderBase *holder = nullptr;
const Result wait_result = this->WaitAnyImpl(std::addressof(holder), infinite, timeout, false, svc::InvalidHandle);
AMS_ASSERT(R_SUCCEEDED(wait_result));
R_ASSERT(wait_result);
AMS_UNUSED(wait_result);
return holder;
}
public: