diff options
author | lupoDharkael <izhe@hotmail.es> | 2020-04-02 01:20:12 +0200 |
---|---|---|
committer | lupoDharkael <izhe@hotmail.es> | 2020-04-02 13:38:00 +0200 |
commit | 95a1400a2ac9de1a29fa305f45b928ce8e3044bd (patch) | |
tree | be0cd59e5a90926e9d653fed9f3b1b77e735ca2f /modules/visual_script | |
parent | 5f11e1557156617366d2c316a97716172103980d (diff) |
Replace NULL with nullptr
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/register_types.cpp | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 38 | ||||
-rw-r--r-- | modules/visual_script/visual_script.h | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_builtin_funcs.cpp | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 22 | ||||
-rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 66 | ||||
-rw-r--r-- | modules/visual_script/visual_script_expression.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 56 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 8 | ||||
-rw-r--r-- | modules/visual_script/visual_script_property_selector.cpp | 24 | ||||
-rw-r--r-- | modules/visual_script/visual_script_yield_nodes.cpp | 18 |
11 files changed, 123 insertions, 123 deletions
diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index 63bd88ad81..5ea84a32c4 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -41,9 +41,9 @@ #include "visual_script_nodes.h" #include "visual_script_yield_nodes.h" -VisualScriptLanguage *visual_script_language = NULL; +VisualScriptLanguage *visual_script_language = nullptr; #ifdef TOOLS_ENABLED -static _VisualScriptEditor *vs_editor_singleton = NULL; +static _VisualScriptEditor *vs_editor_singleton = nullptr; #endif void register_visual_script_types() { diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index d00cc6986f..b52dfe1733 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -94,7 +94,7 @@ void VisualScriptNode::validate_input_default_values() { default_input_values[i] = Variant::construct(expected, &existingp, 1, ce, false); if (ce.error != Callable::CallError::CALL_OK) { //could not convert? force.. - default_input_values[i] = Variant::construct(expected, NULL, 0, ce, false); + default_input_values[i] = Variant::construct(expected, nullptr, 0, ce, false); } } } @@ -158,8 +158,8 @@ VisualScriptNode::VisualScriptNode() { VisualScriptNodeInstance::VisualScriptNodeInstance() { - sequence_outputs = NULL; - input_ports = NULL; + sequence_outputs = nullptr; + input_ports = nullptr; } VisualScriptNodeInstance::~VisualScriptNodeInstance() { @@ -1594,7 +1594,7 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int output_args[i] = &variant_stack[node->output_ports[i]]; } - Variant *working_mem = node->working_mem_idx >= 0 ? &variant_stack[node->working_mem_idx] : (Variant *)NULL; + Variant *working_mem = node->working_mem_idx >= 0 ? &variant_stack[node->working_mem_idx] : (Variant *)nullptr; node->step(input_args, output_args, VisualScriptNodeInstance::START_MODE_BEGIN_SEQUENCE, working_mem, r_error, error_str); //ignore return @@ -1615,8 +1615,8 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p const Variant **input_args = (const Variant **)(sequence_bits + f->node_count); Variant **output_args = (Variant **)(input_args + max_input_args); int flow_max = f->flow_stack_size; - int *flow_stack = flow_max ? (int *)(output_args + max_output_args) : (int *)NULL; - int *pass_stack = flow_stack ? (int *)(flow_stack + flow_max) : (int *)NULL; + int *flow_stack = flow_max ? (int *)(output_args + max_output_args) : (int *)nullptr; + int *pass_stack = flow_stack ? (int *)(flow_stack + flow_max) : (int *)nullptr; String error_str; @@ -1624,7 +1624,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p bool error = false; int current_node_id = f->node; Variant return_value; - Variant *working_mem = NULL; + Variant *working_mem = nullptr; int flow_stack_pos = p_flow_stack_pos; @@ -1643,7 +1643,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p VSDEBUG("AT STACK POS: " + itos(flow_stack_pos)); //setup working mem - working_mem = node->working_mem_idx >= 0 ? &variant_stack[node->working_mem_idx] : (Variant *)NULL; + working_mem = node->working_mem_idx >= 0 ? &variant_stack[node->working_mem_idx] : (Variant *)nullptr; VSDEBUG("WORKING MEM: " + itos(node->working_mem_idx)); @@ -1817,7 +1817,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p break; //exit function requested, bye } - VisualScriptNodeInstance *next = NULL; //next node + VisualScriptNodeInstance *next = nullptr; //next node if ((ret == output || ret & VisualScriptNodeInstance::STEP_FLAG_PUSH_STACK_BIT) && node->sequence_output_count) { //if no exit bit was set, and has sequence outputs, guess next node @@ -2033,8 +2033,8 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p const Variant **input_args = (const Variant **)(sequence_bits + f->node_count); Variant **output_args = (Variant **)(input_args + max_input_args); int flow_max = f->flow_stack_size; - int *flow_stack = flow_max ? (int *)(output_args + max_output_args) : (int *)NULL; - int *pass_stack = flow_stack ? (int *)(flow_stack + flow_max) : (int *)NULL; + int *flow_stack = flow_max ? (int *)(output_args + max_output_args) : (int *)nullptr; + int *pass_stack = flow_stack ? (int *)(flow_stack + flow_max) : (int *)nullptr; for (int i = 0; i < f->node_count; i++) { sequence_bits[i] = false; //all starts as false @@ -2097,7 +2097,7 @@ void VisualScriptInstance::notification(int p_notification) { String VisualScriptInstance::to_string(bool *r_valid) { if (has_method(CoreStringNames::get_singleton()->_to_string)) { Callable::CallError ce; - Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce); + Variant ret = call(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) @@ -2237,12 +2237,12 @@ void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_o instance->id = F->key(); instance->input_port_count = node->get_input_value_port_count(); - instance->input_ports = NULL; + instance->input_ports = nullptr; instance->output_port_count = node->get_output_value_port_count(); - instance->output_ports = NULL; + instance->output_ports = nullptr; instance->sequence_output_count = node->get_output_sequence_port_count(); instance->sequence_index = function.node_count++; - instance->sequence_outputs = NULL; + instance->sequence_outputs = nullptr; instance->pass_idx = -1; if (instance->input_port_count) { @@ -2263,7 +2263,7 @@ void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_o if (instance->sequence_output_count) { instance->sequence_outputs = memnew_arr(VisualScriptNodeInstance *, instance->sequence_output_count); for (int i = 0; i < instance->sequence_output_count; i++) { - instance->sequence_outputs[i] = NULL; //if it remains null, flow ends here + instance->sequence_outputs[i] = nullptr; //if it remains null, flow ends here } } @@ -2797,7 +2797,7 @@ int VisualScriptLanguage::profiling_get_frame_data(ProfilingInfo *p_info_arr, in return 0; } -VisualScriptLanguage *VisualScriptLanguage::singleton = NULL; +VisualScriptLanguage *VisualScriptLanguage::singleton = nullptr; void VisualScriptLanguage::add_register_func(const String &p_name, VisualScriptNodeRegisterFunc p_func) { @@ -2844,7 +2844,7 @@ VisualScriptLanguage::VisualScriptLanguage() { } else { _debug_max_call_stack = 0; - _call_stack = NULL; + _call_stack = nullptr; } } @@ -2853,5 +2853,5 @@ VisualScriptLanguage::~VisualScriptLanguage() { if (_call_stack) { memdelete_arr(_call_stack); } - singleton = NULL; + singleton = nullptr; } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 20273316b4..29309aa156 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -420,7 +420,7 @@ public: virtual bool set(const StringName &p_name, const Variant &p_value); virtual bool get(const StringName &p_name, Variant &r_ret) const; virtual void get_property_list(List<PropertyInfo> *p_properties) const; - virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid = NULL) const; + virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid = nullptr) const; virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; @@ -596,7 +596,7 @@ public: virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const; virtual bool is_using_templates(); virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script); - virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = NULL, List<ScriptLanguage::Warning> *r_warnings = NULL, Set<int> *r_safe_lines = NULL) const; + virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = nullptr, List<ScriptLanguage::Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const; virtual Script *create_script() const; virtual bool has_named_classes() const; virtual bool supports_builtin_mode() const; diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 07f152efd4..39d8f7c082 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -1231,7 +1231,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in PackedByteArray barr; int len; bool full_objects = *p_inputs[1]; - Error err = encode_variant(*p_inputs[0], NULL, len, full_objects); + Error err = encode_variant(*p_inputs[0], nullptr, len, full_objects); if (err) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; @@ -1267,7 +1267,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in Variant ret; { const uint8_t *r = varr.ptr(); - Error err = decode_variant(ret, r, varr.size(), NULL, allow_objects); + Error err = decode_variant(ret, r, varr.size(), nullptr, allow_objects); if (err != OK) { r_error_str = RTR("Not enough bytes for decoding bytes, or invalid format."); r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 19771ef373..30522930c7 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -182,7 +182,7 @@ public: _change_notify(); } - VisualScriptEditorSignalEdit() { undo_redo = NULL; } + VisualScriptEditorSignalEdit() { undo_redo = nullptr; } }; class VisualScriptEditorVariableEdit : public Object { @@ -335,7 +335,7 @@ public: _change_notify(); } - VisualScriptEditorVariableEdit() { undo_redo = NULL; } + VisualScriptEditorVariableEdit() { undo_redo = nullptr; } }; static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { @@ -1932,7 +1932,7 @@ bool VisualScriptEditor::can_drop_data_fw(const Point2 &p_point, const Variant & static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) - return NULL; + return nullptr; Ref<Script> scr = p_current_node->get_script(); @@ -1945,7 +1945,7 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const return n; } - return NULL; + return nullptr; } void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { @@ -3447,7 +3447,7 @@ void VisualScriptEditor::connect_data(Ref<VisualScriptNode> vnode_old, Ref<Visua undo_redo->create_action(TTR("Connect Node Data")); VisualScriptReturn *vnode_return = Object::cast_to<VisualScriptReturn>(vnode.ptr()); - if (vnode_return != NULL && vnode_old->get_output_value_port_count() > 0) { + if (vnode_return != nullptr && vnode_old->get_output_value_port_count() > 0) { vnode_return->set_enable_return_value(true); } if (vnode_old->get_output_value_port_count() <= 0) { @@ -3713,11 +3713,11 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode_new, int new_id) { VisualScriptOperator *vnode_operator = Object::cast_to<VisualScriptOperator>(vnode_new.ptr()); - if (vnode_operator != NULL && !vnode_operator->has_input_sequence_port()) { + if (vnode_operator != nullptr && !vnode_operator->has_input_sequence_port()) { return; } VisualScriptConstructor *vnode_constructor = Object::cast_to<VisualScriptConstructor>(vnode_new.ptr()); - if (vnode_constructor != NULL) { + if (vnode_constructor != nullptr) { return; } if (vnode_old->get_output_sequence_port_count() <= 0) { @@ -3889,7 +3889,7 @@ void VisualScriptEditor::_default_value_edited(Node *p_button, int p_id, int p_i } } - if (default_value_edit->edit(NULL, pinfo.name, pinfo.type, existing, pinfo.hint, pinfo.hint_string)) { + if (default_value_edit->edit(nullptr, pinfo.name, pinfo.type, existing, pinfo.hint, pinfo.hint_string)) { if (pinfo.hint == PROPERTY_HINT_MULTILINE_TEXT) default_value_edit->popup_centered_ratio(); else @@ -4878,10 +4878,10 @@ static ScriptEditorBase *create_editor(const RES &p_resource) { return memnew(VisualScriptEditor); } - return NULL; + return nullptr; } -VisualScriptEditor::Clipboard *VisualScriptEditor::clipboard = NULL; +VisualScriptEditor::Clipboard *VisualScriptEditor::clipboard = nullptr; void VisualScriptEditor::free_clipboard() { if (clipboard) @@ -4917,7 +4917,7 @@ Ref<VisualScriptNode> _VisualScriptEditor::create_node_custom(const String &p_na return node; } -_VisualScriptEditor *_VisualScriptEditor::singleton = NULL; +_VisualScriptEditor *_VisualScriptEditor::singleton = nullptr; Map<String, REF> _VisualScriptEditor::custom_nodes; _VisualScriptEditor::_VisualScriptEditor() { diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index c52315a477..71ed483d65 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -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; } diff --git a/modules/visual_script/visual_script_expression.h b/modules/visual_script/visual_script_expression.h index d131713ef0..61b50ff99d 100644 --- a/modules/visual_script/visual_script_expression.h +++ b/modules/visual_script/visual_script_expression.h @@ -138,7 +138,7 @@ class VisualScriptExpression : public VisualScriptNode { Type type; - ENode() { next = NULL; } + ENode() { next = nullptr; } virtual ~ENode() { if (next) { memdelete(next); diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 011432ef39..3b6ae369ae 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -58,7 +58,7 @@ bool VisualScriptFunctionCall::has_input_sequence_port() const { static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) - return NULL; + return nullptr; Ref<Script> scr = p_current_node->get_script(); @@ -71,7 +71,7 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const return n; } - return NULL; + return nullptr; } #endif @@ -80,33 +80,33 @@ Node *VisualScriptFunctionCall::_get_base_node() const { #ifdef TOOLS_ENABLED Ref<Script> script = get_visual_script(); if (!script.is_valid()) - return NULL; + return nullptr; MainLoop *main_loop = OS::get_singleton()->get_main_loop(); SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop); if (!scene_tree) - return NULL; + return nullptr; Node *edited_scene = scene_tree->get_edited_scene_root(); if (!edited_scene) - return NULL; + return nullptr; Node *script_node = _find_script_node(edited_scene, edited_scene, script); if (!script_node) - return NULL; + return nullptr; if (!script_node->has_node(base_path)) - return NULL; + return nullptr; Node *path_to = script_node->get_node(base_path); return path_to; #else - return NULL; + return nullptr; #endif } @@ -955,34 +955,34 @@ Node *VisualScriptPropertySet::_get_base_node() const { #ifdef TOOLS_ENABLED Ref<Script> script = get_visual_script(); if (!script.is_valid()) - return NULL; + return nullptr; MainLoop *main_loop = OS::get_singleton()->get_main_loop(); SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop); if (!scene_tree) - return NULL; + return nullptr; Node *edited_scene = scene_tree->get_edited_scene_root(); if (!edited_scene) - return NULL; + return nullptr; Node *script_node = _find_script_node(edited_scene, edited_scene, script); if (!script_node) - return NULL; + return nullptr; if (!script_node->has_node(base_path)) - return NULL; + return nullptr; Node *path_to = script_node->get_node(base_path); return path_to; #else - return NULL; + return nullptr; #endif } @@ -1021,7 +1021,7 @@ void VisualScriptPropertySet::_adjust_input_index(PropertyInfo &pinfo) const { Variant v; Callable::CallError ce; - v = Variant::construct(pinfo.type, NULL, 0, ce); + v = Variant::construct(pinfo.type, nullptr, 0, ce); Variant i = v.get(index); pinfo.type = i.get_type(); } @@ -1168,7 +1168,7 @@ void VisualScriptPropertySet::_update_cache() { Variant v; Callable::CallError ce; - v = Variant::construct(basic_type, NULL, 0, ce); + v = Variant::construct(basic_type, nullptr, 0, ce); List<PropertyInfo> pinfo; v.get_property_list(&pinfo); @@ -1185,7 +1185,7 @@ void VisualScriptPropertySet::_update_cache() { StringName type; Ref<Script> script; - Node *node = NULL; + Node *node = nullptr; if (call_mode == CALL_MODE_NODE_PATH) { @@ -1410,7 +1410,7 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const { if (property.name == "index") { Callable::CallError ce; - Variant v = Variant::construct(type_cache.type, NULL, 0, ce); + Variant v = Variant::construct(type_cache.type, nullptr, 0, ce); List<PropertyInfo> plist; v.get_property_list(&plist); String options = ""; @@ -1735,34 +1735,34 @@ Node *VisualScriptPropertyGet::_get_base_node() const { #ifdef TOOLS_ENABLED Ref<Script> script = get_visual_script(); if (!script.is_valid()) - return NULL; + return nullptr; MainLoop *main_loop = OS::get_singleton()->get_main_loop(); SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop); if (!scene_tree) - return NULL; + return nullptr; Node *edited_scene = scene_tree->get_edited_scene_root(); if (!edited_scene) - return NULL; + return nullptr; Node *script_node = _find_script_node(edited_scene, edited_scene, script); if (!script_node) - return NULL; + return nullptr; if (!script_node->has_node(base_path)) - return NULL; + return nullptr; Node *path_to = script_node->get_node(base_path); return path_to; #else - return NULL; + return nullptr; #endif } @@ -1876,7 +1876,7 @@ void VisualScriptPropertyGet::_update_cache() { Variant v; Callable::CallError ce; - v = Variant::construct(basic_type, NULL, 0, ce); + v = Variant::construct(basic_type, nullptr, 0, ce); List<PropertyInfo> pinfo; v.get_property_list(&pinfo); @@ -1894,7 +1894,7 @@ void VisualScriptPropertyGet::_update_cache() { StringName type; Ref<Script> script; - Node *node = NULL; + Node *node = nullptr; if (call_mode == CALL_MODE_NODE_PATH) { @@ -2125,7 +2125,7 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const { if (property.name == "index") { Callable::CallError ce; - Variant v = Variant::construct(type_cache, NULL, 0, ce); + Variant v = Variant::construct(type_cache, nullptr, 0, ce); List<PropertyInfo> plist; v.get_property_list(&plist); String options = ""; @@ -2501,7 +2501,7 @@ void register_visual_script_func_nodes() { Variant::Type t = Variant::Type(i); String type_name = Variant::get_type_name(t); Callable::CallError ce; - Variant vt = Variant::construct(t, NULL, 0, ce); + Variant vt = Variant::construct(t, nullptr, 0, ce); List<MethodInfo> ml; vt.get_method_list(&ml); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 1b496dad32..97c2686cd5 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -1483,7 +1483,7 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) { type = p_type; Callable::CallError ce; - value = Variant::construct(type, NULL, 0, ce); + value = Variant::construct(type, nullptr, 0, ce); ports_changed_notify(); _change_notify(); } @@ -2548,7 +2548,7 @@ VisualScriptNodeInstance *VisualScriptSceneNode::instance(VisualScriptInstance * static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) - return NULL; + return nullptr; Ref<Script> scr = p_current_node->get_script(); @@ -2561,7 +2561,7 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const return n; } - return NULL; + return nullptr; } #endif @@ -4006,7 +4006,7 @@ void VisualScriptDeconstruct::_update_elements() { elements.clear(); Variant v; Callable::CallError ce; - v = Variant::construct(type, NULL, 0, ce); + v = Variant::construct(type, nullptr, 0, ce); List<PropertyInfo> pinfo; v.get_property_list(&pinfo); diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index d749e3257a..f57853078d 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -97,7 +97,7 @@ void VisualScriptPropertySelector::_update_search() { for (List<StringName>::Element *E = base_list.front(); E; E = E->next()) { List<MethodInfo> methods; List<PropertyInfo> props; - TreeItem *category = NULL; + TreeItem *category = nullptr; Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = { vbc->get_theme_icon("Variant", "EditorIcons"), vbc->get_theme_icon("bool", "EditorIcons"), @@ -196,7 +196,7 @@ void VisualScriptPropertySelector::_update_search() { if (type != Variant::NIL) { Variant v; Callable::CallError ce; - v = Variant::construct(type, NULL, 0, ce); + v = Variant::construct(type, nullptr, 0, ce); v.get_method_list(&methods); } else { @@ -264,7 +264,7 @@ void VisualScriptPropertySelector::_update_search() { item->set_metadata(2, connecting); } - if (category && category->get_children() == NULL) { + if (category && category->get_children() == nullptr) { memdelete(category); //old category was unused } } @@ -304,12 +304,12 @@ void VisualScriptPropertySelector::_update_search() { } TreeItem *selected_item = search_options->search_item_text(search_box->get_text()); - if (!found && selected_item != NULL) { + if (!found && selected_item != nullptr) { selected_item->select(0); found = true; } - get_ok()->set_disabled(root->get_children() == NULL); + get_ok()->set_disabled(root->get_children() == nullptr); } void VisualScriptPropertySelector::create_visualscript_item(const String &name, TreeItem *const root, const String &search_input, const String &text) { @@ -481,7 +481,7 @@ void VisualScriptPropertySelector::_item_selected() { List<String> *names = memnew(List<String>); VisualScriptLanguage::singleton->get_registered_node_names(names); - if (names->find(name) != NULL) { + if (names->find(name) != nullptr) { Ref<VisualScriptOperator> operator_node = VisualScriptLanguage::singleton->create_node_from_name(name); if (operator_node.is_valid()) { Map<String, DocData::ClassDoc>::Element *F = dd->class_list.find(operator_node->get_class_name()); @@ -536,7 +536,7 @@ void VisualScriptPropertySelector::select_method_from_base_type(const String &p_ selected = p_current; type = Variant::NIL; properties = false; - instance = NULL; + instance = nullptr; virtuals_only = p_virtuals_only; show_window(.5f); @@ -561,7 +561,7 @@ void VisualScriptPropertySelector::select_from_base_type(const String &p_base, c type = Variant::NIL; properties = true; visual_script_generic = false; - instance = NULL; + instance = nullptr; virtuals_only = p_virtuals_only; show_window(.5f); @@ -585,7 +585,7 @@ void VisualScriptPropertySelector::select_from_script(const Ref<Script> &p_scrip script = p_script->get_instance_id(); properties = true; visual_script_generic = false; - instance = NULL; + instance = nullptr; virtuals_only = false; show_window(.5f); @@ -607,7 +607,7 @@ void VisualScriptPropertySelector::select_from_basic_type(Variant::Type p_type, type = p_type; properties = true; visual_script_generic = false; - instance = NULL; + instance = nullptr; virtuals_only = false; show_window(.5f); @@ -628,7 +628,7 @@ void VisualScriptPropertySelector::select_from_action(const String &p_type, cons type = Variant::NIL; properties = false; visual_script_generic = false; - instance = NULL; + instance = nullptr; virtuals_only = false; show_window(.5f); @@ -670,7 +670,7 @@ void VisualScriptPropertySelector::select_from_visual_script(const String &p_bas type = Variant::NIL; properties = true; visual_script_generic = true; - instance = NULL; + instance = nullptr; virtuals_only = false; show_window(.5f); if (clear_text) diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 858074742e..b300aec385 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -228,7 +228,7 @@ bool VisualScriptYieldSignal::has_input_sequence_port() const { static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) - return NULL; + return nullptr; Ref<Script> scr = p_current_node->get_script(); @@ -241,7 +241,7 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const return n; } - return NULL; + return nullptr; } #endif @@ -250,33 +250,33 @@ Node *VisualScriptYieldSignal::_get_base_node() const { #ifdef TOOLS_ENABLED Ref<Script> script = get_visual_script(); if (!script.is_valid()) - return NULL; + return nullptr; MainLoop *main_loop = OS::get_singleton()->get_main_loop(); SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop); if (!scene_tree) - return NULL; + return nullptr; Node *edited_scene = scene_tree->get_edited_scene_root(); if (!edited_scene) - return NULL; + return nullptr; Node *script_node = _find_script_node(edited_scene, edited_scene, script); if (!script_node) - return NULL; + return nullptr; if (!script_node->has_node(base_path)) - return NULL; + return nullptr; Node *path_to = script_node->get_node(base_path); return path_to; #else - return NULL; + return nullptr; #endif } @@ -516,7 +516,7 @@ public: } else { //yield - Object *object = NULL; + Object *object = nullptr; switch (call_mode) { |