-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Enums: add missing binds #117205
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
Closed
Closed
Enums: add missing binds #117205
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #114129 I added the binding for
TRANSITION_TO_TIME_PREVIOUS_POSITIONalong with documentation. I did not bindTRANSITION_TO_TIME_MAX. The other enums in this file do not bind that; nor does e.g.AudioStreamRandomizer.PlaybackMode. It's also illegal to passTRANSITION_TO_TIME_MAXto e.g.add_transition. So I don't think it's correct to bind it.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've got a bit confused; I was told that XML files are all generated using --doc-tools but it seems that
..._MAXenum values are not generated through binding in the cpp file. Sorry! It would be nice in general to have more instructions on how the documentation should be contributed to because I think I'm probably hindering more than helping!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion (bearing in mind I'm just a guy who occasionally sends 1-line PRs!)
interactive_musicchanges from this branch - it's covered in Bind AudioStreamInteractiveTRANSITION_TO_TIME_PREVIOUS_POSITION#114129 which I hope will be merged at some point!OPENXR_ACTION_MAXThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay cool; I was also confused at why some _MAX enum values are documented and how they are being added to the XML files if they're not bound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be missing where it's bound because they are bound if they are added to the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a bit confused. e.g. why is
<constant name="CLOSE_BUTTON_MAX" value="3" enum="CloseButtonDisplayPolicy">allowed to be bound, but TRANSITION_TO_TIME_MAX is not allowed to be bound here? I don't understand how to distinguish what should/shouldn't be bound.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By wjt's logic, I would suspect its also not valid to pass CLOSE_BUTTON_MAX (or many other of the _MAX enums found in the docs) to their respective functions, but they are still included in the XML files. Maybe I'm wrong though and there's some MAX enum values which have actual usage beyond just representing the max size?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the explanation:
But I'd say that's up to the person implementing the feature, so doing that without understanding the feature or the logic is not a good idea, so I think this might not be the right task for you
In the cases where they are missing, I'd suggest just going back to the PR that added them, see if there's an explanation, and if not ask somewhere about it, there's usually a good idea behind that, but not always (you can use the "blame" tab on each file in the GitHub web interface to explore the history of any file)
But the enum shouldn't generally be bound unless it's actually useful to binds, a lot of the time it's strictly used internally to do range checking, like
ERR_FAIL_INDEX(p_arg, 0, SPECIFIC_ENUM_MAX);(and isn't relevant to iterating over valid values, for example if there's no value for a specific entry between0andX_MAX)