[9] Review request: new macro for conversion to jboolean (original) (raw)

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Wed Mar 19 18:36:39 UTC 2014


Thanks Anthony!

Can somebody from the core-libs team take a look?

On 3/17/14 10:31 PM, Anthony Petrov wrote:

Personally, I'd call it tojboolean(obj), but ISTRUE(obj) sounds good to me too. Either way, I'm fine with the fix.

-- best regards, Anthony On 3/17/2014 7:01 PM, Sergey Bylokhov wrote: Hello. This review request is for the new macro, which simplify conversion to jboolean. It will be useful for fixing parfait warnings.

We have a lot of places, where we cast some type to jboolean: BOOL = retVal; return (jboolean) retVal; WARNING: Expecting value of JNI primitive type jboolean: mismatched value retVal with size 32 bits, retVal used for conversion to int8 in return

+++ b/src/share/native/common/jniutil.h Mon Mar 17 18:28:48 2014 +0400 @@ -277,6 +277,7 @@ #define ISNULL(obj) ((obj) == NULL) #define JNUIsNull(env,obj) ((obj) == NULL) +#define ISTRUE(obj) ((obj) ? JNITRUE : JNIFALSE) I am not sure about the name, probably someone have a better suggestion? The fix is for jdk9/dev. -- Best regards, Sergey.

-- Best regards, Sergey.



More information about the core-libs-dev mailing list