[nostalgia] Make almost everyting noexcept

This commit is contained in:
2021-04-20 01:56:41 -05:00
parent 161780cb91
commit 6ece0b6f9b
22 changed files with 139 additions and 136 deletions
+3 -6
View File
@@ -10,20 +10,17 @@
namespace nostalgia::core {
ox::FileSystem *loadRomFs(const char *path) {
ox::Result<ox::FileSystem*> loadRomFs(const char *path) noexcept {
const auto lastDot = ox_lastIndexOf(path, '.');
const auto fsExt = lastDot != -1 ? path + lastDot : "";
if (ox_strcmp(fsExt, ".oxfs") == 0) {
auto rom = core::loadRom(path);
if (!rom) {
return nullptr;
}
oxRequire(rom, core::loadRom(path));
return new ox::FileSystem32(rom, 32 * ox::units::MB, unloadRom);
} else {
#ifdef OX_HAS_PASSTHROUGHFS
return new ox::PassThroughFS(path);
#else
return nullptr;
return OxError(2);
#endif
}
}