cid#1659848 silence Logically dead code
and cid#1660004 Logically dead code cid#1659644 Logically dead code cid#1659901 Logically dead code cid#1660015 Logically dead code Change-Id: I260149b3f46c86cc7e7c4198242cd3f19cb30f05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188900 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
@@ -36,6 +36,7 @@ template <typename T> inline constexpr T saturating_add(T a, T b)
|
||||
return std::numeric_limits<T>::max();
|
||||
}
|
||||
} else {
|
||||
// coverity[dead_error_line] - suppress warning for template
|
||||
if (a >= std::numeric_limits<T>::min() - b) {
|
||||
return a + b;
|
||||
} else {
|
||||
|
||||
@@ -73,6 +73,7 @@ constexpr sal_Int64 MulDiv(I n, sal_Int64 m, sal_Int64 d)
|
||||
{
|
||||
assert(m > 0 && d > 0);
|
||||
assert(isBetween(n, (SAL_MIN_INT64 + d / 2) / m, (SAL_MAX_INT64 - d / 2) / m));
|
||||
// coverity[dead_error_line] - suppress warning for template
|
||||
return (n >= 0 ? (n * m + d / 2) : (n * m - d / 2)) / d;
|
||||
}
|
||||
template <typename F, std::enable_if_t<std::is_floating_point_v<F>, int> = 0>
|
||||
|
||||
@@ -1428,7 +1428,10 @@ oslFileError SAL_CALL osl_mapFile(
|
||||
*ppAddr = nullptr;
|
||||
|
||||
if (uLength > SAL_MAX_SIZE)
|
||||
{
|
||||
// coverity[dead_error_line] - suppress warning, 32bit platforms still
|
||||
return osl_File_E_OVERFLOW;
|
||||
}
|
||||
|
||||
size_t const nLength = sal::static_int_cast< size_t >(uLength);
|
||||
|
||||
@@ -1504,7 +1507,10 @@ static oslFileError unmapFile(void* pAddr, sal_uInt64 uLength)
|
||||
return osl_File_E_INVAL;
|
||||
|
||||
if (uLength > SAL_MAX_SIZE)
|
||||
{
|
||||
// coverity[dead_error_line] - suppress warning, 32bit platforms still
|
||||
return osl_File_E_OVERFLOW;
|
||||
}
|
||||
|
||||
size_t const nLength = sal::static_int_cast< size_t >(uLength);
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ static std::unique_ptr<sal_uInt8[]> ImplSysReadConfig( const OUString& rFileName
|
||||
if( aFile.getSize( nPos ) == ::osl::FileBase::E_None )
|
||||
{
|
||||
if (nPos > SAL_MAX_SIZE) {
|
||||
// coverity[dead_error_line] - suppress warning, 32bit platforms still
|
||||
aFile.close();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user