ams-libs: AMS_ASSERT no longer invokes expression
This commit is contained in:
@@ -786,6 +786,7 @@ namespace ams::fssystem::save {
|
||||
|
||||
/* Get the entry to invalidate. */
|
||||
const CacheEntry *entry_to_invalidate = std::addressof(this->entries[this->invalidate_index]);
|
||||
AMS_UNUSED(entry_to_invalidate);
|
||||
|
||||
/* Ensure that the entry can be invalidated. */
|
||||
AMS_ASSERT(entry_to_invalidate->is_valid);
|
||||
|
||||
@@ -192,6 +192,7 @@ namespace ams::fssystem::save {
|
||||
const auto cache_buffer = reinterpret_cast<u8 *>(this->memory_range.first) + read_offset;
|
||||
AMS_ASSERT(read_offset >= 0);
|
||||
AMS_ASSERT(static_cast<size_t>(read_offset) <= readable_offset_max);
|
||||
AMS_UNUSED(readable_offset_max);
|
||||
|
||||
std::memcpy(buffer, cache_buffer, size);
|
||||
}
|
||||
@@ -209,6 +210,7 @@ namespace ams::fssystem::save {
|
||||
const auto cache_buffer = reinterpret_cast<u8 *>(this->memory_range.first) + write_offset;
|
||||
AMS_ASSERT(write_offset >= 0);
|
||||
AMS_ASSERT(static_cast<size_t>(write_offset) <= writable_offset_max);
|
||||
AMS_UNUSED(writable_offset_max);
|
||||
|
||||
std::memcpy(cache_buffer, buffer, size);
|
||||
this->is_dirty = true;
|
||||
|
||||
@@ -44,9 +44,10 @@ namespace ams::fssystem::save {
|
||||
{
|
||||
s64 hash_size = 0;
|
||||
s64 data_size = 0;
|
||||
AMS_ASSERT(R_SUCCEEDED(hash_storage.GetSize(std::addressof(hash_size))));
|
||||
AMS_ASSERT(R_SUCCEEDED(data_storage.GetSize(std::addressof(hash_size))));
|
||||
R_ASSERT(hash_storage.GetSize(std::addressof(hash_size)));
|
||||
R_ASSERT(data_storage.GetSize(std::addressof(hash_size)));
|
||||
AMS_ASSERT(((hash_size / HashSize) * this->verification_block_size) >= data_size);
|
||||
AMS_UNUSED(hash_size, data_size);
|
||||
}
|
||||
|
||||
/* Set salt. */
|
||||
|
||||
Reference in New Issue
Block a user