mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 00:43:46 +00:00
Replace NULL with nullptr
This commit is contained in:
parent
5f11e15571
commit
95a1400a2a
755 changed files with 5742 additions and 5742 deletions
|
@ -652,12 +652,12 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
|
||||
while (true) {
|
||||
//keep appending stuff to expression
|
||||
ENode *expr = NULL;
|
||||
ENode *expr = nullptr;
|
||||
|
||||
Token tk;
|
||||
_get_token(tk);
|
||||
if (error_set)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
switch (tk.type) {
|
||||
case TK_CURLY_BRACKET_OPEN: {
|
||||
|
@ -675,18 +675,18 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
//parse an expression
|
||||
ENode *expr2 = _parse_expression();
|
||||
if (!expr2)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
dn->dict.push_back(expr2);
|
||||
|
||||
_get_token(tk);
|
||||
if (tk.type != TK_COLON) {
|
||||
_set_error("Expected ':'");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
expr2 = _parse_expression();
|
||||
if (!expr2)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
dn->dict.push_back(expr2);
|
||||
|
||||
|
@ -719,7 +719,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
//parse an expression
|
||||
ENode *expr2 = _parse_expression();
|
||||
if (!expr2)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
an->array.push_back(expr2);
|
||||
|
||||
cofs = str_ofs;
|
||||
|
@ -739,11 +739,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
//a suexpression
|
||||
ENode *e = _parse_expression();
|
||||
if (error_set)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
_get_token(tk);
|
||||
if (tk.type != TK_PARENTHESIS_CLOSE) {
|
||||
_set_error("Expected ')'");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
expr = e;
|
||||
|
@ -766,7 +766,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
expr = input;
|
||||
} else {
|
||||
_set_error("Invalid input identifier '" + what + "'. For script variables, use self (locals are for inputs)." + what);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
} break;
|
||||
case TK_SELF: {
|
||||
|
@ -786,7 +786,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
_get_token(tk);
|
||||
if (tk.type != TK_PARENTHESIS_OPEN) {
|
||||
_set_error("Expected '('");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ConstructorNode *constructor = alloc_node<ConstructorNode>();
|
||||
|
@ -803,7 +803,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
//parse an expression
|
||||
ENode *expr2 = _parse_expression();
|
||||
if (!expr2)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
constructor->arguments.push_back(expr2);
|
||||
|
||||
|
@ -827,7 +827,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
_get_token(tk);
|
||||
if (tk.type != TK_PARENTHESIS_OPEN) {
|
||||
_set_error("Expected '('");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BuiltinFuncNode *bifunc = alloc_node<BuiltinFuncNode>();
|
||||
|
@ -844,7 +844,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
//parse an expression
|
||||
ENode *expr2 = _parse_expression();
|
||||
if (!expr2)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
bifunc->arguments.push_back(expr2);
|
||||
|
||||
|
@ -886,7 +886,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
|
||||
default: {
|
||||
_set_error("Expected expression.");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} break;
|
||||
}
|
||||
|
||||
|
@ -896,7 +896,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
int cofs2 = str_ofs;
|
||||
_get_token(tk);
|
||||
if (error_set)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
bool done = false;
|
||||
|
||||
|
@ -909,14 +909,14 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
|
||||
ENode *what = _parse_expression();
|
||||
if (!what)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
index->index = what;
|
||||
|
||||
_get_token(tk);
|
||||
if (tk.type != TK_BRACKET_CLOSE) {
|
||||
_set_error("Expected ']' at end of index.");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
expr = index;
|
||||
|
||||
|
@ -926,7 +926,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
_get_token(tk);
|
||||
if (tk.type != TK_IDENTIFIER) {
|
||||
_set_error("Expected identifier after '.'");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StringName identifier = tk.value;
|
||||
|
@ -950,7 +950,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
//parse an expression
|
||||
ENode *expr2 = _parse_expression();
|
||||
if (!expr2)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
func_call->arguments.push_back(expr2);
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
int cofs = str_ofs;
|
||||
_get_token(tk);
|
||||
if (error_set)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Variant::Operator op = Variant::OP_MAX;
|
||||
|
||||
|
@ -1107,7 +1107,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
|
||||
default: {
|
||||
_set_error("Parser bug, invalid operator in expression: " + itos(expression[i].op));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1124,7 +1124,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
if (next_op == -1) {
|
||||
|
||||
_set_error("Yet another parser bug....");
|
||||
ERR_FAIL_V(NULL);
|
||||
ERR_FAIL_V(nullptr);
|
||||
}
|
||||
|
||||
// OK! create operator..
|
||||
|
@ -1137,7 +1137,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
if (expr_pos == expression.size()) {
|
||||
//can happen..
|
||||
_set_error("Unexpected end of expression...");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1147,7 +1147,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
OperatorNode *op = alloc_node<OperatorNode>();
|
||||
op->op = expression[i].op;
|
||||
op->nodes[0] = expression[i + 1].node;
|
||||
op->nodes[1] = NULL;
|
||||
op->nodes[1] = nullptr;
|
||||
expression.write[i].is_op = false;
|
||||
expression.write[i].node = op;
|
||||
expression.remove(i + 1);
|
||||
|
@ -1157,7 +1157,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
|
||||
if (next_op < 1 || next_op >= (expression.size() - 1)) {
|
||||
_set_error("Parser bug...");
|
||||
ERR_FAIL_V(NULL);
|
||||
ERR_FAIL_V(nullptr);
|
||||
}
|
||||
|
||||
OperatorNode *op = alloc_node<OperatorNode>();
|
||||
|
@ -1166,7 +1166,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
if (expression[next_op - 1].is_op) {
|
||||
|
||||
_set_error("Parser bug...");
|
||||
ERR_FAIL_V(NULL);
|
||||
ERR_FAIL_V(nullptr);
|
||||
}
|
||||
|
||||
if (expression[next_op + 1].is_op) {
|
||||
|
@ -1176,7 +1176,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
|||
// due to how precedence works, unaries will always disappear first
|
||||
|
||||
_set_error("Unexpected two consecutive operators.");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
op->nodes[0] = expression[next_op - 1].node; //expression goes as left
|
||||
|
@ -1199,8 +1199,8 @@ bool VisualScriptExpression::_compile_expression() {
|
|||
|
||||
if (nodes) {
|
||||
memdelete(nodes);
|
||||
nodes = NULL;
|
||||
root = NULL;
|
||||
nodes = nullptr;
|
||||
root = nullptr;
|
||||
}
|
||||
|
||||
error_str = String();
|
||||
|
@ -1210,11 +1210,11 @@ bool VisualScriptExpression::_compile_expression() {
|
|||
root = _parse_expression();
|
||||
|
||||
if (error_set) {
|
||||
root = NULL;
|
||||
root = nullptr;
|
||||
if (nodes) {
|
||||
memdelete(nodes);
|
||||
}
|
||||
nodes = NULL;
|
||||
nodes = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1478,8 +1478,8 @@ VisualScriptExpression::VisualScriptExpression() {
|
|||
output_type = Variant::NIL;
|
||||
expression_dirty = true;
|
||||
error_set = true;
|
||||
root = NULL;
|
||||
nodes = NULL;
|
||||
root = nullptr;
|
||||
nodes = nullptr;
|
||||
sequenced = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue