diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-08 13:43:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-08 15:53:29 +0200 |
commit | 2687a5aca143c53c364cb44993ca601b8dd1c65e (patch) | |
tree | d12bb4b5529fdd62ff86b07258a307681ce41b86 | |
parent | 030273e2e28ef9c4d2118ca3851c64498dfe000a (diff) |
-Werror,-Wtautological-compare with latest clang
Change-Id: I073f1893b759f8d31a24187f542b031b86dc4b8a
error: comparison of unsigned enum expression >= 0 is always true
[-Werror,-Wtautological-compare]
Reviewed-on: https://gerrit.libreoffice.org/42103
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | extensions/source/scanner/sane.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsTheme.cxx | 8 | ||||
-rw-r--r-- | svx/source/dialog/swframeposstrings.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index db8ef50d186c..80b6bb30f5c9 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -623,7 +623,7 @@ bool Sane::Start( BitmapTransporter& rBitmap ) "SANE_FRAME_RED", "SANE_FRAME_GREEN", "SANE_FRAME_BLUE", "Unknown !!!" }; fprintf( stderr, "Parameters for frame %d:\n", nStream ); - if( aParams.format < 0 || aParams.format > 4 ) + if( aParams.format > 4 ) aParams.format = (SANE_Frame)5; fprintf( stderr, "format: %s\n", ppFormats[ (int)aParams.format ] ); fprintf( stderr, "last_frame: %s\n", aParams.last_frame ? "TRUE" : "FALSE" ); diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx index dd5c0e164d9f..4ff6c44c6e20 100644 --- a/sd/source/ui/slidesorter/view/SlsTheme.cxx +++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx @@ -162,7 +162,7 @@ std::shared_ptr<vcl::Font> Theme::GetFont ( ColorData Theme::GetColor (const ColorType eType) { - if (eType>=0 && sal_uInt32(eType)<maColor.size()) + if (sal_uInt32(eType)<maColor.size()) return maColor[eType]; else return 0; @@ -208,7 +208,7 @@ void Theme::SetGradient ( const BitmapEx& Theme::GetIcon (const IconType eType) { - if (eType>=0 && size_t(eType)<maIcons.size()) + if (size_t(eType)<maIcons.size()) return maIcons[eType]; else { @@ -219,7 +219,7 @@ const BitmapEx& Theme::GetIcon (const IconType eType) Theme::GradientDescriptor& Theme::GetGradient (const GradientColorType eType) { - if (eType>=0 && size_t(eType)<maGradients.size()) + if (size_t(eType)<maGradients.size()) return maGradients[eType]; else { @@ -230,7 +230,7 @@ Theme::GradientDescriptor& Theme::GetGradient (const GradientColorType eType) void Theme::InitializeIcon(const IconType eType, const OUString& rResourceId) { - if (eType>=0 && size_t(eType)<maIcons.size()) + if (size_t(eType)<maIcons.size()) { const BitmapEx aIcon(rResourceId); maIcons[eType] = aIcon; diff --git a/svx/source/dialog/swframeposstrings.cxx b/svx/source/dialog/swframeposstrings.cxx index 6dd9ae33d05b..d2e9c8e05ab0 100644 --- a/svx/source/dialog/swframeposstrings.cxx +++ b/svx/source/dialog/swframeposstrings.cxx @@ -28,7 +28,7 @@ OUString SvxSwFramePosString::GetString(StringId eId) { assert(SAL_N_ELEMENTS(RID_SVXSW_FRAMEPOSITIONS) == SvxSwFramePosString::STR_MAX); DBG_ASSERT(eId >= 0 && eId < STR_MAX, "invalid StringId"); - if(!(eId >= 0 && eId < STR_MAX)) + if(!(eId < STR_MAX)) eId = LEFT; return SvxResId(RID_SVXSW_FRAMEPOSITIONS[eId]); } |