Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct type for char16 and char32 meta #1554

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

raulsntos
Copy link
Member

@raulsntos raulsntos added enhancement This is an enhancement on the current functionality topic:gdextension This relates to the new Godot 4 extension implementation labels Aug 20, 2024
@raulsntos raulsntos added this to the 4.x milestone Aug 20, 2024
@raulsntos raulsntos requested a review from a team as a code owner August 20, 2024 02:53
Comment on lines 2724 to 2725
elif meta in type_conversion:
return type_conversion[type_name]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the type_conversion above and

	static const char *argmeta[13] = { "none", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float", "double", "char16", "char32" };

does this mean that float meta in the above array also gets converted to double?

Copy link
Member Author

@raulsntos raulsntos Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's unfortunate. I think this elif can be removed since you are never going to get int or Nil as metadata, and if you get float then it means float (not double).

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In retrospect we should probably have used the proper C++ types as meta from the start, but I guess this would break compat now.

Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks good to me :-)

@dsnopek
Copy link
Collaborator

dsnopek commented Aug 22, 2024

Ack, needs a rebase because I merged PR #1555 first

Verified

This commit was signed with the committer’s verified signature.
raulsntos Raul Santos
@dsnopek dsnopek merged commit 19c83a8 into godotengine:master Aug 23, 2024
12 checks passed
@raulsntos raulsntos deleted the char-metadata branch August 23, 2024 00:41
@dsnopek
Copy link
Collaborator

dsnopek commented Sep 3, 2024

Cherry-picked for 4.3 in PR #1569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement on the current functionality topic:gdextension This relates to the new Godot 4 extension implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants