ams: revamp assertion system

This commit is contained in:
Michael Scire 2020-02-22 23:05:14 -08:00
parent 9572fb2ce3
commit 40400aee1f
168 changed files with 1014 additions and 696 deletions

View file

@ -21,14 +21,14 @@ namespace ams::fssystem {
: PathResolutionFileSystem(fs, unc)
{
this->base_path = nullptr;
R_ASSERT(this->Initialize(bp));
R_ABORT_UNLESS(this->Initialize(bp));
}
SubDirectoryFileSystem::SubDirectoryFileSystem(std::unique_ptr<fs::fsa::IFileSystem> fs, const char *bp, bool unc)
: PathResolutionFileSystem(std::move(fs), unc)
{
this->base_path = nullptr;
R_ASSERT(this->Initialize(bp));
R_ABORT_UNLESS(this->Initialize(bp));
}
SubDirectoryFileSystem::~SubDirectoryFileSystem() {
@ -48,7 +48,7 @@ namespace ams::fssystem {
/* Ensure terminating '/' */
if (!PathTool::IsSeparator(normalized_path[normalized_path_len - 1])) {
AMS_ASSERT(normalized_path_len + 2 <= sizeof(normalized_path));
AMS_ABORT_UNLESS(normalized_path_len + 2 <= sizeof(normalized_path));
normalized_path[normalized_path_len] = StringTraits::DirectorySeparator;
normalized_path[normalized_path_len + 1] = StringTraits::NullTerminator;