summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat2015-08-02 18:30:24 -0400
committerGravatar Benjamin Barenblat2015-08-02 18:30:24 -0400
commit0298b7bedd17f88430486dd502fb7923b1d10f26 (patch)
treee56edb5024da1c03b2021c428988f8a710417565 /src
parentHandle invalid `Log::Level::Count` (diff)
downloadyuzu-0298b7bedd17f88430486dd502fb7923b1d10f26.tar.gz
yuzu-0298b7bedd17f88430486dd502fb7923b1d10f26.tar.xz
yuzu-0298b7bedd17f88430486dd502fb7923b1d10f26.zip
Use UNREACHABLE macro for impossible cases in previous commit
Use the UNREACHABLE macro instead of `ASSERT(false, ...);`.
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp3
-rw-r--r--src/common/logging/text_formatter.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 68580e1c0..0a081e7d4 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -80,8 +80,7 @@ const char* GetLevelName(Level log_level) {
80 LVL(Error); 80 LVL(Error);
81 LVL(Critical); 81 LVL(Critical);
82 case Level::Count: 82 case Level::Count:
83 ASSERT_MSG(false, "invalid log level"); 83 UNREACHABLE();
84 return "Unknown";
85 } 84 }
86#undef LVL 85#undef LVL
87} 86}
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp
index e3bb148bb..de195b0f7 100644
--- a/src/common/logging/text_formatter.cpp
+++ b/src/common/logging/text_formatter.cpp
@@ -84,7 +84,7 @@ void PrintColoredMessage(const Entry& entry) {
84 case Level::Critical: // Bright magenta 84 case Level::Critical: // Bright magenta
85 color = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break; 85 color = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
86 case Level::Count: 86 case Level::Count:
87 ASSERT_MSG(false, "invalid log level"); break; 87 UNREACHABLE();
88 } 88 }
89 89
90 SetConsoleTextAttribute(console_handle, color); 90 SetConsoleTextAttribute(console_handle, color);
@@ -105,7 +105,7 @@ void PrintColoredMessage(const Entry& entry) {
105 case Level::Critical: // Bright magenta 105 case Level::Critical: // Bright magenta
106 color = ESC "[1;35m"; break; 106 color = ESC "[1;35m"; break;
107 case Level::Count: 107 case Level::Count:
108 ASSERT_MSG(false, "invalid log level"); break; 108 UNREACHABLE();
109 } 109 }
110 110
111 fputs(color, stderr); 111 fputs(color, stderr);