From a2656563f1a7639a99276fda90b6c8f675d20fc5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 27 Nov 2017 09:46:06 +0100 Subject: loplugin:unnecessaryparen: Warn about parentheses around literals ...that are not composed of multiple tokens, like ("foo" "bar"). Also don't yet warn about Boolean literals, which are sometimes wrapped in parentheses to silence unreachable-code warnings. To avoid multiple warnings about code like f((0)) switch to generally using a set of ParenExpr to keep track of which occurrences have already been handled. Change-Id: I036a25a92836ec6ab6c56ea848f71bc6d63822bc Reviewed-on: https://gerrit.libreoffice.org/45317 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sal/osl/unx/file.cxx | 2 +- sal/osl/unx/file_volume.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sal') diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index de36b3d26a9c..c7d6522ff3d0 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -289,7 +289,7 @@ oslFileError FileHandle_Impl::setPos(sal_uInt64 uPos) sal_uInt64 FileHandle_Impl::getSize() const { - off_t const bufend = std::max((off_t)(0), m_bufptr) + m_buflen; + off_t const bufend = std::max((off_t)0, m_bufptr) + m_buflen; return std::max(m_size, sal::static_int_cast< sal_uInt64 >(bufend)); } diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index 5dc41cc0f7ea..116874569b62 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -216,7 +216,7 @@ static oslFileError osl_psz_getVolumeInformation ( { OSL_detail_STATFS_STRUCT sfs; OSL_detail_STATFS_INIT(sfs); - if ((OSL_detail_STATFS(pszDirectory, &sfs)) < (0)) + if ((OSL_detail_STATFS(pszDirectory, &sfs)) < 0) { oslFileError result = oslTranslateFileError(errno); return result; -- cgit