summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorRafał Mikrut <mikrutrafal@protonmail.com>2020-11-23 17:38:46 +0100
committerRafał Mikrut <mikrutrafal@protonmail.com>2020-11-23 17:38:46 +0100
commit7bd03b718871137740c6bf074e984bba8dc113c3 (patch)
treec83a11a1ddae811a0ac2f7246f423678de2a106e /core/variant
parent18023cc3ede6fd84842db77019085c383e807016 (diff)
Initialize class/struct variables with default values in core/ and drivers/
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/array.cpp2
-rw-r--r--core/variant/callable.h6
-rw-r--r--core/variant/variant.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp
index 79bc01b89c..5043868b1d 100644
--- a/core/variant/array.cpp
+++ b/core/variant/array.cpp
@@ -371,7 +371,7 @@ void Array::sort() {
}
struct _ArrayVariantSortCustom {
- Object *obj;
+ Object *obj = nullptr;
StringName func;
_FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const {
diff --git a/core/variant/callable.h b/core/variant/callable.h
index 40621fbde3..9334ae3581 100644
--- a/core/variant/callable.h
+++ b/core/variant/callable.h
@@ -62,9 +62,9 @@ public:
CALL_ERROR_TOO_FEW_ARGUMENTS, // expected is number of arguments
CALL_ERROR_INSTANCE_IS_NULL,
};
- Error error;
- int argument;
- int expected;
+ Error error = Error::CALL_OK;
+ int argument = 0;
+ int expected = 0;
};
void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, CallError &r_call_error) const;
diff --git a/core/variant/variant.h b/core/variant/variant.h
index 093daf0c6f..26280948be 100644
--- a/core/variant/variant.h
+++ b/core/variant/variant.h
@@ -128,7 +128,7 @@ private:
struct ObjData {
ObjectID id;
- Object *obj;
+ Object *obj = nullptr;
};
/* array helpers */