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

Return type of hb_subset_plan_old_to_new_glyph_mapping() et al #4003

Closed
behdad opened this issue Jan 4, 2023 · 1 comment
Closed

Return type of hb_subset_plan_old_to_new_glyph_mapping() et al #4003

behdad opened this issue Jan 4, 2023 · 1 comment

Comments

@behdad
Copy link
Member

behdad commented Jan 4, 2023

They currently return const hb_map_t *. That is understandable. The reason we don't return const objects in the API though is that hb_map_reference et al take non-const. They can be made to take const, but their return value has to choose between const or non-const. So historically they take non-const and return non-const.

Right now if one wants to reference the return of hb_subset_plan_old_to_new_glyph_mapping and family they need a cast, which is undesirable. I suggest we change them to drop the const. After all, we don't care if user modifies these.

@behdad
Copy link
Member Author

behdad commented Jan 4, 2023

cc @garretrieger

@behdad behdad closed this as completed in c350458 Jan 4, 2023
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

No branches or pull requests

1 participant