summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-17 18:17:00 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-20 09:06:46 +0100
commit141b01ac65d5922aacdf6010043eadc7c28304a5 (patch)
tree8080be6ba72a3d127de8702511d049512d485f11 /connectivity
parent876413440d051f7bae8b3d222320f4bc3b617b79 (diff)
Some more loplugin:cstylecast: connectivity
Change-Id: Iee1d11aef454284dbe050780c4308917c1a2b36f
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/CommonTools.cxx2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx16
-rw-r--r--connectivity/source/drivers/dbase/dindexnode.cxx4
-rw-r--r--connectivity/source/drivers/evoab2/EApi.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.hxx4
-rw-r--r--connectivity/source/drivers/firebird/Blob.cxx2
-rw-r--r--connectivity/source/drivers/firebird/DatabaseMetaData.cxx4
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx4
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx10
-rw-r--r--connectivity/source/drivers/firebird/Util.cxx2
-rw-r--r--connectivity/source/drivers/kab/KDEInit.cxx2
-rw-r--r--connectivity/source/drivers/mork/MNSINIParser.cxx4
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx4
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx8
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx92
-rw-r--r--connectivity/source/drivers/odbc/OFunctions.cxx108
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx4
-rw-r--r--connectivity/source/drivers/odbc/ORealDriver.cxx108
-rw-r--r--connectivity/source/drivers/odbc/OResultSet.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OResultSetMetaData.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OStatement.cxx8
-rw-r--r--connectivity/source/drivers/odbc/OTools.cxx28
-rw-r--r--connectivity/source/drivers/postgresql/pq_baseresultset.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.cxx6
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.hxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_preparedstatement.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_updateableresultset.cxx4
-rw-r--r--connectivity/source/inc/odbc/OFunctions.hxx122
30 files changed, 283 insertions, 283 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 5aa7dc939bd7..fb3cf8a46af2 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -125,7 +125,7 @@ namespace connectivity
Reference< XJavaVM > xVM = JavaVirtualMachine::create(_rxContext);
Sequence<sal_Int8> processID(16);
- rtl_getGlobalProcessId( (sal_uInt8*) processID.getArray() );
+ rtl_getGlobalProcessId( reinterpret_cast<sal_uInt8*>(processID.getArray()) );
processID.realloc(17);
processID[16] = 0;
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 0994bb2769fb..750be4f7f98d 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -202,7 +202,7 @@ void ODbaseTable::readHeader()
if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
throwInvalidDbaseFormat();
- m_pFileStream->Read((char*)(&m_aHeader.db_aedat), 3*sizeof(sal_uInt8));
+ m_pFileStream->Read(m_aHeader.db_aedat, 3*sizeof(sal_uInt8));
if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
throwInvalidDbaseFormat();
(*m_pFileStream).ReadUInt32( m_aHeader.db_anz );
@@ -216,7 +216,7 @@ void ODbaseTable::readHeader()
throwInvalidDbaseFormat();
if (m_aHeader.db_slng == 0)
throwInvalidDbaseFormat();
- m_pFileStream->Read((char*)(&m_aHeader.db_frei), 20*sizeof(sal_uInt8));
+ m_pFileStream->Read(m_aHeader.db_frei, 20*sizeof(sal_uInt8));
if(ERRCODE_NONE != m_pFileStream->GetErrorCode())
throwInvalidDbaseFormat();
@@ -334,7 +334,7 @@ void ODbaseTable::fillColumns()
break;
aDBFColumn.db_fnm[sizeof(aDBFColumn.db_fnm)-1] = 0; //ensure null termination for broken input
- const OUString aColumnName((const char *)aDBFColumn.db_fnm, strlen((const char *)aDBFColumn.db_fnm), m_eEncoding);
+ const OUString aColumnName(reinterpret_cast<char *>(aDBFColumn.db_fnm), strlen(reinterpret_cast<char *>(aDBFColumn.db_fnm)), m_eEncoding);
bool bIsRowVersion = bFoxPro && ( aDBFColumn.db_frei2[0] & 0x01 ) == 0x01;
@@ -853,7 +853,7 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool
if ( ( nByteOffset + nLen) > m_nBufferSize )
break; // length doesn't match buffer size.
- char *pData = (char *) (m_pBuffer + nByteOffset);
+ char *pData = reinterpret_cast<char *>(m_pBuffer + nByteOffset);
if (nType == DataType::CHAR || nType == DataType::VARCHAR)
{
@@ -1570,7 +1570,7 @@ bool ODbaseTable::UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow, const
// position on desired record:
sal_Size nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng;
m_pFileStream->Seek(nPos);
- m_pFileStream->Read((char*)m_pBuffer, m_aHeader.db_slng);
+ m_pFileStream->Read(m_pBuffer, m_aHeader.db_slng);
sal_Size nMemoFileSize( 0 );
if (HasMemoFields() && m_pMemoStream)
@@ -1846,7 +1846,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow, cons
pIndex->Insert(m_nFilePos, thisColVal);
}
- char* pData = (char *)(m_pBuffer + nByteOffset);
+ char* pData = reinterpret_cast<char *>(m_pBuffer + nByteOffset);
if (thisColIsNull)
{
if ( bSetZero )
@@ -2658,7 +2658,7 @@ bool ODbaseTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32
if (m_pFileStream->GetError() != ERRCODE_NONE)
goto Error;
- sal_Size nRead = m_pFileStream->Read((char*)m_pBuffer, nEntryLen);
+ sal_Size nRead = m_pFileStream->Read(m_pBuffer, nEntryLen);
if (nRead != nEntryLen)
{
SAL_WARN("connectivity.drivers", "ODbaseTable::seekRow: short read!");
@@ -2798,7 +2798,7 @@ bool ODbaseTable::WriteBuffer()
// position on desired record:
sal_Size nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng;
m_pFileStream->Seek(nPos);
- return m_pFileStream->Write((char*) m_pBuffer, m_aHeader.db_slng) > 0;
+ return m_pFileStream->Write(m_pBuffer, m_aHeader.db_slng) > 0;
}
sal_Int32 ODbaseTable::getCurrentLastPos() const
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 65774cb0c676..5e5c4ddac58d 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -875,7 +875,7 @@ SvStream& connectivity::dbase::WriteONDXPage(SvStream &rStream, const ONDXPage&
char aEmptyData[DINDEX_PAGE_SIZE];
memset(aEmptyData,0x00,DINDEX_PAGE_SIZE);
- rStream.Write((sal_uInt8*)aEmptyData,DINDEX_PAGE_SIZE);
+ rStream.Write(aEmptyData, DINDEX_PAGE_SIZE);
}
sal_Size nCurrentPos = rStream.Seek(rPage.GetPagePos() * DINDEX_PAGE_SIZE);
OSL_UNUSED( nCurrentPos );
@@ -898,7 +898,7 @@ SvStream& connectivity::dbase::WriteONDXPage(SvStream &rStream, const ONDXPage&
{
char* pEmptyData = new char[nRemainSize];
memset(pEmptyData,0x00,nRemainSize);
- rStream.Write((sal_uInt8*)pEmptyData,nRemainSize);
+ rStream.Write(pEmptyData, nRemainSize);
rStream.Seek(nTell);
delete [] pEmptyData;
}
diff --git a/connectivity/source/drivers/evoab2/EApi.cxx b/connectivity/source/drivers/evoab2/EApi.cxx
index 410422ca35d0..1bc88aeb08ab 100644
--- a/connectivity/source/drivers/evoab2/EApi.cxx
+++ b/connectivity/source/drivers/evoab2/EApi.cxx
@@ -34,7 +34,7 @@ static const char *eBookLibNames[] = {
typedef void (*SymbolFunc) (void);
-#define SYM_MAP(a) { #a, (SymbolFunc *)&a }
+#define SYM_MAP(a) { #a, reinterpret_cast<SymbolFunc *>(&a) }
struct ApiMap
{
const char *sym_name;
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index c53523b5d479..90dac61982d4 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -1168,7 +1168,7 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
aRows.push_back(aRow);
}
- g_list_foreach (pSources, (GFunc)g_object_unref, NULL);
+ g_list_foreach (pSources, reinterpret_cast<GFunc>(g_object_unref), NULL);
g_list_free (pSources);
}
else
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 4cacbb173b92..acc92f015164 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -399,7 +399,7 @@ public:
break;
}
}
- g_list_foreach (pSources, (GFunc)g_object_unref, NULL);
+ g_list_foreach (pSources, reinterpret_cast<GFunc>(g_object_unref), NULL);
g_list_free (pSources);
if (!id)
return NULL;
diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx b/connectivity/source/drivers/evoab2/NStatement.hxx
index bc6467c41167..42df8b1c588a 100644
--- a/connectivity/source/drivers/evoab2/NStatement.hxx
+++ b/connectivity/source/drivers/evoab2/NStatement.hxx
@@ -40,6 +40,7 @@
#include <comphelper/propertycontainer.hxx>
#include "EApi.h"
+#include <NConnection.hxx>
#include <list>
@@ -47,7 +48,6 @@ namespace connectivity
{
namespace evoab
{
- class OEvoabConnection;
typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::sdbc::XWarningsSupplier
, ::com::sun::star::sdbc::XCloseable
> OCommonStatement_IBase;
@@ -230,7 +230,7 @@ namespace connectivity
impl_executeQuery_throw( const QueryData& _rData );
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
- impl_getConnection() { return ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >( (::com::sun::star::sdbc::XConnection*)m_pConnection ); }
+ impl_getConnection() { return ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >( m_pConnection ); }
OUString
impl_getColumnRefColumnName_throw( const ::connectivity::OSQLParseNode& _rColumnRef );
diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx
index 18f684a46d53..0c87b3fdfdd4 100644
--- a/connectivity/source/drivers/firebird/Blob.cxx
+++ b/connectivity/source/drivers/firebird/Blob.cxx
@@ -239,7 +239,7 @@ sal_Int32 SAL_CALL Blob::readBytes(uno::Sequence< sal_Int8 >& rDataOut,
&m_blobHandle,
&nBytesRead,
nReadSize,
- (char*) rDataOut.getArray() + nTotalBytesRead);
+ reinterpret_cast<char*>(rDataOut.getArray()) + nTotalBytesRead);
if (aErr && IndicatesError(m_statusVector))
{
OUString sError(StatusVectorToString(m_statusVector, "isc_get_segment"));
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index c2725a979120..03bdae0e996e 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -1224,7 +1224,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
if (xDescriptionBlob.is())
{
sal_Int32 aBlobLength = (sal_Int32) xDescriptionBlob->length();
- aDescription = OUString((char*) xDescriptionBlob->getBytes(0, aBlobLength).getArray(),
+ aDescription = OUString(reinterpret_cast<char*>(xDescriptionBlob->getBytes(0, aBlobLength).getArray()),
aBlobLength,
RTL_TEXTENCODING_UTF8);
}
@@ -1392,7 +1392,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
// TODO: we should actually be using CLOB here instead.
// However we haven't implemented CLOB yet, so use BLOB.
sal_Int32 aBlobLength = (sal_Int32) xBlob->length();
- sDescription = OUString((char*) xBlob->getBytes(0, aBlobLength).getArray(),
+ sDescription = OUString(reinterpret_cast<char*>(xBlob->getBytes(0, aBlobLength).getArray()),
aBlobLength,
RTL_TEXTENCODING_UTF8);
}
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index ac37c525e341..21a9d900b9e5 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -502,7 +502,7 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 nParameterIndex,
aErr = isc_put_segment(m_statusVector,
&aBlobHandle,
nWriteSize,
- (const char*) xBlob->getBytes(nDataWritten, nWriteSize).getConstArray());
+ reinterpret_cast<const char*>(xBlob->getBytes(nDataWritten, nWriteSize).getConstArray()));
nDataWritten += nWriteSize;
@@ -602,7 +602,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
aErr = isc_put_segment(m_statusVector,
&aBlobHandle,
nWriteSize,
- (const char*) xBytes.getConstArray() + nDataWritten);
+ reinterpret_cast<const char*>(xBytes.getConstArray()) + nDataWritten);
nDataWritten += nWriteSize;
if (aErr)
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 95a555190816..d3531d785f4e 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -437,7 +437,7 @@ Date OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT /*n
{
if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == SQL_TYPE_DATE)
{
- ISC_DATE aISCDate = *((ISC_DATE*) m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
+ ISC_DATE aISCDate = *(reinterpret_cast<ISC_DATE*>(m_pSqlda->sqlvar[nColumnIndex-1].sqldata));
struct tm aCTime;
isc_decode_sql_date(&aISCDate, &aCTime);
@@ -455,7 +455,7 @@ Time OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT /*n
{
if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == SQL_TYPE_TIME)
{
- ISC_TIME aISCTime = *((ISC_TIME*) m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
+ ISC_TIME aISCTime = *(reinterpret_cast<ISC_TIME*>(m_pSqlda->sqlvar[nColumnIndex-1].sqldata));
struct tm aCTime;
isc_decode_sql_time(&aISCTime, &aCTime);
@@ -475,7 +475,7 @@ DateTime OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT
{
if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == SQL_TIMESTAMP)
{
- ISC_TIMESTAMP aISCTimestamp = *((ISC_TIMESTAMP*) m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
+ ISC_TIMESTAMP aISCTimestamp = *(reinterpret_cast<ISC_TIMESTAMP*>(m_pSqlda->sqlvar[nColumnIndex-1].sqldata));
struct tm aCTime;
isc_decode_timestamp(&aISCTimestamp, &aCTime);
@@ -506,7 +506,7 @@ OUString OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT
{
// First 2 bytes are a short containing the length of the string
// No idea if sqllen is still valid here?
- sal_uInt16 aLength = *((sal_uInt16*) m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
+ sal_uInt16 aLength = *(reinterpret_cast<sal_uInt16*>(m_pSqlda->sqlvar[nColumnIndex-1].sqldata));
return OUString(m_pSqlda->sqlvar[nColumnIndex-1].sqldata + 2,
aLength,
RTL_TEXTENCODING_UTF8);
@@ -522,7 +522,7 @@ ISC_QUAD* OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHOR
{
// TODO: this is probably wrong
if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == nType)
- return (ISC_QUAD*) m_pSqlda->sqlvar[nColumnIndex-1].sqldata;
+ return reinterpret_cast<ISC_QUAD*>(m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
else
throw SQLException(); // TODO: better exception (can't convert Blob)
}
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index f0b85913182e..3e9e54356a04 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -28,7 +28,7 @@ OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector,
const OUString& rCause)
{
OUStringBuffer buf;
- const ISC_STATUS* pStatus = (const ISC_STATUS*) &rStatusVector;
+ const ISC_STATUS* pStatus = reinterpret_cast<const ISC_STATUS*>(&rStatusVector);
buf.appendAscii("firebird_sdbc error:");
try
diff --git a/connectivity/source/drivers/kab/KDEInit.cxx b/connectivity/source/drivers/kab/KDEInit.cxx
index 337b0a1ebaa5..da6122dcf28e 100644
--- a/connectivity/source/drivers/kab/KDEInit.cxx
+++ b/connectivity/source/drivers/kab/KDEInit.cxx
@@ -68,7 +68,7 @@ namespace connectivity
osl_getProcessLocale(&pProcessLocale);
// sal_Unicode and QChar are (currently) both 16 bits characters
QString aLanguage(
- (const QChar *) pProcessLocale->Language->buffer,
+ reinterpret_cast<QChar *>(pProcessLocale->Language->buffer),
(int) pProcessLocale->Language->length);
KGlobal::locale()->setLanguage(aLanguage);
diff --git a/connectivity/source/drivers/mork/MNSINIParser.cxx b/connectivity/source/drivers/mork/MNSINIParser.cxx
index b33baa1e82df..154099fd5e6d 100644
--- a/connectivity/source/drivers/mork/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mork/MNSINIParser.cxx
@@ -50,9 +50,9 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce
sal_uInt64 nPos;
if (osl_File_E_None != osl_getFilePos(handle, &nPos) || nPos >= nSize)
break;
- if (osl_File_E_None != osl_readLine(handle , (sal_Sequence **) &seq))
+ if (osl_File_E_None != osl_readLine(handle , reinterpret_cast<sal_Sequence **>(&seq)))
break;
- OString line( (const sal_Char *) seq.getConstArray(), seq.getLength() );
+ OString line( reinterpret_cast<const char *>(seq.getConstArray()), seq.getLength() );
sal_Int32 nIndex = line.indexOf('=');
if (nIndex >= 1)
{
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index c66a68f64226..bed27eef0c29 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -58,9 +58,9 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce
sal_uInt64 nPos;
if (osl_File_E_None != osl_getFilePos(handle, &nPos) || nPos >= nSize)
break;
- if (osl_File_E_None != osl_readLine(handle , (sal_Sequence **) &seq))
+ if (osl_File_E_None != osl_readLine(handle, reinterpret_cast<sal_Sequence **>(&seq)))
break;
- OString line( (const sal_Char *) seq.getConstArray(), seq.getLength() );
+ OString line(reinterpret_cast<const char *>(seq.getConstArray()), seq.getLength() );
sal_Int32 nIndex = line.indexOf('=');
if (nIndex >= 1)
{
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 27d870b0e7e9..d88bb0495335 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -110,7 +110,7 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi
memset(szConnStrOut,'\0',4096);
memset(szConnStrIn,'\0',2048);
OString aConStr(OUStringToOString(aConnectStr,getTextEncoding()));
- memcpy(szConnStrIn, (SDB_ODBC_CHAR*) aConStr.getStr(), ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()));
+ memcpy(szConnStrIn, aConStr.getStr(), ::std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()));
#ifndef MACOSX
N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_LOGIN_TIMEOUT,reinterpret_cast<SQLPOINTER>(nTimeOut),SQL_IS_UINTEGER);
@@ -315,7 +315,7 @@ OUString SAL_CALL OConnection::nativeSQL( const OUString& sql ) throw(SQLExcepti
OString aSql(OUStringToOString(sql.getStr(),getTextEncoding()));
char pOut[2048];
SQLINTEGER nOutLen;
- OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,(SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength(),(SDB_ODBC_CHAR*)pOut,sizeof pOut - 1,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aSql.getStr())),aSql.getLength(),reinterpret_cast<SDB_ODBC_CHAR*>(pOut),sizeof pOut - 1,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
return OUString(pOut,nOutLen,getTextEncoding());
}
@@ -408,7 +408,7 @@ void SAL_CALL OConnection::setCatalog( const OUString& catalog ) throw(SQLExcept
OString aCat(OUStringToOString(catalog.getStr(),getTextEncoding()));
OTools::ThrowException(this,
- N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,(SDB_ODBC_CHAR*)aCat.getStr(),SQL_NTS),
+ N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,const_cast<char *>(aCat.getStr()),SQL_NTS),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
@@ -421,7 +421,7 @@ OUString SAL_CALL OConnection::getCatalog( ) throw(SQLException, RuntimeExcepti
SQLINTEGER nValueLen;
char pCat[1024];
OTools::ThrowException(this,
- N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,(SDB_ODBC_CHAR*)pCat,(sizeof pCat)-1,&nValueLen),
+ N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,pCat,(sizeof pCat)-1,&nValueLen),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
return OUString(pCat,nValueLen,getTextEncoding());
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 420aa3eb1ef3..36d763798cec 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -892,10 +892,10 @@ void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const OUString&
pCOL = SQL_ALL_TABLE_TYPES;
SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, pCOL ? SQL_NTS : 0);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pCOL)), pCOL ? SQL_NTS : 0);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
@@ -907,7 +907,7 @@ void ODatabaseMetaDataResultSet::openTablesTypes( ) throw(SQLException, RuntimeE
0,0,
0,0,
0,0,
- (SDB_ODBC_CHAR *) SQL_ALL_TABLE_TYPES,SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(SQL_ALL_TABLE_TYPES)),SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
m_aColMapping.clear();
@@ -920,10 +920,10 @@ void ODatabaseMetaDataResultSet::openTablesTypes( ) throw(SQLException, RuntimeE
void ODatabaseMetaDataResultSet::openCatalogs() throw(SQLException, RuntimeException)
{
SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- (SDB_ODBC_CHAR *) SQL_ALL_CATALOGS,SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(SQL_ALL_CATALOGS)),SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>("")),SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>("")),SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>("")),SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
@@ -937,10 +937,10 @@ void ODatabaseMetaDataResultSet::openCatalogs() throw(SQLException, RuntimeExcep
void ODatabaseMetaDataResultSet::openSchemas() throw(SQLException, RuntimeException)
{
SQLRETURN nRetcode = N3SQLTables(m_aStatementHandle,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) SQL_ALL_SCHEMAS,SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS,
- (SDB_ODBC_CHAR *) "",SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>("")),SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(SQL_ALL_SCHEMAS)),SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>("")),SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>("")),SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
m_aColMapping.clear();
@@ -976,10 +976,10 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, cons
SQLRETURN nRetcode = N3SQLColumnPrivileges(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pCOL)), SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
@@ -1010,10 +1010,10 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog,
SQLRETURN nRetcode = N3SQLColumns(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pCOL)), SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
TInt2IntMap aMap;
@@ -1078,10 +1078,10 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog,
SQLRETURN nRetcode = N3SQLProcedureColumns(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- (SDB_ODBC_CHAR *) pCOL, SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pCOL)), SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
@@ -1111,9 +1111,9 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUStri
SQLRETURN nRetcode = N3SQLProcedures(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
}
@@ -1154,9 +1154,9 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& cat
SQLRETURN nRetcode = N3SQLSpecialColumns(m_aStatementHandle,_bRowVer ? SQL_ROWVER : SQL_BEST_ROWID,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS,
(SQLSMALLINT)scope,
nullable ? SQL_NULLABLE : SQL_NO_NULLS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
@@ -1195,12 +1195,12 @@ void ODatabaseMetaDataResultSet::openForeignKeys( const Any& catalog, const OUSt
SQLRETURN nRetcode = N3SQLForeignKeys(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKN, pPKN ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pFKQ, (catalog2.hasValue() && !aFKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pFKO, pFKO ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pFKN, SQL_NTS
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), pPKN ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pFKQ)), (catalog2.hasValue() && !aFKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pFKO)), pFKO ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pFKN)), SQL_NTS
);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
@@ -1241,9 +1241,9 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUStr
SQLRETURN nRetcode = N3SQLPrimaryKeys(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
}
@@ -1270,9 +1270,9 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const O
SQLRETURN nRetcode = N3SQLTablePrivileges(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS);
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
checkColumnCount();
}
@@ -1300,9 +1300,9 @@ void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const OUStri
SQLRETURN nRetcode = N3SQLStatistics(m_aStatementHandle,
- (SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
- (SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
- (SDB_ODBC_CHAR *) pPKN, SQL_NTS,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKO)), pPKO ? SQL_NTS : 0 ,
+ reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKN)), SQL_NTS,
unique ? SQL_INDEX_UNIQUE : SQL_INDEX_ALL,
approximate ? 1 : 0);
OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
diff --git a/connectivity/source/drivers/odbc/OFunctions.cxx b/connectivity/source/drivers/odbc/OFunctions.cxx
index 33094290490c..f332e9e4ea79 100644
--- a/connectivity/source/drivers/odbc/OFunctions.cxx
+++ b/connectivity/source/drivers/odbc/OFunctions.cxx
@@ -116,113 +116,113 @@ bool LoadLibrary_ODBC3(OUString &_rPath)
bool LoadFunctions(oslModule pODBCso)
{
- if( ( pODBC3SQLAllocHandle = (T3SQLAllocHandle)osl_getFunctionSymbol(pODBCso, OUString("SQLAllocHandle").pData )) == NULL )
+ if( ( pODBC3SQLAllocHandle = reinterpret_cast<T3SQLAllocHandle>(osl_getFunctionSymbol(pODBCso, OUString("SQLAllocHandle").pData ))) == NULL )
return false;
- if( ( pODBC3SQLConnect = (T3SQLConnect)osl_getFunctionSymbol(pODBCso, OUString("SQLConnect").pData )) == NULL )
+ if( ( pODBC3SQLConnect = reinterpret_cast<T3SQLConnect>(osl_getFunctionSymbol(pODBCso, OUString("SQLConnect").pData ))) == NULL )
return false;
- if( ( pODBC3SQLDriverConnect = (T3SQLDriverConnect)osl_getFunctionSymbol(pODBCso, OUString("SQLDriverConnect").pData )) == NULL )
+ if( ( pODBC3SQLDriverConnect = reinterpret_cast<T3SQLDriverConnect>(osl_getFunctionSymbol(pODBCso, OUString("SQLDriverConnect").pData ))) == NULL )
return false;
- if( ( pODBC3SQLBrowseConnect = (T3SQLBrowseConnect)osl_getFunctionSymbol(pODBCso, OUString("SQLBrowseConnect").pData )) == NULL )
+ if( ( pODBC3SQLBrowseConnect = reinterpret_cast<T3SQLBrowseConnect>(osl_getFunctionSymbol(pODBCso, OUString("SQLBrowseConnect").pData ))) == NULL )
return false;
- if(( pODBC3SQLDataSources = (T3SQLDataSources)osl_getFunctionSymbol(pODBCso, OUString("SQLDataSources").pData )) == NULL )
+ if(( pODBC3SQLDataSources = reinterpret_cast<T3SQLDataSources>(osl_getFunctionSymbol(pODBCso, OUString("SQLDataSources").pData ))) == NULL )
return false;
- if(( pODBC3SQLDrivers = (T3SQLDrivers)osl_getFunctionSymbol(pODBCso, OUString("SQLDrivers").pData )) == NULL )
+ if(( pODBC3SQLDrivers = reinterpret_cast<T3SQLDrivers>(osl_getFunctionSymbol(pODBCso, OUString("SQLDrivers").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetInfo = (T3SQLGetInfo)osl_getFunctionSymbol(pODBCso, OUString("SQLGetInfo").pData )) == NULL )
+ if( ( pODBC3SQLGetInfo = reinterpret_cast<T3SQLGetInfo>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetInfo").pData ))) == NULL )
return false;
- if(( pODBC3SQLGetFunctions = (T3SQLGetFunctions)osl_getFunctionSymbol(pODBCso, OUString("SQLGetFunctions").pData )) == NULL )
+ if(( pODBC3SQLGetFunctions = reinterpret_cast<T3SQLGetFunctions>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetFunctions").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetTypeInfo = (T3SQLGetTypeInfo)osl_getFunctionSymbol(pODBCso, OUString("SQLGetTypeInfo").pData )) == NULL )
+ if( ( pODBC3SQLGetTypeInfo = reinterpret_cast<T3SQLGetTypeInfo>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetTypeInfo").pData ))) == NULL )
return false;
- if( ( pODBC3SQLSetConnectAttr = (T3SQLSetConnectAttr)osl_getFunctionSymbol(pODBCso, OUString("SQLSetConnectAttr").pData )) == NULL )
+ if( ( pODBC3SQLSetConnectAttr = reinterpret_cast<T3SQLSetConnectAttr>(osl_getFunctionSymbol(pODBCso, OUString("SQLSetConnectAttr").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetConnectAttr = (T3SQLGetConnectAttr)osl_getFunctionSymbol(pODBCso, OUString("SQLGetConnectAttr").pData )) == NULL )
+ if( ( pODBC3SQLGetConnectAttr = reinterpret_cast<T3SQLGetConnectAttr>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetConnectAttr").pData ))) == NULL )
return false;
- if( ( pODBC3SQLSetEnvAttr = (T3SQLSetEnvAttr)osl_getFunctionSymbol(pODBCso, OUString("SQLSetEnvAttr").pData )) == NULL )
+ if( ( pODBC3SQLSetEnvAttr = reinterpret_cast<T3SQLSetEnvAttr>(osl_getFunctionSymbol(pODBCso, OUString("SQLSetEnvAttr").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetEnvAttr = (T3SQLGetEnvAttr)osl_getFunctionSymbol(pODBCso, OUString("SQLGetEnvAttr").pData )) == NULL )
+ if( ( pODBC3SQLGetEnvAttr = reinterpret_cast<T3SQLGetEnvAttr>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetEnvAttr").pData ))) == NULL )
return false;
- if( ( pODBC3SQLSetStmtAttr = (T3SQLSetStmtAttr)osl_getFunctionSymbol(pODBCso, OUString("SQLSetStmtAttr").pData )) == NULL )
+ if( ( pODBC3SQLSetStmtAttr = reinterpret_cast<T3SQLSetStmtAttr>(osl_getFunctionSymbol(pODBCso, OUString("SQLSetStmtAttr").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetStmtAttr = (T3SQLGetStmtAttr)osl_getFunctionSymbol(pODBCso, OUString("SQLGetStmtAttr").pData )) == NULL )
+ if( ( pODBC3SQLGetStmtAttr = reinterpret_cast<T3SQLGetStmtAttr>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetStmtAttr").pData ))) == NULL )
return false;
- if( ( pODBC3SQLPrepare = (T3SQLPrepare)osl_getFunctionSymbol(pODBCso, OUString("SQLPrepare").pData )) == NULL )
+ if( ( pODBC3SQLPrepare = reinterpret_cast<T3SQLPrepare>(osl_getFunctionSymbol(pODBCso, OUString("SQLPrepare").pData ))) == NULL )
return false;
- if( ( pODBC3SQLBindParameter = (T3SQLBindParameter)osl_getFunctionSymbol(pODBCso, OUString("SQLBindParameter").pData )) == NULL )
+ if( ( pODBC3SQLBindParameter = reinterpret_cast<T3SQLBindParameter>(osl_getFunctionSymbol(pODBCso, OUString("SQLBindParameter").pData ))) == NULL )
return false;
- if( ( pODBC3SQLSetCursorName = (T3SQLSetCursorName)osl_getFunctionSymbol(pODBCso, OUString("SQLSetCursorName").pData )) == NULL )
+ if( ( pODBC3SQLSetCursorName = reinterpret_cast<T3SQLSetCursorName>(osl_getFunctionSymbol(pODBCso, OUString("SQLSetCursorName").pData ))) == NULL )
return false;
- if( ( pODBC3SQLExecute = (T3SQLExecute)osl_getFunctionSymbol(pODBCso, OUString("SQLExecute").pData )) == NULL )
+ if( ( pODBC3SQLExecute = reinterpret_cast<T3SQLExecute>(osl_getFunctionSymbol(pODBCso, OUString("SQLExecute").pData ))) == NULL )
return false;
- if( ( pODBC3SQLExecDirect = (T3SQLExecDirect)osl_getFunctionSymbol(pODBCso, OUString("SQLExecDirect").pData )) == NULL )
+ if( ( pODBC3SQLExecDirect = reinterpret_cast<T3SQLExecDirect>(osl_getFunctionSymbol(pODBCso, OUString("SQLExecDirect").pData ))) == NULL )
return false;
- if( ( pODBC3SQLDescribeParam = (T3SQLDescribeParam)osl_getFunctionSymbol(pODBCso, OUString("SQLDescribeParam").pData )) == NULL )
+ if( ( pODBC3SQLDescribeParam = reinterpret_cast<T3SQLDescribeParam>(osl_getFunctionSymbol(pODBCso, OUString("SQLDescribeParam").pData ))) == NULL )
return false;
- if( ( pODBC3SQLNumParams = (T3SQLNumParams)osl_getFunctionSymbol(pODBCso, OUString("SQLNumParams").pData )) == NULL )
+ if( ( pODBC3SQLNumParams = reinterpret_cast<T3SQLNumParams>(osl_getFunctionSymbol(pODBCso, OUString("SQLNumParams").pData ))) == NULL )
return false;
- if( ( pODBC3SQLParamData = (T3SQLParamData)osl_getFunctionSymbol(pODBCso, OUString("SQLParamData").pData )) == NULL )
+ if( ( pODBC3SQLParamData = reinterpret_cast<T3SQLParamData>(osl_getFunctionSymbol(pODBCso, OUString("SQLParamData").pData ))) == NULL )
return false;
- if( ( pODBC3SQLPutData = (T3SQLPutData)osl_getFunctionSymbol(pODBCso, OUString("SQLPutData").pData )) == NULL )
+ if( ( pODBC3SQLPutData = reinterpret_cast<T3SQLPutData>(osl_getFunctionSymbol(pODBCso, OUString("SQLPutData").pData ))) == NULL )
return false;
- if( ( pODBC3SQLRowCount = (T3SQLRowCount)osl_getFunctionSymbol(pODBCso, OUString("SQLRowCount").pData )) == NULL )
+ if( ( pODBC3SQLRowCount = reinterpret_cast<T3SQLRowCount>(osl_getFunctionSymbol(pODBCso, OUString("SQLRowCount").pData ))) == NULL )
return false;
- if( ( pODBC3SQLNumResultCols = (T3SQLNumResultCols)osl_getFunctionSymbol(pODBCso, OUString("SQLNumResultCols").pData )) == NULL )
+ if( ( pODBC3SQLNumResultCols = reinterpret_cast<T3SQLNumResultCols>(osl_getFunctionSymbol(pODBCso, OUString("SQLNumResultCols").pData ))) == NULL )
return false;
- if( ( pODBC3SQLDescribeCol = (T3SQLDescribeCol)osl_getFunctionSymbol(pODBCso, OUString("SQLDescribeCol").pData )) == NULL )
+ if( ( pODBC3SQLDescribeCol = reinterpret_cast<T3SQLDescribeCol>(osl_getFunctionSymbol(pODBCso, OUString("SQLDescribeCol").pData ))) == NULL )
return false;
- if( ( pODBC3SQLColAttribute = (T3SQLColAttribute)osl_getFunctionSymbol(pODBCso, OUString("SQLColAttribute").pData )) == NULL )
+ if( ( pODBC3SQLColAttribute = reinterpret_cast<T3SQLColAttribute>(osl_getFunctionSymbol(pODBCso, OUString("SQLColAttribute").pData ))) == NULL )
return false;
- if( ( pODBC3SQLBindCol = (T3SQLBindCol)osl_getFunctionSymbol(pODBCso, OUString("SQLBindCol").pData )) == NULL )
+ if( ( pODBC3SQLBindCol = reinterpret_cast<T3SQLBindCol>(osl_getFunctionSymbol(pODBCso, OUString("SQLBindCol").pData ))) == NULL )
return false;
- if( ( pODBC3SQLFetch = (T3SQLFetch)osl_getFunctionSymbol(pODBCso, OUString("SQLFetch").pData )) == NULL )
+ if( ( pODBC3SQLFetch = reinterpret_cast<T3SQLFetch>(osl_getFunctionSymbol(pODBCso, OUString("SQLFetch").pData ))) == NULL )
return false;
- if( ( pODBC3SQLFetchScroll = (T3SQLFetchScroll)osl_getFunctionSymbol(pODBCso, OUString("SQLFetchScroll").pData )) == NULL )
+ if( ( pODBC3SQLFetchScroll = reinterpret_cast<T3SQLFetchScroll>(osl_getFunctionSymbol(pODBCso, OUString("SQLFetchScroll").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetData = (T3SQLGetData)osl_getFunctionSymbol(pODBCso, OUString("SQLGetData").pData )) == NULL )
+ if( ( pODBC3SQLGetData = reinterpret_cast<T3SQLGetData>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetData").pData ))) == NULL )
return false;
- if( ( pODBC3SQLSetPos = (T3SQLSetPos)osl_getFunctionSymbol(pODBCso, OUString("SQLSetPos").pData )) == NULL )
+ if( ( pODBC3SQLSetPos = reinterpret_cast<T3SQLSetPos>(osl_getFunctionSymbol(pODBCso, OUString("SQLSetPos").pData ))) == NULL )
return false;
- if( ( pODBC3SQLBulkOperations = (T3SQLBulkOperations)osl_getFunctionSymbol(pODBCso, OUString("SQLBulkOperations").pData )) == NULL )
+ if( ( pODBC3SQLBulkOperations = reinterpret_cast<T3SQLBulkOperations>(osl_getFunctionSymbol(pODBCso, OUString("SQLBulkOperations").pData ))) == NULL )
return false;
- if( ( pODBC3SQLMoreResults = (T3SQLMoreResults)osl_getFunctionSymbol(pODBCso, OUString("SQLMoreResults").pData )) == NULL )
+ if( ( pODBC3SQLMoreResults = reinterpret_cast<T3SQLMoreResults>(osl_getFunctionSymbol(pODBCso, OUString("SQLMoreResults").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetDiagRec = (T3SQLGetDiagRec)osl_getFunctionSymbol(pODBCso, OUString("SQLGetDiagRec").pData )) == NULL )
+ if( ( pODBC3SQLGetDiagRec = reinterpret_cast<T3SQLGetDiagRec>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetDiagRec").pData ))) == NULL )
return false;
- if( ( pODBC3SQLColumnPrivileges = (T3SQLColumnPrivileges)osl_getFunctionSymbol(pODBCso, OUString("SQLColumnPrivileges").pData )) == NULL )
+ if( ( pODBC3SQLColumnPrivileges = reinterpret_cast<T3SQLColumnPrivileges>(osl_getFunctionSymbol(pODBCso, OUString("SQLColumnPrivileges").pData ))) == NULL )
return false;
- if( ( pODBC3SQLColumns = (T3SQLColumns)osl_getFunctionSymbol(pODBCso, OUString("SQLColumns").pData )) == NULL )
+ if( ( pODBC3SQLColumns = reinterpret_cast<T3SQLColumns>(osl_getFunctionSymbol(pODBCso, OUString("SQLColumns").pData ))) == NULL )
return false;
- if( ( pODBC3SQLForeignKeys = (T3SQLForeignKeys)osl_getFunctionSymbol(pODBCso, OUString("SQLForeignKeys").pData )) == NULL )
+ if( ( pODBC3SQLForeignKeys = reinterpret_cast<T3SQLForeignKeys>(osl_getFunctionSymbol(pODBCso, OUString("SQLForeignKeys").pData ))) == NULL )
return false;
- if( ( pODBC3SQLPrimaryKeys = (T3SQLPrimaryKeys)osl_getFunctionSymbol(pODBCso, OUString("SQLPrimaryKeys").pData )) == NULL )
+ if( ( pODBC3SQLPrimaryKeys = reinterpret_cast<T3SQLPrimaryKeys>(osl_getFunctionSymbol(pODBCso, OUString("SQLPrimaryKeys").pData ))) == NULL )
return false;
- if( ( pODBC3SQLProcedureColumns = (T3SQLProcedureColumns)osl_getFunctionSymbol(pODBCso, OUString("SQLProcedureColumns").pData )) == NULL )
+ if( ( pODBC3SQLProcedureColumns = reinterpret_cast<T3SQLProcedureColumns>(osl_getFunctionSymbol(pODBCso, OUString("SQLProcedureColumns").pData ))) == NULL )
return false;
- if( ( pODBC3SQLProcedures = (T3SQLProcedures)osl_getFunctionSymbol(pODBCso, OUString("SQLProcedures").pData )) == NULL )
+ if( ( pODBC3SQLProcedures = reinterpret_cast<T3SQLProcedures>(osl_getFunctionSymbol(pODBCso, OUString("SQLProcedures").pData ))) == NULL )
return false;
- if( ( pODBC3SQLSpecialColumns = (T3SQLSpecialColumns)osl_getFunctionSymbol(pODBCso, OUString("SQLSpecialColumns").pData )) == NULL )
+ if( ( pODBC3SQLSpecialColumns = reinterpret_cast<T3SQLSpecialColumns>(osl_getFunctionSymbol(pODBCso, OUString("SQLSpecialColumns").pData ))) == NULL )
return false;
- if( ( pODBC3SQLStatistics = (T3SQLStatistics)osl_getFunctionSymbol(pODBCso, OUString("SQLStatistics").pData )) == NULL )
+ if( ( pODBC3SQLStatistics = reinterpret_cast<T3SQLStatistics>(osl_getFunctionSymbol(pODBCso, OUString("SQLStatistics").pData ))) == NULL )
return false;
- if( ( pODBC3SQLTablePrivileges = (T3SQLTablePrivileges)osl_getFunctionSymbol(pODBCso, OUString("SQLTablePrivileges").pData )) == NULL )
+ if( ( pODBC3SQLTablePrivileges = reinterpret_cast<T3SQLTablePrivileges>(osl_getFunctionSymbol(pODBCso, OUString("SQLTablePrivileges").pData ))) == NULL )
return false;
- if( ( pODBC3SQLTables = (T3SQLTables)osl_getFunctionSymbol(pODBCso, OUString("SQLTables").pData )) == NULL )
+ if( ( pODBC3SQLTables = reinterpret_cast<T3SQLTables>(osl_getFunctionSymbol(pODBCso, OUString("SQLTables").pData ))) == NULL )
return false;
- if( ( pODBC3SQLFreeStmt = (T3SQLFreeStmt)osl_getFunctionSymbol(pODBCso, OUString("SQLFreeStmt").pData )) == NULL )
+ if( ( pODBC3SQLFreeStmt = reinterpret_cast<T3SQLFreeStmt>(osl_getFunctionSymbol(pODBCso, OUString("SQLFreeStmt").pData ))) == NULL )
return false;
- if( ( pODBC3SQLCloseCursor = (T3SQLCloseCursor)osl_getFunctionSymbol(pODBCso, OUString("SQLCloseCursor").pData )) == NULL )
+ if( ( pODBC3SQLCloseCursor = reinterpret_cast<T3SQLCloseCursor>(osl_getFunctionSymbol(pODBCso, OUString("SQLCloseCursor").pData ))) == NULL )
return false;
- if( ( pODBC3SQLCancel = (T3SQLCancel)osl_getFunctionSymbol(pODBCso, OUString("SQLCancel").pData )) == NULL )
+ if( ( pODBC3SQLCancel = reinterpret_cast<T3SQLCancel>(osl_getFunctionSymbol(pODBCso, OUString("SQLCancel").pData ))) == NULL )
return false;
- if( ( pODBC3SQLEndTran = (T3SQLEndTran)osl_getFunctionSymbol(pODBCso, OUString("SQLEndTran").pData )) == NULL )
+ if( ( pODBC3SQLEndTran = reinterpret_cast<T3SQLEndTran>(osl_getFunctionSymbol(pODBCso, OUString("SQLEndTran").pData ))) == NULL )
return false;
- if( ( pODBC3SQLDisconnect = (T3SQLDisconnect)osl_getFunctionSymbol(pODBCso, OUString("SQLDisconnect").pData )) == NULL )
+ if( ( pODBC3SQLDisconnect = reinterpret_cast<T3SQLDisconnect>(osl_getFunctionSymbol(pODBCso, OUString("SQLDisconnect").pData ))) == NULL )
return false;
- if( ( pODBC3SQLFreeHandle = (T3SQLFreeHandle)osl_getFunctionSymbol(pODBCso, OUString("SQLFreeHandle").pData )) == NULL )
+ if( ( pODBC3SQLFreeHandle = reinterpret_cast<T3SQLFreeHandle>(osl_getFunctionSymbol(pODBCso, OUString("SQLFreeHandle").pData ))) == NULL )
return false;
- if( ( pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getFunctionSymbol(pODBCso, OUString("SQLGetCursorName").pData )) == NULL )
+ if( ( pODBC3SQLGetCursorName = reinterpret_cast<T3SQLGetCursorName>(osl_getFunctionSymbol(pODBCso, OUString("SQLGetCursorName").pData ))) == NULL )
return false;
- if( ( pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getFunctionSymbol(pODBCso, OUString("SQLNativeSql").pData )) == NULL )
+ if( ( pODBC3SQLNativeSql = reinterpret_cast<T3SQLNativeSql>(osl_getFunctionSymbol(pODBCso, OUString("SQLNativeSql").pData ))) == NULL )
return false;
return true;
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 7faa7e37a790..dec05dd69386 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -392,7 +392,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
rDataLen = _nDataLen;
SQLRETURN nRetcode;
- nRetcode = (*(T3SQLBindParameter)m_pConnection->getOdbcFunction(ODBC3SQLBindParameter))(
+ nRetcode = (*reinterpret_cast<T3SQLBindParameter>(m_pConnection->getOdbcFunction(ODBC3SQLBindParameter)))(
m_aStatementHandle,
// checkParameterIndex guarantees this is safe
static_cast<SQLUSMALLINT>(parameterIndex),
@@ -928,7 +928,7 @@ void OPreparedStatement::prepareStatement()
{
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
OString aSql(OUStringToOString(m_sSqlStatement,getOwnConnection()->getTextEncoding()));
- SQLRETURN nReturn = N3SQLPrepare(m_aStatementHandle,(SDB_ODBC_CHAR *) aSql.getStr(),aSql.getLength());
+ SQLRETURN nReturn = N3SQLPrepare(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aSql.getStr())), aSql.getLength());
OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
m_bPrepared = true;
initBoundParam();
diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx
index 57bac982018b..2012cf59dff4 100644
--- a/connectivity/source/drivers/odbc/ORealDriver.cxx
+++ b/connectivity/source/drivers/odbc/ORealDriver.cxx
@@ -107,214 +107,214 @@ oslGenericFunction ORealObdcDriver::getOdbcFunction(sal_Int32 _nIndex) const
switch(_nIndex)
{
case ODBC3SQLAllocHandle:
- pFunction = (oslGenericFunction)pODBC3SQLAllocHandle;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLAllocHandle);
break;
case ODBC3SQLConnect:
- pFunction = (oslGenericFunction)pODBC3SQLConnect;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLConnect);
break;
case ODBC3SQLDriverConnect:
- pFunction = (oslGenericFunction)pODBC3SQLDriverConnect;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLDriverConnect);
break;
case ODBC3SQLBrowseConnect:
- pFunction = (oslGenericFunction)pODBC3SQLBrowseConnect;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLBrowseConnect);
break;
case ODBC3SQLDataSources:
- pFunction = (oslGenericFunction)pODBC3SQLDataSources;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLDataSources);
break;
case ODBC3SQLDrivers:
- pFunction = (oslGenericFunction)pODBC3SQLDrivers;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLDrivers);
break;
case ODBC3SQLGetInfo:
- pFunction = (oslGenericFunction)pODBC3SQLGetInfo;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetInfo);
break;
case ODBC3SQLGetFunctions:
- pFunction = (oslGenericFunction)pODBC3SQLGetFunctions;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetFunctions);
break;
case ODBC3SQLGetTypeInfo:
- pFunction = (oslGenericFunction)pODBC3SQLGetTypeInfo;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetTypeInfo);
break;
case ODBC3SQLSetConnectAttr:
- pFunction = (oslGenericFunction)pODBC3SQLSetConnectAttr;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLSetConnectAttr);
break;
case ODBC3SQLGetConnectAttr:
- pFunction = (oslGenericFunction)pODBC3SQLGetConnectAttr;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetConnectAttr);
break;
case ODBC3SQLSetEnvAttr:
- pFunction = (oslGenericFunction)pODBC3SQLSetEnvAttr;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLSetEnvAttr);
break;
case ODBC3SQLGetEnvAttr:
- pFunction = (oslGenericFunction)pODBC3SQLGetEnvAttr;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetEnvAttr);
break;
case ODBC3SQLSetStmtAttr:
- pFunction = (oslGenericFunction)pODBC3SQLSetStmtAttr;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLSetStmtAttr);
break;
case ODBC3SQLGetStmtAttr:
- pFunction = (oslGenericFunction)pODBC3SQLGetStmtAttr;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetStmtAttr);
break;
case ODBC3SQLPrepare:
- pFunction = (oslGenericFunction)pODBC3SQLPrepare;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLPrepare);
break;
case ODBC3SQLBindParameter:
- pFunction = (oslGenericFunction)pODBC3SQLBindParameter;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLBindParameter);
break;
case ODBC3SQLSetCursorName:
- pFunction = (oslGenericFunction)pODBC3SQLSetCursorName;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLSetCursorName);
break;
case ODBC3SQLExecute:
- pFunction = (oslGenericFunction)pODBC3SQLExecute;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLExecute);
break;
case ODBC3SQLExecDirect:
- pFunction = (oslGenericFunction)pODBC3SQLExecDirect;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLExecDirect);
break;
case ODBC3SQLDescribeParam:
- pFunction = (oslGenericFunction)pODBC3SQLDescribeParam;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLDescribeParam);
break;
case ODBC3SQLNumParams:
- pFunction = (oslGenericFunction)pODBC3SQLNumParams;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLNumParams);
break;
case ODBC3SQLParamData:
- pFunction = (oslGenericFunction)pODBC3SQLParamData;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLParamData);
break;
case ODBC3SQLPutData:
- pFunction = (oslGenericFunction)pODBC3SQLPutData;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLPutData);
break;
case ODBC3SQLRowCount:
- pFunction = (oslGenericFunction)pODBC3SQLRowCount;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLRowCount);
break;
case ODBC3SQLNumResultCols:
- pFunction = (oslGenericFunction)pODBC3SQLNumResultCols;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLNumResultCols);
break;
case ODBC3SQLDescribeCol:
- pFunction = (oslGenericFunction)pODBC3SQLDescribeCol;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLDescribeCol);
break;
case ODBC3SQLColAttribute:
- pFunction = (oslGenericFunction)pODBC3SQLColAttribute;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLColAttribute);
break;
case ODBC3SQLBindCol:
- pFunction = (oslGenericFunction)pODBC3SQLBindCol;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLBindCol);
break;
case ODBC3SQLFetch:
- pFunction = (oslGenericFunction)pODBC3SQLFetch;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLFetch);
break;
case ODBC3SQLFetchScroll:
- pFunction = (oslGenericFunction)pODBC3SQLFetchScroll;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLFetchScroll);
break;
case ODBC3SQLGetData:
- pFunction = (oslGenericFunction)pODBC3SQLGetData;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetData);
break;
case ODBC3SQLSetPos:
- pFunction = (oslGenericFunction)pODBC3SQLSetPos;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLSetPos);
break;
case ODBC3SQLBulkOperations:
- pFunction = (oslGenericFunction)pODBC3SQLBulkOperations;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLBulkOperations);
break;
case ODBC3SQLMoreResults:
- pFunction = (oslGenericFunction)pODBC3SQLMoreResults;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLMoreResults);
break;
case ODBC3SQLGetDiagRec:
- pFunction = (oslGenericFunction)pODBC3SQLGetDiagRec;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetDiagRec);
break;
case ODBC3SQLColumnPrivileges:
- pFunction = (oslGenericFunction)pODBC3SQLColumnPrivileges;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLColumnPrivileges);
break;
case ODBC3SQLColumns:
- pFunction = (oslGenericFunction)pODBC3SQLColumns;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLColumns);
break;
case ODBC3SQLForeignKeys:
- pFunction = (oslGenericFunction)pODBC3SQLForeignKeys;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLForeignKeys);
break;
case ODBC3SQLPrimaryKeys:
- pFunction = (oslGenericFunction)pODBC3SQLPrimaryKeys;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLPrimaryKeys);
break;
case ODBC3SQLProcedureColumns:
- pFunction = (oslGenericFunction)pODBC3SQLProcedureColumns;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLProcedureColumns);
break;
case ODBC3SQLProcedures:
- pFunction = (oslGenericFunction)pODBC3SQLProcedures;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLProcedures);
break;
case ODBC3SQLSpecialColumns:
- pFunction = (oslGenericFunction)pODBC3SQLSpecialColumns;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLSpecialColumns);
break;
case ODBC3SQLStatistics:
- pFunction = (oslGenericFunction)pODBC3SQLStatistics;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLStatistics);
break;
case ODBC3SQLTablePrivileges:
- pFunction = (oslGenericFunction)pODBC3SQLTablePrivileges;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLTablePrivileges);
break;
case ODBC3SQLTables:
- pFunction = (oslGenericFunction)pODBC3SQLTables;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLTables);
break;
case ODBC3SQLFreeStmt:
- pFunction = (oslGenericFunction)pODBC3SQLFreeStmt;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLFreeStmt);
break;
case ODBC3SQLCloseCursor:
- pFunction = (oslGenericFunction)pODBC3SQLCloseCursor;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLCloseCursor);
break;
case ODBC3SQLCancel:
- pFunction = (oslGenericFunction)pODBC3SQLCancel;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLCancel);
break;
case ODBC3SQLEndTran:
- pFunction = (oslGenericFunction)pODBC3SQLEndTran;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLEndTran);
break;
case ODBC3SQLDisconnect:
- pFunction = (oslGenericFunction)pODBC3SQLDisconnect;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLDisconnect);
break;
case ODBC3SQLFreeHandle:
- pFunction = (oslGenericFunction)pODBC3SQLFreeHandle;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLFreeHandle);
break;
case ODBC3SQLGetCursorName:
- pFunction = (oslGenericFunction)pODBC3SQLGetCursorName;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLGetCursorName);
break;
case ODBC3SQLNativeSql:
- pFunction = (oslGenericFunction)pODBC3SQLNativeSql;
+ pFunction = reinterpret_cast<oslGenericFunction>(pODBC3SQLNativeSql);
break;
default:
OSL_FAIL("Function unknown!");
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index 149a1642ef8c..79e6afc6515c 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -1343,7 +1343,7 @@ OUString OResultSet::getCursorName() const
SQLCHAR pName[258];
SQLSMALLINT nRealLen = 0;
N3SQLGetCursorName(m_aStatementHandle,(SQLCHAR*)pName,256,&nRealLen);
- return OUString::createFromAscii((const char*)pName);
+ return OUString::createFromAscii(reinterpret_cast<char*>(pName));
}
bool OResultSet::isBookmarkable() const
diff --git a/connectivity/source/drivers/odbc/OResultSetMetaData.cxx b/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
index 5eb1bb1cae2b..1fb6dd38bb58 100644
--- a/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
+++ b/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
@@ -83,7 +83,7 @@ SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
,sal_Int32 _ident) throw(SQLException, RuntimeException)
{
SQLLEN nValue=0;
- OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*reinterpret_cast<T3SQLColAttribute>(_pConnection->getOdbcFunction(ODBC3SQLColAttribute)))(_aStatementHandle,
(SQLUSMALLINT)_column,
(SQLUSMALLINT)_ident,
NULL,
diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index e6bdf6d20feb..3026eaa12b65 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -353,7 +353,7 @@ sal_Bool SAL_CALL OStatement_Base::execute( const OUString& sql ) throw(SQLExcep
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
try {
- THROW_SQL(N3SQLExecDirect(m_aStatementHandle, (SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength()));
+ THROW_SQL(N3SQLExecDirect(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aSql.getStr())), aSql.getLength()));
}
catch (const SQLWarning& ex) {
@@ -504,7 +504,7 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException,
}
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- THROW_SQL(N3SQLExecDirect(m_aStatementHandle, (SDB_ODBC_CHAR*)aBatchSql.getStr(),aBatchSql.getLength()));
+ THROW_SQL(N3SQLExecDirect(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aBatchSql.getStr())), aBatchSql.getLength()));
Sequence< sal_Int32 > aRet(nLen);
sal_Int32* pArray = aRet.getArray();
@@ -732,7 +732,7 @@ OUString OStatement_Base::getCursorName() const
SQLSMALLINT nRealLen = 0;
SQLRETURN nRetCode = N3SQLGetCursorName(m_aStatementHandle,(SQLCHAR*)pName,256,&nRealLen);
OSL_UNUSED( nRetCode );
- return OUString::createFromAscii((const char*)pName);
+ return OUString::createFromAscii(reinterpret_cast<char*>(pName));
}
void OStatement_Base::setQueryTimeOut(sal_Int64 seconds)
@@ -861,7 +861,7 @@ void OStatement_Base::setCursorName(const OUString &_par0)
{
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
OString aName(OUStringToOString(_par0,getOwnConnection()->getTextEncoding()));
- N3SQLSetCursorName(m_aStatementHandle,(SDB_ODBC_CHAR*)aName.getStr(),(SQLSMALLINT)aName.getLength());
+ N3SQLSetCursorName(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aName.getStr())), (SQLSMALLINT)aName.getLength());
}
bool OStatement_Base::isUsingBookmarks() const
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx
index e09a89b1d701..d8533e47c1c2 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -140,7 +140,7 @@ void OTools::getValue( OConnection* _pConnection,
OSL_ENSURE(static_cast<size_t>(_nSize) >= properSize, "memory region is too small");
SQLLEN pcbValue = SQL_NULL_DATA;
OTools::ThrowException(_pConnection,
- (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
+ (*reinterpret_cast<T3SQLGetData>(_pConnection->getOdbcFunction(ODBC3SQLGetData)))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
_nType,
_pValue,
@@ -176,7 +176,7 @@ void OTools::bindValue( OConnection* _pConnection,
if (columnIndex != 0 && !_pValue)
{
*pLen = SQL_NULL_DATA;
- nRetcode = (*(T3SQLBindCol)_pConnection->getOdbcFunction(ODBC3SQLBindCol))(_aStatementHandle,
+ nRetcode = (*reinterpret_cast<T3SQLBindCol>(_pConnection->getOdbcFunction(ODBC3SQLBindCol)))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
fCType,
_pData,
@@ -277,7 +277,7 @@ void OTools::bindValue( OConnection* _pConnection,
{
}
- nRetcode = (*(T3SQLBindCol)_pConnection->getOdbcFunction(ODBC3SQLBindCol))(_aStatementHandle,
+ nRetcode = (*reinterpret_cast<T3SQLBindCol>(_pConnection->getOdbcFunction(ODBC3SQLBindCol)))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
fCType,
_pData,
@@ -330,7 +330,7 @@ void OTools::ThrowException(const OConnection* _pConnection,
// statements of this connection [what in this case will probably be the same, but the Reference
// Manual isn't totally clear in this...].
// corresponding for hdbc.
- SQLRETURN n = (*(T3SQLGetDiagRec)_pConnection->getOdbcFunction(ODBC3SQLGetDiagRec))(_nHandleType,_pContext,1,
+ SQLRETURN n = (*reinterpret_cast<T3SQLGetDiagRec>(_pConnection->getOdbcFunction(ODBC3SQLGetDiagRec)))(_nHandleType,_pContext,1,
szSqlState,
&pfNativeError,
szErrorMessage,sizeof szErrorMessage - 1,&pcbErrorMsg);
@@ -339,9 +339,9 @@ void OTools::ThrowException(const OConnection* _pConnection,
OSL_ENSURE(n == SQL_SUCCESS || n == SQL_SUCCESS_WITH_INFO || n == SQL_NO_DATA_FOUND || n == SQL_ERROR,"SdbODBC3_SetStatus: SQLError failed");
// For the Return Code of SQLError see ODBC 2.0 Programmer's Reference Page 287ff
- throw SQLException( OUString((char *)szErrorMessage,pcbErrorMsg,_nTextEncoding),
+ throw SQLException( OUString(reinterpret_cast<char *>(szErrorMessage), pcbErrorMsg, _nTextEncoding),
_xInterface,
- OUString((char *)szSqlState,5,_nTextEncoding),
+ OUString(reinterpret_cast<char *>(szSqlState), 5, _nTextEncoding),
pfNativeError,
Any()
);
@@ -368,7 +368,7 @@ Sequence<sal_Int8> OTools::getBytesValue(const OConnection* _pConnection,
while (pcbValue == SQL_NO_TOTAL || pcbValue > nMaxLen)
{
OTools::ThrowException(_pConnection,
- (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(
+ (*reinterpret_cast<T3SQLGetData>(_pConnection->getOdbcFunction(ODBC3SQLGetData)))(
_aStatementHandle,
(SQLUSMALLINT)columnIndex,
_fSqlType,
@@ -428,7 +428,7 @@ OUString OTools::getStringValue(OConnection* _pConnection,
while ((pcbValue == SQL_NO_TOTAL ) || (pcbValue >= nMaxSize) )
{
OTools::ThrowException(_pConnection,
- (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(
+ (*reinterpret_cast<T3SQLGetData>(_pConnection->getOdbcFunction(ODBC3SQLGetData)))(
_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_WCHAR,
@@ -472,7 +472,7 @@ OUString OTools::getStringValue(OConnection* _pConnection,
while ((pcbValue == SQL_NO_TOTAL ) || (pcbValue >= nMaxLen) )
{
OTools::ThrowException(_pConnection,
- (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(
+ (*reinterpret_cast<T3SQLGetData>(_pConnection->getOdbcFunction(ODBC3SQLGetData)))(
_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_CHAR,
@@ -520,7 +520,7 @@ void OTools::GetInfo(OConnection* _pConnection,
char aValue[512];
SQLSMALLINT nValueLen=0;
OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,aValue,(sizeof aValue)-1,&nValueLen),
+ (*reinterpret_cast<T3SQLGetInfo>(_pConnection->getOdbcFunction(ODBC3SQLGetInfo)))(_aConnectionHandle,_nInfo,aValue,(sizeof aValue)-1,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
_rValue = OUString(aValue,nValueLen,_nTextEncoding);
@@ -535,7 +535,7 @@ void OTools::GetInfo(OConnection* _pConnection,
SQLSMALLINT nValueLen;
_rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
+ (*reinterpret_cast<T3SQLGetInfo>(_pConnection->getOdbcFunction(ODBC3SQLGetInfo)))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
}
@@ -548,7 +548,7 @@ void OTools::GetInfo(OConnection* _pConnection,
SQLSMALLINT nValueLen;
_rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
+ (*reinterpret_cast<T3SQLGetInfo>(_pConnection->getOdbcFunction(ODBC3SQLGetInfo)))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
}
@@ -561,7 +561,7 @@ void OTools::GetInfo(OConnection* _pConnection,
SQLSMALLINT nValueLen;
_rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
+ (*reinterpret_cast<T3SQLGetInfo>(_pConnection->getOdbcFunction(ODBC3SQLGetInfo)))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
}
@@ -573,7 +573,7 @@ void OTools::GetInfo(OConnection* _pConnection,
{
SQLSMALLINT nValueLen;
OTools::ThrowException(_pConnection,
- (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
+ (*reinterpret_cast<T3SQLGetInfo>(_pConnection->getOdbcFunction(ODBC3SQLGetInfo)))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
}
diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index 3fd0d7492f38..1a05cb7662c2 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -523,8 +523,8 @@ Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 columnIndex )
OString val = OUStringToOString( ustr, RTL_TEXTENCODING_ASCII_US );
size_t length;
- char * res = (char*) PQunescapeBytea( (unsigned char *)val.getStr() , &length);
- ret = Sequence< sal_Int8 > ( (sal_Int8*)res, length );
+ char * res = reinterpret_cast<char*>(PQunescapeBytea( reinterpret_cast<unsigned char const *>(val.getStr()), &length));
+ ret = Sequence< sal_Int8 > ( reinterpret_cast<sal_Int8*>(res), length );
if( res )
free( res );
}
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 5e241268efc1..285462d83a63 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -147,7 +147,7 @@ static sal_Int32 readLogLevelFromConfiguration()
sal_Int32 loglevel = LogLevel::NONE;
OUString fileName;
osl_getModuleURLFromAddress(
- (void*) readLogLevelFromConfiguration, (rtl_uString **) &fileName );
+ (void*) readLogLevelFromConfiguration, &fileName.pData );
fileName = fileName.copy( fileName.lastIndexOf( '/' )+1 );
#ifdef MACOSX
fileName += "../Resources/";
@@ -279,7 +279,7 @@ Reference< XStatement > Connection::createStatement() throw (SQLException, Runti
Statement *stmt = new Statement( m_refMutex, this , &m_settings );
Reference< XStatement > ret( stmt );
::rtl::ByteSequence id( 16 );
- rtl_createUuid( (sal_uInt8*) id.getConstArray(), 0 , sal_False );
+ rtl_createUuid( reinterpret_cast<sal_uInt8*>(id.getArray()), 0, sal_False );
m_myStatements[ id ] = Reference< XCloseable > ( stmt );
stmt->queryAdapter()->addReference( new ClosableReference( id, this ) );
return ret;
@@ -296,7 +296,7 @@ Reference< XPreparedStatement > Connection::prepareStatement( const OUString& sq
Reference< XPreparedStatement > ret = stmt;
::rtl::ByteSequence id( 16 );
- rtl_createUuid( (sal_uInt8*) id.getConstArray(), 0 , sal_False );
+ rtl_createUuid( reinterpret_cast<sal_uInt8*>(id.getArray()), 0, sal_False );
m_myStatements[ id ] = Reference< XCloseable > ( stmt );
stmt->queryAdapter()->addReference( new ClosableReference( id, this ) );
return ret;
diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx
index 20526ce51af3..848dc70a4edf 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.hxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.hxx
@@ -142,7 +142,7 @@ struct HashByteSequence
{
sal_Int32 operator () ( const ::rtl::ByteSequence & seq ) const
{
- return *(sal_Int32*) seq.getConstArray();
+ return *reinterpret_cast<sal_Int32 const *>(seq.getConstArray());
}
};
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index 5a7bbe6dd5e4..217b96687d7c 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -576,14 +576,14 @@ void PreparedStatement::setBytes(
buf.append( "'" );
size_t len;
unsigned char * escapedString =
- PQescapeBytea( (unsigned char *)x.getConstArray(), x.getLength(), &len);
+ PQescapeBytea( reinterpret_cast<unsigned char const *>(x.getConstArray()), x.getLength(), &len);
if( ! escapedString )
{
throw SQLException(
"pq_preparedstatement.setBytes: Error during converting bytesequence to an SQL conform string",
*this, OUString(), 1, Any() );
}
- buf.append( (const sal_Char *)escapedString, len -1 );
+ buf.append( reinterpret_cast<char *>(escapedString), len -1 );
free( escapedString );
buf.append( "'" );
m_vars[parameterIndex-1] = buf.makeStringAndClear();
diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
index dfe3f42c0e9b..8241b179355b 100644
--- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
@@ -491,7 +491,7 @@ void UpdateableResultSet::updateBytes( sal_Int32 columnIndex, const ::com::sun::
size_t len;
unsigned char * escapedString =
- PQescapeBytea( (unsigned char *)x.getConstArray(), x.getLength(), &len);
+ PQescapeBytea( reinterpret_cast<unsigned char const *>(x.getConstArray()), x.getLength(), &len);
if( ! escapedString )
{
throw SQLException(
@@ -501,7 +501,7 @@ void UpdateableResultSet::updateBytes( sal_Int32 columnIndex, const ::com::sun::
// buf.append( (const sal_Char *)escapedString, len -1 );
m_updateableField[columnIndex-1].value <<=
- OUString( (sal_Char*) escapedString, len, RTL_TEXTENCODING_ASCII_US );
+ OUString( reinterpret_cast<char*>(escapedString), len, RTL_TEXTENCODING_ASCII_US );
free( escapedString );
}
diff --git a/connectivity/source/inc/odbc/OFunctions.hxx b/connectivity/source/inc/odbc/OFunctions.hxx
index feeda59537a0..677587e59cea 100644
--- a/connectivity/source/inc/odbc/OFunctions.hxx
+++ b/connectivity/source/inc/odbc/OFunctions.hxx
@@ -34,11 +34,11 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
// Connecting to a data source
typedef SQLRETURN (SQL_API *T3SQLAllocHandle) (SQLSMALLINT HandleType,SQLHANDLE InputHandle,SQLHANDLE * OutputHandlePtr);
- #define N3SQLAllocHandle(a,b,c) (*(T3SQLAllocHandle)getOdbcFunction(ODBC3SQLAllocHandle))(a,b,c)
+ #define N3SQLAllocHandle(a,b,c) (*reinterpret_cast<T3SQLAllocHandle>(getOdbcFunction(ODBC3SQLAllocHandle)))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLConnect) (SQLHDBC ConnectionHandle,SQLCHAR *ServerName,SQLSMALLINT NameLength1,SQLCHAR *UserName,SQLSMALLINT NameLength2,SQLCHAR *Authentication,SQLSMALLINT NameLength3);
- #define N3SQLConnect(a,b,c,d,e,f,g) (*(T3SQLConnect)getOdbcFunction(ODBC3SQLConnect))(a,b,c,d,e,f,g)
+ #define N3SQLConnect(a,b,c,d,e,f,g) (*reinterpret_cast<T3SQLConnect>(getOdbcFunction(ODBC3SQLConnect)))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLDriverConnect) ( SQLHDBC ConnectionHandle,
HWND WindowHandle,
@@ -49,7 +49,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT * StringLength2Ptr,
SQLUSMALLINT DriverCompletion);
- #define N3SQLDriverConnect(a,b,c,d,e,f,g,h) (*(T3SQLDriverConnect)getOdbcFunction(ODBC3SQLDriverConnect))(a,b,c,d,e,f,g,h)
+ #define N3SQLDriverConnect(a,b,c,d,e,f,g,h) (*reinterpret_cast<T3SQLDriverConnect>(getOdbcFunction(ODBC3SQLDriverConnect)))(a,b,c,d,e,f,g,h)
typedef SQLRETURN (SQL_API *T3SQLBrowseConnect) ( SQLHDBC ConnectionHandle,
SQLCHAR * InConnectionString,
@@ -58,7 +58,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLength2Ptr);
- #define N3SQLBrowseConnect(a,b,c,d,e,f) (*(T3SQLBrowseConnect)getOdbcFunction(ODBC3SQLBrowseConnect))(a,b,c,d,e,f)
+ #define N3SQLBrowseConnect(a,b,c,d,e,f) (*reinterpret_cast<T3SQLBrowseConnect>(getOdbcFunction(ODBC3SQLBrowseConnect)))(a,b,c,d,e,f)
// Obtaining information about a driver and data source
typedef SQLRETURN (SQL_API *T3SQLDataSources) ( SQLHENV EnvironmentHandle,
@@ -70,7 +70,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT BufferLength2,
SQLSMALLINT * NameLength2Ptr);
- #define N3SQLDataSources(a,b,c,d,e,f,g,h) (*(T3SQLDataSources)getOdbcFunction(ODBC3SQLDataSources))(a,b,c,d,e,f,g,h)
+ #define N3SQLDataSources(a,b,c,d,e,f,g,h) (*reinterpret_cast<T3SQLDataSources>(getOdbcFunction(ODBC3SQLDataSources)))(a,b,c,d,e,f,g,h)
typedef SQLRETURN (SQL_API *T3SQLDrivers) ( SQLHENV EnvironmentHandle,
SQLUSMALLINT Direction,
@@ -81,7 +81,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT BufferLength2,
SQLSMALLINT * AttributesLengthPtr);
- #define N3SQLDrivers(a,b,c,d,e,f,g,h) (*(T3SQLDrivers)getOdbcFunction(ODBC3SQLDrivers))(a,b,c,d,e,f,g,h)
+ #define N3SQLDrivers(a,b,c,d,e,f,g,h) (*reinterpret_cast<T3SQLDrivers>(getOdbcFunction(ODBC3SQLDrivers)))(a,b,c,d,e,f,g,h)
typedef SQLRETURN (SQL_API *T3SQLGetInfo) ( SQLHDBC ConnectionHandle,
SQLUSMALLINT InfoType,
@@ -89,18 +89,18 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr);
- #define N3SQLGetInfo(a,b,c,d,e) (*(T3SQLGetInfo)getOdbcFunction(ODBC3SQLGetInfo))(a,b,c,d,e)
+ #define N3SQLGetInfo(a,b,c,d,e) (*reinterpret_cast<T3SQLGetInfo>(getOdbcFunction(ODBC3SQLGetInfo)))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLGetFunctions) (SQLHDBC ConnectionHandle,
SQLUSMALLINT FunctionId,
SQLUSMALLINT * SupportedPtr);
- #define N3SQLGetFunctions(a,b,c) (*(T3SQLGetFunctions)getOdbcFunction(ODBC3SQLGetFunctions))(a,b,c)
+ #define N3SQLGetFunctions(a,b,c) (*reinterpret_cast<T3SQLGetFunctions>(getOdbcFunction(ODBC3SQLGetFunctions)))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLGetTypeInfo) ( SQLHSTMT StatementHandle,
SQLSMALLINT DataType);
- #define N3SQLGetTypeInfo(a,b) (*(T3SQLGetTypeInfo)getOdbcFunction(ODBC3SQLGetTypeInfo))(a,b)
+ #define N3SQLGetTypeInfo(a,b) (*reinterpret_cast<T3SQLGetTypeInfo>(getOdbcFunction(ODBC3SQLGetTypeInfo)))(a,b)
// Setting and retrieving driver attributes
typedef SQLRETURN (SQL_API *T3SQLSetConnectAttr)(SQLHDBC ConnectionHandle,
@@ -108,7 +108,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLPOINTER ValuePtr,
SQLINTEGER StringLength);
- #define N3SQLSetConnectAttr(a,b,c,d) (*(T3SQLSetConnectAttr)getOdbcFunction(ODBC3SQLSetConnectAttr))(a,b,c,d)
+ #define N3SQLSetConnectAttr(a,b,c,d) (*reinterpret_cast<T3SQLSetConnectAttr>(getOdbcFunction(ODBC3SQLSetConnectAttr)))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLGetConnectAttr) (SQLHDBC ConnectionHandle,
SQLINTEGER Attribute,
@@ -116,7 +116,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLINTEGER BufferLength,
SQLINTEGER* StringLength);
- #define N3SQLGetConnectAttr(a,b,c,d,e) (*(T3SQLGetConnectAttr)getOdbcFunction(ODBC3SQLGetConnectAttr))(a,b,c,d,e)
+ #define N3SQLGetConnectAttr(a,b,c,d,e) (*reinterpret_cast<T3SQLGetConnectAttr>(getOdbcFunction(ODBC3SQLGetConnectAttr)))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLSetEnvAttr) ( SQLHENV EnvironmentHandle,
@@ -124,7 +124,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLPOINTER ValuePtr,
SQLINTEGER StringLength);
- #define N3SQLSetEnvAttr(a,b,c,d) (*(T3SQLSetEnvAttr)getOdbcFunction(ODBC3SQLSetEnvAttr))(a,b,c,d)
+ #define N3SQLSetEnvAttr(a,b,c,d) (*reinterpret_cast<T3SQLSetEnvAttr>(getOdbcFunction(ODBC3SQLSetEnvAttr)))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLGetEnvAttr) ( SQLHENV EnvironmentHandle,
SQLINTEGER Attribute,
@@ -132,7 +132,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLINTEGER BufferLength,
SQLINTEGER* StringLength);
- #define N3SQLGetEnvAttr(a,b,c,d,e) (*(T3SQLGetEnvAttr)getOdbcFunction(ODBC3SQLGetEnvAttr))(a,b,c,d,e)
+ #define N3SQLGetEnvAttr(a,b,c,d,e) (*reinterpret_cast<T3SQLGetEnvAttr>(getOdbcFunction(ODBC3SQLGetEnvAttr)))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLSetStmtAttr) ( SQLHSTMT StatementHandle,
@@ -140,7 +140,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLPOINTER ValuePtr,
SQLINTEGER StringLength);
- #define N3SQLSetStmtAttr(a,b,c,d) (*(T3SQLSetStmtAttr)getOdbcFunction(ODBC3SQLSetStmtAttr))(a,b,c,d)
+ #define N3SQLSetStmtAttr(a,b,c,d) (*reinterpret_cast<T3SQLSetStmtAttr>(getOdbcFunction(ODBC3SQLSetStmtAttr)))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLGetStmtAttr) ( SQLHSTMT StatementHandle,
SQLINTEGER Attribute,
@@ -148,7 +148,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLINTEGER BufferLength,
SQLINTEGER* StringLength);
- #define N3SQLGetStmtAttr(a,b,c,d,e) (*(T3SQLGetStmtAttr)getOdbcFunction(ODBC3SQLGetStmtAttr))(a,b,c,d,e)
+ #define N3SQLGetStmtAttr(a,b,c,d,e) (*reinterpret_cast<T3SQLGetStmtAttr>(getOdbcFunction(ODBC3SQLGetStmtAttr)))(a,b,c,d,e)
// Setting and retrieving descriptor fields
/*typedef SQLRETURN (SQL_API *T3SQLSetDescField) (SQLHDESC DescriptorHandle,
@@ -157,7 +157,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength);
- #define N3SQLSetDescField(a,b,c,d,e) (*(T3SQLSetDescField)getOdbcFunction(ODBC3SQLSetDescField))(a,b,c,d,e)
+ #define N3SQLSetDescField(a,b,c,d,e) (*reinterpret_cast<T3SQLSetDescField>(getOdbcFunction(ODBC3SQLSetDescField)))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLGetDescField) ( SQLHDESC DescriptorHandle,
SQLSMALLINT RecNumber,
@@ -166,7 +166,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLINTEGER BufferLength,
SQLINTEGER * StringLengthPtr);
- #define N3SQLGetDescField(a,b,c,d,e,f) (*(T3SQLGetDescField)getOdbcFunction(ODBC3SQLGetDescField))(a,b,c,d,e,f)
+ #define N3SQLGetDescField(a,b,c,d,e,f) (*reinterpret_cast<T3SQLGetDescField>(getOdbcFunction(ODBC3SQLGetDescField)))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLGetDescRec) ( SQLHDESC DescriptorHandle,
@@ -181,7 +181,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT * ScalePtr,
SQLSMALLINT * NullablePtr);
- #define N3SQLGetDescRec(a,b,c,d,e,f,g,h,i,j,k) (*(T3SQLGetDescRec)getOdbcFunction(ODBC3SQLGetDescRec))(a,b,c,d,e,f,g,h,i,j,k)
+ #define N3SQLGetDescRec(a,b,c,d,e,f,g,h,i,j,k) (*reinterpret_cast<T3SQLGetDescRec>(getOdbcFunction(ODBC3SQLGetDescRec)))(a,b,c,d,e,f,g,h,i,j,k)
typedef SQLRETURN (SQL_API *T3SQLSetDescRec) ( SQLHDESC DescriptorHandle,
@@ -195,7 +195,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLLEN * StringLengthPtr,
SQLLEN * IndicatorPtr);
- #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j)
+ #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*reinterpret_cast<T3SQLSetDescRec>(getOdbcFunction(ODBC3SQLSetDescRec)))(a,b,c,d,e,f,g,h,i,j)
*/
// Preparing SQL requests
@@ -203,7 +203,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * StatementText,
SQLINTEGER TextLength);
- #define N3SQLPrepare(a,b,c) (*(T3SQLPrepare)getOdbcFunction(ODBC3SQLPrepare))(a,b,c)
+ #define N3SQLPrepare(a,b,c) (*reinterpret_cast<T3SQLPrepare>(getOdbcFunction(ODBC3SQLPrepare)))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLBindParameter) (SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
@@ -216,32 +216,32 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLLEN BufferLength,
SQLLEN * StrLen_or_IndPtr);
- #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j)
+ #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*reinterpret_cast<T3SQLBindParameter>(getOdbcFunction(ODBC3SQLBindParameter)))(a,b,c,d,e,f,g,h,i,j)
/*typedef SQLRETURN (SQL_API *T3SQLGetCursorName) (SQLHSTMT StatementHandle,
SQLCHAR * CursorName,
SQLSMALLINT BufferLength,
SQLSMALLINT * NameLengthPtr);
- #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d)
+ #define N3SQLGetCursorName(a,b,c,d) (*reinterpret_cast<T3SQLGetCursorName>(getOdbcFunction(ODBC3SQLGetCursorName)))(a,b,c,d)
*/
typedef SQLRETURN (SQL_API *T3SQLSetCursorName) (SQLHSTMT StatementHandle,
SQLCHAR * CursorName,
SQLSMALLINT NameLength);
- #define N3SQLSetCursorName(a,b,c) (*(T3SQLSetCursorName)getOdbcFunction(ODBC3SQLSetCursorName))(a,b,c)
+ #define N3SQLSetCursorName(a,b,c) (*reinterpret_cast<T3SQLSetCursorName>(getOdbcFunction(ODBC3SQLSetCursorName)))(a,b,c)
// Submitting requests
typedef SQLRETURN (SQL_API *T3SQLExecute) ( SQLHSTMT StatementHandle);
- #define N3SQLExecute(a) (*(T3SQLExecute)getOdbcFunction(ODBC3SQLExecute))(a)
+ #define N3SQLExecute(a) (*reinterpret_cast<T3SQLExecute>(getOdbcFunction(ODBC3SQLExecute)))(a)
typedef SQLRETURN (SQL_API *T3SQLExecDirect) ( SQLHSTMT StatementHandle,
SQLCHAR * StatementText,
SQLINTEGER TextLength);
- #define N3SQLExecDirect(a,b,c) (*(T3SQLExecDirect)getOdbcFunction(ODBC3SQLExecDirect))(a,b,c)
+ #define N3SQLExecDirect(a,b,c) (*reinterpret_cast<T3SQLExecDirect>(getOdbcFunction(ODBC3SQLExecDirect)))(a,b,c)
/*typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHDBC ConnectionHandle,
SQLCHAR * InStatementText,
@@ -250,7 +250,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLINTEGER BufferLength,
SQLINTEGER * TextLength2Ptr);
- #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)*/
+ #define N3SQLNativeSql(a,b,c,d,e,f) (*reinterpret_cast<T3SQLNativeSql>(getOdbcFunction(ODBC3SQLNativeSql)))(a,b,c,d,e,f)*/
typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
@@ -259,34 +259,34 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT * DecimalDigitsPtr,
SQLSMALLINT * NullablePtr);
- #define N3SQLDescribeParam(a,b,c,d,e,f) (*(T3SQLDescribeParam)getOdbcFunction(ODBC3SQLDescribeParam))(a,b,c,d,e,f)
+ #define N3SQLDescribeParam(a,b,c,d,e,f) (*reinterpret_cast<T3SQLDescribeParam>(getOdbcFunction(ODBC3SQLDescribeParam)))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLNumParams) ( SQLHSTMT StatementHandle,
SQLSMALLINT * ParameterCountPtr);
- #define N3SQLNumParams(a,b) (*(T3SQLNumParams)getOdbcFunction(ODBC3SQLNumParams))(a,b)
+ #define N3SQLNumParams(a,b) (*reinterpret_cast<T3SQLNumParams>(getOdbcFunction(ODBC3SQLNumParams)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLParamData) ( SQLHSTMT StatementHandle,
SQLPOINTER * ValuePtrPtr);
- #define N3SQLParamData(a,b) (*(T3SQLParamData)getOdbcFunction(ODBC3SQLParamData))(a,b)
+ #define N3SQLParamData(a,b) (*reinterpret_cast<T3SQLParamData>(getOdbcFunction(ODBC3SQLParamData)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle,
SQLPOINTER DataPtr,
SQLLEN StrLen_or_Ind);
- #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c)
+ #define N3SQLPutData(a,b,c) (*reinterpret_cast<T3SQLPutData>(getOdbcFunction(ODBC3SQLPutData)))(a,b,c)
// Retrieving results and information about results
typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle,
SQLLEN * RowCountPtr);
- #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b)
+ #define N3SQLRowCount(a,b) (*reinterpret_cast<T3SQLRowCount>(getOdbcFunction(ODBC3SQLRowCount)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLNumResultCols) (SQLHSTMT StatementHandle,
SQLSMALLINT * ColumnCountPtr);
- #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b)
+ #define N3SQLNumResultCols(a,b) (*reinterpret_cast<T3SQLNumResultCols>(getOdbcFunction(ODBC3SQLNumResultCols)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -298,7 +298,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT * DecimalDigitsPtr,
SQLSMALLINT * NullablePtr);
- #define N3SQLDescribeCol(a,b,c,d,e,f,g,h,i) (*(T3SQLDescribeCol)getOdbcFunction(ODBC3SQLDescribeCol))(a,b,c,d,e,f,g,h,i)
+ #define N3SQLDescribeCol(a,b,c,d,e,f,g,h,i) (*reinterpret_cast<T3SQLDescribeCol>(getOdbcFunction(ODBC3SQLDescribeCol)))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLColAttribute) (SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -308,7 +308,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT * StringLengthPtr,
SQLLEN * NumericAttributePtr);
- #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g)
+ #define N3SQLColAttribute(a,b,c,d,e,f,g) (*reinterpret_cast<T3SQLColAttribute>(getOdbcFunction(ODBC3SQLColAttribute)))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLBindCol) ( SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -317,17 +317,17 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLLEN BufferLength,
SQLLEN * StrLen_or_IndPtr);
- #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f)
+ #define N3SQLBindCol(a,b,c,d,e,f) (*reinterpret_cast<T3SQLBindCol>(getOdbcFunction(ODBC3SQLBindCol)))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLFetch) ( SQLHSTMT StatementHandle);
- #define N3SQLFetch(a) (*(T3SQLFetch)getOdbcFunction(ODBC3SQLFetch))(a)
+ #define N3SQLFetch(a) (*reinterpret_cast<T3SQLFetch>(getOdbcFunction(ODBC3SQLFetch)))(a)
typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle,
SQLSMALLINT FetchOrientation,
SQLLEN FetchOffset);
- #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c)
+ #define N3SQLFetchScroll(a,b,c) (*reinterpret_cast<T3SQLFetchScroll>(getOdbcFunction(ODBC3SQLFetchScroll)))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLGetData) ( SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -336,23 +336,23 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLLEN BufferLength,
SQLLEN * StrLen_or_IndPtr);
- #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f)
+ #define N3SQLGetData(a,b,c,d,e,f) (*reinterpret_cast<T3SQLGetData>(getOdbcFunction(ODBC3SQLGetData)))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle,
SQLSETPOSIROW RowNumber,
SQLUSMALLINT Operation,
SQLUSMALLINT LockType);
- #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d)
+ #define N3SQLSetPos(a,b,c,d) (*reinterpret_cast<T3SQLSetPos>(getOdbcFunction(ODBC3SQLSetPos)))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle,
SQLSMALLINT Operation);
- #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b)
+ #define N3SQLBulkOperations(a,b) (*reinterpret_cast<T3SQLBulkOperations>(getOdbcFunction(ODBC3SQLBulkOperations)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLMoreResults) ( SQLHSTMT StatementHandle);
- #define N3SQLMoreResults(a) (*(T3SQLMoreResults)getOdbcFunction(ODBC3SQLMoreResults))(a)
+ #define N3SQLMoreResults(a) (*reinterpret_cast<T3SQLMoreResults>(getOdbcFunction(ODBC3SQLMoreResults)))(a)
/*typedef SQLRETURN (SQL_API *T3SQLGetDiagField) (SQLSMALLINT HandleType,
SQLHANDLE Handle,
@@ -362,7 +362,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr);
- #define N3SQLGetDiagField(a,b,c,d,e,f,g) (*(T3SQLGetDiagField)getOdbcFunction(ODBC3SQLGetDiagField))(a,b,c,d,e,f,g)*/
+ #define N3SQLGetDiagField(a,b,c,d,e,f,g) (*reinterpret_cast<T3SQLGetDiagField>(getOdbcFunction(ODBC3SQLGetDiagField)))(a,b,c,d,e,f,g)*/
typedef SQLRETURN (SQL_API *T3SQLGetDiagRec) ( SQLSMALLINT HandleType,
SQLHANDLE Handle,
@@ -374,7 +374,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLSMALLINT * TextLengthPtr);
- #define N3SQLGetDiagRec(a,b,c,d,e,f,g,h) (*(T3SQLGetDiagRec)getOdbcFunction(ODBC3SQLGetDiagRec))(a,b,c,d,e,f,g,h)
+ #define N3SQLGetDiagRec(a,b,c,d,e,f,g,h) (*reinterpret_cast<T3SQLGetDiagRec>(getOdbcFunction(ODBC3SQLGetDiagRec)))(a,b,c,d,e,f,g,h)
// Obtaining information about the data source's system tables (catalog functions)
typedef SQLRETURN (SQL_API *T3SQLColumnPrivileges) (SQLHSTMT StatementHandle,
@@ -387,7 +387,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * ColumnName,
SQLSMALLINT NameLength4);
- #define N3SQLColumnPrivileges(a,b,c,d,e,f,g,h,i) (*(T3SQLColumnPrivileges)getOdbcFunction(ODBC3SQLColumnPrivileges))(a,b,c,d,e,f,g,h,i)
+ #define N3SQLColumnPrivileges(a,b,c,d,e,f,g,h,i) (*reinterpret_cast<T3SQLColumnPrivileges>(getOdbcFunction(ODBC3SQLColumnPrivileges)))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLColumns) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -399,7 +399,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * ColumnName,
SQLSMALLINT NameLength4);
- #define N3SQLColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLColumns)getOdbcFunction(ODBC3SQLColumns))(a,b,c,d,e,f,g,h,i)
+ #define N3SQLColumns(a,b,c,d,e,f,g,h,i) (*reinterpret_cast<T3SQLColumns>(getOdbcFunction(ODBC3SQLColumns)))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLForeignKeys) ( SQLHSTMT StatementHandle,
SQLCHAR * PKCatalogName,
@@ -415,7 +415,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * FKTableName,
SQLSMALLINT NameLength6);
- #define N3SQLForeignKeys(a,b,c,d,e,f,g,h,i,j,k,l,m) (*(T3SQLForeignKeys)getOdbcFunction(ODBC3SQLForeignKeys))(a,b,c,d,e,f,g,h,i,j,k,l,m)
+ #define N3SQLForeignKeys(a,b,c,d,e,f,g,h,i,j,k,l,m) (*reinterpret_cast<T3SQLForeignKeys>(getOdbcFunction(ODBC3SQLForeignKeys)))(a,b,c,d,e,f,g,h,i,j,k,l,m)
typedef SQLRETURN (SQL_API *T3SQLPrimaryKeys) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -425,7 +425,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * TableName,
SQLSMALLINT NameLength3);
- #define N3SQLPrimaryKeys(a,b,c,d,e,f,g) (*(T3SQLPrimaryKeys)getOdbcFunction(ODBC3SQLPrimaryKeys))(a,b,c,d,e,f,g)
+ #define N3SQLPrimaryKeys(a,b,c,d,e,f,g) (*reinterpret_cast<T3SQLPrimaryKeys>(getOdbcFunction(ODBC3SQLPrimaryKeys)))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLProcedureColumns) (SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -437,7 +437,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * ColumnName,
SQLSMALLINT NameLength4);
- #define N3SQLProcedureColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLProcedureColumns)getOdbcFunction(ODBC3SQLProcedureColumns))(a,b,c,d,e,f,g,h,i)
+ #define N3SQLProcedureColumns(a,b,c,d,e,f,g,h,i) (*reinterpret_cast<T3SQLProcedureColumns>(getOdbcFunction(ODBC3SQLProcedureColumns)))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLProcedures) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -447,7 +447,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * ProcName,
SQLSMALLINT NameLength3);
- #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g)
+ #define N3SQLProcedures(a,b,c,d,e,f,g) (*reinterpret_cast<T3SQLProcedures>(getOdbcFunction(ODBC3SQLProcedures)))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle,
SQLUSMALLINT IdentifierType,
@@ -460,7 +460,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLUSMALLINT Scope,
SQLUSMALLINT Nullable);
- #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j)
+ #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*reinterpret_cast<T3SQLSpecialColumns>(getOdbcFunction(ODBC3SQLSpecialColumns)))(a,b,c,d,e,f,g,h,i,j)
typedef SQLRETURN (SQL_API *T3SQLStatistics) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -472,7 +472,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLUSMALLINT Unique,
SQLUSMALLINT Reserved);
- #define N3SQLStatistics(a,b,c,d,e,f,g,h,i) (*(T3SQLStatistics)getOdbcFunction(ODBC3SQLStatistics))(a,b,c,d,e,f,g,h,i)
+ #define N3SQLStatistics(a,b,c,d,e,f,g,h,i) (*reinterpret_cast<T3SQLStatistics>(getOdbcFunction(ODBC3SQLStatistics)))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLTablePrivileges) (SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -482,7 +482,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * TableName,
SQLSMALLINT NameLength3);
- #define N3SQLTablePrivileges(a,b,c,d,e,f,g) (*(T3SQLTablePrivileges)getOdbcFunction(ODBC3SQLTablePrivileges))(a,b,c,d,e,f,g)
+ #define N3SQLTablePrivileges(a,b,c,d,e,f,g) (*reinterpret_cast<T3SQLTablePrivileges>(getOdbcFunction(ODBC3SQLTablePrivileges)))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLTables) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -494,44 +494,44 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLCHAR * TableType,
SQLSMALLINT NameLength4);
- #define N3SQLTables(a,b,c,d,e,f,g,h,i) (*(T3SQLTables)getOdbcFunction(ODBC3SQLTables))(a,b,c,d,e,f,g,h,i)
+ #define N3SQLTables(a,b,c,d,e,f,g,h,i) (*reinterpret_cast<T3SQLTables>(getOdbcFunction(ODBC3SQLTables)))(a,b,c,d,e,f,g,h,i)
// Terminating a statement
typedef SQLRETURN (SQL_API *T3SQLFreeStmt) ( SQLHSTMT StatementHandle,
SQLUSMALLINT Option);
- #define N3SQLFreeStmt(a,b) (*(T3SQLFreeStmt)getOdbcFunction(ODBC3SQLFreeStmt))(a,b)
+ #define N3SQLFreeStmt(a,b) (*reinterpret_cast<T3SQLFreeStmt>(getOdbcFunction(ODBC3SQLFreeStmt)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLCloseCursor) (SQLHSTMT StatementHandle);
- #define N3SQLCloseCursor(a) (*(T3SQLCloseCursor)getOdbcFunction(ODBC3SQLCloseCursor))(a)
+ #define N3SQLCloseCursor(a) (*reinterpret_cast<T3SQLCloseCursor>(getOdbcFunction(ODBC3SQLCloseCursor)))(a)
typedef SQLRETURN (SQL_API *T3SQLCancel) ( SQLHSTMT StatementHandle);
- #define N3SQLCancel(a) (*(T3SQLCancel)getOdbcFunction(ODBC3SQLCancel))(a)
+ #define N3SQLCancel(a) (*reinterpret_cast<T3SQLCancel>(getOdbcFunction(ODBC3SQLCancel)))(a)
typedef SQLRETURN (SQL_API *T3SQLEndTran) ( SQLSMALLINT HandleType,
SQLHANDLE Handle,
SQLSMALLINT CompletionType);
- #define N3SQLEndTran(a,b,c) (*(T3SQLEndTran)getOdbcFunction(ODBC3SQLEndTran))(a,b,c)
+ #define N3SQLEndTran(a,b,c) (*reinterpret_cast<T3SQLEndTran>(getOdbcFunction(ODBC3SQLEndTran)))(a,b,c)
// Terminating a connection
typedef SQLRETURN (SQL_API *T3SQLDisconnect) (SQLHDBC ConnectionHandle);
- #define N3SQLDisconnect(a) (*(T3SQLDisconnect)getOdbcFunction(ODBC3SQLDisconnect))(a)
+ #define N3SQLDisconnect(a) (*reinterpret_cast<T3SQLDisconnect>(getOdbcFunction(ODBC3SQLDisconnect)))(a)
typedef SQLRETURN (SQL_API *T3SQLFreeHandle) (SQLSMALLINT HandleType,
SQLHANDLE Handle);
- #define N3SQLFreeHandle(a,b) (*(T3SQLFreeHandle)getOdbcFunction(ODBC3SQLFreeHandle))(a,b)
+ #define N3SQLFreeHandle(a,b) (*reinterpret_cast<T3SQLFreeHandle>(getOdbcFunction(ODBC3SQLFreeHandle)))(a,b)
typedef SQLRETURN (SQL_API *T3SQLGetCursorName) ( SQLHSTMT StatementHandle,
SQLCHAR * CursorName,
SQLSMALLINT BufferLength,
SQLSMALLINT* NameLength2);
- #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d)
+ #define N3SQLGetCursorName(a,b,c,d) (*reinterpret_cast<T3SQLGetCursorName>(getOdbcFunction(ODBC3SQLGetCursorName)))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHSTMT ConnectionHandle,
SQLCHAR * InStatementText,
@@ -540,7 +540,7 @@ bool LoadLibrary_ODBC3(OUString &_rPath);
SQLINTEGER BufferLength,
SQLINTEGER * TextLength2Ptr);
- #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)
+ #define N3SQLNativeSql(a,b,c,d,e,f) (*reinterpret_cast<T3SQLNativeSql>(getOdbcFunction(ODBC3SQLNativeSql)))(a,b,c,d,e,f)
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_OFUNCTIONS_HXX