Refactoring: Convert enum Direction to enum class

This commit is contained in:
amai2012 2019-08-01 20:56:02 +02:00
parent 7eaa49fd5b
commit 29596baa92
2 changed files with 6 additions and 6 deletions

View File

@ -248,7 +248,7 @@ public:
optional(false), optional(false),
variadic(false), variadic(false),
iteratorInfo(), iteratorInfo(),
direction(DIR_UNKNOWN) { direction(Direction::DIR_UNKNOWN) {
} }
bool notbool; bool notbool;
@ -282,7 +282,7 @@ public:
}; };
std::vector<MinSize> minsizes; std::vector<MinSize> minsizes;
enum Direction { enum class Direction {
DIR_IN, ///< Input to called function. Data is treated as read-only. DIR_IN, ///< Input to called function. Data is treated as read-only.
DIR_OUT, ///< Output to caller. Data is passed by reference or address and is potentially written. DIR_OUT, ///< Output to caller. Data is passed by reference or address and is potentially written.
DIR_INOUT, ///< Input to called function, and output to caller. Data is passed by reference or address and is potentially modified. DIR_INOUT, ///< Input to called function, and output to caller. Data is passed by reference or address and is potentially modified.

View File

@ -294,10 +294,10 @@ private:
tokenList.createTokens(istr); tokenList.createTokens(istr);
tokenList.front()->next()->astOperand1(tokenList.front()); tokenList.front()->next()->astOperand1(tokenList.front());
ASSERT_EQUALS(Library::ArgumentChecks::Direction::DIR_IN, library.getArgDirection(tokenList.front(), 1)); ASSERT(Library::ArgumentChecks::Direction::DIR_IN == library.getArgDirection(tokenList.front(), 1));
ASSERT_EQUALS(Library::ArgumentChecks::Direction::DIR_OUT, library.getArgDirection(tokenList.front(), 2)); ASSERT(Library::ArgumentChecks::Direction::DIR_OUT == library.getArgDirection(tokenList.front(), 2));
ASSERT_EQUALS(Library::ArgumentChecks::Direction::DIR_INOUT, library.getArgDirection(tokenList.front(), 3)); ASSERT(Library::ArgumentChecks::Direction::DIR_INOUT == library.getArgDirection(tokenList.front(), 3));
ASSERT_EQUALS(Library::ArgumentChecks::Direction::DIR_UNKNOWN, library.getArgDirection(tokenList.front(), 4)); ASSERT(Library::ArgumentChecks::Direction::DIR_UNKNOWN == library.getArgDirection(tokenList.front(), 4));
} }
void function_arg_valid() const { void function_arg_valid() const {