summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
commit14cd5182c5f64c43581c82db8c958369152226ac (patch)
tree57f150ba2707f29214eeb9b1eaad2373780d1b15 /connectivity
parente4bb2b4f4875c15bd68297b5be716edd6859841e (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. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/CommonTools.cxx6
-rw-r--r--connectivity/source/commontools/FValue.cxx4
-rw-r--r--connectivity/source/commontools/dbtools.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx4
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx2
-rw-r--r--connectivity/source/parse/sqlnode.cxx2
8 files changed, 14 insertions, 12 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index edc40bb1f8ea..33962c6a63e6 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 b03faabff8ca..9e86bf2e77da 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -1032,7 +1032,7 @@ bool ORowSetValue::getBool() const
break;
}
}
- // run through
+ SAL_FALLTHROUGH;
case DataType::DECIMAL:
case DataType::NUMERIC:
@@ -1930,7 +1930,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 68471608a13a..69c1524ab555 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 2bee713c72de..391a5edc05a8 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1289,7 +1289,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;
@@ -1770,7 +1770,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo
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 dd2748cd091b..25d95d842b20 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 0626560da9ca..a79ded6cc85c 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -734,7 +734,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 c55834dbd214..df51a3b62aa0 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -1224,8 +1224,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 bc20db4d1c8d..955cf2db0bee 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() != ':' )
{