summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-07 09:08:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-07 12:16:13 +0000
commitbe8b9b4d29abb951aea0ea195541143d256954dc (patch)
treef35cddad2b45e189b23d881cb7c194845eb5c933 /vcl
parent7d98edfa4955ab6280655a9678d6a913845fa2f3 (diff)
loplugin:redundantcast find cstyle arithmetic casts
Change-Id: If7c259f0d12a41182f476ddb558f7cb5f76f9577 Reviewed-on: https://gerrit.libreoffice.org/36253 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/fontmetric.cxx28
-rw-r--r--vcl/qa/cppunit/graphicfilter/filters-test.cxx3
-rw-r--r--vcl/source/gdi/bitmap4.cxx4
-rw-r--r--vcl/source/gdi/pngread.cxx4
-rw-r--r--vcl/source/window/menu.cxx2
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx4
-rw-r--r--vcl/unx/generic/window/salframe.cxx8
7 files changed, 26 insertions, 27 deletions
diff --git a/vcl/qa/cppunit/fontmetric.cxx b/vcl/qa/cppunit/fontmetric.cxx
index b8c1f4282afc..7fdd531c52b3 100644
--- a/vcl/qa/cppunit/fontmetric.cxx
+++ b/vcl/qa/cppunit/fontmetric.cxx
@@ -55,27 +55,27 @@ void VclFontMetricTest::testSpacings()
// default constructor should set scalable flag to false
FontMetric aFontMetric;
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetAscent(), 0L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetDescent(), 0L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetExternalLeading(), 0L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetInternalLeading(), 0L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetLineHeight(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetAscent(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetDescent(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetExternalLeading(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetInternalLeading(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetLineHeight(), 0L );
aFontMetric.SetAscent( 100 );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetAscent(), 100L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetAscent(), 100L );
aFontMetric.SetDescent( 100 );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetDescent(), 100L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetDescent(), 100L );
aFontMetric.SetExternalLeading( 100L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetExternalLeading(), 100L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetExternalLeading(), 100L );
aFontMetric.SetInternalLeading( 100L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetInternalLeading(), 100L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetInternalLeading(), 100L );
aFontMetric.SetLineHeight( 100L );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetLineHeight(), 100L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetLineHeight(), 100L );
}
void VclFontMetricTest::testSlant()
@@ -83,10 +83,10 @@ void VclFontMetricTest::testSlant()
// default constructor should set scalable flag to false
FontMetric aFontMetric;
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetSlant(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetSlant(), 0L );
aFontMetric.SetSlant( 45 );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetSlant(), 45L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetSlant(), 45L );
}
void VclFontMetricTest::testBulletOffset()
@@ -94,10 +94,10 @@ void VclFontMetricTest::testBulletOffset()
// default constructor should set scalable flag to false
FontMetric aFontMetric;
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetBulletOffset(), 0L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetBulletOffset(), 0L );
aFontMetric.SetBulletOffset( 45 );
- CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetBulletOffset(), 45L );
+ CPPUNIT_ASSERT_EQUAL( aFontMetric.GetBulletOffset(), 45L );
}
void VclFontMetricTest::testEqualityOperator()
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index 6c0eedffb1f7..78477d4846e4 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -70,8 +70,7 @@ void VclFiltersTest::testScaling()
fprintf( stderr, "scale with type %d\n", int( i ) );
CPPUNIT_ASSERT( aBitmapEx.Scale( 0.1937046, 0.193154, i ) );
Size aAfter( aBitmapEx.GetSizePixel() );
- fprintf( stderr, "size %ld, %ld\n", (long)aAfter.Width(),
- aAfter.Height() );
+ fprintf( stderr, "size %ld, %ld\n", aAfter.Width(), aAfter.Height() );
CPPUNIT_ASSERT( labs (aAfter.Height() - aAfter.Width()) <= 1 );
}
}
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 30c33bcd36b1..3a172718572c 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -1074,8 +1074,8 @@ void Bitmap::ImplBlurContributions( const int aSize, const int aNumberOfContribu
for ( int i = 0; i < aSize; i++ )
{
- aLeft = (int) i - aNumberOfContributions / 2;
- aRight = (int) i + aNumberOfContributions / 2;
+ aLeft = i - aNumberOfContributions / 2;
+ aRight = i + aNumberOfContributions / 2;
aCurrentCount = 0;
for ( int j = aLeft; j <= aRight; j++ )
{
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 15265890345d..aa2aefa5f760 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -1093,8 +1093,8 @@ void PNGReaderImpl::ImplApplyFilter()
int nb = *(p3++);
int nc = *(p4++);
- int npa = nb - (int)nc;
- int npb = na - (int)nc;
+ int npa = nb - nc;
+ int npb = na - nc;
int npc = npa + npb;
if( npa < 0 )
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 6f24bfb72229..668ed11b9067 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1576,7 +1576,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
pData->aSz.Height() += EXTRAITEMHEIGHT; // little bit more distance
if (!IsMenuBar())
- aSz.Height() += (long)pData->aSz.Height();
+ aSz.Height() += pData->aSz.Height();
if ( nWidth > nMaxWidth )
nMaxWidth = nWidth;
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 8301e75774df..5517b47c894d 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -781,8 +781,8 @@ bool X11SalBitmap::Create(
depth,
0,
0,
- (long) rSize.Width(),
- (long) rSize.Height()
+ rSize.Width(),
+ rSize.Height()
);
bool bFreePixmap = false;
if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap )
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index fcbe5c0456c6..f8dfbd385d96 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -1713,13 +1713,13 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
// adjust position so that frame fits onto screen
if( aPosSize.Right()+(long)aGeom.nRightDecoration > aScreenSize.Width()-1 )
- aPosSize.Move( (long)aScreenSize.Width() - (long)aPosSize.Right() - (long)aGeom.nRightDecoration, 0 );
+ aPosSize.Move( aScreenSize.Width() - aPosSize.Right() - (long)aGeom.nRightDecoration, 0 );
if( aPosSize.Bottom()+(long)aGeom.nBottomDecoration > aScreenSize.Height()-1 )
- aPosSize.Move( 0, (long)aScreenSize.Height() - (long)aPosSize.Bottom() - (long)aGeom.nBottomDecoration );
+ aPosSize.Move( 0, aScreenSize.Height() - aPosSize.Bottom() - (long)aGeom.nBottomDecoration );
if( aPosSize.Left() < (long)aGeom.nLeftDecoration )
- aPosSize.Move( (long)aGeom.nLeftDecoration - (long)aPosSize.Left(), 0 );
+ aPosSize.Move( (long)aGeom.nLeftDecoration - aPosSize.Left(), 0 );
if( aPosSize.Top() < (long)aGeom.nTopDecoration )
- aPosSize.Move( 0, (long)aGeom.nTopDecoration - (long)aPosSize.Top() );
+ aPosSize.Move( 0, (long)aGeom.nTopDecoration - aPosSize.Top() );
}
SetPosSize( 0, 0, aPosSize.GetWidth(), aPosSize.GetHeight(), SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );