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

GDScriptVM: Avoid c-style cast/const_cast #94891

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

Conversation

rune-scape
Copy link
Contributor

+replaced c-style casts with more verbose and searchable c++ casts
+moved common const_cast of instruction_args to const Variant ** into a ref var

@rune-scape rune-scape requested a review from a team as a code owner July 29, 2024 00:06
@fire
Copy link
Member

fire commented Jul 29, 2024

What is the benefit for this code style change?

Edited: it's not very long so it's probably ok and localized to gdscript

@rune-scape
Copy link
Contributor Author

rune-scape commented Jul 29, 2024

im searching for const_casts after #93759, and trying to find ways to remove them or improve them, this is just a style change. bc of how Vector and CowData might(?) copy the data if stack.ptrw() was used. i didn't want to touch that

the style guide doesnt say anything about casts, but im assuming moving away from c-style casts toward verbose casts is desired

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.

3 participants