diff options
| author | 2018-08-15 05:38:37 -0400 | |
|---|---|---|
| committer | 2018-08-15 05:52:37 -0400 | |
| commit | 87d8a9c98626be491e87e4b9fad84b862d8aa0c9 (patch) | |
| tree | d242adb55cd5998b6f5ee20462717d6a916bb552 /src/core/file_sys | |
| parent | Merge pull request #1067 from lioncash/init (diff) | |
| download | yuzu-87d8a9c98626be491e87e4b9fad84b862d8aa0c9.tar.gz yuzu-87d8a9c98626be491e87e4b9fad84b862d8aa0c9.tar.xz yuzu-87d8a9c98626be491e87e4b9fad84b862d8aa0c9.zip | |
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 8e05b9d0e..060948f9e 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -4,11 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #include <array> | 5 | #include <array> |
| 6 | #include <string> | 6 | #include <string> |
| 7 | #include <core/loader/loader.h> | 7 | |
| 8 | #include <fmt/ostream.h> | ||
| 9 | |||
| 8 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 9 | #include "core/file_sys/card_image.h" | 11 | #include "core/file_sys/card_image.h" |
| 10 | #include "core/file_sys/partition_filesystem.h" | 12 | #include "core/file_sys/partition_filesystem.h" |
| 11 | #include "core/file_sys/vfs_offset.h" | 13 | #include "core/file_sys/vfs_offset.h" |
| 14 | #include "core/loader/loader.h" | ||
| 12 | 15 | ||
| 13 | namespace FileSys { | 16 | namespace FileSys { |
| 14 | 17 | ||
| @@ -142,7 +145,7 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { | |||
| 142 | const u16 error_id = static_cast<u16>(nca->GetStatus()); | 145 | const u16 error_id = static_cast<u16>(nca->GetStatus()); |
| 143 | LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", | 146 | LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", |
| 144 | partition_names[static_cast<size_t>(part)], nca->GetName(), error_id, | 147 | partition_names[static_cast<size_t>(part)], nca->GetName(), error_id, |
| 145 | Loader::GetMessageForResultStatus(nca->GetStatus())); | 148 | nca->GetStatus()); |
| 146 | } | 149 | } |
| 147 | } | 150 | } |
| 148 | 151 | ||