Skip to content

Commit

Permalink
Minor style fix in Cython code
Browse files Browse the repository at this point in the history
  • Loading branch information
touilleMan committed Dec 1, 2024
1 parent ee3c2e9 commit baedcd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/godot/builtins_pxd/member.pxd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}:
Expand Down Expand Up @@ -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 %}

Expand Down Expand Up @@ -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 %}

Expand Down
4 changes: 2 additions & 2 deletions src/godot/hazmat/extension_class.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit baedcd0

Please sign in to comment.