Merge pull request #70355 from Chaosus/gds_fix_loops

Fix empty zero assigners for the variant types
This commit is contained in:
Rémi Verschelde 2022-12-21 18:25:28 +01:00
commit 1df71f89a8
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -1314,7 +1314,7 @@ struct VariantZeroAssigner<float> {
template <> template <>
struct VariantZeroAssigner<String> { struct VariantZeroAssigner<String> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string(v) = String(); }
}; };
template <> template <>
@ -1399,12 +1399,12 @@ struct VariantZeroAssigner<Color> {
template <> template <>
struct VariantZeroAssigner<StringName> { struct VariantZeroAssigner<StringName> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string_name(v) = StringName(); }
}; };
template <> template <>
struct VariantZeroAssigner<NodePath> { struct VariantZeroAssigner<NodePath> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_node_path(v) = NodePath(); }
}; };
template <> template <>
@ -1414,12 +1414,12 @@ struct VariantZeroAssigner<::RID> {
template <> template <>
struct VariantZeroAssigner<Callable> { struct VariantZeroAssigner<Callable> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_callable(v) = Callable(); }
}; };
template <> template <>
struct VariantZeroAssigner<Signal> { struct VariantZeroAssigner<Signal> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_signal(v) = Signal(); }
}; };
template <> template <>
@ -1434,47 +1434,47 @@ struct VariantZeroAssigner<Array> {
template <> template <>
struct VariantZeroAssigner<PackedByteArray> { struct VariantZeroAssigner<PackedByteArray> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_byte_array(v) = PackedByteArray(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedInt32Array> { struct VariantZeroAssigner<PackedInt32Array> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int32_array(v) = PackedInt32Array(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedInt64Array> { struct VariantZeroAssigner<PackedInt64Array> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int64_array(v) = PackedInt64Array(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedFloat32Array> { struct VariantZeroAssigner<PackedFloat32Array> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float32_array(v) = PackedFloat32Array(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedFloat64Array> { struct VariantZeroAssigner<PackedFloat64Array> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float64_array(v) = PackedFloat64Array(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedStringArray> { struct VariantZeroAssigner<PackedStringArray> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string_array(v) = PackedStringArray(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedVector2Array> { struct VariantZeroAssigner<PackedVector2Array> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2_array(v) = PackedVector2Array(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedVector3Array> { struct VariantZeroAssigner<PackedVector3Array> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3_array(v) = PackedVector3Array(); }
}; };
template <> template <>
struct VariantZeroAssigner<PackedColorArray> { struct VariantZeroAssigner<PackedColorArray> {
static _FORCE_INLINE_ void zero(Variant *v) {} static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_color_array(v) = PackedColorArray(); }
}; };
template <class T> template <class T>