diff options
| author | Hein-Pieter van Braam | 2017-09-18 20:02:47 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-09-19 18:55:31 +0200 |
| commit | 833c3917b247baa46f5a5f6ad6ce478cffc1911d (patch) | |
| tree | 0f25e4584f1da4b0534c55c9b6f88e0358d8dd98 /modules | |
| parent | 85641c545bedbdb703ad923306786afe5c312110 (diff) | |
| download | godot-833c3917b247baa46f5a5f6ad6ce478cffc1911d.tar.gz godot-833c3917b247baa46f5a5f6ad6ce478cffc1911d.tar.zst godot-833c3917b247baa46f5a5f6ad6ce478cffc1911d.zip | |
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/gdnative/gdnative/variant.cpp | 5 | ||||
| -rw-r--r-- | modules/gdnative/include/gdnative/variant.h | 2 | ||||
| -rw-r--r-- | modules/gdnative/include/gdnative_api_struct.h | 2 | ||||
| -rw-r--r-- | modules/gdscript/gd_function.cpp | 27 |
4 files changed, 7 insertions, 29 deletions
diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 1b2aae607..9ba4166c1 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -480,10 +480,9 @@ godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const g return self->hash_compare(*other); } -godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self, godot_bool *r_valid) { +godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self) { const Variant *self = (const Variant *)p_self; - bool &valid = *r_valid; - return self->booleanize(valid); + return self->booleanize(); } void GDAPI godot_variant_destroy(godot_variant *p_self) { diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h index 969506585..7b804c1ea 100644 --- a/modules/gdnative/include/gdnative/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -190,7 +190,7 @@ godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other); -godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self, godot_bool *r_valid); +godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self); void GDAPI godot_variant_destroy(godot_variant *p_self); diff --git a/modules/gdnative/include/gdnative_api_struct.h b/modules/gdnative/include/gdnative_api_struct.h index cfebeb08c..c345e2722 100644 --- a/modules/gdnative/include/gdnative_api_struct.h +++ b/modules/gdnative/include/gdnative_api_struct.h @@ -534,7 +534,7 @@ extern "C" { GDAPI_FUNC(godot_variant_operator_equal, godot_bool, const godot_variant *p_self, const godot_variant *p_other) \ GDAPI_FUNC(godot_variant_operator_less, godot_bool, const godot_variant *p_self, const godot_variant *p_other) \ GDAPI_FUNC(godot_variant_hash_compare, godot_bool, const godot_variant *p_self, const godot_variant *p_other) \ - GDAPI_FUNC(godot_variant_booleanize, godot_bool, const godot_variant *p_self, godot_bool *r_valid) \ + GDAPI_FUNC(godot_variant_booleanize, godot_bool, const godot_variant *p_self) \ GDAPI_FUNC_VOID(godot_variant_destroy, godot_variant *p_self) \ GDAPI_FUNC_VOID(godot_string_new, godot_string *r_dest) \ GDAPI_FUNC_VOID(godot_string_new_copy, godot_string *r_dest, const godot_string *p_src) \ diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 438d484a4..df7b16c96 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -982,15 +982,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a GET_VARIANT_PTR(test, 1); - bool valid; - bool result = test->booleanize(valid); -#ifdef DEBUG_ENABLED - if (!valid) { + bool result = test->booleanize(); - err_text = "cannot evaluate conditional expression of type: " + Variant::get_type_name(test->get_type()); - break; - } -#endif if (result) { int to = _code_ptr[ip + 2]; GD_ERR_BREAK(to < 0 || to > _code_size); @@ -1006,15 +999,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a GET_VARIANT_PTR(test, 1); - bool valid; - bool result = test->booleanize(valid); -#ifdef DEBUG_ENABLED - if (!valid) { + bool result = test->booleanize(); - err_text = "cannot evaluate conditional expression of type: " + Variant::get_type_name(test->get_type()); - break; - } -#endif if (!result) { int to = _code_ptr[ip + 2]; GD_ERR_BREAK(to < 0 || to > _code_size); @@ -1107,14 +1093,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a GET_VARIANT_PTR(test, 1); #ifdef DEBUG_ENABLED - bool valid; - bool result = test->booleanize(valid); - - if (!valid) { - - err_text = "cannot evaluate conditional expression of type: " + Variant::get_type_name(test->get_type()); - break; - } + bool result = test->booleanize(); if (!result) { |
