diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 16:42:16 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-07-20 01:26:06 -0400 |
commit | e7b11300cd813f821d1ec5cb4633ce2c5f7d1b9f (patch) | |
tree | a6c39d9d4cde1baa84a9d788affbce3508af89a8 /connectivity/source | |
parent | 34f591ca95c4c63be092da4c4b2294230404f336 (diff) |
Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough. (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)
Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.) C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.
(cherry picked from commit 14cd5182c5f64c43581c82db8c958369152226ac)
Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/commontools/CommonTools.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/commontools/FValue.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FDatabaseMetaData.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_tools.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 2 |
8 files changed, 14 insertions, 12 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index 8a0f25b2d316..c924be523ed2 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -75,8 +75,10 @@ namespace connectivity else pWild += pos; else - break; // WARNING in certain circumstances - // it will run into the next 'case'!! + break; + // WARNING/TODO: in certain circumstances it will run into + // the next 'case'! + SAL_FALLTHROUGH; case CHAR_WILD: while ( *pWild == CHAR_WILD ) pWild++; diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index be18ec286b1e..9299309561ae 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -1151,7 +1151,7 @@ bool ORowSetValue::getBool() const break; } } - // run through + SAL_FALLTHROUGH; case DataType::DECIMAL: case DataType::NUMERIC: @@ -2045,7 +2045,7 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const case DataType::OBJECT: default: OSL_ENSURE( false, "ORowSetValue::getDate: cannot retrieve the data!" ); - // NO break! + SAL_FALLTHROUGH; case DataType::BINARY: case DataType::VARBINARY: diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 16e0b1250f30..7f9a443b6756 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1515,7 +1515,7 @@ bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject, _rxUpdatedObject->updateBinaryStream(_nColumnIndex, xStream, xStream->available()); break; } - // run through + SAL_FALLTHROUGH; default: bSuccessfullyReRouted = false; } @@ -1622,7 +1622,7 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, _rxParameters->setBinaryStream(_nColumnIndex, xStream, xStream->available()); break; } - // run through + SAL_FALLTHROUGH; default: bSuccessfullyReRouted = false; diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 2aab28139ea3..57104d299c30 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1300,7 +1300,7 @@ bool ODbaseTable::CreateFile(const INetURLObject& aFile, bool& bCreateMemo) break; case DataType::LONGVARBINARY: bBinary = true; - // run through + SAL_FALLTHROUGH; case DataType::LONGVARCHAR: cTyp = 'M'; break; @@ -1783,7 +1783,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow, cons case DataType::DOUBLE: case DataType::TIMESTAMP: bSetZero = true; - //fall-through + SAL_FALLTHROUGH; case DataType::LONGVARBINARY: case DataType::DATE: case DataType::BIT: diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index 12c9e1e6eb38..7eec6cca2797 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -240,7 +240,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( break; case -1: bKnowCaseSensivity = false; - /** run through */ + SAL_FALLTHROUGH; case 0: bCaseSensitiveDir = false; } diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 6600515984d3..cf79bb18271c 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -743,7 +743,7 @@ bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 n { case IResultSetHelper::FIRST: m_nRowPos = 0; - // run through + SAL_FALLTHROUGH; case IResultSetHelper::NEXT: { assert(m_nRowPos >= 0); diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 0c70c9db06ee..784aac9dfa6d 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -1233,8 +1233,8 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, _rxParameters->setBinaryStream(_nColumnIndex, xStream, xStream->available()); break; } + SAL_FALLTHROUGH; } - // run through default: bSuccessfullyReRouted = false; diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 6a7bb9956464..45d8333a7ba0 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -2493,7 +2493,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet rString.append(m_aNodeValue); break; } - // fall through + SAL_FALLTHROUGH; default: if (!rString.isEmpty() && m_aNodeValue.toChar() != '.' && m_aNodeValue.toChar() != ':' ) { |