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

Make jboolean an alias for bool instead of u8 #23

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

rib
Copy link
Contributor

@rib rib commented Jun 21, 2023

JNI only strictly defines two valid values for a jboolean and there's no consensus on whether other values greater than one will be interpreted as TRUE in all situations.

The safest interpretation is to say that it will lead to undefined behaviour to pass any value besides zero or one as a jboolean.

Addresses jni-rs/jni-rs#400
Closes #19

JNI only strictly defines two valid values for a `jboolean`
and there's no consensus on whether other values greater than one will
be interpreted as TRUE in all situations.

The safest interpretation is to say that it will lead to undefined
behaviour to pass any value besides zero or one as a `jboolean`.

Addresses jni-rs/jni-rs#400
Closes #19
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.

Considering redefining jboolean as either an bool or our own #[repr(u8)] enum
1 participant