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

Replace some problematic uses of String::num to String::num_int64 #101595

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Jan 15, 2025

This PR replaces some problematic uses of String::num to String::num_int64. I made sure to check that the source variable is indeed an int.

This is a regression from #47502
Fixes #101553

@adamscott adamscott added this to the 4.4 milestone Jan 15, 2025
@adamscott adamscott requested review from a team as code owners January 15, 2025 17:17
@adamscott
Copy link
Member Author

cc. @KoBeWi

@adamscott adamscott force-pushed the fix-with-String--num_64 branch from 38c7ce2 to 33e1643 Compare January 15, 2025 17:51
@Ivorforce
Copy link
Contributor

Great find!
Did you go through all String::num callers to make sure there are no other regressions? It may be possible to statically find other incompatible ones by temporarily re-defining the function as static String num(std::enable_if_t<std::is_floating_point_v<double>, double> p_num, int p_decimals = -1);, and simply recompiling.

@akien-mga akien-mga merged commit 0726d3c into godotengine:master Jan 16, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi
Copy link
Member

KoBeWi commented Jan 16, 2025

I wonder why we don't have some universal number to string method.
Although instead of concatenating and being careful about types, these strings should just use vformat().

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.

Web Export Debug Broken in 4.4.dev4+
4 participants