projects
/
sdk
/
tools
/
coreprofiler.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
682a4f1
)
Remove default branch in switch block for enum so compiler can check if all enum...
author
Aleksei Vereshchagin
<avereschagin@dev.rtsoft.ru>
Mon, 11 Dec 2017 17:22:35 +0000
(20:22 +0300)
committer
Aleksei Vereshchagin
<avereschagin@dev.rtsoft.ru>
Mon, 11 Dec 2017 17:22:35 +0000
(20:22 +0300)
src/log.h
patch
|
blob
|
history
diff --git
a/src/log.h
b/src/log.h
index 7489069d28a5515803323f9cc928b77b99c04ed2..cc5fc7738dd2706693316a55d660bd6abe27e499 100644
(file)
--- a/
src/log.h
+++ b/
src/log.h
@@
-34,6
+34,9
@@
enum class LogLevel
static inline const char *LogLevelName(LogLevel level)
{
+ // NOTE: we expect compilation error if some of LogLevel enum values don't
+ // be covered by 'switch' statement. So, no 'default' label or 'return'
+ // statement after 'switch'.
switch (level)
{
case LogLevel::None:
@@
-52,8
+55,6
@@
static inline const char *LogLevelName(LogLevel level)
return "TRACE";
case LogLevel::All:
return "ALL";
- default:
- return "";
}
}