diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-07-01 21:04:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-07-01 22:32:58 +0200 |
commit | 8895dc3c4cb3e3fafcde1d0243dd683e7283b805 (patch) | |
tree | 3f39f52935f6bf0675fdac3c2b0d0063253a57d4 /connectivity | |
parent | e37e1a7d2007bd6896027b69271774da2568e6f8 (diff) |
Use some more O3TL_UNREACHABLE
Change-Id: I5885c1f33fe7d15e6bd0b572b6d0db1410252362
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136777
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/BlobHelper.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx | 32 |
2 files changed, 13 insertions, 33 deletions
diff --git a/connectivity/source/commontools/BlobHelper.cxx b/connectivity/source/commontools/BlobHelper.cxx index 591fe961e517..f1f048a7318e 100644 --- a/connectivity/source/commontools/BlobHelper.cxx +++ b/connectivity/source/commontools/BlobHelper.cxx @@ -20,6 +20,7 @@ #include <comphelper/seqstream.hxx> #include <connectivity/dbexception.hxx> #include <com/sun/star/sdbc/SQLException.hpp> +#include <o3tl/unreachable.hxx> using namespace connectivity; using namespace dbtools; @@ -47,25 +48,16 @@ css::uno::Reference< css::io::XInputStream > SAL_CALL BlobHelper::getBinaryStrea return new ::comphelper::SequenceInputStream(m_aValue); } - -// The "return" after a call to throwFeatureNotImplementedSQLException() -// (which always throws) will be detected as unreachable when doing -// global inlining. - -SAL_WNOUNREACHABLE_CODE_PUSH - ::sal_Int64 SAL_CALL BlobHelper::position( const css::uno::Sequence< ::sal_Int8 >& /*pattern*/, ::sal_Int64 /*start*/ ) { ::dbtools::throwFeatureNotImplementedSQLException( "XBlob::position", *this ); - return 0; + O3TL_UNREACHABLE; } ::sal_Int64 SAL_CALL BlobHelper::positionOfBlob( const css::uno::Reference< css::sdbc::XBlob >& /*pattern*/, ::sal_Int64 /*start*/ ) { ::dbtools::throwFeatureNotImplementedSQLException( "XBlob::positionOfBlob", *this ); - return 0; + O3TL_UNREACHABLE; } -SAL_WNOUNREACHABLE_CODE_POP - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index 3c755f206224..d4ae8760f2ce 100644 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -312,22 +312,18 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast( ) } -SAL_WNOUNREACHABLE_CODE_PUSH - sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } -SAL_WNOUNREACHABLE_CODE_POP - void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst( ) { @@ -351,41 +347,37 @@ void SAL_CALL ODatabaseMetaDataResultSet::close( ) } -SAL_WNOUNREACHABLE_CODE_PUSH - sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 /*row*/ ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 /*row*/ ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } -SAL_WNOUNREACHABLE_CODE_POP - Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement( ) { @@ -393,28 +385,24 @@ Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement( ) } -SAL_WNOUNREACHABLE_CODE_PUSH - sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated( ) { ::dbtools::throwFunctionSequenceException(*this); - return false; + O3TL_UNREACHABLE; } -SAL_WNOUNREACHABLE_CODE_POP - sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst( ) { |