Skip to content

Question: When passing a char as a function argument, should I pass the number obtained by calling the string's ord method? #96

@kojix2

Description

@kojix2

Hi!
I have a question about c char.

https://github.com/andlabs/libui/blob/fea45b2d5b75839be0af9acc842a147c5cba9295/ui.h#L767

c function

void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);

ruby method

extern 'void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)'

I wonder if I should call ord like this?

LibUI::FFI.uiOpenTypeFeaturesAdd(otf, 'l'.ord, 'i'.ord, 'g'.ord, 'a'.ord, 0)

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions