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

Add PackedByteArray docs warning about s64 int autocasting in GDScript #102462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vocco
Copy link

@Vocco Vocco commented Feb 5, 2025

Adds a warning about automatic conversion to 64-bit integer when using GDScript to avoid type confusion when decoding uint64 data. Intended to close godotengine/godot-docs#10601.

@Vocco Vocco requested a review from a team as a code owner February 5, 2025 17:47
@AThousandShips AThousandShips added this to the 4.x milestone Feb 5, 2025
@Vocco Vocco force-pushed the docs-s64-cast-warning branch 2 times, most recently from cdc8ea7 to ced2c33 Compare February 5, 2025 18:33
@Vocco Vocco force-pushed the docs-s64-cast-warning branch 2 times, most recently from 005967e to 63b8c1a Compare February 6, 2025 10:14
@Vocco
Copy link
Author

Vocco commented Feb 6, 2025

Rebased and added missing space after "-" in second bulletpoint.

@Vocco Vocco force-pushed the docs-s64-cast-warning branch from 63b8c1a to 98025b1 Compare February 6, 2025 11:53
@Ombrezz
Copy link

Ombrezz commented Feb 10, 2025

You might also want to add that if a string representation of the unsigned integer is all that's needed, that's provided in the String.num_uint64 function.
https://docs.godotengine.org/en/stable/classes/class_string.html#class-string-method-num-uint64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PackedByteArray.decode_u64 should warn about auto conversion to signed 64bit integer
4 participants