From 2beeeea4ea3a5799921674310712aa3ead9acd7a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 8 Sep 2015 18:26:13 +0200 Subject: Get rid of OSL_UNUSED In many cases it was originally used to silence warnings about variables used only in OSL_ENSURE etc., but that's no longer necessary since OSL_ENSURE is based on SAL_WARN etc. In some other cases it was apparently used as a speculative debugging aid, to have a value assigned to a variable to be easily able to view the value in a debugger. And in some cases it was used with (otherwise ignored) return values of (typically SQL-related) function calls, but it is probably better to eventually find and fix all the problematic ones among such calls via function declarations annotated SAL_WARN_UNUSED_RESULT. Change-Id: Ib925b38da70073b546fdcd00fa8524dc302accbf --- connectivity/source/commontools/dbcharset.cxx | 1 - connectivity/source/commontools/dbtools.cxx | 3 +-- connectivity/source/drivers/ado/Aolevariant.cxx | 23 ---------------------- connectivity/source/drivers/ado/Awrapado.cxx | 3 --- connectivity/source/drivers/dbase/dindexnode.cxx | 3 +-- .../source/drivers/file/FPreparedStatement.cxx | 5 ----- .../source/drivers/hsqldb/HStorageAccess.cxx | 21 +++++++++++--------- .../drivers/hsqldb/StorageNativeOutputStream.cxx | 7 ++++--- connectivity/source/drivers/mork/MConnection.cxx | 2 -- .../source/drivers/mork/MPreparedStatement.cxx | 5 ----- connectivity/source/drivers/mozab/MConnection.cxx | 1 - .../source/drivers/mozab/MPreparedStatement.cxx | 5 ----- connectivity/source/drivers/mozab/MStatement.cxx | 2 -- connectivity/source/drivers/odbc/OConnection.cxx | 5 ++--- .../source/drivers/odbc/OPreparedStatement.cxx | 5 ++--- connectivity/source/drivers/odbc/ORealDriver.cxx | 3 +-- connectivity/source/drivers/odbc/OResultSet.cxx | 6 ++---- connectivity/source/drivers/odbc/OStatement.cxx | 3 +-- connectivity/source/drivers/odbc/OTools.cxx | 1 - connectivity/source/inc/diagnose_ex.h | 3 --- include/tools/diagnose_ex.h | 3 --- svtools/source/uno/svtxgridcontrol.cxx | 6 ++---- svtools/source/uno/unogridcolumnfacade.cxx | 3 +-- .../source/controls/grid/sortablegriddatamodel.cxx | 4 +--- 24 files changed, 30 insertions(+), 93 deletions(-) diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx index f8267bf4d2e4..c9d41d80611a 100644 --- a/connectivity/source/commontools/dbcharset.cxx +++ b/connectivity/source/commontools/dbcharset.cxx @@ -70,7 +70,6 @@ namespace dbtools bool bIsMimeEncoding = 0 != ( _rInfo.Flags & RTL_TEXTENCODING_INFO_MIME ); OSL_ENSURE( !bIsMimeEncoding || rtl_getMimeCharsetFromTextEncoding( _eEncoding ), "OCharsetMap::OCharsetMap: inconsistence in rtl!" ); - OSL_UNUSED( _eEncoding ); return bIsMimeEncoding; } diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 43e524423888..593f7012359c 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -983,9 +983,8 @@ try { xNewProps->setPropertyValue(pResult->Name, xOldProps->getPropertyValue(pResult->Name)); } - catch(IllegalArgumentException& e) + catch(IllegalArgumentException&) { - OSL_UNUSED( e ); #ifdef DBG_UTIL OUString sMessage = "TransferFormComponentProperties : could not transfer the value for property \"" + pResult->Name + diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx index 1ec825b92624..cd89425ae09c 100644 --- a/connectivity/source/drivers/ado/Aolevariant.cxx +++ b/connectivity/source/drivers/ado/Aolevariant.cxx @@ -104,14 +104,12 @@ OLEVariant::OLEVariant(const VARIANT& varSrc) ::VariantInit(this); HRESULT eRet = ::VariantCopy(this, const_cast(&varSrc)); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); } OLEVariant::OLEVariant(const OLEVariant& varSrc) { ::VariantInit(this); HRESULT eRet = ::VariantCopy(this, const_cast(static_cast(&varSrc))); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); } OLEVariant::OLEVariant(bool x) { VariantInit(this); vt = VT_BOOL; boolVal = (x ? VARIANT_TRUE : VARIANT_FALSE);} @@ -130,7 +128,6 @@ OLEVariant::~OLEVariant() { HRESULT eRet = ::VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); } // clears all the memory that was allocated before OLEVariant::OLEVariant(const ::com::sun::star::util::Date& x ) @@ -186,7 +183,6 @@ OLEVariant::OLEVariant(const ::com::sun::star::uno::Sequence< sal_Int8 >& x) sal_Int32 nData = *pBegin; HRESULT rs = SafeArrayPutElement(parray,&i,&nData); OSL_ENSURE(S_OK == rs,"Error while copy byte data"); - OSL_UNUSED(rs); } } @@ -194,7 +190,6 @@ OLEVariant& OLEVariant::operator=(const OLEVariant& varSrc) { HRESULT eRet = ::VariantCopy(this, const_cast(static_cast(&varSrc))); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); return *this; } // Assign a const VARIANT& (::VariantCopy handles everything) @@ -203,7 +198,6 @@ OLEVariant& OLEVariant::operator=(const tagVARIANT& varSrc) { HRESULT eRet = ::VariantCopy(this, const_cast(&varSrc)); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); return *this; } @@ -214,7 +208,6 @@ OLEVariant& OLEVariant::operator=(const VARIANT* pSrc) { HRESULT eRet = ::VariantCopy(this, const_cast(pSrc)); OSL_ENSURE(eRet == S_OK,"Error while copying an ado variant!"); - OSL_UNUSED(eRet); return *this; } @@ -223,7 +216,6 @@ void OLEVariant::setByte(sal_uInt8 n) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_UI1; bVal = n; } @@ -231,7 +223,6 @@ void OLEVariant::setInt16(sal_Int16 n) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_I2; iVal = n; } @@ -239,14 +230,12 @@ void OLEVariant::setInt32(sal_Int32 n) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_I4; lVal = n; } void OLEVariant::setFloat(float f) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_R4; fltVal = f; } @@ -254,14 +243,12 @@ void OLEVariant::setDouble(double d) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_R8; dblVal = d; } void OLEVariant::setDate(DATE d) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_DATE; date = d; } @@ -269,7 +256,6 @@ void OLEVariant::setChar(unsigned char a) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_UI1; bVal = a; } @@ -277,7 +263,6 @@ void OLEVariant::setCurrency(double aCur) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_CY; set(aCur*10000); } @@ -285,7 +270,6 @@ void OLEVariant::setBool(sal_Bool b) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_BOOL; boolVal = b ? VARIANT_TRUE : VARIANT_FALSE; } @@ -293,7 +277,6 @@ void OLEVariant::setString(const OUString& us) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_BSTR; bstrVal = ::SysAllocString(reinterpret_cast(us.getStr())); } @@ -301,7 +284,6 @@ void OLEVariant::setNoArg() { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_ERROR; scode = DISP_E_PARAMNOTFOUND; } @@ -310,14 +292,12 @@ void OLEVariant::setNull() { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_NULL; } void OLEVariant::setEmpty() { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_EMPTY; } @@ -325,7 +305,6 @@ void OLEVariant::setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_ARRAY|VT_UI1; parray = pSafeAr; } @@ -333,7 +312,6 @@ void OLEVariant::setArray(SAFEARRAY* pSafeArray, VARTYPE vtType) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = (VARTYPE)(VT_ARRAY|vtType); parray = pSafeArray; } @@ -342,7 +320,6 @@ void OLEVariant::setIDispatch(IDispatch* pDispInterface) { HRESULT eRet = VariantClear(this); OSL_ENSURE(eRet == S_OK,"Error while clearing an ado variant!"); - OSL_UNUSED(eRet); vt = VT_DISPATCH; pdispVal = pDispInterface; diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index 026390aa307b..1c2ddd406763 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -2146,7 +2146,6 @@ void WpADOColumn::put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject) OSL_ENSURE(pInterface,"Interface is null!"); sal_Bool bRet = SUCCEEDED(pInterface->put_ParentCatalog(ppvObject)); OSL_ENSURE(bRet,"Could not set ParentCatalog!"); - OSL_UNUSED(bRet); } void WpADOTable::putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject) @@ -2154,7 +2153,6 @@ void WpADOTable::putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObjec OSL_ENSURE(pInterface,"Interface is null!"); sal_Bool bRet = SUCCEEDED(pInterface->putref_ParentCatalog(ppvObject)); OSL_ENSURE(bRet,"Could not set ParentCatalog!"); - OSL_UNUSED(bRet); } void WpBase::setIDispatch(IDispatch* _pIUnknown) @@ -2170,7 +2168,6 @@ void OTools::putValue(const WpADOProperties& _rProps,const OLEVariant &_aPositio { sal_Bool bRet = aProp.PutValue(_aValVar); OSL_ENSURE(bRet,"Could not put value!"); - OSL_UNUSED(bRet); } } diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 9f4f8425c36e..0eadcc392e7c 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -877,8 +877,7 @@ SvStream& connectivity::dbase::WriteONDXPage(SvStream &rStream, const ONDXPage& memset(aEmptyData,0x00,DINDEX_PAGE_SIZE); rStream.Write(aEmptyData, DINDEX_PAGE_SIZE); } - sal_Size nCurrentPos = rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE); - OSL_UNUSED( nCurrentPos ); + rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE); nValue = rPage.nCount; rStream.WriteUInt32( nValue ); diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 32290b70bef9..ca465c98370e 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -424,13 +424,8 @@ void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const ORowSetVal sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference& _xCol) { - OSL_UNUSED( pParameter ); OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument ist kein Parameter"); OSL_ENSURE(pParameter->count() > 0,"OResultSet: Fehler im Parse Tree"); -#if OSL_DEBUG_LEVEL > 0 - OSQLParseNode * pMark = pParameter->getChild(0); - OSL_UNUSED( pMark ); -#endif OUString sParameterName; // set up Parameter-Column: diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 7d3b10e6d401..0a5b75ba3b49 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -147,7 +147,6 @@ 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, DataLogFile* logger ) { - OSL_UNUSED( logger ); ::boost::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); OSL_ENSURE(xIn.is(),"Input stream is NULL!"); @@ -175,10 +174,12 @@ jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name, if (tmpInt < 0 ) tmpInt = 256 +tmpInt; -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( tmpInt ); #endif + } return tmpInt; } } @@ -210,7 +211,6 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,jstring name, jstring key, jbyteArray buffer, jint off, jint len, DataLogFile* logger ) { - OSL_UNUSED( logger ); #ifdef HSQLDB_DBG { OUString sKey = StorageContainer::jstring2ustring(env,key); @@ -247,10 +247,12 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,js return -1; env->SetByteArrayRegion(buffer,off,nBytesRead,reinterpret_cast(&aData[0])); -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( aData.getConstArray(), nBytesRead ); #endif + } return nBytesRead; } ThrowException( env, @@ -418,7 +420,6 @@ 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, DataLogFile* logger ) { - OSL_UNUSED( logger ); ::boost::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE(xOut.is(),"Stream is NULL"); @@ -439,10 +440,12 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst Sequence< ::sal_Int8 > aData(reinterpret_cast(buf + off),len); env->ReleaseByteArrayElements(buffer, buf, JNI_ABORT); xOut->writeBytes(aData); -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( aData.getConstArray(), len ); #endif + } } } else @@ -483,8 +486,6 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, jstring key, jint v, DataLogFile* logger ) { - OSL_UNUSED( logger ); - ::boost::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE(xOut.is(),"Stream is NULL"); @@ -499,10 +500,12 @@ void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, j oneByte[3] = (sal_Int8) ((v >> 0) & 0xFF); xOut->writeBytes(oneByte); -#ifdef HSQLDB_DBG if ( logger ) + { +#ifdef HSQLDB_DBG logger->write( oneByte.getConstArray(), 4 ); #endif + } } else { diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index ce194628a738..70633e50e396 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx @@ -161,14 +161,15 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_flush (JNIEnv * env, jobject /*obj_this*/, jstring key, jstring name) { - OSL_UNUSED( env ); - OSL_UNUSED( key ); - OSL_UNUSED( name ); #ifdef HSQLDB_DBG OperationLogFile( env, name, "output" ).logOperation( "flush" ); OUString sKey = StorageContainer::jstring2ustring(env,key); OUString sName = StorageContainer::jstring2ustring(env,name); +#else + (void) env; + (void) key; + (void) name; #endif } diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 5efb9d0f2a47..ee71aad526b4 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -206,7 +206,6 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OU SAL_INFO("connectivity.mork", "=> OConnection::prepareStatement()" ); SAL_INFO("connectivity.mork", "OConnection::prepareStatement( " << _sSql << " )"); - OSL_UNUSED( _sSql ); ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); @@ -225,7 +224,6 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const OUStrin { SAL_INFO("connectivity.mork", "=> OConnection::prepareCall()" ); SAL_INFO("connectivity.mork", "sql: " << _sSql); - OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedSQLException( "XConnection::prepareCall", *this ); SAL_INFO("connectivity.mork", "OConnection::prepareCall( " << _sSql << " )"); return NULL; diff --git a/connectivity/source/drivers/mork/MPreparedStatement.cxx b/connectivity/source/drivers/mork/MPreparedStatement.cxx index ead3e77d60cd..1348963caa66 100644 --- a/connectivity/source/drivers/mork/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mork/MPreparedStatement.cxx @@ -392,16 +392,11 @@ ORowSetValue& x) size_t OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference& _xCol) { - OSL_UNUSED( pParameter ); // Count of the newly added Parameters size_t nParameter = m_xParamColumns->get().size()+1; OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument is not a Parameter"); OSL_ENSURE(pParameter->count() > 0,"OResultSet: error in parse tree"); -#if OSL_DEBUG_LEVEL > 0 - OSQLParseNode * pMark = pParameter->getChild(0); - OSL_UNUSED( pMark ); -#endif OUString sParameterName; diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx index bf1fb63fd47a..9b609a0e43ee 100644 --- a/connectivity/source/drivers/mozab/MConnection.cxx +++ b/connectivity/source/drivers/mozab/MConnection.cxx @@ -375,7 +375,6 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OU Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const OUString& _sSql ) throw(SQLException, RuntimeException) { - OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedSQLException( "XConnection::prepareCall", *this ); OSL_TRACE("OConnection::prepareCall( %s )", OUtoCStr( _sSql ) ); return NULL; diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx index 8b5212912901..ce434a19b8f8 100644 --- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx @@ -400,16 +400,11 @@ ORowSetValue& x) size_t OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference& _xCol) { - OSL_UNUSED( pParameter ); // Count of the newly added Parameters size_t nParameter = m_xParamColumns->get().size()+1; OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument is not a Parameter"); OSL_ENSURE(pParameter->count() > 0,"OResultSet: error in parse tree"); -#if OSL_DEBUG_LEVEL > 0 - OSQLParseNode * pMark = pParameter->getChild(0); - OSL_UNUSED( pMark ); -#endif OUString sParameterName; diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx index 637a2e2c8f59..5a258b508c4c 100644 --- a/connectivity/source/drivers/mozab/MStatement.cxx +++ b/connectivity/source/drivers/mozab/MStatement.cxx @@ -190,8 +190,6 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql #if OSL_DEBUG_LEVEL > 0 { - const char* str = OUtoCStr(sql); - OSL_UNUSED( str ); OSL_TRACE("ParseSQL: %s", OUtoCStr( sql ) ); } #endif // OSL_DEBUG_LEVEL diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 2b2589e7f34a..c06559b77814 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -119,7 +119,7 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi #endif #ifdef LINUX - OSL_UNUSED( bSilent ); + (void) bSilent; nSQLRETURN = N3SQLDriverConnect(m_aConnectionHandle, NULL, szConnStrIn, @@ -532,8 +532,7 @@ SQLHANDLE OConnection::createStatementHandle() } SQLHANDLE aStatementHandle = SQL_NULL_HANDLE; - SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,pConnectionTemp->getConnection(),&aStatementHandle); - OSL_UNUSED( nRetcode ); + N3SQLAllocHandle(SQL_HANDLE_STMT,pConnectionTemp->getConnection(),&aStatementHandle); ++m_nStatementCount; if(bNew) m_aConnections.insert(::std::map< SQLHANDLE,OConnection*>::value_type(aStatementHandle,pConnectionTemp)); diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx index a611ebe191e9..f8a0dbef5f29 100644 --- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx @@ -660,9 +660,8 @@ void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, Runtim ::osl::MutexGuard aGuard( m_aMutex ); prepareStatement(); OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - SQLRETURN nRet = N3SQLFreeStmt (m_aStatementHandle, SQL_RESET_PARAMS); - nRet = N3SQLFreeStmt (m_aStatementHandle, SQL_UNBIND); - OSL_UNUSED(nRet); + N3SQLFreeStmt (m_aStatementHandle, SQL_RESET_PARAMS); + N3SQLFreeStmt (m_aStatementHandle, SQL_UNBIND); } void SAL_CALL OPreparedStatement::clearBatch( ) throw(SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx index f5f4f2e20a00..f464c810228d 100644 --- a/connectivity/source/drivers/odbc/ORealDriver.cxx +++ b/connectivity/source/drivers/odbc/ORealDriver.cxx @@ -343,8 +343,7 @@ SQLHANDLE ORealObdcDriver::EnvironmentHandle(OUString &_rPath) // Save in global Structure m_pDriverHandle = h; - SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION, reinterpret_cast(SQL_OV_ODBC3), SQL_IS_UINTEGER); - OSL_UNUSED( nError ); + N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION, reinterpret_cast(SQL_OV_ODBC3), SQL_IS_UINTEGER); //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER); } diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index b6feb2f358d9..0a98a62934d8 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -181,8 +181,7 @@ void OResultSet::construct() void OResultSet::disposing() { - SQLRETURN nRet = N3SQLCloseCursor(m_aStatementHandle); - OSL_UNUSED( nRet ); + N3SQLCloseCursor(m_aStatementHandle); OPropertySetHelper::disposing(); ::osl::MutexGuard aGuard(m_aMutex); @@ -1226,8 +1225,7 @@ sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_ invalidateCache(); Sequence aBookmark; bookmark >>= aBookmark; - SQLRETURN nReturn = setStmtOption(SQL_ATTR_FETCH_BOOKMARK_PTR, reinterpret_cast(aBookmark.getArray())); - OSL_UNUSED( nReturn ); + setStmtOption(SQL_ATTR_FETCH_BOOKMARK_PTR, reinterpret_cast(aBookmark.getArray())); m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,rows); OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this); diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index 5774a57d14a1..0a8128679620 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -729,8 +729,7 @@ OUString OStatement_Base::getCursorName() const OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); SQLCHAR pName[258]; SQLSMALLINT nRealLen = 0; - SQLRETURN nRetCode = N3SQLGetCursorName(m_aStatementHandle,pName,256,&nRealLen); - OSL_UNUSED( nRetCode ); + N3SQLGetCursorName(m_aStatementHandle,pName,256,&nRealLen); return OUString::createFromAscii(reinterpret_cast(pName)); } diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx index 8777b3de6adb..f27bc97f9a59 100644 --- a/connectivity/source/drivers/odbc/OTools.cxx +++ b/connectivity/source/drivers/odbc/OTools.cxx @@ -330,7 +330,6 @@ void OTools::ThrowException(const OConnection* _pConnection, szSqlState, &pfNativeError, szErrorMessage,sizeof szErrorMessage - 1,&pcbErrorMsg); - OSL_UNUSED( n ); OSL_ENSURE(n != SQL_INVALID_HANDLE,"SdbODBC3_SetStatus: SQLError returned SQL_INVALID_HANDLE"); OSL_ENSURE(n == SQL_SUCCESS || n == SQL_SUCCESS_WITH_INFO || n == SQL_NO_DATA_FOUND || n == SQL_ERROR,"SdbODBC3_SetStatus: SQLError failed"); diff --git a/connectivity/source/inc/diagnose_ex.h b/connectivity/source/inc/diagnose_ex.h index 10671a4c5085..436683209e31 100644 --- a/connectivity/source/inc/diagnose_ex.h +++ b/connectivity/source/inc/diagnose_ex.h @@ -32,9 +32,6 @@ (void)(expression) #endif -#define OSL_UNUSED( expression ) \ - (void)(expression) - #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_DIAGNOSE_EX_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index 7efffc67489d..b162f94db8fd 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -29,9 +29,6 @@ #include -#define OSL_UNUSED( expression ) \ - (void)(expression) - TOOLS_DLLPUBLIC void DbgUnhandledException(const ::com::sun::star::uno::Any& caughtException, const char* currentFunction, const char* fileAndLineNo); #if OSL_DEBUG_LEVEL > 0 diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index de5ac2750d3c..aa8908b1e493 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -631,10 +631,9 @@ void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw } -void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException, std::exception) +void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& ) throw (RuntimeException, std::exception) { SolarMutexGuard aGuard; - OSL_UNUSED( i_event ); VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" ); @@ -666,11 +665,10 @@ void SAL_CALL SVTXGridControl::elementRemoved( const ContainerEvent& i_event ) t } -void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException, std::exception) +void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& ) throw (RuntimeException, std::exception) { OSL_ENSURE( false, "SVTXGridControl::elementReplaced: not implemented!" ); // at the moment, the XGridColumnModel API does not allow replacing columns - OSL_UNUSED( i_event ); // TODO: replace the respective column in our table model } diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index 7e19c7baa6d7..d3b56d8e7152 100644 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx @@ -166,9 +166,8 @@ namespace svt { namespace table } - void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& i_event ) throw (RuntimeException, std::exception) + void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& ) throw (RuntimeException, std::exception) { - OSL_UNUSED( i_event ); } diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 35450bb020f7..1edc113d64f6 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -490,10 +490,8 @@ private: } - void SAL_CALL SortableGridDataModel::disposing( const EventObject& i_event ) throw (RuntimeException, std::exception) + void SAL_CALL SortableGridDataModel::disposing( const EventObject& ) throw (RuntimeException, std::exception) { - // not interested in - OSL_UNUSED( i_event ); } -- cgit