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
@rib rib force-pushed the rib/pr/alias-jboolean-as-bool branch from 2aa4136 to b478617 Compare June 21, 2023 09:26
@rib rib added this to the Release 0.4 milestone Jul 25, 2023
Base automatically changed from rib/pr/add-get-module to master August 31, 2023 19:41
@rib rib merged commit 674fcc8 into master Aug 31, 2023
20 checks passed
@rib rib deleted the rib/pr/alias-jboolean-as-bool branch August 31, 2023 19:43
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