diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-06-14 15:48:25 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-15 10:17:43 +0200 |
commit | fc898f20cffe94cfde0a24027480fb97ab84563e (patch) | |
tree | 947b138039f6ad74ee55c37329c69ec1bec41f59 /connectivity | |
parent | 7efd118d5d48e1d4b2f57752cb3b9170f5c05f71 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
4 files changed, 12 insertions, 6 deletions
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 <sal/config.h> + +#include <cstddef> + #include <TDatabaseMetaDataBase.hxx> #include <RowFunctionParser.hxx> @@ -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<sal_Int32>(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 <connectivity/dbexception.hxx> #include <strings.hrc> #include <algorithm> +#include <cstddef> namespace connectivity::file { @@ -440,7 +441,7 @@ void OStatement_Base::createColumnMapping() // initialize the column index map (mapping select columns to table columns) ::rtl::Reference<connectivity::OSQLColumns> xColumns = m_aSQLIterator.getSelectColumns(); m_aColMapping.resize(xColumns->size() + 1); - for (sal_Int32 i=0; i<static_cast<sal_Int32>(m_aColMapping.size()); ++i) + for (std::size_t i=0; i<m_aColMapping.size(); ++i) m_aColMapping[i] = i; Reference<XIndexAccess> 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 <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> +#include <cstddef> #include <string.h> #include <string_view> @@ -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<int>(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<int>(sourceTableKeys.size()) ) + if( !sourceTableKeys.empty() && i == sourceTableKeys.size() ) { *(data->pLastResultset) = UpdateableResultSet::createFromPGResultSet( |