diff options
| Commit | 9cf31d4b4e389f7c879aa8750a397e32f55a43d1 (patch) | |
|---|---|---|
| Author | 2020-10-19 22:49:27 +0300 | |
| Committer | 2020-11-28 20:58:46 +0200 | |
| Files | 17dd480ad1b0cf3c19d9f67d1318c656d4d37db0 /JSImpl | |
| IPL-9cf31d4b4e389f7c879aa8750a397e32f55a43d1.tar IPL-9cf31d4b4e389f7c879aa8750a397e32f55a43d1.tar.gz IPL-9cf31d4b4e389f7c879aa8750a397e32f55a43d1.zip | ||
| Parent | 6eca913a22b7132a4dcb0bf1a5b8542f81752141 (diff) | |
Fix warnings about assignment in conditions
2 files changed, 25 insertions, 22 deletions
| -rw-r--r-- | JSImpl/src/Expression.h | 5 | ||||
| -rw-r--r-- | JSImpl/src/Parser.cpp | 42 |
diff --git a/JSImpl/src/Expression.h b/JSImpl/src/Expression.h index 37b927f..570687a 100644 --- a/JSImpl/src/Expression.h +++ b/JSImpl/src/Expression.h @@ -38,7 +38,10 @@ 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); } \ \ diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp index 4bc97ce..00907a0 100644 --- a/JSImpl/src/Parser.cpp +++ b/JSImpl/src/Parser.cpp @@ -373,12 +373,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 +464,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 +490,7 @@ ExpressionPtr Parser::FullNewExpression() ExpressionPtr Parser::FullNewSubexpression() { ExpressionPtr result; - if (result = PrimaryExpression(NormalType::Normal)) + if ((result = PrimaryExpression(NormalType::Normal))) { return result; } @@ -764,22 +764,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; } |
