Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
This commit is contained in:
parent
53317bbe14
commit
f8ab79e68a
258 changed files with 2398 additions and 2421 deletions
|
|
@ -368,7 +368,7 @@ private:
|
|||
PathRotation path_rotation;
|
||||
bool path_local;
|
||||
|
||||
Path3D *path;
|
||||
Path3D *path = nullptr;
|
||||
|
||||
bool smooth_faces;
|
||||
bool path_continuous_u;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -62,21 +62,21 @@ class GridMapEditor : public VBoxContainer {
|
|||
DISPLAY_LIST
|
||||
};
|
||||
|
||||
UndoRedo *undo_redo;
|
||||
UndoRedo *undo_redo = nullptr;
|
||||
InputAction input_action = INPUT_NONE;
|
||||
Panel *panel;
|
||||
MenuButton *options;
|
||||
SpinBox *floor;
|
||||
Panel *panel = nullptr;
|
||||
MenuButton *options = nullptr;
|
||||
SpinBox *floor = nullptr;
|
||||
double accumulated_floor_delta = 0.0;
|
||||
Button *mode_thumbnail;
|
||||
Button *mode_list;
|
||||
LineEdit *search_box;
|
||||
HSlider *size_slider;
|
||||
HBoxContainer *spatial_editor_hb;
|
||||
ConfirmationDialog *settings_dialog;
|
||||
VBoxContainer *settings_vbc;
|
||||
SpinBox *settings_pick_distance;
|
||||
Label *spin_box_label;
|
||||
Button *mode_thumbnail = nullptr;
|
||||
Button *mode_list = nullptr;
|
||||
LineEdit *search_box = nullptr;
|
||||
HSlider *size_slider = nullptr;
|
||||
HBoxContainer *spatial_editor_hb = nullptr;
|
||||
ConfirmationDialog *settings_dialog = nullptr;
|
||||
VBoxContainer *settings_vbc = nullptr;
|
||||
SpinBox *settings_pick_distance = nullptr;
|
||||
Label *spin_box_label = nullptr;
|
||||
|
||||
struct SetItem {
|
||||
Vector3i position;
|
||||
|
|
@ -89,7 +89,7 @@ class GridMapEditor : public VBoxContainer {
|
|||
List<SetItem> set_items;
|
||||
|
||||
GridMap *node = nullptr;
|
||||
MeshLibrary *last_mesh_library;
|
||||
MeshLibrary *last_mesh_library = nullptr;
|
||||
|
||||
Transform3D grid_xform;
|
||||
Transform3D edit_grid_xform;
|
||||
|
|
@ -173,15 +173,15 @@ class GridMapEditor : public VBoxContainer {
|
|||
|
||||
};
|
||||
|
||||
Node3DEditorPlugin *spatial_editor;
|
||||
Node3DEditorPlugin *spatial_editor = nullptr;
|
||||
|
||||
struct AreaDisplay {
|
||||
RID mesh;
|
||||
RID instance;
|
||||
};
|
||||
|
||||
ItemList *mesh_library_palette;
|
||||
Label *info_message;
|
||||
ItemList *mesh_library_palette = nullptr;
|
||||
Label *info_message = nullptr;
|
||||
|
||||
void update_grid(); // Change which and where the grid is displayed
|
||||
void _draw_grids(const Vector3 &cell_size);
|
||||
|
|
@ -234,7 +234,7 @@ public:
|
|||
class GridMapEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(GridMapEditorPlugin, EditorPlugin);
|
||||
|
||||
GridMapEditor *grid_map_editor;
|
||||
GridMapEditor *grid_map_editor = nullptr;
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ template <typename T, int POOL_SIZE = 5>
|
|||
struct ArgumentsVector {
|
||||
private:
|
||||
T pool[POOL_SIZE];
|
||||
T *_ptr;
|
||||
T *_ptr = nullptr;
|
||||
int size;
|
||||
|
||||
ArgumentsVector() = delete;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
class ManagedCallable : public CallableCustom {
|
||||
friend class CSharpLanguage;
|
||||
MonoGCHandleData delegate_handle;
|
||||
GDMonoMethod *delegate_invoke;
|
||||
GDMonoMethod *delegate_invoke = nullptr;
|
||||
|
||||
#ifdef GD_MONO_HOT_RELOAD
|
||||
SelfList<ManagedCallable> self_instance = this;
|
||||
|
|
|
|||
|
|
@ -94,16 +94,16 @@ private:
|
|||
|
||||
UnhandledExceptionPolicy unhandled_exception_policy;
|
||||
|
||||
MonoDomain *root_domain;
|
||||
MonoDomain *scripts_domain;
|
||||
MonoDomain *root_domain = nullptr;
|
||||
MonoDomain *scripts_domain = nullptr;
|
||||
|
||||
HashMap<int32_t, HashMap<String, GDMonoAssembly *>> assemblies;
|
||||
|
||||
GDMonoAssembly *corlib_assembly;
|
||||
GDMonoAssembly *project_assembly;
|
||||
GDMonoAssembly *corlib_assembly = nullptr;
|
||||
GDMonoAssembly *project_assembly = nullptr;
|
||||
#ifdef TOOLS_ENABLED
|
||||
GDMonoAssembly *tools_assembly;
|
||||
GDMonoAssembly *tools_project_editor_assembly;
|
||||
GDMonoAssembly *tools_assembly = nullptr;
|
||||
GDMonoAssembly *tools_project_editor_assembly = nullptr;
|
||||
#endif
|
||||
|
||||
LoadedApiAssembly core_api_assembly;
|
||||
|
|
@ -150,7 +150,7 @@ private:
|
|||
void _init_godot_api_hashes();
|
||||
void _init_exception_policy();
|
||||
|
||||
GDMonoLog *gdmono_log;
|
||||
GDMonoLog *gdmono_log = nullptr;
|
||||
|
||||
#if defined(WINDOWS_ENABLED) && defined(TOOLS_ENABLED)
|
||||
MonoRegInfo mono_reg_info;
|
||||
|
|
@ -250,7 +250,7 @@ public:
|
|||
namespace gdmono {
|
||||
|
||||
class ScopeDomain {
|
||||
MonoDomain *prev_domain;
|
||||
MonoDomain *prev_domain = nullptr;
|
||||
|
||||
public:
|
||||
ScopeDomain(MonoDomain *p_domain) {
|
||||
|
|
@ -270,7 +270,7 @@ public:
|
|||
};
|
||||
|
||||
class ScopeExitDomainUnload {
|
||||
MonoDomain *domain;
|
||||
MonoDomain *domain = nullptr;
|
||||
|
||||
public:
|
||||
ScopeExitDomainUnload(MonoDomain *p_domain) :
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ class GDMonoAssembly {
|
|||
};
|
||||
|
||||
String name;
|
||||
MonoImage *image;
|
||||
MonoAssembly *assembly;
|
||||
MonoImage *image = nullptr;
|
||||
MonoAssembly *assembly = nullptr;
|
||||
|
||||
bool attrs_fetched = false;
|
||||
MonoCustomAttrInfo *attributes = nullptr;
|
||||
|
|
|
|||
|
|
@ -41,91 +41,91 @@ struct CachedData {
|
|||
// corlib classes
|
||||
|
||||
// Let's use the no-namespace format for these too
|
||||
GDMonoClass *class_MonoObject; // object
|
||||
GDMonoClass *class_bool; // bool
|
||||
GDMonoClass *class_int8_t; // sbyte
|
||||
GDMonoClass *class_int16_t; // short
|
||||
GDMonoClass *class_int32_t; // int
|
||||
GDMonoClass *class_int64_t; // long
|
||||
GDMonoClass *class_uint8_t; // byte
|
||||
GDMonoClass *class_uint16_t; // ushort
|
||||
GDMonoClass *class_uint32_t; // uint
|
||||
GDMonoClass *class_uint64_t; // ulong
|
||||
GDMonoClass *class_float; // float
|
||||
GDMonoClass *class_double; // double
|
||||
GDMonoClass *class_String; // string
|
||||
GDMonoClass *class_IntPtr; // System.IntPtr
|
||||
GDMonoClass *class_MonoObject = nullptr; // object
|
||||
GDMonoClass *class_bool = nullptr; // bool
|
||||
GDMonoClass *class_int8_t = nullptr; // sbyte
|
||||
GDMonoClass *class_int16_t = nullptr; // short
|
||||
GDMonoClass *class_int32_t = nullptr; // int
|
||||
GDMonoClass *class_int64_t = nullptr; // long
|
||||
GDMonoClass *class_uint8_t = nullptr; // byte
|
||||
GDMonoClass *class_uint16_t = nullptr; // ushort
|
||||
GDMonoClass *class_uint32_t = nullptr; // uint
|
||||
GDMonoClass *class_uint64_t = nullptr; // ulong
|
||||
GDMonoClass *class_float = nullptr; // float
|
||||
GDMonoClass *class_double = nullptr; // double
|
||||
GDMonoClass *class_String = nullptr; // string
|
||||
GDMonoClass *class_IntPtr = nullptr; // System.IntPtr
|
||||
|
||||
GDMonoClass *class_System_Collections_IEnumerable;
|
||||
GDMonoClass *class_System_Collections_ICollection;
|
||||
GDMonoClass *class_System_Collections_IDictionary;
|
||||
GDMonoClass *class_System_Collections_IEnumerable = nullptr;
|
||||
GDMonoClass *class_System_Collections_ICollection = nullptr;
|
||||
GDMonoClass *class_System_Collections_IDictionary = nullptr;
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
GDMonoClass *class_System_Diagnostics_StackTrace;
|
||||
GDMonoClass *class_System_Diagnostics_StackTrace = nullptr;
|
||||
GDMonoMethodThunkR<MonoArray *, MonoObject *> methodthunk_System_Diagnostics_StackTrace_GetFrames;
|
||||
GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_bool;
|
||||
GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_Exception_bool;
|
||||
GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_bool = nullptr;
|
||||
GDMonoMethod *method_System_Diagnostics_StackTrace_ctor_Exception_bool = nullptr;
|
||||
#endif
|
||||
|
||||
GDMonoClass *class_KeyNotFoundException;
|
||||
GDMonoClass *class_KeyNotFoundException = nullptr;
|
||||
|
||||
MonoClass *rawclass_Dictionary;
|
||||
MonoClass *rawclass_Dictionary = nullptr;
|
||||
// -----------------------------------------------
|
||||
|
||||
GDMonoClass *class_Vector2;
|
||||
GDMonoClass *class_Vector2i;
|
||||
GDMonoClass *class_Rect2;
|
||||
GDMonoClass *class_Rect2i;
|
||||
GDMonoClass *class_Transform2D;
|
||||
GDMonoClass *class_Vector3;
|
||||
GDMonoClass *class_Vector3i;
|
||||
GDMonoClass *class_Basis;
|
||||
GDMonoClass *class_Quaternion;
|
||||
GDMonoClass *class_Transform3D;
|
||||
GDMonoClass *class_AABB;
|
||||
GDMonoClass *class_Color;
|
||||
GDMonoClass *class_Plane;
|
||||
GDMonoClass *class_StringName;
|
||||
GDMonoClass *class_NodePath;
|
||||
GDMonoClass *class_RID;
|
||||
GDMonoClass *class_GodotObject;
|
||||
GDMonoClass *class_GodotResource;
|
||||
GDMonoClass *class_Node;
|
||||
GDMonoClass *class_Control;
|
||||
GDMonoClass *class_Node3D;
|
||||
GDMonoClass *class_WeakRef;
|
||||
GDMonoClass *class_Callable;
|
||||
GDMonoClass *class_SignalInfo;
|
||||
GDMonoClass *class_Array;
|
||||
GDMonoClass *class_Dictionary;
|
||||
GDMonoClass *class_MarshalUtils;
|
||||
GDMonoClass *class_ISerializationListener;
|
||||
GDMonoClass *class_Vector2 = nullptr;
|
||||
GDMonoClass *class_Vector2i = nullptr;
|
||||
GDMonoClass *class_Rect2 = nullptr;
|
||||
GDMonoClass *class_Rect2i = nullptr;
|
||||
GDMonoClass *class_Transform2D = nullptr;
|
||||
GDMonoClass *class_Vector3 = nullptr;
|
||||
GDMonoClass *class_Vector3i = nullptr;
|
||||
GDMonoClass *class_Basis = nullptr;
|
||||
GDMonoClass *class_Quaternion = nullptr;
|
||||
GDMonoClass *class_Transform3D = nullptr;
|
||||
GDMonoClass *class_AABB = nullptr;
|
||||
GDMonoClass *class_Color = nullptr;
|
||||
GDMonoClass *class_Plane = nullptr;
|
||||
GDMonoClass *class_StringName = nullptr;
|
||||
GDMonoClass *class_NodePath = nullptr;
|
||||
GDMonoClass *class_RID = nullptr;
|
||||
GDMonoClass *class_GodotObject = nullptr;
|
||||
GDMonoClass *class_GodotResource = nullptr;
|
||||
GDMonoClass *class_Node = nullptr;
|
||||
GDMonoClass *class_Control = nullptr;
|
||||
GDMonoClass *class_Node3D = nullptr;
|
||||
GDMonoClass *class_WeakRef = nullptr;
|
||||
GDMonoClass *class_Callable = nullptr;
|
||||
GDMonoClass *class_SignalInfo = nullptr;
|
||||
GDMonoClass *class_Array = nullptr;
|
||||
GDMonoClass *class_Dictionary = nullptr;
|
||||
GDMonoClass *class_MarshalUtils = nullptr;
|
||||
GDMonoClass *class_ISerializationListener = nullptr;
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
GDMonoClass *class_DebuggingUtils;
|
||||
GDMonoClass *class_DebuggingUtils = nullptr;
|
||||
GDMonoMethodThunk<MonoObject *, MonoString **, int *, MonoString **> methodthunk_DebuggingUtils_GetStackFrameInfo;
|
||||
#endif
|
||||
|
||||
GDMonoClass *class_ExportAttribute;
|
||||
GDMonoField *field_ExportAttribute_hint;
|
||||
GDMonoField *field_ExportAttribute_hintString;
|
||||
GDMonoClass *class_SignalAttribute;
|
||||
GDMonoClass *class_ToolAttribute;
|
||||
GDMonoClass *class_AnyPeerAttribute;
|
||||
GDMonoClass *class_AuthorityAttribute;
|
||||
GDMonoClass *class_GodotMethodAttribute;
|
||||
GDMonoField *field_GodotMethodAttribute_methodName;
|
||||
GDMonoClass *class_ScriptPathAttribute;
|
||||
GDMonoField *field_ScriptPathAttribute_path;
|
||||
GDMonoClass *class_AssemblyHasScriptsAttribute;
|
||||
GDMonoField *field_AssemblyHasScriptsAttribute_requiresLookup;
|
||||
GDMonoField *field_AssemblyHasScriptsAttribute_scriptTypes;
|
||||
GDMonoClass *class_ExportAttribute = nullptr;
|
||||
GDMonoField *field_ExportAttribute_hint = nullptr;
|
||||
GDMonoField *field_ExportAttribute_hintString = nullptr;
|
||||
GDMonoClass *class_SignalAttribute = nullptr;
|
||||
GDMonoClass *class_ToolAttribute = nullptr;
|
||||
GDMonoClass *class_AnyPeerAttribute = nullptr;
|
||||
GDMonoClass *class_AuthorityAttribute = nullptr;
|
||||
GDMonoClass *class_GodotMethodAttribute = nullptr;
|
||||
GDMonoField *field_GodotMethodAttribute_methodName = nullptr;
|
||||
GDMonoClass *class_ScriptPathAttribute = nullptr;
|
||||
GDMonoField *field_ScriptPathAttribute_path = nullptr;
|
||||
GDMonoClass *class_AssemblyHasScriptsAttribute = nullptr;
|
||||
GDMonoField *field_AssemblyHasScriptsAttribute_requiresLookup = nullptr;
|
||||
GDMonoField *field_AssemblyHasScriptsAttribute_scriptTypes = nullptr;
|
||||
|
||||
GDMonoField *field_GodotObject_ptr;
|
||||
GDMonoField *field_StringName_ptr;
|
||||
GDMonoField *field_NodePath_ptr;
|
||||
GDMonoField *field_Image_ptr;
|
||||
GDMonoField *field_RID_ptr;
|
||||
GDMonoField *field_GodotObject_ptr = nullptr;
|
||||
GDMonoField *field_StringName_ptr = nullptr;
|
||||
GDMonoField *field_NodePath_ptr = nullptr;
|
||||
GDMonoField *field_Image_ptr = nullptr;
|
||||
GDMonoField *field_RID_ptr = nullptr;
|
||||
|
||||
GDMonoMethodThunk<MonoObject *> methodthunk_GodotObject_Dispose;
|
||||
GDMonoMethodThunkR<Array *, MonoObject *> methodthunk_Array_GetPtr;
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ class GDMonoClass {
|
|||
StringName namespace_name;
|
||||
StringName class_name;
|
||||
|
||||
MonoClass *mono_class;
|
||||
GDMonoAssembly *assembly;
|
||||
MonoClass *mono_class = nullptr;
|
||||
GDMonoAssembly *assembly = nullptr;
|
||||
|
||||
bool attrs_fetched;
|
||||
MonoCustomAttrInfo *attributes;
|
||||
MonoCustomAttrInfo *attributes = nullptr;
|
||||
|
||||
// This contains both the original method names and remapped method names from the native Godot identifiers to the C# functions.
|
||||
// Most method-related functions refer to this and it's possible this is unintuitive for outside users; this may be a prime location for refactoring or renaming.
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@
|
|||
#include "i_mono_class_member.h"
|
||||
|
||||
class GDMonoField : public IMonoClassMember {
|
||||
GDMonoClass *owner;
|
||||
MonoClassField *mono_field;
|
||||
GDMonoClass *owner = nullptr;
|
||||
MonoClassField *mono_field = nullptr;
|
||||
|
||||
StringName name;
|
||||
ManagedType type;
|
||||
|
||||
bool attrs_fetched;
|
||||
MonoCustomAttrInfo *attributes;
|
||||
MonoCustomAttrInfo *attributes = nullptr;
|
||||
|
||||
public:
|
||||
virtual GDMonoClass *get_enclosing_class() const final { return owner; }
|
||||
|
|
|
|||
|
|
@ -196,14 +196,14 @@ PackedVector3Array mono_array_to_PackedVector3Array(MonoArray *p_array);
|
|||
#pragma pack(push, 1)
|
||||
|
||||
struct M_Callable {
|
||||
MonoObject *target;
|
||||
MonoObject *method_string_name;
|
||||
MonoDelegate *delegate;
|
||||
MonoObject *target = nullptr;
|
||||
MonoObject *method_string_name = nullptr;
|
||||
MonoDelegate *delegate = nullptr;
|
||||
};
|
||||
|
||||
struct M_SignalInfo {
|
||||
MonoObject *owner;
|
||||
MonoObject *name_string_name;
|
||||
MonoObject *owner = nullptr;
|
||||
MonoObject *name_string_name = nullptr;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class GDMonoMethod : public IMonoClassMember {
|
|||
|
||||
friend class GDMonoClass;
|
||||
|
||||
MonoMethod *mono_method;
|
||||
MonoMethod *mono_method = nullptr;
|
||||
|
||||
public:
|
||||
virtual GDMonoClass *get_enclosing_class() const final;
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@
|
|||
#include "i_mono_class_member.h"
|
||||
|
||||
class GDMonoProperty : public IMonoClassMember {
|
||||
GDMonoClass *owner;
|
||||
MonoProperty *mono_property;
|
||||
GDMonoClass *owner = nullptr;
|
||||
MonoProperty *mono_property = nullptr;
|
||||
|
||||
StringName name;
|
||||
ManagedType type;
|
||||
|
||||
bool attrs_fetched;
|
||||
MonoCustomAttrInfo *attributes;
|
||||
MonoCustomAttrInfo *attributes = nullptr;
|
||||
|
||||
unsigned int param_buffer_size;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ struct Mono_InterpMethodArguments {
|
|||
size_t ilen;
|
||||
void **iargs;
|
||||
size_t flen;
|
||||
double *fargs;
|
||||
double *fargs = nullptr;
|
||||
void **retval;
|
||||
size_t is_float_ret;
|
||||
//#ifdef TARGET_WASM
|
||||
void *sig;
|
||||
void *sig = nullptr;
|
||||
//#endif
|
||||
};
|
||||
} // extern "C"
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public:
|
|||
};
|
||||
|
||||
class EventSignalCallable : public CallableCustom {
|
||||
Object *owner;
|
||||
Object *owner = nullptr;
|
||||
const CSharpScript::EventSignal *event_signal;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ class NavigationMeshEditor : public Control {
|
|||
|
||||
GDCLASS(NavigationMeshEditor, Control);
|
||||
|
||||
AcceptDialog *err_dialog;
|
||||
AcceptDialog *err_dialog = nullptr;
|
||||
|
||||
HBoxContainer *bake_hbox;
|
||||
Button *button_bake;
|
||||
Button *button_reset;
|
||||
Label *bake_info;
|
||||
HBoxContainer *bake_hbox = nullptr;
|
||||
Button *button_bake = nullptr;
|
||||
Button *button_reset = nullptr;
|
||||
Label *bake_info = nullptr;
|
||||
|
||||
NavigationRegion3D *node;
|
||||
NavigationRegion3D *node = nullptr;
|
||||
|
||||
void _bake_pressed();
|
||||
void _clear_pressed();
|
||||
|
|
@ -68,7 +68,7 @@ public:
|
|||
class NavigationMeshEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(NavigationMeshEditorPlugin, EditorPlugin);
|
||||
|
||||
NavigationMeshEditor *navigation_mesh_editor;
|
||||
NavigationMeshEditor *navigation_mesh_editor = nullptr;
|
||||
|
||||
public:
|
||||
virtual String get_name() const override { return "NavigationMesh"; }
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ struct Edge {
|
|||
};
|
||||
|
||||
struct Polygon {
|
||||
NavRegion *owner;
|
||||
NavRegion *owner = nullptr;
|
||||
|
||||
/// The points of this `Polygon`
|
||||
std::vector<Point> points;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Noise : public Resource {
|
|||
// Helper struct for get_seamless_image(). See comments in .cpp for usage.
|
||||
template <typename T>
|
||||
struct img_buff {
|
||||
T *img;
|
||||
T *img = nullptr;
|
||||
int width; // Array dimensions & default modulo for image.
|
||||
int height;
|
||||
int offset_x; // Offset index location on image (wrapped by specified modulo).
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
class OpenXREditorPlugin : public EditorPlugin {
|
||||
GDCLASS(OpenXREditorPlugin, EditorPlugin);
|
||||
|
||||
OpenXRActionMapEditor *action_map_editor;
|
||||
OpenXRActionMapEditor *action_map_editor = nullptr;
|
||||
|
||||
public:
|
||||
virtual String get_name() const override { return "OpenXRPlugin"; }
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class OpenXRAPI;
|
|||
|
||||
class OpenXRExtensionWrapper {
|
||||
protected:
|
||||
OpenXRAPI *openxr_api;
|
||||
OpenXRAPI *openxr_api = nullptr;
|
||||
|
||||
// Store extension we require.
|
||||
// If bool pointer is a nullptr this means this extension is mandatory and initialisation will fail if it is not available
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ private:
|
|||
|
||||
struct Scenario {
|
||||
struct RaycastThreadData {
|
||||
CameraRayTile *rays;
|
||||
CameraRayTile *rays = nullptr;
|
||||
const uint32_t *masks;
|
||||
};
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ private:
|
|||
uint32_t vertex_count;
|
||||
Transform3D xform;
|
||||
const Vector3 *read;
|
||||
Vector3 *write;
|
||||
Vector3 *write = nullptr;
|
||||
};
|
||||
|
||||
Thread *commit_thread = nullptr;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
class RegEx : public RefCounted {
|
||||
GDCLASS(RegEx, RefCounted);
|
||||
|
||||
void *general_ctx;
|
||||
void *general_ctx = nullptr;
|
||||
void *code = nullptr;
|
||||
String pattern;
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback {
|
|||
RingBuffer<uint8_t> ring_buffer;
|
||||
Vector<uint8_t> read_buffer;
|
||||
bool thread_eof = false;
|
||||
Semaphore *thread_sem;
|
||||
Semaphore *thread_sem = nullptr;
|
||||
Thread thread;
|
||||
SafeFlag thread_exit;
|
||||
|
||||
|
|
|
|||
|
|
@ -62,23 +62,23 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
|
|||
SCOPE_ALL = SCOPE_BASE | SCOPE_INHERITERS | SCOPE_UNRELATED
|
||||
};
|
||||
|
||||
LineEdit *search_box;
|
||||
LineEdit *search_box = nullptr;
|
||||
|
||||
Button *case_sensitive_button;
|
||||
Button *hierarchy_button;
|
||||
Button *case_sensitive_button = nullptr;
|
||||
Button *hierarchy_button = nullptr;
|
||||
|
||||
Button *search_visual_script_nodes;
|
||||
Button *search_classes;
|
||||
Button *search_operators;
|
||||
Button *search_visual_script_nodes = nullptr;
|
||||
Button *search_classes = nullptr;
|
||||
Button *search_operators = nullptr;
|
||||
|
||||
Button *search_methods;
|
||||
Button *search_signals;
|
||||
Button *search_constants;
|
||||
Button *search_properties;
|
||||
Button *search_theme_items;
|
||||
Button *search_methods = nullptr;
|
||||
Button *search_signals = nullptr;
|
||||
Button *search_constants = nullptr;
|
||||
Button *search_properties = nullptr;
|
||||
Button *search_theme_items = nullptr;
|
||||
|
||||
OptionButton *scope_combo;
|
||||
Tree *results_tree;
|
||||
OptionButton *scope_combo = nullptr;
|
||||
Tree *results_tree = nullptr;
|
||||
|
||||
class SearchRunner;
|
||||
Ref<SearchRunner> search_runner;
|
||||
|
|
@ -94,7 +94,7 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
|
|||
void _item_selected();
|
||||
void _hide_requested();
|
||||
|
||||
EditorHelpBit *help_bit;
|
||||
EditorHelpBit *help_bit = nullptr;
|
||||
|
||||
bool properties = false;
|
||||
bool visual_script_generic = false;
|
||||
|
|
@ -104,9 +104,9 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
|
|||
String base_type;
|
||||
String base_script;
|
||||
ObjectID script;
|
||||
Object *instance;
|
||||
Object *instance = nullptr;
|
||||
bool virtuals_only = false;
|
||||
VBoxContainer *vbox;
|
||||
VBoxContainer *vbox = nullptr;
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
|
@ -159,9 +159,9 @@ class VisualScriptPropertySelector::SearchRunner : public RefCounted {
|
|||
}
|
||||
};
|
||||
|
||||
VisualScriptPropertySelector *selector_ui;
|
||||
Control *ui_service;
|
||||
Tree *results_tree;
|
||||
VisualScriptPropertySelector *selector_ui = nullptr;
|
||||
Control *ui_service = nullptr;
|
||||
Tree *results_tree = nullptr;
|
||||
String term;
|
||||
int search_flags;
|
||||
int scope_flags;
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ class VisualScriptLanguage : public ScriptLanguage {
|
|||
String _debug_error;
|
||||
int _debug_call_stack_pos = 0;
|
||||
int _debug_max_call_stack;
|
||||
CallLevel *_call_stack;
|
||||
CallLevel *_call_stack = nullptr;
|
||||
|
||||
public:
|
||||
StringName notification = "_notification";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue