From 79a359fea1885151a77f83e05eee8d2aa97895ab Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 8 May 2015 09:22:10 +0200 Subject: jboolean-related clean-up Change-Id: Iecd03d0343b9b7c3a8b23b5a1e9654148b94d44c --- bridges/source/jni_uno/jni_base.h | 4 ++-- bridges/source/jni_uno/jni_bridge.cxx | 8 ++++---- bridges/source/jni_uno/jni_data.cxx | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'bridges') diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h index 2b856aaad6f6..af93d6a35cac 100644 --- a/bridges/source/jni_uno/jni_base.h +++ b/bridges/source/jni_uno/jni_base.h @@ -96,7 +96,7 @@ public: inline void JNI_context::ensure_no_exception() const { - if (JNI_FALSE != m_env->ExceptionCheck()) + if (m_env->ExceptionCheck()) { java_exc_occurred(); } @@ -104,7 +104,7 @@ inline void JNI_context::ensure_no_exception() const inline bool JNI_context::assert_no_exception() const { - if (JNI_FALSE != m_env->ExceptionCheck()) + if (m_env->ExceptionCheck()) { SAL_WARN("bridges", "unexpected java exception occurred"); #if OSL_DEBUG_LEVEL > 0 diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index 982f417a01ae..7eb2dc01f0db 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -288,7 +288,7 @@ void JNI_context::java_exc_occurred() const // call toString(); don't rely on m_jni_info jclass jo_class = m_env->FindClass( "java/lang/Object" ); - if (JNI_FALSE != m_env->ExceptionCheck()) + if (m_env->ExceptionCheck()) { m_env->ExceptionClear(); throw BridgeRuntimeError( @@ -298,7 +298,7 @@ void JNI_context::java_exc_occurred() const // method Object.toString() jmethodID method_Object_toString = m_env->GetMethodID( static_cast(jo_Object.get()), "toString", "()Ljava/lang/String;" ); - if (JNI_FALSE != m_env->ExceptionCheck()) + if (m_env->ExceptionCheck()) { m_env->ExceptionClear(); throw BridgeRuntimeError( @@ -523,8 +523,8 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping( *ppMapping = 0; } - static_assert(JNI_FALSE == sal_False, "must be equal"); - static_assert(JNI_TRUE == sal_True, "must be equal"); + static_assert(int(JNI_FALSE) == int(sal_False), "must be equal"); + static_assert(int(JNI_TRUE) == int(sal_True), "must be equal"); static_assert(sizeof (jboolean) == sizeof (sal_Bool), "must be the same size"); static_assert(sizeof (jchar) == sizeof (sal_Unicode), "must be the same size"); static_assert(sizeof (jdouble) == sizeof (double), "must be the same size"); diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index 829c73063a4f..d1f36eda2b42 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -461,8 +461,7 @@ void Bridge::map_to_uno( JLocalAutoRef jo_type( jni ); JLocalAutoRef jo_wrapped_holder( jni ); - if (JNI_FALSE != jni->IsInstanceOf( - java_data.l, getJniInfo()->m_class_Any )) + if (jni->IsInstanceOf( java_data.l, getJniInfo()->m_class_Any )) { // boxed any jo_type.reset( jni->GetObjectField( -- cgit