diff options
| Commit | 8aaa9cbf48e4fb526d1832c12a644a64be7202df (patch) | |
|---|---|---|
| Author | 2020-11-28 22:42:39 +0200 | |
| Committer | 2020-11-28 22:42:39 +0200 | |
| Files | a3acc545a4a6258d2d3e97f69b55a844272fac08 /JSImpl | |
| IPL-8aaa9cbf48e4fb526d1832c12a644a64be7202df.tar IPL-8aaa9cbf48e4fb526d1832c12a644a64be7202df.tar.gz IPL-8aaa9cbf48e4fb526d1832c12a644a64be7202df.zip | ||
| Parent | ad0778674d9679eaf8a6d5ee84b646a6055b9a90 (diff) | |
| Parent | 7eb2b8e1ec0f5aaf1854cafcb1de7f9cf7d86e3c (diff) | |
Merge pull request #88 from SofiaCPP/feature/clang-tidy
Feature support running clang-tidy
7 files changed, 39 insertions, 33 deletions
| -rw-r--r-- | JSImpl/solution/genie.lua | 8 | ||||
| -rw-r--r-- | JSImpl/src/ASTInterpreter.cpp | 1 | ||||
| -rw-r--r-- | JSImpl/src/Expression.h | 7 | ||||
| -rw-r--r-- | JSImpl/src/JSONParser.cpp | 2 | ||||
| -rw-r--r-- | JSImpl/src/Lexer.cpp | 5 | ||||
| -rw-r--r-- | JSImpl/src/Parser.cpp | 47 | ||||
| -rw-r--r-- | JSImpl/test/googletest/googletest/src/gtest-internal-inl.h | 2 |
diff --git a/JSImpl/solution/genie.lua b/JSImpl/solution/genie.lua index 10d31de..e3720a4 100644 --- a/JSImpl/solution/genie.lua +++ b/JSImpl/solution/genie.lua @@ -1,6 +1,10 @@ solution 'JSImpl' - configurations {'Debug', 'Release'} - platforms { 'x32', 'x64' } + if _ACTION ~= 'jcdb' then + platforms { 'x32', 'x64' } + configurations {'Debug', 'Release'} + else + configurations {'Debug'} + end flags { 'FatalWarnings', 'ExtraWarnings', diff --git a/JSImpl/src/ASTInterpreter.cpp b/JSImpl/src/ASTInterpreter.cpp index f56706a..baf38ae 100644 --- a/JSImpl/src/ASTInterpreter.cpp +++ b/JSImpl/src/ASTInterpreter.cpp @@ -229,6 +229,7 @@ struct LValueExtractor : public ExpressionVisitor public: LValueExtractor(ASTInterpreter* interpreter) : m_Interpreter(interpreter) + , m_LValue(nullptr) {} ~LValueExtractor() {} diff --git a/JSImpl/src/Expression.h b/JSImpl/src/Expression.h index 333568f..570687a 100644 --- a/JSImpl/src/Expression.h +++ b/JSImpl/src/Expression.h @@ -38,14 +38,17 @@ class Expression : public IPLEnableShared<Expression> public: \ ClassName(MEMBERS_ITERATOR(EXPAND_ARGUMENT) bool __dummy = 0) \ : \ - MEMBERS_ITERATOR(EXPAND_INITIALIZER_LIST) m_dummy(__dummy) {} \ + MEMBERS_ITERATOR(EXPAND_INITIALIZER_LIST) m_dummy(__dummy) \ + { \ + (void)m_dummy; /* silence warning about unused private field */ \ + } \ virtual ~ClassName() {} \ virtual void Accept(ExpressionVisitor& v) override { v.Visit(this); } \ \ MEMBERS_ITERATOR(GENERATE_GETTERS) \ private: \ MEMBERS_ITERATOR(GENERATE_MEMBER_DEFINITIONS) \ - bool m_dummy; \ + bool m_dummy; /* NOLINT */ \ }; EXPRESSION_DEFINITION_ITERATOR(GENERATE_EXPRESSION); diff --git a/JSImpl/src/JSONParser.cpp b/JSImpl/src/JSONParser.cpp index 275fb0e..3f87aad 100644 --- a/JSImpl/src/JSONParser.cpp +++ b/JSImpl/src/JSONParser.cpp @@ -55,7 +55,7 @@ EXPRESSION_DEFINITION_ITERATOR(GENERATE_EXPRESSION_TYPE_ENUMS); #undef GENERATE_EXPRESSION_TYPE_ENUM_MEMBERS template <typename T> -ExpressionPtr JSONParseWrap(const char*& json, const char* eName) +ExpressionPtr JSONParseWrap(const char*&, const char*) { assert(false); return nullptr; diff --git a/JSImpl/src/Lexer.cpp b/JSImpl/src/Lexer.cpp index 4a2deb8..30a7e42 100644 --- a/JSImpl/src/Lexer.cpp +++ b/JSImpl/src/Lexer.cpp @@ -33,11 +33,6 @@ inline bool IsStringBound(char c) return c == '\'' || c == '"'; } -inline bool IsWhiteSpace(char c) -{ - return c == ' '; -} - inline bool IsNewLine(char c) { return c == '\n'; diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp index 4bc97ce..8f415fb 100644 --- a/JSImpl/src/Parser.cpp +++ b/JSImpl/src/Parser.cpp @@ -140,7 +140,8 @@ ExpressionPtr Parser::PrimaryExpression(NormalType a) { if (a == NormalType::Initial) { - return SimpleExpression(); + auto simple = SimpleExpression(); + return simple; } if (auto simple = SimpleExpression()) @@ -373,12 +374,12 @@ ExpressionPtr Parser::LeftSideExpression(NormalType a) { ExpressionPtr result; auto ss = Snapshot(); - if (result = CallExpression(a)) + if ((result = CallExpression(a))) { return result; } Restore(ss); - if (result = ShortNewExpression()) + if ((result = ShortNewExpression())) { return result; } @@ -464,12 +465,12 @@ ExpressionPtr Parser::ShortNewSubexpression() { ExpressionPtr result; auto ss = Snapshot(); - if (result = FullNewSubexpression()) + if ((result = FullNewSubexpression())) { return result; } Restore(ss); - if (result = ShortNewExpression()) + if ((result = ShortNewExpression())) { return result; } @@ -490,7 +491,7 @@ ExpressionPtr Parser::FullNewExpression() ExpressionPtr Parser::FullNewSubexpression() { ExpressionPtr result; - if (result = PrimaryExpression(NormalType::Normal)) + if ((result = PrimaryExpression(NormalType::Normal))) { return result; } @@ -682,9 +683,11 @@ ExpressionPtr Parser::ConditionalExpression(NormalType a, AllowType b) if (Match(TokenType::QuestionMark)) { auto trueExpr= AssignmentExpression(NormalType::Normal, b); + (void)trueExpr; if (Match(TokenType::Colon)) { auto falseExpr = AssignmentExpression(NormalType::Normal, b); + (void)falseExpr; // TODO implement trinary operator assert(false); return ExpressionPtr(); @@ -764,22 +767,22 @@ ExpressionPtr Parser::Expression(NormalType a, AllowType b) ExpressionPtr Parser::Statement() { ExpressionPtr result; - if (result = EmptyStatement()) return result; - if (result = Expression(NormalType::Initial, AllowType::AllowIn)) return result; - if (result = VariableDefinition(AllowType::AllowIn)) return result; - if (result = Block()) return result; - if (result = LabeledStatement()) return result; - if (result = IfStatementfull()) return result; - if (result = SwitchStatement()) return result; - if (result = DoStatement()) return result; - if (result = WhileStatement()) return result; - if (result = ForStatement()) return result; - if (result = WithStatement()) return result; - if (result = ContinueStatement()) return result; - if (result = BreakStatement()) return result; - if (result = OptionalLabel()) return result; - if (result = ReturnStatement()) return result; - if (result = TryStatement()) return result; + if ((result = EmptyStatement())) return result; + if ((result = Expression(NormalType::Initial, AllowType::AllowIn))) return result; + if ((result = VariableDefinition(AllowType::AllowIn))) return result; + if ((result = Block())) return result; + if ((result = LabeledStatement())) return result; + if ((result = IfStatementfull())) return result; + if ((result = SwitchStatement())) return result; + if ((result = DoStatement())) return result; + if ((result = WhileStatement())) return result; + if ((result = ForStatement())) return result; + if ((result = WithStatement())) return result; + if ((result = ContinueStatement())) return result; + if ((result = BreakStatement())) return result; + if ((result = OptionalLabel())) return result; + if ((result = ReturnStatement())) return result; + if ((result = TryStatement())) return result; return result; } diff --git a/JSImpl/test/googletest/googletest/src/gtest-internal-inl.h b/JSImpl/test/googletest/googletest/src/gtest-internal-inl.h index 4790041..b6916d6 100644 --- a/JSImpl/test/googletest/googletest/src/gtest-internal-inl.h +++ b/JSImpl/test/googletest/googletest/src/gtest-internal-inl.h @@ -152,7 +152,7 @@ inline int GetNextRandomSeed(int seed) { // This class saves the values of all Google Test flags in its c'tor, and // restores them in its d'tor. -class GTestFlagSaver { +class GTestFlagSaver { // NOLINT - lots of padding public: // The c'tor. GTestFlagSaver() { |
