diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-11-06 01:47:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 09:47:26 -0800 |
| commit | b118451e301d734e3e783b3acdf871f3f6ea851c (patch) | |
| tree | 277f160d31e2c442f724bc6a2d3c09fabff403ca /source/core/slang-signal.cpp | |
| parent | 53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff) | |
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines
* format
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/core/slang-signal.cpp')
| -rw-r--r-- | source/core/slang-signal.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/source/core/slang-signal.cpp b/source/core/slang-signal.cpp index 1600183e7..4ae75eb0e 100644 --- a/source/core/slang-signal.cpp +++ b/source/core/slang-signal.cpp @@ -10,13 +10,20 @@ static const char* _getSignalTypeAsText(SignalType type) { switch (type) { - case SignalType::AssertFailure: return "assert failure"; - case SignalType::Unimplemented: return "unimplemented"; - case SignalType::Unreachable: return "hit unreachable code"; - case SignalType::Unexpected: return "unexpected"; - case SignalType::InvalidOperation: return "invalid operation"; - case SignalType::AbortCompilation: return "abort compilation"; - default: return "unhandled"; + case SignalType::AssertFailure: + return "assert failure"; + case SignalType::Unimplemented: + return "unimplemented"; + case SignalType::Unreachable: + return "hit unreachable code"; + case SignalType::Unexpected: + return "unexpected"; + case SignalType::InvalidOperation: + return "invalid operation"; + case SignalType::AbortCompilation: + return "abort compilation"; + default: + return "unhandled"; } } @@ -50,9 +57,12 @@ String _getMessage(SignalType type, char const* message) #if SLANG_HAS_EXCEPTIONS switch (type) { - case SignalType::InvalidOperation: throw InvalidOperationException(_getMessage(type, message)); - case SignalType::AbortCompilation: throw AbortCompilationException(_getMessage(type, message)); - default: throw InternalError(_getMessage(type, message)); + case SignalType::InvalidOperation: + throw InvalidOperationException(_getMessage(type, message)); + case SignalType::AbortCompilation: + throw AbortCompilationException(_getMessage(type, message)); + default: + throw InternalError(_getMessage(type, message)); } #else // Attempt to drop out into the debugger. If a debugger isn't attached this will likely crash - |
