diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-08 09:22:10 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-08 09:49:01 +0200 |
commit | 79a359fea1885151a77f83e05eee8d2aa97895ab (patch) | |
tree | 0f17ddb1a91c5ffd68c9dfb036b37e3993e5ecc6 | |
parent | 1cb0b37ad09400138d7c4a5874c02f921e742d37 (diff) |
jboolean-related clean-up
Change-Id: Iecd03d0343b9b7c3a8b23b5a1e9654148b94d44c
-rw-r--r-- | bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c | 2 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_base.h | 4 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_bridge.cxx | 8 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_data.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/hsqldb/HStorageAccess.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/hsqldb/HStorageMap.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/hsqldb/StorageFileAccess.cxx | 4 | ||||
-rw-r--r-- | javaunohelper/source/bootstrap.cxx | 6 | ||||
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 8 |
9 files changed, 21 insertions, 22 deletions
diff --git a/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c b/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c index 275e6486e6e4..771839f3c571 100644 --- a/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c +++ b/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c @@ -87,7 +87,7 @@ SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindo /* Get the AWT */ awt.version = JAWT_VERSION_1_3; result = JAWT_GetAWT(env, &awt); - if (result == JNI_FALSE) + if (!result) ThrowException(env, "java/lang/RuntimeException", "JAWT_GetAWT failed"); /* Get the drawing surface */ 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<jclass>(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( diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index e87e68dee571..628aa3093ddc 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -428,7 +428,7 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst if ( xOut.is() ) { jbyte *buf = env->GetByteArrayElements(buffer,NULL); - if (JNI_FALSE != env->ExceptionCheck()) + if (env->ExceptionCheck()) { env->ExceptionClear(); OSL_FAIL("ExceptionClear"); diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index 8e30cfe3697c..64566b136e0e 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -139,7 +139,7 @@ namespace connectivity OUString StorageContainer::jstring2ustring(JNIEnv * env, jstring jstr) { - if (JNI_FALSE != env->ExceptionCheck()) + if (env->ExceptionCheck()) { env->ExceptionClear(); OSL_FAIL("ExceptionClear"); @@ -156,7 +156,7 @@ namespace connectivity env->ReleaseStringChars(jstr,pChar); } - if (JNI_FALSE != env->ExceptionCheck()) + if (env->ExceptionCheck()) { env->ExceptionClear(); OSL_FAIL("ExceptionClear"); @@ -334,7 +334,7 @@ namespace connectivity void StorageContainer::throwJavaException(const Exception& _aException,JNIEnv * env) { - if (JNI_FALSE != env->ExceptionCheck()) + if (env->ExceptionCheck()) env->ExceptionClear(); OString cstr( OUStringToOString(_aException.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); OSL_TRACE( __FILE__": forwarding Exception: %s", cstr.getStr() ); diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx index 740fe733ba08..498b39935bfb 100644 --- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx +++ b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx @@ -76,7 +76,7 @@ extern "C" SAL_JNI_EXPORT jboolean JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_S catch(const Exception& e) { OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement"); - if (JNI_FALSE != env->ExceptionCheck()) + if (env->ExceptionCheck()) env->ExceptionClear(); OString cstr( OUStringToOString(e.Message, RTL_TEXTENCODING_JAVA_UTF8 ) ); OSL_TRACE( __FILE__": forwarding Exception: %s", cstr.getStr() ); @@ -109,7 +109,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora } catch(const NoSuchElementException&) { - if (JNI_FALSE != env->ExceptionCheck()) + if (env->ExceptionCheck()) env->ExceptionClear(); } catch(const Exception& e) diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx index 7a4e2833d33b..81d6a35909b3 100644 --- a/javaunohelper/source/bootstrap.cxx +++ b/javaunohelper/source/bootstrap.cxx @@ -54,7 +54,7 @@ inline OUString jstring_to_oustring( jstring jstr, JNIEnv * jni_env ) rtl_uString * ustr = static_cast<rtl_uString *>(rtl_allocateMemory( sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) )); jni_env->GetStringRegion( jstr, 0, len, ustr->buffer ); - OSL_ASSERT( JNI_FALSE == jni_env->ExceptionCheck() ); + OSL_ASSERT( !jni_env->ExceptionCheck() ); ustr->refCount = 1; ustr->length = len; ustr->buffer[ len ] = '\0'; @@ -77,7 +77,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap( { // name jstring jstr = static_cast<jstring>(jni_env->GetObjectArrayElement( jpairs, nPos )); - if (JNI_FALSE != jni_env->ExceptionCheck()) + if (jni_env->ExceptionCheck()) { jni_env->ExceptionClear(); throw RuntimeException( "index out of bounds?!" ); @@ -87,7 +87,7 @@ jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap( OUString name( ::javaunohelper::jstring_to_oustring( jstr, jni_env ) ); // value jstr = static_cast<jstring>(jni_env->GetObjectArrayElement( jpairs, nPos +1 )); - if (JNI_FALSE != jni_env->ExceptionCheck()) + if (jni_env->ExceptionCheck()) { jni_env->ExceptionClear(); throw RuntimeException( "index out of bounds?!" ); diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index be3e41f898d2..8ccd0c108540 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -1248,14 +1248,14 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( jstring jsClass= static_cast<jstring>(pJNIEnv->CallObjectMethod( jcSec, jmName)); const jchar* jcharName= pJNIEnv->GetStringChars( jsClass, NULL); OUString sName( jcharName); - jboolean bIsSandbox; + bool bIsSandbox; if ( sName == "com.sun.star.lib.sandbox.SandboxSecurity" ) - bIsSandbox= JNI_TRUE; + bIsSandbox= true; else - bIsSandbox= JNI_FALSE; + bIsSandbox= false; pJNIEnv->ReleaseStringChars( jsClass, jcharName); - if (bIsSandbox == JNI_TRUE) + if (bIsSandbox) { // call SandboxSecurity.reset jmethodID jmReset= pJNIEnv->GetMethodID( jcSec,"reset","()V"); |