https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a1ebce3aac7290b66ebad…
commit a1ebce3aac7290b66ebadcd0e006fe288420b907
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sun Jul 25 17:52:33 2021 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Jul 25 18:14:23 2021 +0300
[DRWTSN32] Fix Clang build. Addendum to bdab437f.
Also use a macro for better code readability.
Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
---
base/applications/drwtsn32/sysinfo.cpp | 49 +++++++++++++++++-----------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/base/applications/drwtsn32/sysinfo.cpp
b/base/applications/drwtsn32/sysinfo.cpp
index eef86e3d3e8..bc96af0d00f 100644
--- a/base/applications/drwtsn32/sysinfo.cpp
+++ b/base/applications/drwtsn32/sysinfo.cpp
@@ -15,30 +15,31 @@ static const char* Exception2Str(DWORD code)
{
switch (code)
{
- case EXCEPTION_ACCESS_VIOLATION: return "EXCEPTION_ACCESS_VIOLATION";
- case EXCEPTION_DATATYPE_MISALIGNMENT: return
"EXCEPTION_DATATYPE_MISALIGNMENT";
- case EXCEPTION_BREAKPOINT: return "EXCEPTION_BREAKPOINT";
- case EXCEPTION_SINGLE_STEP: return "EXCEPTION_SINGLE_STEP";
- case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: return
"EXCEPTION_ARRAY_BOUNDS_EXCEEDED";
- case EXCEPTION_FLT_DENORMAL_OPERAND: return
"EXCEPTION_FLT_DENORMAL_OPERAND";
- case EXCEPTION_FLT_DIVIDE_BY_ZERO: return "EXCEPTION_FLT_DIVIDE_BY_ZERO";
- case EXCEPTION_FLT_INEXACT_RESULT: return "EXCEPTION_FLT_INEXACT_RESULT";
- case EXCEPTION_FLT_INVALID_OPERATION: return
"EXCEPTION_FLT_INVALID_OPERATION";
- case EXCEPTION_FLT_OVERFLOW: return "EXCEPTION_FLT_OVERFLOW";
- case EXCEPTION_FLT_STACK_CHECK: return "EXCEPTION_FLT_STACK_CHECK";
- case EXCEPTION_FLT_UNDERFLOW: return "EXCEPTION_FLT_UNDERFLOW";
- case EXCEPTION_INT_DIVIDE_BY_ZERO: return "EXCEPTION_INT_DIVIDE_BY_ZERO";
- case EXCEPTION_INT_OVERFLOW: return "EXCEPTION_INT_OVERFLOW";
- case EXCEPTION_PRIV_INSTRUCTION: return "EXCEPTION_PRIV_INSTRUCTION";
- case EXCEPTION_IN_PAGE_ERROR: return "EXCEPTION_IN_PAGE_ERROR";
- case EXCEPTION_ILLEGAL_INSTRUCTION: return
"EXCEPTION_ILLEGAL_INSTRUCTION";
- case EXCEPTION_NONCONTINUABLE_EXCEPTION: return
"EXCEPTION_NONCONTINUABLE_EXCEPTION";
- case EXCEPTION_STACK_OVERFLOW: return "EXCEPTION_STACK_OVERFLOW";
- case EXCEPTION_INVALID_DISPOSITION: return
"EXCEPTION_INVALID_DISPOSITION";
- case EXCEPTION_GUARD_PAGE: return "EXCEPTION_GUARD_PAGE";
- case EXCEPTION_INVALID_HANDLE: return "EXCEPTION_INVALID_HANDLE";
- case EXCEPTION_WINE_STUB: return "EXCEPTION_WINE_STUB";
- case STATUS_ASSERTION_FAILURE: return "STATUS_ASSERTION_FAILURE";
+#define EX_TO_STR(name) case (DWORD)(name): return #name
+ EX_TO_STR(EXCEPTION_ACCESS_VIOLATION);
+ EX_TO_STR(EXCEPTION_DATATYPE_MISALIGNMENT);
+ EX_TO_STR(EXCEPTION_BREAKPOINT);
+ EX_TO_STR(EXCEPTION_SINGLE_STEP);
+ EX_TO_STR(EXCEPTION_ARRAY_BOUNDS_EXCEEDED);
+ EX_TO_STR(EXCEPTION_FLT_DENORMAL_OPERAND);
+ EX_TO_STR(EXCEPTION_FLT_DIVIDE_BY_ZERO);
+ EX_TO_STR(EXCEPTION_FLT_INEXACT_RESULT);
+ EX_TO_STR(EXCEPTION_FLT_INVALID_OPERATION);
+ EX_TO_STR(EXCEPTION_FLT_OVERFLOW);
+ EX_TO_STR(EXCEPTION_FLT_STACK_CHECK);
+ EX_TO_STR(EXCEPTION_FLT_UNDERFLOW);
+ EX_TO_STR(EXCEPTION_INT_DIVIDE_BY_ZERO);
+ EX_TO_STR(EXCEPTION_INT_OVERFLOW);
+ EX_TO_STR(EXCEPTION_PRIV_INSTRUCTION);
+ EX_TO_STR(EXCEPTION_IN_PAGE_ERROR);
+ EX_TO_STR(EXCEPTION_ILLEGAL_INSTRUCTION);
+ EX_TO_STR(EXCEPTION_NONCONTINUABLE_EXCEPTION);
+ EX_TO_STR(EXCEPTION_STACK_OVERFLOW);
+ EX_TO_STR(EXCEPTION_INVALID_DISPOSITION);
+ EX_TO_STR(EXCEPTION_GUARD_PAGE);
+ EX_TO_STR(EXCEPTION_INVALID_HANDLE);
+ EX_TO_STR(EXCEPTION_WINE_STUB);
+ EX_TO_STR(STATUS_ASSERTION_FAILURE);
}
return "--";