Style: Apply clang-tidy's readability-braces-around-statements

This commit is contained in:
Rémi Verschelde 2021-04-05 14:09:59 +02:00
parent 9bbe51dc27
commit d83761ba80
No known key found for this signature in database
GPG key ID: C3336907360768E1
32 changed files with 308 additions and 165 deletions

View file

@ -6932,10 +6932,11 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
decl.initializer.push_back(n);
break;
} else {
if (curly)
if (curly) {
_set_error("Expected '}' or ','");
else
} else {
_set_error("Expected ')' or ','");
}
return ERR_PARSE_ERROR;
}
}
@ -6962,8 +6963,9 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
} else {
//variable created with assignment! must parse an expression
Node *expr = _parse_and_reduce_expression(nullptr, FunctionInfo());
if (!expr)
if (!expr) {
return ERR_PARSE_ERROR;
}
if (expr->type == Node::TYPE_OPERATOR && ((OperatorNode *)expr)->op == OP_CALL) {
_set_error("Expected constant expression after '='");
return ERR_PARSE_ERROR;