Merge pull request #1253 from gilzoide/fix-variant-iteration-valid-flag

Fix return value and `r_valid` value in `Variant::iter_init` and `Variant::iter_next`
pull/1277/head
David Snopek 2023-10-20 10:39:05 -05:00 committed by GitHub
commit 0a6a19e33b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -638,14 +638,16 @@ bool Variant::in(const Variant &index, bool *r_valid) const {
bool Variant::iter_init(Variant &r_iter, bool &r_valid) const { bool Variant::iter_init(Variant &r_iter, bool &r_valid) const {
GDExtensionBool valid; GDExtensionBool valid;
internal::gdextension_interface_variant_iter_init(_native_ptr(), r_iter._native_ptr(), &valid); GDExtensionBool result = internal::gdextension_interface_variant_iter_init(_native_ptr(), r_iter._native_ptr(), &valid);
return PtrToArg<bool>::convert(&valid); r_valid = PtrToArg<bool>::convert(&valid);
return PtrToArg<bool>::convert(&result);
} }
bool Variant::iter_next(Variant &r_iter, bool &r_valid) const { bool Variant::iter_next(Variant &r_iter, bool &r_valid) const {
GDExtensionBool valid; GDExtensionBool valid;
internal::gdextension_interface_variant_iter_next(_native_ptr(), r_iter._native_ptr(), &valid); GDExtensionBool result = internal::gdextension_interface_variant_iter_next(_native_ptr(), r_iter._native_ptr(), &valid);
return PtrToArg<bool>::convert(&valid); r_valid = PtrToArg<bool>::convert(&valid);
return PtrToArg<bool>::convert(&result);
} }
Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const {