summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-22 22:12:53 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-23 01:35:14 +0100
commitd37df8fd1a681db758de6f4acfe6479e8e78b2dd (patch)
tree3427c325ea6de49f7bbdc5e05927ce2ee13b4f56 /connectivity/source/drivers
parentd7831d30e46a46e253cd6e855dd87eee3cb004a4 (diff)
Fix warning C4312 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717 Like these: C:/lo/core/sw/source/ui/dbui/addresslistdialog.cxx(426): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size Change-Id: Idbfbe8add89c8e219bdabcf28b741e2e31a5e345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163781 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 7ae8c46802e2..1189ba88b6cf 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -98,7 +98,7 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi
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);
+ N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_LOGIN_TIMEOUT,reinterpret_cast<SQLPOINTER>(static_cast<sal_IntPtr>(nTimeOut)),SQL_IS_UINTEGER);
#else
(void)nTimeOut; /* WaE */
#endif
@@ -312,10 +312,10 @@ void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+ const sal_IntPtr nAutocommit = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
OTools::ThrowException(this,N3SQLSetConnectAttr(m_aConnectionHandle,
SQL_ATTR_AUTOCOMMIT,
- reinterpret_cast<SQLPOINTER>((autoCommit) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF) ,SQL_IS_INTEGER),
+ reinterpret_cast<SQLPOINTER>(nAutocommit) ,SQL_IS_INTEGER),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
@@ -423,7 +423,7 @@ void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level )
OTools::ThrowException(this,N3SQLSetConnectAttr(m_aConnectionHandle,
SQL_ATTR_TXN_ISOLATION,
- reinterpret_cast<SQLPOINTER>(level),SQL_IS_INTEGER),
+ reinterpret_cast<SQLPOINTER>(static_cast<sal_IntPtr>(level)),SQL_IS_INTEGER),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}