diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-11-27 09:46:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-11-27 14:04:40 +0100 |
commit | a2656563f1a7639a99276fda90b6c8f675d20fc5 (patch) | |
tree | cc9eb4f064b1e8cdfce9ac42c52dfa6ae54f2b70 /sal | |
parent | 0093ae5f2ca1141f199aa9ae3b34b05a33def928 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/file_volume.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
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; |