Kaydet (Commit) 2687a5ac authored tarafından Noel Grandin's avatar Noel Grandin

-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/42103Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 030273e2
......@@ -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" );
......
......@@ -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;
......
......@@ -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]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment