summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-10-14 02:51:05 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-15 06:49:23 +0000
commitb4b7703e4335460cf48bfd6440f116359994c8ff (patch)
tree66b6ab43d6fb13d037160d7384d1a7a93d92940b /tools
parent90d82f73b89d8a0b0b13d224dbd1a741a10a7fd9 (diff)
cppcheck:variableScope
Change-Id: I9b671637fbe0f32e695d22b74bfb40a39a9fe884 Reviewed-on: https://gerrit.libreoffice.org/19364 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/poly.cxx8
-rw-r--r--tools/source/rc/resmgr.cxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 727943dde023..f5cf0dfd46d0 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -637,7 +637,6 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoin
// Ceil number of points until divisible by four
mpImplPolygon = new ImplPolygon( nPoints = (nPoints + 3) & ~3 );
- Point* pPt;
sal_uInt16 i;
sal_uInt16 nPoints2 = nPoints >> 1;
sal_uInt16 nPoints4 = nPoints >> 2;
@@ -649,7 +648,7 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoin
long nX = FRound( nRadX * cos( nAngle ) );
long nY = FRound( -nRadY * sin( nAngle ) );
- pPt = &(mpImplPolygon->mpPointAry[i]);
+ Point* pPt = &(mpImplPolygon->mpPointAry[i]);
pPt->X() = nX + rCenter.X();
pPt->Y() = nY + rCenter.Y();
pPt = &(mpImplPolygon->mpPointAry[nPoints2-i-1]);
@@ -750,7 +749,7 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
const double fInc = 1.0 / ( nPoints - 1 );
double fK_1 = 0.0, fK1_1 = 1.0;
- double fK_2, fK_3, fK1_2, fK1_3, fK12, fK21;
+ double fK_2, fK_3, fK1_2, fK1_3;
const double fX0 = rBezPt1.X();
const double fY0 = rBezPt1.Y();
const double fX1 = 3.0 * rCtrlPt1.X();
@@ -768,7 +767,8 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
fK_2 = fK_1, fK_3 = ( fK_2 *= fK_1 ), fK_3 *= fK_1;
fK1_2 = fK1_1, fK1_3 = ( fK1_2 *= fK1_1 ), fK1_3 *= fK1_1;
- fK12 = fK_1 * fK1_2, fK21 = fK_2 * fK1_1;
+ double fK12 = fK_1 * fK1_2;
+ double fK21 = fK_2 * fK1_1;
rPt.X() = FRound( fK1_3 * fX0 + fK12 * fX1 + fK21 * fX2 + fK_3 * fX3 );
rPt.Y() = FRound( fK1_3 * fY0 + fK12 * fY1 + fK21 * fY2 + fK_3 * fY3 );
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 33c1e087a271..e00315e881e9 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -750,11 +750,11 @@ static RSHEADER_TYPE* LocalResource( const ImpRCStack* pStack,
sal_uInt32 nId )
{
// Returns position of the resource if found or NULL otherwise
- RSHEADER_TYPE* pTmp; // Pointer to child resource
- RSHEADER_TYPE* pEnd; // Pointer to the end of this resource
if ( pStack->pResource && pStack->pClassRes )
{
+ RSHEADER_TYPE* pTmp; // Pointer to child resource
+ RSHEADER_TYPE* pEnd; // Pointer to the end of this resource
pTmp = reinterpret_cast<RSHEADER_TYPE*>
(reinterpret_cast<sal_uInt8*>(pStack->pResource) + pStack->pResource->GetLocalOff());
pEnd = reinterpret_cast<RSHEADER_TYPE*>