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

Dialog: Add filter size argument, remove NULL termination #9856

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

Semphriss
Copy link
Contributor

Description

This replaces the handling of the length of the filters arguments from null-terminated to a separate size argument, which should be less bug-prone.

I've also removed the case where if a user selected a file without selecting any filter, it would return the size of the array. It now returns -1, the same as when the platform doesn't support fetching the chosen filter. I'm not sure there's any difference that's relevant for the downstream developers.

Note: I've had to manually update the dynapi files to accomodate for the new arguments. Running gendynapi.py did not update the arguments, and it added two thread-related functions which seem to have been forgotten.

Existing Issue(s)

Closes #9693

@Semphriss Semphriss force-pushed the diag-num-filt branch 2 times, most recently from 268ca3f to fb9461e Compare May 23, 2024 16:25
@Semphriss
Copy link
Contributor Author

While fixing Haiku compilation problems, I've also added some more checks to filter-related functions to make sure that attempting to convert NULL filters will result in an error, not a crash.

@slouken slouken merged commit 8c8ee21 into libsdl-org:main Jun 4, 2024
39 checks passed
@slouken
Copy link
Collaborator

slouken commented Jun 4, 2024

Merged, thanks!

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

Successfully merging this pull request may close these issues.

Better handling of SDL_DialogFileFilter
2 participants