sts: add STS_UNREACHABLE_DEFAULT_CASE()
This commit is contained in:
@@ -109,7 +109,7 @@ Result DirectorySaveDataFileSystem::AllocateWorkBuffer(void **out_buf, size_t *o
|
||||
size_t try_size = ideal_size;
|
||||
|
||||
/* Repeatedly try to allocate until success. */
|
||||
while (try_size > 0x200) {
|
||||
while (true) {
|
||||
void *buf = malloc(try_size);
|
||||
if (buf != nullptr) {
|
||||
*out_buf = buf;
|
||||
@@ -119,11 +119,11 @@ Result DirectorySaveDataFileSystem::AllocateWorkBuffer(void **out_buf, size_t *o
|
||||
|
||||
/* Divide size by two. */
|
||||
try_size >>= 1;
|
||||
STS_ASSERT(try_size > 0x200);
|
||||
}
|
||||
|
||||
/* TODO: Return a result here? Nintendo does not, but they have other allocation failed results. */
|
||||
/* Consider returning ResultFsAllocationFailureInDirectorySaveDataFileSystem? */
|
||||
std::abort();
|
||||
}
|
||||
|
||||
Result DirectorySaveDataFileSystem::GetFullPath(char *out, size_t out_size, const char *relative_path) {
|
||||
|
||||
@@ -122,9 +122,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) {
|
||||
R_ASSERT(this->file_romfs->Read((void *)((uintptr_t)buffer + read_so_far), cur_read_size, cur_source->base_source_info.offset + (offset - cur_source->virtual_offset)));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
std::abort();
|
||||
break;
|
||||
STS_UNREACHABLE_DEFAULT_CASE();
|
||||
}
|
||||
read_so_far += cur_read_size;
|
||||
offset += cur_read_size;
|
||||
|
||||
Reference in New Issue
Block a user