diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:25:57 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:25:57 +0200 |
commit | ab9c10c3fb852660e4028e7ff7b3b87666787827 (patch) | |
tree | b196cd0304c1ee73b00a958c4bc8d4a6d8ed6a11 /connectivity | |
parent | cd93d5f36a8b94e6c2f1449a4ca1bdbdada83129 (diff) |
loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: I9852610322540a87305b775a1f4c90fb81f728e9
Diffstat (limited to 'connectivity')
12 files changed, 23 insertions, 23 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index cc4202e3d470..c937eae71faa 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -974,7 +974,7 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool case DataType::BIT: { bool b; - switch (* ((const char *)pData)) + switch (*pData) { case 'T': case 'Y': @@ -1963,7 +1963,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow, cons char cNext = pData[nLen]; // Mark's scratch and replaced by 0 pData[nLen] = '\0'; // This is because the buffer is always a sign of greater ... - sal_Size nBlockNo = strtol((const char *)pData,NULL,10); // Block number read + sal_Size nBlockNo = strtol(pData,NULL,10); // Block number read // Next initial character restore again: pData[nLen] = cNext; diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index d7dfd273ce6f..27729d9fa462 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -374,7 +374,7 @@ bool isBookBackend( EBookClient *pBook, const char *backendname) { if (!pBook) return false; - ESource *pSource = e_client_get_source ((EClient *) pBook); + ESource *pSource = e_client_get_source (reinterpret_cast<EClient *>(pBook)); return isSourceBackend(pSource, backendname); } diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 628aa3093ddc..7d3b10e6d401 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -245,7 +245,7 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,js if (nBytesRead <= 0) return -1; - env->SetByteArrayRegion(buffer,off,nBytesRead,(jbyte*) &aData[0]); + env->SetByteArrayRegion(buffer,off,nBytesRead,reinterpret_cast<jbyte*>(&aData[0])); #ifdef HSQLDB_DBG if ( logger ) @@ -436,7 +436,7 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst OSL_ENSURE(buf,"buf is NULL"); if ( buf && len > 0 && len <= env->GetArrayLength(buffer)) { - Sequence< ::sal_Int8 > aData((const signed char*) buf + off,len); + Sequence< ::sal_Int8 > aData(reinterpret_cast<sal_Int8 *>(buf + off),len); env->ReleaseByteArrayElements(buffer, buf, JNI_ABORT); xOut->writeBytes(aData); #ifdef HSQLDB_DBG diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx index fea9a9c3d0eb..9effe1ba73f9 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx @@ -281,7 +281,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora } OSL_ENSURE(nLen >= nBytesRead,"Buffer is too small!"); OSL_ENSURE(aData.getLength() >= nBytesRead,"Buffer is too small!"); - env->SetByteArrayRegion(buffer, 0, nBytesRead, (jbyte*) &aData[0]); + env->SetByteArrayRegion(buffer, 0, nBytesRead, reinterpret_cast<jbyte*>(&aData[0])); #ifdef HSQLDB_DBG aDataLog.write( &aData[0], nBytesRead ); #endif diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx index 6f909a1f1c66..219e0d980d58 100644 --- a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx +++ b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx @@ -880,7 +880,7 @@ Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getColumns( OUString sName; aQtName = ::KABC::Addressee::revisionLabel(); - sName = (const sal_Unicode *) aQtName.ucs2(); + sName = reinterpret_cast<const sal_Unicode *>(aQtName.ucs2()); if (match(columnNamePattern, sName, '\0')) { aRow[4] = new ORowSetValueDecorator(sName); @@ -898,7 +898,7 @@ Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getColumns( ++aField, ++nPosition) { aQtName = (*aField)->label(); - sName = (const sal_Unicode *) aQtName.ucs2(); + sName = reinterpret_cast<const sal_Unicode *>(aQtName.ucs2()); if (match(columnNamePattern, sName, '\0')) { aRow[4] = new ORowSetValueDecorator(sName); @@ -993,7 +993,7 @@ Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getVersionColumns( { ODatabaseMetaDataResultSet::ORow aRow( 9 ); QString aQtName = ::KABC::Addressee::revisionLabel(); - OUString sName = (const sal_Unicode *) aQtName.ucs2(); + OUString sName = reinterpret_cast<const sal_Unicode *>(aQtName.ucs2()); aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue(); diff --git a/connectivity/source/drivers/kab/KResultSet.cxx b/connectivity/source/drivers/kab/KResultSet.cxx index cbe61c9feb62..fface0363b9c 100644 --- a/connectivity/source/drivers/kab/KResultSet.cxx +++ b/connectivity/source/drivers/kab/KResultSet.cxx @@ -197,7 +197,7 @@ return aRet; if (!aQtName.isNull()) { m_bWasNull = false; - aRet = OUString((const sal_Unicode *) aQtName.ucs2()); + aRet = OUString(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); return aRet; } } @@ -797,7 +797,7 @@ Any SAL_CALL KabResultSet::getBookmark() throw( SQLException, RuntimeException, if (m_nRowPos != -1 && m_nRowPos != nAddressees) { QString aQtName = m_aKabAddressees[m_nRowPos].uid(); - OUString sUniqueIdentifier = OUString((const sal_Unicode *) aQtName.ucs2()); + OUString sUniqueIdentifier = OUString(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); return makeAny(sUniqueIdentifier); } return Any(); @@ -814,7 +814,7 @@ sal_Bool SAL_CALL KabResultSet::moveToBookmark(const Any& bookmark) throw( SQLE for (sal_Int32 nRow = 0; nRow < nAddressees; nRow++) { QString aQtName = m_aKabAddressees[nRow].uid(); - OUString sUniqueIdentifier = OUString((const sal_Unicode *) aQtName.ucs2()); + OUString sUniqueIdentifier = OUString(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); if (sUniqueIdentifier == sBookmark) { diff --git a/connectivity/source/drivers/kab/KResultSetMetaData.cxx b/connectivity/source/drivers/kab/KResultSetMetaData.cxx index 640298117ad9..a1d1a82f4725 100644 --- a/connectivity/source/drivers/kab/KResultSetMetaData.cxx +++ b/connectivity/source/drivers/kab/KResultSetMetaData.cxx @@ -91,7 +91,7 @@ OUString SAL_CALL KabResultSetMetaData::getColumnName(sal_Int32 column) throw(SQ default: aQtName = aFields[nFieldNumber - KAB_DATA_FIELDS]->label(); } - OUString aName((const sal_Unicode *) aQtName.ucs2()); + OUString aName(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); return aName; } diff --git a/connectivity/source/drivers/kab/kcondition.cxx b/connectivity/source/drivers/kab/kcondition.cxx index c5b6879b3f8e..a21154d2f925 100644 --- a/connectivity/source/drivers/kab/kcondition.cxx +++ b/connectivity/source/drivers/kab/kcondition.cxx @@ -117,7 +117,7 @@ bool KabConditionEqual::eval(const ::KABC::Addressee &aAddressee) const if (aQtName.isNull()) return false; - OUString sValue((const sal_Unicode *) aQtName.ucs2()); + OUString sValue(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); return sValue == m_sMatchString; } @@ -132,7 +132,7 @@ bool KabConditionDifferent::eval(const ::KABC::Addressee &aAddressee) const if (aQtName.isNull()) return false; - OUString sValue((const sal_Unicode *) aQtName.ucs2()); + OUString sValue(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); return sValue != m_sMatchString; } @@ -147,7 +147,7 @@ bool KabConditionSimilar::eval(const ::KABC::Addressee &aAddressee) const if (aQtName.isNull()) return false; - OUString sValue((const sal_Unicode *) aQtName.ucs2()); + OUString sValue(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); return match(m_sMatchString, sValue, '\0'); } diff --git a/connectivity/source/drivers/kab/kfields.cxx b/connectivity/source/drivers/kab/kfields.cxx index 79582dd05de3..55f5d4d8e220 100644 --- a/connectivity/source/drivers/kab/kfields.cxx +++ b/connectivity/source/drivers/kab/kfields.cxx @@ -53,7 +53,7 @@ sal_uInt32 findKabField(const OUString& columnName) throw(SQLException) OUString aName; aQtName = KABC::Addressee::revisionLabel(); - aName = OUString((const sal_Unicode *) aQtName.ucs2()); + aName = OUString(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); if (columnName == aName) return KAB_FIELD_REVISION; @@ -66,7 +66,7 @@ sal_uInt32 findKabField(const OUString& columnName) throw(SQLException) ++aField, ++nResult) { aQtName = (*aField)->label(); - aName = OUString((const sal_Unicode *) aQtName.ucs2()); + aName = OUString(reinterpret_cast<const sal_Unicode *>(aQtName.ucs2())); if (columnName == aName) return nResult; diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx index 56a27ff1c478..6e3dbeaea7b0 100644 --- a/connectivity/source/drivers/macab/MacabRecords.cxx +++ b/connectivity/source/drivers/macab/MacabRecords.cxx @@ -711,7 +711,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert /* Get the keys and values */ dictKeys = static_cast<CFStringRef *>(malloc(sizeof(CFStringRef)*numRecords)); dictValues = static_cast<CFTypeRef *>(malloc(sizeof(CFTypeRef)*numRecords)); - CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(_propertyValue), reinterpret_cast<const void **>(dictKeys), (const void **) dictValues); + CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(_propertyValue), reinterpret_cast<const void **>(dictKeys), static_cast<const void **>(dictValues)); propertyNameString = CFStringToOUString(_propertyName); @@ -793,7 +793,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert */ for(i = 0; i < arrLength; i++) { - arrValue = (CFTypeRef) CFArrayGetValueAtIndex(static_cast<CFArrayRef>(_propertyValue), i); + arrValue = static_cast<CFTypeRef>(CFArrayGetValueAtIndex(static_cast<CFArrayRef>(_propertyValue), i)); arrType = (ABPropertyType) getABTypeFromCFType( CFGetTypeID(arrValue) ); arrLabelString = propertyNameString + OUString::number(i); arrLabel = OUStringToCFString(arrLabelString); @@ -1022,7 +1022,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT CFTypeRef *dictValues; dictKeys = static_cast<CFStringRef *>(malloc(sizeof(CFStringRef)*numRecords)); dictValues = static_cast<CFTypeRef *>(malloc(sizeof(CFTypeRef)*numRecords)); - CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(_propertyValue), reinterpret_cast<const void **>(dictKeys), (const void **) dictValues); + CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(_propertyValue), reinterpret_cast<const void **>(dictKeys), static_cast<const void **>(dictValues)); /* Going through each element... */ for(i = 0; i < numRecords; i++) diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index 722e09b4aa83..c2fd559511b2 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -1336,7 +1336,7 @@ OUString OResultSet::getCursorName() const { SQLCHAR pName[258]; SQLSMALLINT nRealLen = 0; - N3SQLGetCursorName(m_aStatementHandle,(SQLCHAR*)pName,256,&nRealLen); + N3SQLGetCursorName(m_aStatementHandle,pName,256,&nRealLen); return OUString::createFromAscii(reinterpret_cast<char*>(pName)); } diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index 8f3f8b6b5805..5774a57d14a1 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -729,7 +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,(SQLCHAR*)pName,256,&nRealLen); + SQLRETURN nRetCode = N3SQLGetCursorName(m_aStatementHandle,pName,256,&nRealLen); OSL_UNUSED( nRetCode ); return OUString::createFromAscii(reinterpret_cast<char*>(pName)); } |