diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-04 10:20:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-07 09:42:23 +0200 |
commit | 439004122498b34433e2394d1d9c55c7d3666ab5 (patch) | |
tree | cb89fadfe33778ba5f277feb2e9f51f1876fd76d | |
parent | 875793d841165aaaaefa2c34b855e8f0f8a8c214 (diff) |
enable -Wrange-loop-analysis on clang
Change-Id: I2095308943c94ad16c110d5fac47715398eb5d39
Reviewed-on: https://gerrit.libreoffice.org/80187
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | connectivity/source/drivers/mork/MQueryHelper.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 4 | ||||
-rw-r--r-- | editeng/source/outliner/outlobj.cxx | 4 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 3 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 4 |
7 files changed, 13 insertions, 12 deletions
diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 4e64e08f2ad9..9077f49f7cc1 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -218,7 +218,7 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression entry->setValue(key, valueOUString); } bool result = true; - for (auto const& elem : entryMatchedByExpression(this, &expr, entry.get())) + for (bool elem : entryMatchedByExpression(this, &expr, entry.get())) { result = result && elem; } @@ -296,7 +296,7 @@ std::vector<bool> entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpressi MQueryExpression::bool_cond condition = queryExpression->getExpressionCondition(); if (condition == MQueryExpression::OR) { bool result = false; - for (auto const& elem : subquery_result) + for (bool elem : subquery_result) { result = result || elem; } @@ -304,7 +304,7 @@ std::vector<bool> entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpressi } else { assert(condition == MQueryExpression::AND && "only OR or AND should exist"); bool result = true; - for (auto const& elem : subquery_result) + for (bool elem : subquery_result) { result = result && elem; } diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 2130d6b4acf4..955dbc54cf50 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1234,9 +1234,9 @@ void ORowSet::impl_restoreDataColumnsWriteable_throw() { assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.size() == 0 ); TDataColumns::const_iterator aIter = m_aDataColumns.begin(); - for (auto const& readOnlyDataColumn : m_aReadOnlyDataColumns) + for (bool readOnlyDataColumn : m_aReadOnlyDataColumns) { - (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, makeAny( static_cast<bool>(readOnlyDataColumn)) ); + (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, makeAny(readOnlyDataColumn) ); ++aIter; } m_aReadOnlyDataColumns.clear(); diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index 396e948f6595..23206122b1df 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -233,8 +233,8 @@ void OutlinerParaObject::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterStartElement(pWriter, BAD_CAST("OutlinerParaObject")); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); mpImpl->mpEditTextObject->dumpAsXml(pWriter); - for (Paragraph const & p : mpImpl->maParagraphDataVector) - p.dumpAsXml(pWriter); + for (ParagraphData const & p : mpImpl->maParagraphDataVector) + Paragraph(p).dumpAsXml(pWriter); xmlTextWriterEndElement(pWriter); } diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 96e2c12b17ba..9ece7eb4192e 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -848,7 +848,7 @@ static std::string getAuthorRenderingArgument(LOKDocViewPrivate& priv) boost::property_tree::ptree aTree; boost::property_tree::read_json(aStream, aTree); std::string aRet; - for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aTree) + for (const auto& rPair : aTree) { if (rPair.first == ".uno:Author") { diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 776514612b70..7f04c9b57e89 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -496,7 +496,7 @@ void PresentationFragmentHandler::finalizeImport() try { int nPagesImported = 0; - for (auto const& elem : aRangeEnumerator) + for (sal_Int32 elem : aRangeEnumerator) { if ( rxStatusIndicator.is() ) rxStatusIndicator->setValue((nPagesImported * 10000) / aRangeEnumerator.size()); diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index fc3ba6958321..2c3d5f1a98f3 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -106,7 +106,8 @@ endif ifeq ($(COM_IS_CLANG),TRUE) gb_CXXFLAGS_COMMON += \ -Wimplicit-fallthrough \ - -Wunused-exception-parameter + -Wunused-exception-parameter \ + -Wrange-loop-analysis else gb_CFLAGS_COMMON += \ -Wduplicated-cond \ diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 17499d4c9920..9f0607248c66 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -142,9 +142,9 @@ namespace uno::Sequence< sal_Bool > aBools( aCmisBools.size( ) ); sal_Bool* aBoolsArr = aBools.getArray( ); sal_Int32 i = 0; - for ( const auto& rCmisBool : aCmisBools ) + for ( bool bCmisBool : aCmisBools ) { - aBoolsArr[i++] = rCmisBool; + aBoolsArr[i++] = bCmisBool; } aValue <<= aBools; } |