From baedcd05f523f011743eccac205f2931fc28d5ff Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Sun, 1 Dec 2024 10:20:30 +0100 Subject: [PATCH] Minor style fix in Cython code --- src/godot/builtins_pxd/member.pxd.j2 | 9 +++++---- src/godot/hazmat/extension_class.pxd | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/godot/builtins_pxd/member.pxd.j2 b/src/godot/builtins_pxd/member.pxd.j2 index cef01509..955f2d1c 100644 --- a/src/godot/builtins_pxd/member.pxd.j2 +++ b/src/godot/builtins_pxd/member.pxd.j2 @@ -9,8 +9,9 @@ void set_{{ m.name }}(self, {{ m.type.cy_type }} val) {% macro render_member(builtin, m) %} -{% if not m.is_in_struct %} -{# Property unrelated to the builtin internal structure, must use Godot API method to access it #} +{% if m.is_in_struct %} +# Ignore `{{ m.name }}` property as it is unrelated to the builtin internal structure (must use Godot API method to access it) +{% else %} {% if m.type.is_scalar %} {# Scalar type accessed by property (unused in extension_api.json afaik) #} cdef inline {{ render_member_getter_signature(m) }}: @@ -47,7 +48,7 @@ cdef inline {{ builtin.indexing_return_type.cy_type }} _getitem(self, object key # No need to destroy gdret given the conversion has stolen ownership on data ! {% else %} ret = {{ builtin.indexing_return_type.cy_type }}.__new__({{ builtin.indexing_return_type.cy_type }}) - ret._gd_data = {{ builtin.c_name_prefix }}_keyed_getter(&self._gd_data, &gdkey) + ret._gd_data = {{ builtin.c_name_prefix }}_keyed_getter(&self._gd_data, &gdkey) return ret {% endif %} @@ -141,7 +142,7 @@ cdef inline {{ builtin.indexing_return_type.cy_type }} _getitem(self, GDExtensio # No need to destroy gdret given the conversion has stolen ownership on data ! {% else %} cdef {{ builtin.indexing_return_type.cy_type }} ret = {{ builtin.indexing_return_type.cy_type }}.__new__({{ builtin.indexing_return_type.cy_type }}) - ret._gd_data = {{ builtin.c_name_prefix }}_indexed_getter(&self._gd_data, index) + ret._gd_data = {{ builtin.c_name_prefix }}_indexed_getter(&self._gd_data, index) return ret {% endif %} diff --git a/src/godot/hazmat/extension_class.pxd b/src/godot/hazmat/extension_class.pxd index feb10e6d..f9dad58e 100644 --- a/src/godot/hazmat/extension_class.pxd +++ b/src/godot/hazmat/extension_class.pxd @@ -66,8 +66,8 @@ cdef inline void register_extension_class_creation( info.get_func = NULL # GDExtensionClassGet info.get_property_list_func = NULL # GDExtensionClassGetPropertyList info.free_property_list_func = NULL # GDExtensionClassFreePropertyList - info.property_can_revert_func = NULL # GDExtensionClassPropertyCanRevert - info.property_get_revert_func = NULL # GDExtensionClassPropertyGetRevert + info.property_can_revert_func = NULL # GDExtensionClassPropertyCanRevert + info.property_get_revert_func = NULL # GDExtensionClassPropertyGetRevert info.notification_func = NULL # GDExtensionClassNotification info.to_string_func = &_extension_class_to_string # GDExtensionClassToString info.reference_func = NULL # GDExtensionClassReference