Skip to content

Commit b028b61

Browse files
committed
Turned DT_NodeType enum into enum class + renamed enum values
The enum values used full caps which caused collisions with macros from windows.h. Followed the style advice of https://google.github.io/styleguide/cppguide.html#Enumerator_Names to use 'k' followed by camel casing.
1 parent b572e30 commit b028b61

6 files changed

Lines changed: 92 additions & 89 deletions

File tree

src/src_sharpSAT/Basics.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,16 @@ enum TriValue
7676
X = 2
7777
};
7878

79-
enum DT_NodeType
79+
// Note: do not use full capital for enum values
80+
// otherwise DT_BOTTOM/DT_TOP/.. collide with windows.h macros.
81+
// https://google.github.io/styleguide/cppguide.html#Enumerator_Names
82+
enum class DT_NodeType
8083
{
81-
DT_AND,
82-
DT_OR,
83-
DT_LIT,
84-
DT_TOP,
85-
DT_BOTTOM
84+
kDTAnd,
85+
kDTOr,
86+
kDTLit,
87+
kDTTop,
88+
kDTBottom
8689
};
8790

8891

src/src_sharpSAT/MainSolver/DecisionStack.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ void CDecisionStack::init(unsigned int resSize)
8686
allComponentsStack.push_back(new CComponentId());
8787

8888
// initialize the stack to contain at least level zero
89-
DTNode * dummyLeft = new DTNode(DT_AND, 2);
90-
DTNode * dummyRight = new DTNode(DT_AND, 1);
91-
dtMain = new DTNode(DT_AND, 0);
89+
DTNode * dummyLeft = new DTNode(DT_NodeType::kDTAnd, 2);
90+
DTNode * dummyRight = new DTNode(DT_NodeType::kDTAnd, 1);
91+
dtMain = new DTNode(DT_NodeType::kDTAnd, 0);
9292

9393
dummyLeft->addParent(dtMain, true);
9494
dummyRight->addParent(dtMain, true);

0 commit comments

Comments
 (0)