Skip to content

Conversation

@leecommamichael
Copy link
Contributor

@leecommamichael leecommamichael commented Sep 8, 2025

These parts of the API need to process an array for a range of characters, so I changed them to multi-pointers.

font_size: f32,
first_unicode_codepoint_in_range: c.int,
array_of_unicode_codepoints: [^]rune,
array_of_unicode_codepoints: [^]rune, // optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe([^]rune) could be added? Not saying it should be though.

Copy link
Contributor Author

@leecommamichael leecommamichael Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, the comment is erroneous since either first_unicode_codepoint_in_range or array_of_unicode_codepoints is expected. The first_codepoint... is ignored if the array is present. I can't think of a better Odin binding that isn't a wrapper. I could do two Maybe parameters, but then it seems that neither are needed 😅

By the way, would you mind if I converted some of these c.int returns to b32? Sean returns only 1 or 0 in many of these functions. Thanks.

EDIT: Check my math, but; I think in practice Odin only supports ILP32/LP64 things, so c.int can safely be typed as i32 (and thus b32) in all cases, so there'd be no ABI fuss.

@leecommamichael
Copy link
Contributor Author

I've not worked with forks very much, not sure why it's including my (already merged) PNG change from earlier today... I guess I've got to rebase/squash more to convince it.

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.

2 participants