Permalink
Browse files

Remove duplicate code

ENUM2STR_CASE_DEF is exactly the same as ENUM2STR_CASE

Since ENUM2STR_CASE is being used as primary, no longer need a reason to have duplicate maco method.
  • Loading branch information...
RadWolfie committed Feb 5, 2019
1 parent 3d1de11 commit ff4da755245e21e5bc2703a4b15802c0f335df16
Showing with 12 additions and 14 deletions.
  1. +0 −2 src/common/Logging.h
  2. +12 −12 src/core/kernel/exports/EmuKrnlLogging.cpp
@@ -457,8 +457,6 @@ extern thread_local std::string _logThreadPrefix;
#define ENUM2STR_HEADER(EnumType) extern TYPE2PCHAR_HEADER(EnumType); LOGRENDER_HEADER_BY_REF(EnumType);
#define ENUM2STR_START(EnumType) TYPE2PCHAR_HEADER(EnumType) { switch (value) {
#define ENUM2STR_CASE(a) case a: return #a;
// ENUM2STR_CASE_DEF is needed for #define'd symbols
#define ENUM2STR_CASE_DEF(a) case a: return #a;
#define ENUM2STR_END(EnumType) default: return "Unknown_"#EnumType; } }
#define ENUM2STR_END_and_LOGRENDER(EnumType) ENUM2STR_END(EnumType) LOGRENDER_TYPE(EnumType)

@@ -122,12 +122,12 @@ ENUM2STR_START(BUS_DATA_TYPE)
ENUM2STR_END_and_LOGRENDER(BUS_DATA_TYPE)

ENUM2STR_START(CREATE_DISPOSITION)
ENUM2STR_CASE_DEF(FILE_SUPERSEDE)
ENUM2STR_CASE_DEF(FILE_OPEN)
ENUM2STR_CASE_DEF(FILE_CREATE)
ENUM2STR_CASE_DEF(FILE_OPEN_IF)
ENUM2STR_CASE_DEF(FILE_OVERWRITE)
ENUM2STR_CASE_DEF(FILE_OVERWRITE_IF)
ENUM2STR_CASE(FILE_SUPERSEDE)
ENUM2STR_CASE(FILE_OPEN)
ENUM2STR_CASE(FILE_CREATE)
ENUM2STR_CASE(FILE_OPEN_IF)
ENUM2STR_CASE(FILE_OVERWRITE)
ENUM2STR_CASE(FILE_OVERWRITE_IF)
// ENUM2STR_CASE_DEF(FILE_MAXIMUM_DISPOSITION) Skip, identical to FILE_OVERWRITE_IF
ENUM2STR_END_and_LOGRENDER(CREATE_DISPOSITION)

@@ -239,12 +239,12 @@ ENUM2STR_START(KINTERRUPT_MODE)
ENUM2STR_END_and_LOGRENDER(KINTERRUPT_MODE)

ENUM2STR_START(KIRQL_TYPE)
ENUM2STR_CASE_DEF(PASSIVE_LEVEL)
ENUM2STR_CASE_DEF(APC_LEVEL)
ENUM2STR_CASE_DEF(DISPATCH_LEVEL)
ENUM2STR_CASE_DEF(PROFILE_LEVEL)
ENUM2STR_CASE_DEF(SYNC_LEVEL)
ENUM2STR_CASE_DEF(HIGH_LEVEL)
ENUM2STR_CASE(PASSIVE_LEVEL)
ENUM2STR_CASE(APC_LEVEL)
ENUM2STR_CASE(DISPATCH_LEVEL)
ENUM2STR_CASE(PROFILE_LEVEL)
ENUM2STR_CASE(SYNC_LEVEL)
ENUM2STR_CASE(HIGH_LEVEL)
ENUM2STR_END_and_LOGRENDER(KIRQL_TYPE)

ENUM2STR_START(KWAIT_REASON)

0 comments on commit ff4da75

Please sign in to comment.