summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-06 22:55:00 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-07 14:42:07 +0100
commit25fb44265113c670ac3aaedb5a46c39a8c2895c8 (patch)
treeaa504bc3663d14a0369b934f916d3e49860b702b /bridges
parent7b1261f6f956271ec2a545f635e11432a5e64fa1 (diff)
loplugin:cstylecast: bridges
Change-Id: I7c41b90c9af045fd452ee62ed0c5d9b261236855
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx2
-rw-r--r--bridges/source/jni_uno/jni_bridge.cxx14
-rw-r--r--bridges/source/jni_uno/jni_data.cxx156
-rw-r--r--bridges/source/jni_uno/jni_info.cxx160
-rw-r--r--bridges/source/jni_uno/jni_java2uno.cxx6
-rw-r--r--bridges/source/jni_uno/jni_uno2java.cxx16
7 files changed, 178 insertions, 178 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
index 6dae025d3174..295596d154de 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
@@ -68,7 +68,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
// Get pointer to method
sal_uInt64 pMethod = *((sal_uInt64 *)pThis);
pMethod += 8 * nVtableIndex;
- data.pMethod = *((sal_uInt64 *)pMethod);
+ data.pMethod = *reinterpret_cast<sal_uInt64 *>(pMethod);
// Load parameters to stack, if necessary
sal_uInt64* pCallStack = NULL;
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index 3f5292d41388..c43e0f9ddf9d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -132,7 +132,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr)
std::type_info * base_rtti = getRTTI(
ctd.pBaseTypeDescription->aBase);
rtti = new __cxxabiv1::__si_class_type_info(
- strdup( rttiName ), (__cxxabiv1::__class_type_info *)base_rtti );
+ strdup( rttiName ), static_cast<__cxxabiv1::__class_type_info *>(base_rtti) );
}
else
{
diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx
index 7be6363123f7..e1026c59f9b0 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -298,7 +298,7 @@ void JNI_context::java_exc_occurred() const
JLocalAutoRef jo_Object( *this, jo_class );
// method Object.toString()
jmethodID method_Object_toString = m_env->GetMethodID(
- (jclass) jo_Object.get(), "toString", "()Ljava/lang/String;" );
+ static_cast<jclass>(jo_Object.get()), "toString", "()Ljava/lang/String;" );
if (JNI_FALSE != m_env->ExceptionCheck())
{
m_env->ExceptionClear();
@@ -319,12 +319,12 @@ void JNI_context::java_exc_occurred() const
get_stack_trace() );
}
- jsize len = m_env->GetStringLength( (jstring) jo_descr.get() );
+ jsize len = m_env->GetStringLength( static_cast<jstring>(jo_descr.get()) );
std::unique_ptr< rtl_mem > ustr_mem(
rtl_mem::allocate(
sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) );
rtl_uString * ustr = (rtl_uString *)ustr_mem.get();
- m_env->GetStringRegion( (jstring) jo_descr.get(), 0, len, ustr->buffer );
+ m_env->GetStringRegion( static_cast<jstring>(jo_descr.get()), 0, len, ustr->buffer );
if (m_env->ExceptionCheck())
{
m_env->ExceptionClear();
@@ -383,7 +383,7 @@ OUString JNI_context::get_stack_trace( jobject jo_exc ) const
{
// static method JNI_proxy.get_stack_trace()
jmethodID method = m_env->GetStaticMethodID(
- (jclass) jo_JNI_proxy.get(), "get_stack_trace",
+ static_cast<jclass>(jo_JNI_proxy.get()), "get_stack_trace",
"(Ljava/lang/Throwable;)Ljava/lang/String;" );
if (assert_no_exception() && (0 != method))
{
@@ -391,17 +391,17 @@ OUString JNI_context::get_stack_trace( jobject jo_exc ) const
arg.l = jo_exc;
JLocalAutoRef jo_stack_trace(
*this, m_env->CallStaticObjectMethodA(
- (jclass) jo_JNI_proxy.get(), method, &arg ) );
+ static_cast<jclass>(jo_JNI_proxy.get()), method, &arg ) );
if (assert_no_exception())
{
jsize len =
- m_env->GetStringLength( (jstring) jo_stack_trace.get() );
+ m_env->GetStringLength( static_cast<jstring>(jo_stack_trace.get()) );
std::unique_ptr< rtl_mem > ustr_mem(
rtl_mem::allocate(
sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) );
rtl_uString * ustr = (rtl_uString *)ustr_mem.get();
m_env->GetStringRegion(
- (jstring) jo_stack_trace.get(), 0, len, ustr->buffer );
+ static_cast<jstring>(jo_stack_trace.get()), 0, len, ustr->buffer );
if (assert_no_exception())
{
ustr->refCount = 1;
diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx
index 5e3730248453..6fa4d834ee75 100644
--- a/bridges/source/jni_uno/jni_data.cxx
+++ b/bridges/source/jni_uno/jni_data.cxx
@@ -217,7 +217,7 @@ void Bridge::map_to_uno(
{
assert(
!out_param ||
- (1 == jni->GetArrayLength( (jarray) java_data.l )) );
+ (1 == jni->GetArrayLength( static_cast<jarray>(java_data.l) )) );
switch (type->eTypeClass)
{
@@ -225,7 +225,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetCharArrayRegion(
- (jcharArray) java_data.l, 0, 1, (jchar *) uno_data );
+ static_cast<jcharArray>(java_data.l), 0, 1, (jchar *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -243,7 +243,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetBooleanArrayRegion(
- (jbooleanArray) java_data.l, 0, 1, (jboolean *) uno_data );
+ static_cast<jbooleanArray>(java_data.l), 0, 1, (jboolean *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -261,7 +261,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetByteArrayRegion(
- (jbyteArray) java_data.l, 0, 1, (jbyte *) uno_data );
+ static_cast<jbyteArray>(java_data.l), 0, 1, (jbyte *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -280,7 +280,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetShortArrayRegion(
- (jshortArray) java_data.l, 0, 1, (jshort *) uno_data );
+ static_cast<jshortArray>(java_data.l), 0, 1, (jshort *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -299,7 +299,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetIntArrayRegion(
- (jintArray) java_data.l, 0, 1, (jint *) uno_data );
+ static_cast<jintArray>(java_data.l), 0, 1, (jint *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -318,7 +318,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetLongArrayRegion(
- (jlongArray) java_data.l, 0, 1, (jlong *) uno_data );
+ static_cast<jlongArray>(java_data.l), 0, 1, (jlong *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -336,7 +336,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetFloatArrayRegion(
- (jfloatArray) java_data.l, 0, 1, (jfloat *) uno_data );
+ static_cast<jfloatArray>(java_data.l), 0, 1, (jfloat *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -354,7 +354,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jni->GetDoubleArrayRegion(
- (jdoubleArray) java_data.l, 0, 1, (jdouble *) uno_data );
+ static_cast<jdoubleArray>(java_data.l), 0, 1, (jdouble *) uno_data );
jni.ensure_no_exception();
}
else if (special_wrapped_integral_types)
@@ -374,7 +374,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -387,7 +387,7 @@ void Bridge::map_to_uno(
if (! assign)
*(rtl_uString **)uno_data = 0;
jstring_to_ustring(
- jni, (rtl_uString **)uno_data, (jstring) java_data.l );
+ jni, (rtl_uString **)uno_data, static_cast<jstring>(java_data.l) );
break;
}
case typelib_TypeClass_TYPE:
@@ -396,7 +396,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -419,7 +419,7 @@ void Bridge::map_to_uno(
+ jni.get_stack_trace() );
}
OUString type_name(
- jstring_to_oustring( jni, (jstring) jo_type_name.get() ) );
+ jstring_to_oustring( jni, static_cast<jstring>(jo_type_name.get()) ) );
::com::sun::star::uno::TypeDescription td( type_name );
if (! td.is())
{
@@ -443,7 +443,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -484,7 +484,7 @@ void Bridge::map_to_uno(
{
// create type out of class
JLocalAutoRef jo_class( jni, jni->GetObjectClass( java_data.l ) );
- jo_type.reset( create_type( jni, (jclass) jo_class.get() ) );
+ jo_type.reset( create_type( jni, static_cast<jclass>(jo_class.get()) ) );
}
// get type name
@@ -493,7 +493,7 @@ void Bridge::map_to_uno(
jo_type.get(), getJniInfo()->m_field_Type__typeName ) );
jni.ensure_no_exception();
OUString type_name(
- jstring_to_oustring( jni, (jstring) jo_type_name.get() ) );
+ jstring_to_oustring( jni, static_cast<jstring>(jo_type_name.get()) ) );
::com::sun::star::uno::TypeDescription value_td( type_name );
if (! value_td.is())
@@ -613,7 +613,7 @@ void Bridge::map_to_uno(
pAny->pData = &pAny->pReserved;
jstring_to_ustring(
jni, (rtl_uString **)pAny->pData,
- (jstring) java_data.l );
+ static_cast<jstring>(java_data.l) );
break;
case typelib_TypeClass_TYPE:
case typelib_TypeClass_ENUM:
@@ -664,7 +664,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -686,7 +686,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -955,7 +955,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -971,28 +971,28 @@ void Bridge::map_to_uno(
((typelib_IndirectTypeDescription *)td.get())->pType;
std::unique_ptr< rtl_mem > seq;
- sal_Int32 nElements = jni->GetArrayLength( (jarray) java_data.l );
+ sal_Int32 nElements = jni->GetArrayLength( static_cast<jarray>(java_data.l) );
switch (element_type->eTypeClass)
{
case typelib_TypeClass_CHAR:
seq.reset( seq_allocate( nElements, sizeof (sal_Unicode) ) );
jni->GetCharArrayRegion(
- (jcharArray) java_data.l, 0, nElements,
+ static_cast<jcharArray>(java_data.l), 0, nElements,
(jchar *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
case typelib_TypeClass_BOOLEAN:
seq.reset( seq_allocate( nElements, sizeof (sal_Bool) ) );
jni->GetBooleanArrayRegion(
- (jbooleanArray) java_data.l, 0, nElements,
+ static_cast<jbooleanArray>(java_data.l), 0, nElements,
(jboolean *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
case typelib_TypeClass_BYTE:
seq.reset( seq_allocate( nElements, sizeof (sal_Int8) ) );
jni->GetByteArrayRegion(
- (jbyteArray) java_data.l, 0, nElements,
+ static_cast<jbyteArray>(java_data.l), 0, nElements,
(jbyte *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
@@ -1000,7 +1000,7 @@ void Bridge::map_to_uno(
case typelib_TypeClass_UNSIGNED_SHORT:
seq.reset( seq_allocate( nElements, sizeof (sal_Int16) ) );
jni->GetShortArrayRegion(
- (jshortArray) java_data.l, 0, nElements,
+ static_cast<jshortArray>(java_data.l), 0, nElements,
(jshort *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
@@ -1008,7 +1008,7 @@ void Bridge::map_to_uno(
case typelib_TypeClass_UNSIGNED_LONG:
seq.reset( seq_allocate( nElements, sizeof (sal_Int32) ) );
jni->GetIntArrayRegion(
- (jintArray) java_data.l, 0, nElements,
+ static_cast<jintArray>(java_data.l), 0, nElements,
(jint *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
@@ -1016,21 +1016,21 @@ void Bridge::map_to_uno(
case typelib_TypeClass_UNSIGNED_HYPER:
seq.reset( seq_allocate( nElements, sizeof (sal_Int64) ) );
jni->GetLongArrayRegion(
- (jlongArray) java_data.l, 0, nElements,
+ static_cast<jlongArray>(java_data.l), 0, nElements,
(jlong *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
case typelib_TypeClass_FLOAT:
seq.reset( seq_allocate( nElements, sizeof (float) ) );
jni->GetFloatArrayRegion(
- (jfloatArray) java_data.l, 0, nElements,
+ static_cast<jfloatArray>(java_data.l), 0, nElements,
(jfloat *)((uno_Sequence *)seq.get())->elements );
jni.ensure_no_exception();
break;
case typelib_TypeClass_DOUBLE:
seq.reset( seq_allocate( nElements, sizeof (double) ) );
jni->GetDoubleArrayRegion(
- (jdoubleArray) java_data.l, 0, nElements,
+ static_cast<jdoubleArray>(java_data.l), 0, nElements,
(jdouble *) ((uno_Sequence *) seq.get())->elements );
jni.ensure_no_exception();
break;
@@ -1065,7 +1065,7 @@ void Bridge::map_to_uno(
{
JLocalAutoRef jo(
jni, jni->GetObjectArrayElement(
- (jobjectArray) java_data.l, nPos ) );
+ static_cast<jobjectArray>(java_data.l), nPos ) );
jni.ensure_no_exception();
jvalue val;
val.l = jo.get();
@@ -1113,7 +1113,7 @@ void Bridge::map_to_uno(
if (out_param)
{
jo_out_holder.reset(
- jni->GetObjectArrayElement( (jobjectArray) java_data.l, 0 ) );
+ jni->GetObjectArrayElement( static_cast<jobjectArray>(java_data.l), 0 ) );
jni.ensure_no_exception();
java_data.l = jo_out_holder.get();
}
@@ -1176,7 +1176,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetCharArrayRegion(
- (jcharArray) jo_ar.get(), 0, 1, (jchar *) uno_data );
+ static_cast<jcharArray>(jo_ar.get()), 0, 1, (jchar *) uno_data );
jni.ensure_no_exception();
}
java_data->l = jo_ar.release();
@@ -1186,7 +1186,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetCharArrayRegion(
- (jcharArray) java_data->l, 0, 1, (jchar *) uno_data );
+ static_cast<jcharArray>(java_data->l), 0, 1, (jchar *) uno_data );
jni.ensure_no_exception();
}
}
@@ -1215,7 +1215,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetBooleanArrayRegion(
- (jbooleanArray) jo_ar.get(),
+ static_cast<jbooleanArray>(jo_ar.get()),
0, 1, (jboolean *) uno_data );
jni.ensure_no_exception();
}
@@ -1226,7 +1226,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetBooleanArrayRegion(
- (jbooleanArray) java_data->l,
+ static_cast<jbooleanArray>(java_data->l),
0, 1, (jboolean *) uno_data );
jni.ensure_no_exception();
}
@@ -1256,7 +1256,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetByteArrayRegion(
- (jbyteArray) jo_ar.get(), 0, 1, (jbyte *) uno_data );
+ static_cast<jbyteArray>(jo_ar.get()), 0, 1, (jbyte *) uno_data );
jni.ensure_no_exception();
}
java_data->l = jo_ar.release();
@@ -1266,7 +1266,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetByteArrayRegion(
- (jbyteArray) java_data->l, 0, 1, (jbyte *) uno_data );
+ static_cast<jbyteArray>(java_data->l), 0, 1, (jbyte *) uno_data );
jni.ensure_no_exception();
}
}
@@ -1296,7 +1296,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetShortArrayRegion(
- (jshortArray) jo_ar.get(), 0, 1, (jshort *) uno_data );
+ static_cast<jshortArray>(jo_ar.get()), 0, 1, (jshort *) uno_data );
jni.ensure_no_exception();
}
java_data->l = jo_ar.release();
@@ -1306,7 +1306,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetShortArrayRegion(
- (jshortArray) java_data->l, 0, 1, (jshort *) uno_data );
+ static_cast<jshortArray>(java_data->l), 0, 1, (jshort *) uno_data );
jni.ensure_no_exception();
}
}
@@ -1336,7 +1336,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetIntArrayRegion(
- (jintArray) jo_ar.get(), 0, 1, (jint *) uno_data );
+ static_cast<jintArray>(jo_ar.get()), 0, 1, (jint *) uno_data );
jni.ensure_no_exception();
}
java_data->l = jo_ar.release();
@@ -1346,7 +1346,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetIntArrayRegion(
- (jintArray) java_data->l, 0, 1, (jint *) uno_data );
+ static_cast<jintArray>(java_data->l), 0, 1, (jint *) uno_data );
jni.ensure_no_exception();
}
}
@@ -1376,7 +1376,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetLongArrayRegion(
- (jlongArray)jo_ar.get(), 0, 1, (jlong *) uno_data );
+ static_cast<jlongArray>(jo_ar.get()), 0, 1, (jlong *) uno_data );
jni.ensure_no_exception();
}
java_data->l = jo_ar.release();
@@ -1386,7 +1386,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetLongArrayRegion(
- (jlongArray)java_data->l, 0, 1, (jlong *) uno_data );
+ static_cast<jlongArray>(java_data->l), 0, 1, (jlong *) uno_data );
jni.ensure_no_exception();
}
}
@@ -1415,7 +1415,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetFloatArrayRegion(
- (jfloatArray) jo_ar.get(), 0, 1, (jfloat *) uno_data );
+ static_cast<jfloatArray>(jo_ar.get()), 0, 1, (jfloat *) uno_data );
jni.ensure_no_exception();
}
java_data->l = jo_ar.release();
@@ -1425,7 +1425,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetFloatArrayRegion(
- (jfloatArray) java_data->l, 0, 1, (jfloat *) uno_data );
+ static_cast<jfloatArray>(java_data->l), 0, 1, (jfloat *) uno_data );
jni.ensure_no_exception();
}
}
@@ -1454,7 +1454,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetDoubleArrayRegion(
- (jdoubleArray) jo_ar.get(),
+ static_cast<jdoubleArray>(jo_ar.get()),
0, 1, (jdouble *) uno_data );
jni.ensure_no_exception();
}
@@ -1465,7 +1465,7 @@ void Bridge::map_to_java(
if (in_param)
{
jni->SetDoubleArrayRegion(
- (jdoubleArray) java_data->l,
+ static_cast<jdoubleArray>(java_data->l),
0, 1, (jdouble *) uno_data );
jni.ensure_no_exception();
}
@@ -1505,7 +1505,7 @@ void Bridge::map_to_java(
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_in.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_in.get() );
jni.ensure_no_exception();
}
}
@@ -1539,7 +1539,7 @@ void Bridge::map_to_java(
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_in.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_in.get() );
jni.ensure_no_exception();
}
}
@@ -1761,7 +1761,7 @@ void Bridge::map_to_java(
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_any.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_any.get() );
jni.ensure_no_exception();
}
}
@@ -1789,7 +1789,7 @@ void Bridge::map_to_java(
sig_buf.append( ';' );
OString sig( sig_buf.makeStringAndClear() );
jmethodID method_id = jni->GetStaticMethodID(
- (jclass) jo_enum_class.get(), "fromInt", sig.getStr() );
+ static_cast<jclass>(jo_enum_class.get()), "fromInt", sig.getStr() );
jni.ensure_no_exception();
assert( 0 != method_id );
@@ -1797,7 +1797,7 @@ void Bridge::map_to_java(
arg.i = *(jint const *) uno_data;
jo_enum.reset(
jni->CallStaticObjectMethodA(
- (jclass) jo_enum_class.get(), method_id, &arg ) );
+ static_cast<jclass>(jo_enum_class.get()), method_id, &arg ) );
jni.ensure_no_exception();
}
if (out_param)
@@ -1805,13 +1805,13 @@ void Bridge::map_to_java(
if (0 == java_data->l)
{
java_data->l = jni->NewObjectArray(
- 1, (jclass) jo_enum_class.get(), jo_enum.get() );
+ 1, static_cast<jclass>(jo_enum_class.get()), jo_enum.get() );
jni.ensure_no_exception();
}
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_enum.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_enum.get() );
jni.ensure_no_exception();
}
}
@@ -2069,7 +2069,7 @@ void Bridge::map_to_java(
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_comp.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_comp.get() );
jni.ensure_no_exception();
}
}
@@ -2108,7 +2108,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetCharArrayRegion(
- (jcharArray) jo_ar.get(),
+ static_cast<jcharArray>(jo_ar.get()),
0, nElements, (jchar *) seq->elements );
jni.ensure_no_exception();
}
@@ -2119,7 +2119,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetBooleanArrayRegion(
- (jbooleanArray) jo_ar.get(),
+ static_cast<jbooleanArray>(jo_ar.get()),
0, nElements, (jboolean *) seq->elements );
jni.ensure_no_exception();
}
@@ -2130,7 +2130,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetByteArrayRegion(
- (jbyteArray) jo_ar.get(),
+ static_cast<jbyteArray>(jo_ar.get()),
0, nElements, (jbyte *) seq->elements );
jni.ensure_no_exception();
}
@@ -2142,7 +2142,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetShortArrayRegion(
- (jshortArray) jo_ar.get(),
+ static_cast<jshortArray>(jo_ar.get()),
0, nElements, (jshort *) seq->elements );
jni.ensure_no_exception();
}
@@ -2154,7 +2154,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetIntArrayRegion(
- (jintArray) jo_ar.get(),
+ static_cast<jintArray>(jo_ar.get()),
0, nElements, (jint *) seq->elements );
jni.ensure_no_exception();
}
@@ -2166,7 +2166,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetLongArrayRegion(
- (jlongArray) jo_ar.get(),
+ static_cast<jlongArray>(jo_ar.get()),
0, nElements, (jlong *) seq->elements );
jni.ensure_no_exception();
}
@@ -2177,7 +2177,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetFloatArrayRegion(
- (jfloatArray) jo_ar.get(),
+ static_cast<jfloatArray>(jo_ar.get()),
0, nElements, (jfloat *) seq->elements );
jni.ensure_no_exception();
}
@@ -2188,7 +2188,7 @@ void Bridge::map_to_java(
if (0 < nElements)
{
jni->SetDoubleArrayRegion(
- (jdoubleArray) jo_ar.get(),
+ static_cast<jdoubleArray>(jo_ar.get()),
0, nElements, (jdouble *) seq->elements );
jni.ensure_no_exception();
}
@@ -2207,7 +2207,7 @@ void Bridge::map_to_java(
JLocalAutoRef jo_string(
jni, ustring_to_jstring( jni, pp[ nPos ] ) );
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(), nPos, jo_string.get() );
+ static_cast<jobjectArray>(jo_ar.get()), nPos, jo_string.get() );
jni.ensure_no_exception();
}
}
@@ -2228,7 +2228,7 @@ void Bridge::map_to_java(
true /* in */, false /* no out */ );
JLocalAutoRef jo_element( jni, val.l );
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(), nPos, jo_element.get() );
+ static_cast<jobjectArray>(jo_ar.get()), nPos, jo_element.get() );
jni.ensure_no_exception();
}
}
@@ -2249,7 +2249,7 @@ void Bridge::map_to_java(
true /* in */, false /* no out */ );
JLocalAutoRef jo_element( jni, val.l );
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(), nPos, jo_element.get() );
+ static_cast<jobjectArray>(jo_ar.get()), nPos, jo_element.get() );
jni.ensure_no_exception();
}
}
@@ -2266,7 +2266,7 @@ void Bridge::map_to_java(
jo_ar.reset(
jni->NewObjectArray(
- nElements, (jclass) jo_enum_class.get(), 0 ) );
+ nElements, static_cast<jclass>(jo_enum_class.get()), 0 ) );
jni.ensure_no_exception();
if (0 < nElements)
@@ -2278,7 +2278,7 @@ void Bridge::map_to_java(
sig_buf.append( ';' );
OString sig( sig_buf.makeStringAndClear() );
jmethodID method_id = jni->GetStaticMethodID(
- (jclass) jo_enum_class.get(), "fromInt", sig.getStr() );
+ static_cast<jclass>(jo_enum_class.get()), "fromInt", sig.getStr() );
jni.ensure_no_exception();
assert( 0 != method_id );
@@ -2289,10 +2289,10 @@ void Bridge::map_to_java(
arg.i = p[ nPos ];
JLocalAutoRef jo_enum(
jni, jni->CallStaticObjectMethodA(
- (jclass) jo_enum_class.get(), method_id, &arg ) );
+ static_cast<jclass>(jo_enum_class.get()), method_id, &arg ) );
jni.ensure_no_exception();
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(), nPos, jo_enum.get() );
+ static_cast<jobjectArray>(jo_ar.get()), nPos, jo_enum.get() );
jni.ensure_no_exception();
}
}
@@ -2321,7 +2321,7 @@ void Bridge::map_to_java(
true /* in */, false /* no out */ );
JLocalAutoRef jo_element( jni, val.l );
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(), nPos, jo_element.get() );
+ static_cast<jobjectArray>(jo_ar.get()), nPos, jo_element.get() );
jni.ensure_no_exception();
}
}
@@ -2339,7 +2339,7 @@ void Bridge::map_to_java(
jo_ar.reset(
jni->NewObjectArray(
- nElements, (jclass) jo_seq_class.get(), 0 ) );
+ nElements, static_cast<jclass>(jo_seq_class.get()), 0 ) );
jni.ensure_no_exception();
if (0 < nElements)
@@ -2354,7 +2354,7 @@ void Bridge::map_to_java(
true /* in */, false /* no out */ );
JLocalAutoRef jo_seq( jni, java_data2.l );
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(), nPos, jo_seq.get() );
+ static_cast<jobjectArray>(jo_ar.get()), nPos, jo_seq.get() );
jni.ensure_no_exception();
}
}
@@ -2381,7 +2381,7 @@ void Bridge::map_to_java(
JLocalAutoRef jo_element(
jni, map_to_java( jni, pUnoI, iface_info ) );
jni->SetObjectArrayElement(
- (jobjectArray) jo_ar.get(),
+ static_cast<jobjectArray>(jo_ar.get()),
nPos, jo_element.get() );
jni.ensure_no_exception();
}
@@ -2408,19 +2408,19 @@ void Bridge::map_to_java(
if (in_param)
{
java_data->l = jni->NewObjectArray(
- 1, (jclass) jo_element_class.get(), jo_ar.get() );
+ 1, static_cast<jclass>(jo_element_class.get()), jo_ar.get() );
}
else
{
java_data->l = jni->NewObjectArray(
- 1, (jclass) jo_element_class.get(), 0 );
+ 1, static_cast<jclass>(jo_element_class.get()), 0 );
}
jni.ensure_no_exception();
}
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_ar.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_ar.get() );
jni.ensure_no_exception();
}
}
@@ -2458,7 +2458,7 @@ void Bridge::map_to_java(
else
{
jni->SetObjectArrayElement(
- (jobjectArray) java_data->l, 0, jo_iface.get() );
+ static_cast<jobjectArray>(java_data->l), 0, jo_iface.get() );
jni.ensure_no_exception();
}
}
diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx
index 84ac6aaadd3f..6db961caffc6 100644
--- a/bridges/source/jni_uno/jni_info.cxx
+++ b/bridges/source/jni_uno/jni_info.cxx
@@ -82,7 +82,7 @@ JNI_interface_type_info::JNI_interface_type_info(
jni,
( OUStringToOString( uno_name, RTL_TEXTENCODING_JAVA_UTF8 ).
getStr() ) ) );
- JLocalAutoRef jo_type( jni, create_type( jni, (jclass) jo_class.get() ) );
+ JLocalAutoRef jo_type( jni, create_type( jni, static_cast<jclass>(jo_class.get()) ) );
// get proxy ctor
jvalue arg;
@@ -143,7 +143,7 @@ JNI_interface_type_info::JNI_interface_type_info(
RTL_TEXTENCODING_JAVA_UTF8 ) );
m_methods[ nMethodIndex ] = jni->GetMethodID(
- (jclass) jo_class.get(), method_name.getStr(),
+ static_cast<jclass>(jo_class.get()), method_name.getStr(),
method_signature.getStr() );
jni.ensure_no_exception();
assert( 0 != m_methods[ nMethodIndex ] );
@@ -181,7 +181,7 @@ JNI_interface_type_info::JNI_interface_type_info(
name_buf.makeStringAndClear(),
RTL_TEXTENCODING_JAVA_UTF8 ) );
m_methods[ nMethodIndex ] = jni->GetMethodID(
- (jclass) jo_class.get(), method_name.getStr(),
+ static_cast<jclass>(jo_class.get()), method_name.getStr(),
method_signature.getStr() );
jni.ensure_no_exception();
assert( 0 != m_methods[ nMethodIndex ] );
@@ -201,7 +201,7 @@ JNI_interface_type_info::JNI_interface_type_info(
name_buf.makeStringAndClear(),
RTL_TEXTENCODING_JAVA_UTF8 );
m_methods[ nMethodIndex ] = jni->GetMethodID(
- (jclass) jo_class.get(), method_name.getStr(),
+ static_cast<jclass>(jo_class.get()), method_name.getStr(),
method_signature.getStr() );
jni.ensure_no_exception();
assert( 0 != m_methods[ nMethodIndex ] );
@@ -216,7 +216,7 @@ JNI_interface_type_info::JNI_interface_type_info(
throw;
}
}
- m_class = (jclass) jni->NewGlobalRef( jo_class.get() );
+ m_class = static_cast<jclass>(jni->NewGlobalRef( jo_class.get() ));
m_type = jni->NewGlobalRef( jo_type.get() );
m_proxy_ctor = jni->NewGlobalRef( jo_proxy_ctor.get() );
}
@@ -266,7 +266,7 @@ JNI_compound_type_info::JNI_compound_type_info(
{
// retrieve exc ctor( msg )
m_exc_ctor = jni->GetMethodID(
- (jclass) jo_class.get(), "<init>", "(Ljava/lang/String;)V" );
+ static_cast<jclass>(jo_class.get()), "<init>", "(Ljava/lang/String;)V" );
jni.ensure_no_exception();
assert( 0 != m_exc_ctor );
}
@@ -295,7 +295,7 @@ JNI_compound_type_info::JNI_compound_type_info(
m_fields[ 0 ] = 0; // special Throwable.getMessage()
// field Context
m_fields[ 1 ] = jni->GetFieldID(
- (jclass) jo_class.get(), "Context", "Ljava/lang/Object;" );
+ static_cast<jclass>(jo_class.get()), "Context", "Ljava/lang/Object;" );
jni.ensure_no_exception();
assert( 0 != m_fields[ 1 ] );
}
@@ -327,7 +327,7 @@ JNI_compound_type_info::JNI_compound_type_info(
RTL_TEXTENCODING_JAVA_UTF8 ) );
m_fields[ nPos ] = jni->GetFieldID(
- (jclass) jo_class.get(), member_name.getStr(),
+ static_cast<jclass>(jo_class.get()), member_name.getStr(),
sig.getStr() );
jni.ensure_no_exception();
assert( 0 != m_fields[ nPos ] );
@@ -340,7 +340,7 @@ JNI_compound_type_info::JNI_compound_type_info(
throw;
}
- m_class = (jclass) jni->NewGlobalRef( jo_class.get() );
+ m_class = static_cast<jclass>(jni->NewGlobalRef( jo_class.get() ));
}
@@ -542,112 +542,112 @@ JNI_info::JNI_info(
// method Object.toString()
m_method_Object_toString = jni->GetMethodID(
- (jclass) jo_Object.get(), "toString", "()Ljava/lang/String;" );
+ static_cast<jclass>(jo_Object.get()), "toString", "()Ljava/lang/String;" );
jni.ensure_no_exception();
assert( 0 != m_method_Object_toString );
// method Class.getName()
m_method_Class_getName = jni->GetMethodID(
- (jclass) jo_Class.get(), "getName", "()Ljava/lang/String;" );
+ static_cast<jclass>(jo_Class.get()), "getName", "()Ljava/lang/String;" );
jni.ensure_no_exception();
assert( 0 != m_method_Class_getName );
// method Throwable.getMessage()
m_method_Throwable_getMessage = jni->GetMethodID(
- (jclass) jo_Throwable.get(), "getMessage", "()Ljava/lang/String;" );
+ static_cast<jclass>(jo_Throwable.get()), "getMessage", "()Ljava/lang/String;" );
jni.ensure_no_exception();
assert( 0 != m_method_Throwable_getMessage );
// method Character.charValue()
m_method_Character_charValue = jni->GetMethodID(
- (jclass) jo_Character.get(), "charValue", "()C" );
+ static_cast<jclass>(jo_Character.get()), "charValue", "()C" );
jni.ensure_no_exception();
assert( 0 != m_method_Character_charValue );
// method Boolean.booleanValue()
m_method_Boolean_booleanValue = jni->GetMethodID(
- (jclass) jo_Boolean.get(), "booleanValue", "()Z" );
+ static_cast<jclass>(jo_Boolean.get()), "booleanValue", "()Z" );
jni.ensure_no_exception();
assert( 0 != m_method_Boolean_booleanValue );
// method Byte.byteValue()
m_method_Byte_byteValue = jni->GetMethodID(
- (jclass) jo_Byte.get(), "byteValue", "()B" );
+ static_cast<jclass>(jo_Byte.get()), "byteValue", "()B" );
jni.ensure_no_exception();
assert( 0 != m_method_Byte_byteValue );
// method Short.shortValue()
m_method_Short_shortValue = jni->GetMethodID(
- (jclass) jo_Short.get(), "shortValue", "()S" );
+ static_cast<jclass>(jo_Short.get()), "shortValue", "()S" );
jni.ensure_no_exception();
assert( 0 != m_method_Short_shortValue );
// method Integer.intValue()
m_method_Integer_intValue = jni->GetMethodID(
- (jclass) jo_Integer.get(), "intValue", "()I" );
+ static_cast<jclass>(jo_Integer.get()), "intValue", "()I" );
jni.ensure_no_exception();
assert( 0 != m_method_Integer_intValue );
// method Long.longValue()
m_method_Long_longValue = jni->GetMethodID(
- (jclass) jo_Long.get(), "longValue", "()J" );
+ static_cast<jclass>(jo_Long.get()), "longValue", "()J" );
jni.ensure_no_exception();
assert( 0 != m_method_Long_longValue );
// method Float.floatValue()
m_method_Float_floatValue = jni->GetMethodID(
- (jclass) jo_Float.get(), "floatValue", "()F" );
+ static_cast<jclass>(jo_Float.get()), "floatValue", "()F" );
jni.ensure_no_exception();
assert( 0 != m_method_Float_floatValue );
// method Double.doubleValue()
m_method_Double_doubleValue = jni->GetMethodID(
- (jclass) jo_Double.get(), "doubleValue", "()D" );
+ static_cast<jclass>(jo_Double.get()), "doubleValue", "()D" );
jni.ensure_no_exception();
assert( 0 != m_method_Double_doubleValue );
// ctor Character( char )
m_ctor_Character_with_char = jni->GetMethodID(
- (jclass) jo_Character.get(), "<init>", "(C)V" );
+ static_cast<jclass>(jo_Character.get()), "<init>", "(C)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Character_with_char );
// ctor Boolean( boolean )
m_ctor_Boolean_with_boolean = jni->GetMethodID(
- (jclass) jo_Boolean.get(), "<init>", "(Z)V" );
+ static_cast<jclass>(jo_Boolean.get()), "<init>", "(Z)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Boolean_with_boolean );
// ctor Byte( byte )
m_ctor_Byte_with_byte = jni->GetMethodID(
- (jclass) jo_Byte.get(), "<init>", "(B)V" );
+ static_cast<jclass>(jo_Byte.get()), "<init>", "(B)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Byte_with_byte );
// ctor Short( short )
m_ctor_Short_with_short = jni->GetMethodID(
- (jclass) jo_Short.get(), "<init>", "(S)V" );
+ static_cast<jclass>(jo_Short.get()), "<init>", "(S)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Short_with_short );
// ctor Integer( int )
m_ctor_Integer_with_int = jni->GetMethodID(
- (jclass) jo_Integer.get(), "<init>", "(I)V" );
+ static_cast<jclass>(jo_Integer.get()), "<init>", "(I)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Integer_with_int );
// ctor Long( long )
m_ctor_Long_with_long = jni->GetMethodID(
- (jclass) jo_Long.get(), "<init>", "(J)V" );
+ static_cast<jclass>(jo_Long.get()), "<init>", "(J)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Long_with_long );
// ctor Float( float )
m_ctor_Float_with_float = jni->GetMethodID(
- (jclass) jo_Float.get(), "<init>", "(F)V" );
+ static_cast<jclass>(jo_Float.get()), "<init>", "(F)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Float_with_float );
// ctor Double( double )
m_ctor_Double_with_double = jni->GetMethodID(
- (jclass) jo_Double.get(), "<init>", "(D)V" );
+ static_cast<jclass>(jo_Double.get()), "<init>", "(D)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Double_with_double );
// static method UnoRuntime.generateOid()
m_method_UnoRuntime_generateOid = jni->GetStaticMethodID(
- (jclass) jo_UnoRuntime.get(),
+ static_cast<jclass>(jo_UnoRuntime.get()),
"generateOid", "(Ljava/lang/Object;)Ljava/lang/String;" );
jni.ensure_no_exception();
assert( 0 != m_method_UnoRuntime_generateOid );
// static method UnoRuntime.queryInterface()
m_method_UnoRuntime_queryInterface = jni->GetStaticMethodID(
- (jclass) jo_UnoRuntime.get(),
+ static_cast<jclass>(jo_UnoRuntime.get()),
"queryInterface",
"(Lcom/sun/star/uno/Type;Ljava/lang/Object;)Ljava/lang/Object;" );
jni.ensure_no_exception();
@@ -655,62 +655,62 @@ JNI_info::JNI_info(
// field Enum.m_value
m_field_Enum_m_value = jni->GetFieldID(
- (jclass) jo_Enum.get(), "m_value", "I" );
+ static_cast<jclass>(jo_Enum.get()), "m_value", "I" );
jni.ensure_no_exception();
assert( 0 != m_field_Enum_m_value );
// static method TypeClass.fromInt()
m_method_TypeClass_fromInt = jni->GetStaticMethodID(
- (jclass) jo_TypeClass.get(),
+ static_cast<jclass>(jo_TypeClass.get()),
"fromInt", "(I)Lcom/sun/star/uno/TypeClass;" );
jni.ensure_no_exception();
assert( 0 != m_method_TypeClass_fromInt );
// ctor Type( Class )
m_ctor_Type_with_Class = jni->GetMethodID(
- (jclass) jo_Type.get(), "<init>", "(Ljava/lang/Class;)V" );
+ static_cast<jclass>(jo_Type.get()), "<init>", "(Ljava/lang/Class;)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Type_with_Class );
// ctor Type( String, TypeClass )
m_ctor_Type_with_Name_TypeClass = jni->GetMethodID(
- (jclass) jo_Type.get(),
+ static_cast<jclass>(jo_Type.get()),
"<init>", "(Ljava/lang/String;Lcom/sun/star/uno/TypeClass;)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Type_with_Name_TypeClass );
// field Type._typeName
m_field_Type__typeName = jni->GetFieldID(
- (jclass) jo_Type.get(), "_typeName", "Ljava/lang/String;" );
+ static_cast<jclass>(jo_Type.get()), "_typeName", "Ljava/lang/String;" );
jni.ensure_no_exception();
assert( 0 != m_field_Type__typeName );
// ctor Any( Type, Object )
m_ctor_Any_with_Type_Object = jni->GetMethodID(
- (jclass) jo_Any.get(),
+ static_cast<jclass>(jo_Any.get()),
"<init>", "(Lcom/sun/star/uno/Type;Ljava/lang/Object;)V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_Any_with_Type_Object );
// field Any._type
m_field_Any__type = jni->GetFieldID(
- (jclass) jo_Any.get(), "_type", "Lcom/sun/star/uno/Type;" );
+ static_cast<jclass>(jo_Any.get()), "_type", "Lcom/sun/star/uno/Type;" );
jni.ensure_no_exception();
assert( 0 != m_field_Any__type );
// field Any._object
m_field_Any__object = jni->GetFieldID(
- (jclass) jo_Any.get(), "_object", "Ljava/lang/Object;" );
+ static_cast<jclass>(jo_Any.get()), "_object", "Ljava/lang/Object;" );
jni.ensure_no_exception();
assert( 0 != m_field_Any__object );
// method IEnvironment.getRegisteredInterface()
m_method_IEnvironment_getRegisteredInterface = jni->GetMethodID(
- (jclass) jo_IEnvironment.get(),
+ static_cast<jclass>(jo_IEnvironment.get()),
"getRegisteredInterface",
"(Ljava/lang/String;Lcom/sun/star/uno/Type;)Ljava/lang/Object;" );
jni.ensure_no_exception();
assert( 0 != m_method_IEnvironment_getRegisteredInterface );
// method IEnvironment.registerInterface()
m_method_IEnvironment_registerInterface = jni->GetMethodID(
- (jclass) jo_IEnvironment.get(), "registerInterface",
+ static_cast<jclass>(jo_IEnvironment.get()), "registerInterface",
"(Ljava/lang/Object;[Ljava/lang/String;Lcom/sun/star/uno/Type;)"
"Ljava/lang/Object;" );
jni.ensure_no_exception();
@@ -718,13 +718,13 @@ JNI_info::JNI_info(
// static method JNI_proxy.get_proxy_ctor()
m_method_JNI_proxy_get_proxy_ctor = jni->GetStaticMethodID(
- (jclass) jo_JNI_proxy.get(), "get_proxy_ctor",
+ static_cast<jclass>(jo_JNI_proxy.get()), "get_proxy_ctor",
"(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;" );
jni.ensure_no_exception();
assert( 0 != m_method_JNI_proxy_get_proxy_ctor );
// static method JNI_proxy.create()
m_method_JNI_proxy_create = jni->GetStaticMethodID(
- (jclass) jo_JNI_proxy.get(), "create",
+ static_cast<jclass>(jo_JNI_proxy.get()), "create",
"(JLcom/sun/star/uno/IEnvironment;JJLcom/sun/star/uno/Type;Ljava/lang"
"/String;Ljava/lang/reflect/Constructor;"
"Lcom/sun/star/lib/util/AsynchronousFinalizer;)Ljava/lang/Object;" );
@@ -732,33 +732,33 @@ JNI_info::JNI_info(
assert( 0 != m_method_JNI_proxy_create );
// field JNI_proxy.m_receiver_handle
m_field_JNI_proxy_m_receiver_handle = jni->GetFieldID(
- (jclass) jo_JNI_proxy.get(), "m_receiver_handle", "J" );
+ static_cast<jclass>(jo_JNI_proxy.get()), "m_receiver_handle", "J" );
jni.ensure_no_exception();
assert( 0 != m_field_JNI_proxy_m_receiver_handle );
// field JNI_proxy.m_td_handle
m_field_JNI_proxy_m_td_handle = jni->GetFieldID(
- (jclass) jo_JNI_proxy.get(), "m_td_handle", "J" );
+ static_cast<jclass>(jo_JNI_proxy.get()), "m_td_handle", "J" );
jni.ensure_no_exception();
assert( 0 != m_field_JNI_proxy_m_td_handle );
// field JNI_proxy.m_type
m_field_JNI_proxy_m_type = jni->GetFieldID(
- (jclass) jo_JNI_proxy.get(), "m_type", "Lcom/sun/star/uno/Type;" );
+ static_cast<jclass>(jo_JNI_proxy.get()), "m_type", "Lcom/sun/star/uno/Type;" );
jni.ensure_no_exception();
assert( 0 != m_field_JNI_proxy_m_type );
// field JNI_proxy.m_oid
m_field_JNI_proxy_m_oid = jni->GetFieldID(
- (jclass) jo_JNI_proxy.get(), "m_oid", "Ljava/lang/String;" );
+ static_cast<jclass>(jo_JNI_proxy.get()), "m_oid", "Ljava/lang/String;" );
jni.ensure_no_exception();
assert( 0 != m_field_JNI_proxy_m_oid );
// ctor AsynchronousFinalizer
m_ctor_AsynchronousFinalizer = jni->GetMethodID(
- (jclass) jo_AsynchronousFinalizer.get(), "<init>", "()V" );
+ static_cast<jclass>(jo_AsynchronousFinalizer.get()), "<init>", "()V" );
jni.ensure_no_exception();
assert( 0 != m_ctor_AsynchronousFinalizer );
// method AsynchronousFinalizer.drain()
m_method_AsynchronousFinalizer_drain = jni->GetMethodID(
- (jclass) jo_AsynchronousFinalizer.get(), "drain", "()V" );
+ static_cast<jclass>(jo_AsynchronousFinalizer.get()), "drain", "()V" );
jni.ensure_no_exception();
assert( 0 != m_method_AsynchronousFinalizer_drain );
@@ -770,86 +770,86 @@ JNI_info::JNI_info(
args[ 0 ].l = jo_java.get();
args[ 1 ].l = 0;
jmethodID method_getEnvironment = jni->GetStaticMethodID(
- (jclass) jo_UnoRuntime.get(), "getEnvironment",
+ static_cast<jclass>(jo_UnoRuntime.get()), "getEnvironment",
"(Ljava/lang/String;Ljava/lang/Object;)"
"Lcom/sun/star/uno/IEnvironment;" );
jni.ensure_no_exception();
assert( 0 != method_getEnvironment );
JLocalAutoRef jo_java_env(
jni, jni->CallStaticObjectMethodA(
- (jclass) jo_UnoRuntime.get(), method_getEnvironment, args ) );
+ static_cast<jclass>(jo_UnoRuntime.get()), method_getEnvironment, args ) );
// get com.sun.star.uno.Any.VOID
jfieldID field_Any_VOID = jni->GetStaticFieldID(
- (jclass) jo_Any.get(), "VOID", "Lcom/sun/star/uno/Any;" );
+ static_cast<jclass>(jo_Any.get()), "VOID", "Lcom/sun/star/uno/Any;" );
jni.ensure_no_exception();
assert( 0 != field_Any_VOID );
JLocalAutoRef jo_Any_VOID(
jni, jni->GetStaticObjectField(
- (jclass) jo_Any.get(), field_Any_VOID ) );
+ static_cast<jclass>(jo_Any.get()), field_Any_VOID ) );
// get com.sun.star.uno.Type.UNSIGNED_SHORT
jfieldID field_Type_UNSIGNED_SHORT = jni->GetStaticFieldID(
- (jclass) jo_Type.get(), "UNSIGNED_SHORT", "Lcom/sun/star/uno/Type;" );
+ static_cast<jclass>(jo_Type.get()), "UNSIGNED_SHORT", "Lcom/sun/star/uno/Type;" );
jni.ensure_no_exception();
assert( 0 != field_Type_UNSIGNED_SHORT );
JLocalAutoRef jo_Type_UNSIGNED_SHORT(
jni, jni->GetStaticObjectField(
- (jclass) jo_Type.get(), field_Type_UNSIGNED_SHORT ) );
+ static_cast<jclass>(jo_Type.get()), field_Type_UNSIGNED_SHORT ) );
// get com.sun.star.uno.Type.UNSIGNED_LONG
jfieldID field_Type_UNSIGNED_LONG = jni->GetStaticFieldID(
- (jclass) jo_Type.get(), "UNSIGNED_LONG", "Lcom/sun/star/uno/Type;" );
+ static_cast<jclass>(jo_Type.get()), "UNSIGNED_LONG", "Lcom/sun/star/uno/Type;" );
jni.ensure_no_exception();
assert( 0 != field_Type_UNSIGNED_LONG );
JLocalAutoRef jo_Type_UNSIGNED_LONG(
jni, jni->GetStaticObjectField(
- (jclass) jo_Type.get(), field_Type_UNSIGNED_LONG ) );
+ static_cast<jclass>(jo_Type.get()), field_Type_UNSIGNED_LONG ) );
// get com.sun.star.uno.Type.UNSIGNED_HYPER
jfieldID field_Type_UNSIGNED_HYPER = jni->GetStaticFieldID(
- (jclass) jo_Type.get(), "UNSIGNED_HYPER", "Lcom/sun/star/uno/Type;" );
+ static_cast<jclass>(jo_Type.get()), "UNSIGNED_HYPER", "Lcom/sun/star/uno/Type;" );
jni.ensure_no_exception();
assert( 0 != field_Type_UNSIGNED_HYPER );
JLocalAutoRef jo_Type_UNSIGNED_HYPER(
jni, jni->GetStaticObjectField(
- (jclass) jo_Type.get(), field_Type_UNSIGNED_HYPER ) );
+ static_cast<jclass>(jo_Type.get()), field_Type_UNSIGNED_HYPER ) );
// make global refs
m_class_UnoRuntime =
- (jclass) jni->NewGlobalRef( jo_UnoRuntime.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_UnoRuntime.get() ));
m_class_RuntimeException =
- (jclass) jni->NewGlobalRef( jo_RuntimeException.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_RuntimeException.get() ));
m_class_Any =
- (jclass) jni->NewGlobalRef( jo_Any.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Any.get() ));
m_class_Type =
- (jclass) jni->NewGlobalRef( jo_Type.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Type.get() ));
m_class_TypeClass =
- (jclass) jni->NewGlobalRef( jo_TypeClass.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_TypeClass.get() ));
m_class_JNI_proxy =
- (jclass) jni->NewGlobalRef( jo_JNI_proxy.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_JNI_proxy.get() ));
m_class_AsynchronousFinalizer =
- (jclass) jni->NewGlobalRef( jo_AsynchronousFinalizer.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_AsynchronousFinalizer.get() ));
m_class_Character =
- (jclass) jni->NewGlobalRef( jo_Character.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Character.get() ));
m_class_Boolean =
- (jclass) jni->NewGlobalRef( jo_Boolean.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Boolean.get() ));
m_class_Byte =
- (jclass) jni->NewGlobalRef( jo_Byte.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Byte.get() ));
m_class_Short =
- (jclass) jni->NewGlobalRef( jo_Short.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Short.get() ));
m_class_Integer =
- (jclass) jni->NewGlobalRef( jo_Integer.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Integer.get() ));
m_class_Long =
- (jclass) jni->NewGlobalRef( jo_Long.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Long.get() ));
m_class_Float =
- (jclass) jni->NewGlobalRef( jo_Float.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Float.get() ));
m_class_Double =
- (jclass) jni->NewGlobalRef( jo_Double.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Double.get() ));
m_class_String =
- (jclass) jni->NewGlobalRef( jo_String.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_String.get() ));
m_class_Object =
- (jclass) jni->NewGlobalRef( jo_Object.get() );
+ static_cast<jclass>(jni->NewGlobalRef( jo_Object.get() ));
m_class_Class =
- (jclass) jni->NewGlobalRef( m_class_Class );
+ static_cast<jclass>(jni->NewGlobalRef( m_class_Class ));
m_object_Any_VOID =
jni->NewGlobalRef( jo_Any_VOID.get() );
@@ -943,14 +943,14 @@ JNI_info const * JNI_info::get_jni_info(
// field JNI_info_holder.m_jni_info_handle
jfieldID field_s_jni_info_handle =
jni->GetStaticFieldID(
- (jclass) jo_JNI_info_holder.get(), "s_jni_info_handle", "J" );
+ static_cast<jclass>(jo_JNI_info_holder.get()), "s_jni_info_handle", "J" );
jni.ensure_no_exception();
assert( 0 != field_s_jni_info_handle );
JNI_info const * jni_info =
reinterpret_cast< JNI_info const * >(
jni->GetStaticLongField(
- (jclass) jo_JNI_info_holder.get(), field_s_jni_info_handle ) );
+ static_cast<jclass>(jo_JNI_info_holder.get()), field_s_jni_info_handle ) );
if (0 == jni_info) // un-initialized?
{
JNI_info * new_info = new JNI_info(
@@ -961,12 +961,12 @@ JNI_info const * JNI_info::get_jni_info(
jni_info =
reinterpret_cast< JNI_info const * >(
jni->GetStaticLongField(
- (jclass) jo_JNI_info_holder.get(),
+ static_cast<jclass>(jo_JNI_info_holder.get()),
field_s_jni_info_handle ) );
if (0 == jni_info) // still un-initialized?
{
jni->SetStaticLongField(
- (jclass) jo_JNI_info_holder.get(), field_s_jni_info_handle,
+ static_cast<jclass>(jo_JNI_info_holder.get()), field_s_jni_info_handle,
reinterpret_cast< jlong >( new_info ) );
jni_info = new_info;
}
diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx
index 8d432cd98d22..a3887f772443 100644
--- a/bridges/source/jni_uno/jni_java2uno.cxx
+++ b/bridges/source/jni_uno/jni_java2uno.cxx
@@ -119,7 +119,7 @@ void Bridge::handle_uno_exc( JNI_context const & jni, uno_Any * uno_exc ) const
uno_any_destruct( uno_exc, 0 );
JLocalAutoRef jo_exc( jni, java_exc.l );
- jint res = jni->Throw( (jthrowable) jo_exc.get() );
+ jint res = jni->Throw( static_cast<jthrowable>(jo_exc.get()) );
if (0 != res)
{
// call toString()
@@ -129,7 +129,7 @@ void Bridge::handle_uno_exc( JNI_context const & jni, uno_Any * uno_exc ) const
jni.ensure_no_exception();
throw BridgeRuntimeError(
"throwing java exception failed: "
- + jstring_to_oustring( jni, (jstring) jo_descr.get() )
+ + jstring_to_oustring( jni, static_cast<jstring>(jo_descr.get()) )
+ jni.get_stack_trace() );
}
}
@@ -421,7 +421,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
jni.get_stack_trace() );
}
OUString type_name(
- jstring_to_oustring( jni, (jstring) jo_type_name.get() ) );
+ jstring_to_oustring( jni, static_cast<jstring>(jo_type_name.get()) ) );
JNI_type_info const * info =
jni_info->get_type_info( jni, type_name );
if (typelib_TypeClass_INTERFACE != info->m_td.get()->eTypeClass)
diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx
index 1885c888751d..29ef813367da 100644
--- a/bridges/source/jni_uno/jni_uno2java.cxx
+++ b/bridges/source/jni_uno/jni_uno2java.cxx
@@ -78,7 +78,7 @@ void Bridge::handle_java_exc(
jo_class.get(), getJniInfo()->m_method_Class_getName, 0 ) );
jni.ensure_no_exception();
OUString exc_name(
- jstring_to_oustring( jni, (jstring) jo_class_name.get() ) );
+ jstring_to_oustring( jni, static_cast<jstring>(jo_class_name.get()) ) );
::com::sun::star::uno::TypeDescription td( exc_name.pData );
if (!td.is() || (typelib_TypeClass_EXCEPTION != td.get()->eTypeClass))
@@ -90,7 +90,7 @@ void Bridge::handle_java_exc(
jni.ensure_no_exception();
throw BridgeRuntimeError(
"non-UNO exception occurred: "
- + jstring_to_oustring( jni, (jstring) jo_descr.get() )
+ + jstring_to_oustring( jni, static_cast<jstring>(jo_descr.get()) )
+ jni.get_stack_trace( jo_exc.get() ) );
}
@@ -221,20 +221,20 @@ void Bridge::call_java(
jni, jni->CallObjectMethodA(
jo_method.get(), getJniInfo()->m_method_Object_toString, 0 ) );
jni.ensure_no_exception();
- trace_buf.append( jstring_to_oustring( jni, (jstring) jo_descr.get() ) );
+ trace_buf.append( jstring_to_oustring( jni, static_cast<jstring>(jo_descr.get()) ) );
trace_buf.append( " on " );
jo_descr.reset(
jni->CallObjectMethodA(
javaI, getJniInfo()->m_method_Object_toString, 0 ) );
jni.ensure_no_exception();
- trace_buf.append( jstring_to_oustring( jni, (jstring) jo_descr.get() ) );
+ trace_buf.append( jstring_to_oustring( jni, static_cast<jstring>(jo_descr.get()) ) );
trace_buf.append( " (" );
JLocalAutoRef jo_class( jni, jni->GetObjectClass( javaI ) );
jo_descr.reset(
jni->CallObjectMethodA(
jo_class.get(), getJniInfo()->m_method_Object_toString, 0 ) );
jni.ensure_no_exception();
- trace_buf.append( jstring_to_oustring( jni, (jstring) jo_descr.get() ) );
+ trace_buf.append( jstring_to_oustring( jni, static_cast<jstring>(jo_descr.get()) ) );
trace_buf.append( ")" );
SAL_INFO("bridges", trace_buf.makeStringAndClear());
#endif
@@ -441,7 +441,7 @@ inline UNO_proxy::UNO_proxy(
jni.ensure_no_exception();
m_javaI = jni->NewGlobalRef( jo_iface );
- m_jo_oid = (jstring) jni->NewGlobalRef( jo_oid );
+ m_jo_oid = static_cast<jstring>(jni->NewGlobalRef( jo_oid ));
bridge->acquire();
m_bridge = bridge;
@@ -485,7 +485,7 @@ uno_Interface * Bridge::map_to_uno(
jobject javaI, JNI_interface_type_info const * info ) const
{
JLocalAutoRef jo_oid( jni, compute_oid( jni, javaI ) );
- OUString oid( jstring_to_oustring( jni, (jstring) jo_oid.get() ) );
+ OUString oid( jstring_to_oustring( jni, static_cast<jstring>(jo_oid.get()) ) );
uno_Interface * pUnoI = 0;
(*m_uno_env->getRegisteredInterface)(
@@ -497,7 +497,7 @@ uno_Interface * Bridge::map_to_uno(
// refcount initially 1
pUnoI = new UNO_proxy(
jni, const_cast< Bridge * >( this ),
- javaI, (jstring) jo_oid.get(), oid, info );
+ javaI, static_cast<jstring>(jo_oid.get()), oid, info );
(*m_uno_env->registerProxyInterface)(
m_uno_env, (void **)&pUnoI,