From a407e4da6564d0ab316d7e0e4f4e876a798181d0 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 26 Feb 2017 22:00:26 +0100 Subject: loplugin:loopvartoosmall Change-Id: Ib90fb2c3f4d976dce764d4c91af797351317397b --- connectivity/source/drivers/dbase/DTable.cxx | 11 ++++++----- connectivity/source/parse/sqlnode.cxx | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index fba7c5f62d70..5dffd4141b76 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -54,6 +54,7 @@ #include #include +#include using namespace ::comphelper; using namespace connectivity; @@ -1679,7 +1680,6 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo // Update fields: Reference xCol; Reference xIndex; - sal_uInt16 i; OUString aColName; const sal_Int32 nColumnCount = m_pColumns->getCount(); std::vector< Reference > aIndexedCols(nColumnCount); @@ -1688,7 +1688,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo Reference xColumns = m_pColumns; // first search a key that exist already in the table - for (i = 0; i < nColumnCount; ++i) + for (sal_Int32 i = 0; i < nColumnCount; ++i) { sal_Int32 nPos = i; if(_xCols != xColumns) @@ -1746,14 +1746,15 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo // when we are here there is no double key in the table - for (i = 0; i < nColumnCount && nByteOffset <= m_nBufferSize ; ++i) + for (sal_Int32 i = 0; i < nColumnCount && nByteOffset <= m_nBufferSize ; ++i) { // Lengths for each data type: - OSL_ENSURE(i < m_aPrecisions.size(),"Illegal index!"); + assert(i >= 0); + OSL_ENSURE(sal_uInt32(i) < m_aPrecisions.size(),"Illegal index!"); sal_Int32 nLen = 0; sal_Int32 nType = 0; sal_Int32 nScale = 0; - if ( i < m_aPrecisions.size() ) + if ( sal_uInt32(i) < m_aPrecisions.size() ) { nLen = m_aPrecisions[i]; nType = m_aTypes[i]; diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index d2e88a92d6a4..b2f1d43a05d9 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1664,7 +1664,7 @@ bool OSQLParseNode::operator==(OSQLParseNode& rParseNode) const bResult = bResult && !SQL_ISRULE(this, parameter); // compare children - for (sal_uInt32 i=0; bResult && i < count(); i++) + for (size_t i=0; bResult && i < count(); i++) bResult = *getChild(i) == *rParseNode.getChild(i); return bResult; -- cgit