summaryrefslogtreecommitdiffstats
path: root/connectivity/source/commontools
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/source/commontools
parentNote pull request for boost patch (diff)
downloadcore-14cd5182c5f64c43581c82db8c958369152226ac.tar.gz
core-14cd5182c5f64c43581c82db8c958369152226ac.zip
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/source/commontools')
-rw-r--r--connectivity/source/commontools/CommonTools.cxx6
-rw-r--r--connectivity/source/commontools/FValue.cxx4
-rw-r--r--connectivity/source/commontools/dbtools.cxx4
3 files changed, 8 insertions, 6 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;