From 612b489d3e05b24c1b6690082e8518bac033e9d2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 1 Aug 2017 08:40:47 +0200 Subject: loplugin:checkunusedparams the "check for taking address of function" part was generating false+ Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f Reviewed-on: https://gerrit.libreoffice.org/40613 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/drivers/hsqldb/HStorageAccess.cxx | 23 ++++++++++++---------- .../drivers/hsqldb/StorageNativeInputStream.cxx | 9 +++++---- .../drivers/hsqldb/StorageNativeOutputStream.cxx | 11 +++++++---- connectivity/source/inc/hsqldb/HStorageAccess.hxx | 8 ++++---- 4 files changed, 29 insertions(+), 22 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 34e818351c13..e8030b2c0b71 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -143,7 +143,7 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nati } -jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name, jstring key ) +jint read_from_storage_stream( JNIEnv * env, jstring name, jstring key ) { std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); @@ -185,7 +185,7 @@ jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name, * Signature: (Ljava/lang/String;Ljava/lang/String;)I */ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv* env, jobject obj_this, jstring name, jstring key) + (JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key) { #ifdef HSQLDB_DBG OperationLogFile aOpLog( env, name, "data" ); @@ -194,12 +194,12 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ DataLogFile aDataLog( env, name, "data" ); return read_from_storage_stream( env, obj_this, name, key, &aDataLog ); #else - return read_from_storage_stream( env, obj_this, name, key ); + return read_from_storage_stream( env, name, key ); #endif } -jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key, jbyteArray buffer, jint off, jint len ) +jint read_from_storage_stream_into_buffer( JNIEnv * env, jstring name, jstring key, jbyteArray buffer, jint off, jint len ) { #ifdef HSQLDB_DBG { @@ -261,7 +261,8 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ DataLogFile aDataLog( env, name, "data" ); return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog ); #else - return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len ); + (void)obj_this; + return read_from_storage_stream_into_buffer( env, name, key, buffer, off, len ); #endif } @@ -401,7 +402,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ } -void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jbyteArray buffer, jint off, jint len ) +void write_to_storage_stream_from_buffer( JNIEnv* env, jstring name, jstring key, jbyteArray buffer, jint off, jint len ) { std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); @@ -455,12 +456,13 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ DataLogFile aDataLog( env, name, "data" ); write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog ); #else - write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len ); + (void)obj_this; + write_to_storage_stream_from_buffer( env, name, key, buffer, off, len ); #endif } -void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jint v ) +void write_to_storage_stream( JNIEnv* env, jstring name, jstring key, jint v ) { std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); @@ -505,9 +507,10 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ aOpLog.logOperation( "writeInt" ); DataLogFile aDataLog( env, name, "data" ); - write_to_storage_stream( env, obj_this, name, key, v, &aDataLog ); + write_to_storage_stream( env, name, key, v, &aDataLog ); #else - write_to_storage_stream( env, obj_this, name, key, v ); + (void)obj_this; + write_to_storage_stream( env, name, key, v ); #endif } diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx index 81f06835d520..70cb184b5cb6 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx @@ -75,7 +75,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora * Signature: (Ljava/lang/String;Ljava/lang/String;)I */ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv * env, jobject obj_this,jstring key, jstring name) + (JNIEnv * env, jobject /*obj_this*/, jstring key, jstring name) { #ifdef HSQLDB_DBG OperationLogFile( env, name, "input" ).logOperation( "read()" ); @@ -83,7 +83,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora DataLogFile aDataLog( env, name, "input" ); return read_from_storage_stream( env, obj_this, name, key, &aDataLog ); #else - return read_from_storage_stream( env, obj_this, name, key ); + return read_from_storage_stream( env, name, key ); #endif } @@ -94,7 +94,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)I */ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII - (JNIEnv * env, jobject obj_this,jstring key, jstring name, jbyteArray buffer, jint off, jint len) + (JNIEnv * env, jobject obj_this, jstring key, jstring name, jbyteArray buffer, jint off, jint len) { #ifdef HSQLDB_DBG OperationLogFile( env, name, "input" ).logOperation( "read( byte[], int, int )" ); @@ -102,7 +102,8 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora DataLogFile aDataLog( env, name, "input" ); return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog ); #else - return read_from_storage_stream_into_buffer(env,obj_this,name,key,buffer,off,len); + (void)obj_this; + return read_from_storage_stream_into_buffer(env, name,key,buffer,off,len); #endif } diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index 67e066adee05..ad551ccce06c 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx @@ -79,7 +79,8 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora DataLogFile aDataLog( env, name, "output" ); write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog ); #else - write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, off, len ); + (void)obj_this; + write_to_storage_stream_from_buffer( env, name, key, buffer, off, len ); #endif } @@ -97,7 +98,8 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora DataLogFile aDataLog( env, name, "output" ); write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, 0, env->GetArrayLength( buffer ), &aDataLog ); #else - write_to_storage_stream_from_buffer( env, obj_this, name, key, buffer, 0, env->GetArrayLength( buffer ) ); + (void)obj_this; + write_to_storage_stream_from_buffer( env, name, key, buffer, 0, env->GetArrayLength( buffer ) ); #endif } @@ -145,9 +147,10 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora OperationLogFile( env, name, "output" ).logOperation( "write( int )" ); DataLogFile aDataLog( env, name, "output" ); - write_to_storage_stream( env, obj_this, name, key, b, &aDataLog ); + write_to_storage_stream( env, name, key, b, &aDataLog ); #else - write_to_storage_stream( env, obj_this, name, key, b ); + (void)obj_this; + write_to_storage_stream( env, name, key, b ); #endif } diff --git a/connectivity/source/inc/hsqldb/HStorageAccess.hxx b/connectivity/source/inc/hsqldb/HStorageAccess.hxx index 7fe654119976..c0ae65541530 100644 --- a/connectivity/source/inc/hsqldb/HStorageAccess.hxx +++ b/connectivity/source/inc/hsqldb/HStorageAccess.hxx @@ -29,10 +29,10 @@ namespace connectivity { namespace hsqldb class DataLogFile; } } -jint read_from_storage_stream( JNIEnv * env, jobject obj_this, jstring name, jstring key ); -jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject obj_this,jstring name, jstring key, jbyteArray buffer, jint off, jint len ); -void write_to_storage_stream_from_buffer( JNIEnv* env, jobject obj_this, jstring name, jstring key, jbyteArray buffer, jint off, jint len ); -void write_to_storage_stream( JNIEnv* env, jobject obj_this, jstring name, jstring key, jint v ); +jint read_from_storage_stream( JNIEnv * env, jstring name, jstring key ); +jint read_from_storage_stream_into_buffer( JNIEnv * env, jstring name, jstring key, jbyteArray buffer, jint off, jint len ); +void write_to_storage_stream_from_buffer( JNIEnv* env, jstring name, jstring key, jbyteArray buffer, jint off, jint len ); +void write_to_storage_stream( JNIEnv* env, jstring name, jstring key, jint v ); #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_HSQLDB_HSTORAGEACCESS_HXX -- cgit