Fix Variant::can_convert[_strict] returning gibberish.

An uninitialized value was being returned instead of the function return
value.
pull/1000/head
Fabio Alessandrelli 2023-01-19 02:16:32 +01:00
parent cf3d995e8c
commit d64d97cb17
1 changed files with 2 additions and 4 deletions

View File

@ -719,14 +719,12 @@ String Variant::get_type_name(Variant::Type type) {
} }
bool Variant::can_convert(Variant::Type from, Variant::Type to) { bool Variant::can_convert(Variant::Type from, Variant::Type to) {
GDExtensionBool can; GDExtensionBool can = internal::gde_interface->variant_can_convert(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
internal::gde_interface->variant_can_convert(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
return PtrToArg<bool>::convert(&can); return PtrToArg<bool>::convert(&can);
} }
bool Variant::can_convert_strict(Variant::Type from, Variant::Type to) { bool Variant::can_convert_strict(Variant::Type from, Variant::Type to) {
GDExtensionBool can; GDExtensionBool can = internal::gde_interface->variant_can_convert_strict(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
internal::gde_interface->variant_can_convert_strict(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
return PtrToArg<bool>::convert(&can); return PtrToArg<bool>::convert(&can);
} }