From fc898f20cffe94cfde0a24027480fb97ab84563e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 14 Jun 2022 15:48:25 +0200 Subject: Use some more appropriate index variable types Change-Id: Ife891e8757e3f83d53245dfd04594b0359a897cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135831 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- connectivity/source/commontools/TDatabaseMetaDataBase.cxx | 6 +++++- connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx | 2 +- connectivity/source/drivers/file/FStatement.cxx | 3 ++- connectivity/source/drivers/postgresql/pq_statement.cxx | 7 ++++--- 4 files changed, 12 insertions(+), 6 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx index 0e81e71cf4ea..330156781422 100644 --- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx +++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include + #include #include @@ -139,7 +143,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) ::connectivity::ODatabaseMetaDataResultSet::ORow aRow; aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue()); const sal_Int32* pType = pTypes; - for (sal_Int32 i = 1; i <= sal_Int32(std::size(pTypes)); ++i,++pType) + for (std::size_t i = 1; i <= std::size(pTypes); ++i,++pType) { ORowSetValue aValue; aValue.fill(i,*pType,xRow); diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx index dbb8cb447159..2ffd82d0da7b 100644 --- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx @@ -300,7 +300,7 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getColumns( ::osl::MutexGuard aGuard( m_aMutex ); initFields(); - for (sal_Int32 i = 0; i < static_cast(nFields); i++) + for (guint i = 0; i < nFields; i++) { if( match( columnNamePattern, getFieldName( i ), '\0' ) ) { diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index d32ac0ed22e1..d97ce47ae404 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -38,6 +38,7 @@ #include #include #include +#include namespace connectivity::file { @@ -440,7 +441,7 @@ void OStatement_Base::createColumnMapping() // initialize the column index map (mapping select columns to table columns) ::rtl::Reference xColumns = m_aSQLIterator.getSelectColumns(); m_aColMapping.resize(xColumns->size() + 1); - for (sal_Int32 i=0; i(m_aColMapping.size()); ++i) + for (std::size_t i=0; i xNames(m_xColNames,UNO_QUERY); diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 7db4b20536e2..1dc5e8c420f6 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -59,6 +59,7 @@ #include #include +#include #include #include @@ -429,8 +430,8 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data ) &table); // check, whether the columns are in the result set (required !) - int i; - for( i = 0 ; i < static_cast(sourceTableKeys.size()) ; i ++ ) + std::size_t i; + for( i = 0 ; i < sourceTableKeys.size() ; i ++ ) { if( -1 == PQfnumber( result, @@ -441,7 +442,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data ) } } - if( !sourceTableKeys.empty() && i == static_cast(sourceTableKeys.size()) ) + if( !sourceTableKeys.empty() && i == sourceTableKeys.size() ) { *(data->pLastResultset) = UpdateableResultSet::createFromPGResultSet( -- cgit v1.2.3