diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-08-15 05:38:37 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-08-15 05:52:37 -0400 |
| commit | aaed7027903544c80df4e03f62a96ba8ffa9cf5e (patch) | |
| tree | d242adb55cd5998b6f5ee20462717d6a916bb552 /src/core/file_sys | |
| parent | 26a456e76f3808f8a499c8c31052fb68f8bccf5c (diff) | |
loader: Make ResultStatus directly compatible with fmt
We can make the enum class type compatible with fmt by providing an
overload of operator<<.
While we're at it, perform proper bounds checking. If something exceeds
the array, it should be a hard fail, because it's, without a doubt, a
programmer error in this case.
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 8e05b9d0eb..060948f9e6 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp @@ -4,11 +4,14 @@ #include <array> #include <string> -#include <core/loader/loader.h> + +#include <fmt/ostream.h> + #include "common/logging/log.h" #include "core/file_sys/card_image.h" #include "core/file_sys/partition_filesystem.h" #include "core/file_sys/vfs_offset.h" +#include "core/loader/loader.h" namespace FileSys { @@ -142,7 +145,7 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { const u16 error_id = static_cast<u16>(nca->GetStatus()); LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", partition_names[static_cast<size_t>(part)], nca->GetName(), error_id, - Loader::GetMessageForResultStatus(nca->GetStatus())); + nca->GetStatus()); } } |
