mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Style: Replaces uses of 0/NULL by nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
parent
2b429b24b5
commit
a828398655
633 changed files with 4454 additions and 4410 deletions
|
|
@ -44,7 +44,7 @@ bool GDScriptCompiler::_is_class_member_property(CodeGen &codegen, const StringN
|
|||
|
||||
bool GDScriptCompiler::_is_class_member_property(GDScript *owner, const StringName &p_name) {
|
||||
GDScript *scr = owner;
|
||||
GDScriptNativeClass *nc = NULL;
|
||||
GDScriptNativeClass *nc = nullptr;
|
||||
while (scr) {
|
||||
if (scr->native.is_valid())
|
||||
nc = scr->native.ptr();
|
||||
|
|
@ -278,7 +278,7 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
|
|||
GDScript *owner = codegen.script;
|
||||
while (owner) {
|
||||
GDScript *scr = owner;
|
||||
GDScriptNativeClass *nc = NULL;
|
||||
GDScriptNativeClass *nc = nullptr;
|
||||
while (scr) {
|
||||
if (scr->constants.has(identifier)) {
|
||||
//int idx=scr->constants[identifier];
|
||||
|
|
@ -1550,7 +1550,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser
|
|||
codegen.stack_max = 0;
|
||||
codegen.current_line = 0;
|
||||
codegen.call_max = 0;
|
||||
codegen.debug_stack = ScriptDebugger::get_singleton() != NULL;
|
||||
codegen.debug_stack = ScriptDebugger::get_singleton() != nullptr;
|
||||
Vector<StringName> argnames;
|
||||
|
||||
int stack_level = 0;
|
||||
|
|
@ -1667,13 +1667,13 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser
|
|||
gdfunc->_constant_count = codegen.constant_map.size();
|
||||
gdfunc->constants.resize(codegen.constant_map.size());
|
||||
gdfunc->_constants_ptr = gdfunc->constants.ptrw();
|
||||
const Variant *K = NULL;
|
||||
const Variant *K = nullptr;
|
||||
while ((K = codegen.constant_map.next(K))) {
|
||||
int idx = codegen.constant_map[*K];
|
||||
gdfunc->constants.write[idx] = *K;
|
||||
}
|
||||
} else {
|
||||
gdfunc->_constants_ptr = NULL;
|
||||
gdfunc->_constants_ptr = nullptr;
|
||||
gdfunc->_constant_count = 0;
|
||||
}
|
||||
//global names
|
||||
|
|
@ -1686,7 +1686,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser
|
|||
gdfunc->_global_names_count = gdfunc->global_names.size();
|
||||
|
||||
} else {
|
||||
gdfunc->_global_names_ptr = NULL;
|
||||
gdfunc->_global_names_ptr = nullptr;
|
||||
gdfunc->_global_names_count = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1708,7 +1708,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser
|
|||
gdfunc->_code_size = codegen.opcodes.size();
|
||||
|
||||
} else {
|
||||
gdfunc->_code_ptr = NULL;
|
||||
gdfunc->_code_ptr = nullptr;
|
||||
gdfunc->_code_size = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1718,7 +1718,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser
|
|||
gdfunc->_default_arg_ptr = &gdfunc->default_arguments[0];
|
||||
} else {
|
||||
gdfunc->_default_arg_count = 0;
|
||||
gdfunc->_default_arg_ptr = NULL;
|
||||
gdfunc->_default_arg_ptr = nullptr;
|
||||
}
|
||||
|
||||
gdfunc->_argument_count = p_func ? p_func->arguments.size() : 0;
|
||||
|
|
@ -1798,7 +1798,7 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar
|
|||
|
||||
p_script->native = Ref<GDScriptNativeClass>();
|
||||
p_script->base = Ref<GDScript>();
|
||||
p_script->_base = NULL;
|
||||
p_script->_base = nullptr;
|
||||
p_script->members.clear();
|
||||
p_script->constants.clear();
|
||||
for (Map<StringName, GDScriptFunction *>::Element *E = p_script->member_functions.front(); E; E = E->next()) {
|
||||
|
|
@ -1808,7 +1808,7 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar
|
|||
p_script->member_indices.clear();
|
||||
p_script->member_info.clear();
|
||||
p_script->_signals.clear();
|
||||
p_script->initializer = NULL;
|
||||
p_script->initializer = nullptr;
|
||||
|
||||
p_script->tool = p_class->tool;
|
||||
p_script->name = p_class->name;
|
||||
|
|
@ -1917,7 +1917,7 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar
|
|||
if (c->base.is_valid()) {
|
||||
c = c->base.ptr();
|
||||
} else {
|
||||
c = NULL;
|
||||
c = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1985,14 +1985,14 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa
|
|||
|
||||
if (!has_initializer) {
|
||||
//create a constructor
|
||||
Error err = _parse_function(p_script, p_class, NULL);
|
||||
Error err = _parse_function(p_script, p_class, nullptr);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (!has_ready && p_class->ready->statements.size()) {
|
||||
//create a constructor
|
||||
Error err = _parse_function(p_script, p_class, NULL, true);
|
||||
Error err = _parse_function(p_script, p_class, nullptr, true);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
|
@ -2029,7 +2029,7 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa
|
|||
/* STEP 2, INITIALIZE AND CONSTRUCT */
|
||||
|
||||
Variant::CallError ce;
|
||||
p_script->initializer->call(instance, NULL, 0, ce);
|
||||
p_script->initializer->call(instance, nullptr, 0, ce);
|
||||
|
||||
if (ce.error != Variant::CallError::CALL_OK) {
|
||||
//well, tough luck, not goinna do anything here
|
||||
|
|
@ -2111,7 +2111,7 @@ Error GDScriptCompiler::compile(const GDScriptParser *p_parser, GDScript *p_scri
|
|||
// Create scripts for subclasses beforehand so they can be referenced
|
||||
_make_scripts(p_script, static_cast<const GDScriptParser::ClassNode *>(root), p_keep_state);
|
||||
|
||||
p_script->_owner = NULL;
|
||||
p_script->_owner = nullptr;
|
||||
Error err = _parse_class_level(p_script, static_cast<const GDScriptParser::ClassNode *>(root), p_keep_state);
|
||||
|
||||
if (err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue