diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-04-04 21:24:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-04 21:24:27 +0200 |
| commit | 1abb5ebf6532944a9fd0d1acf9ad61a0df1bb0ed (patch) | |
| tree | a9d2df2e2df939c189135b1c36a01e06b37b80b2 /modules/gdscript | |
| parent | 53317bbe146dd19a919685df8d846c55568daba1 (diff) | |
| parent | f8ab79e68af20e18e1d868b64d6dfd0c429bc554 (diff) | |
Merge pull request #59867 from akien-mga/refactor-zero-initialize-all-pointers
Diffstat (limited to 'modules/gdscript')
| -rw-r--r-- | modules/gdscript/gdscript.h | 16 | ||||
| -rw-r--r-- | modules/gdscript/language_server/gdscript_text_document.h | 2 | ||||
| -rw-r--r-- | modules/gdscript/tests/gdscript_test_runner.h | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index f7fa967883..82125610c2 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -265,7 +265,7 @@ class GDScriptInstance : public ScriptInstance { friend struct GDScriptUtilityFunctionsDefinitions; ObjectID owner_id; - Object *owner; + Object *owner = nullptr; Ref<GDScript> script; #ifdef DEBUG_ENABLED Map<StringName, int> member_indices_cache; //used only for hot script reloading @@ -311,17 +311,17 @@ class GDScriptLanguage : public ScriptLanguage { static GDScriptLanguage *singleton; - Variant *_global_array; + Variant *_global_array = nullptr; Vector<Variant> global_array; Map<StringName, int> globals; Map<StringName, Variant> named_globals; struct CallLevel { - Variant *stack; - GDScriptFunction *function; - GDScriptInstance *instance; - int *ip; - int *line; + Variant *stack = nullptr; + GDScriptFunction *function = nullptr; + GDScriptInstance *instance = nullptr; + int *ip = nullptr; + int *line = nullptr; }; int _debug_parse_err_line; @@ -329,7 +329,7 @@ class GDScriptLanguage : public ScriptLanguage { String _debug_error; int _debug_call_stack_pos; int _debug_max_call_stack; - CallLevel *_call_stack; + CallLevel *_call_stack = nullptr; void _add_global(const StringName &p_name, const Variant &p_value); diff --git a/modules/gdscript/language_server/gdscript_text_document.h b/modules/gdscript/language_server/gdscript_text_document.h index eb7b2c0240..a0e584e525 100644 --- a/modules/gdscript/language_server/gdscript_text_document.h +++ b/modules/gdscript/language_server/gdscript_text_document.h @@ -40,7 +40,7 @@ class GDScriptTextDocument : public RefCounted { protected: static void _bind_methods(); - FileAccess *file_checker; + FileAccess *file_checker = nullptr; void didOpen(const Variant &p_param); void didClose(const Variant &p_param); diff --git a/modules/gdscript/tests/gdscript_test_runner.h b/modules/gdscript/tests/gdscript_test_runner.h index 1a950c6898..d6c6419e21 100644 --- a/modules/gdscript/tests/gdscript_test_runner.h +++ b/modules/gdscript/tests/gdscript_test_runner.h @@ -63,8 +63,8 @@ public: private: struct ErrorHandlerData { - TestResult *result; - GDScriptTest *self; + TestResult *result = nullptr; + GDScriptTest *self = nullptr; ErrorHandlerData(TestResult *p_result, GDScriptTest *p_this) { result = p_result; self = p_this; |