summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-11 14:11:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-11 14:59:36 +0200
commitd8910519f1bc5aa284a79b7d24581d087adf0c29 (patch)
tree40959368162642352328b2449b7ab444095a6916
parent1fcc0cb5ee5397addee2fcfbebcc2d124a82e8e5 (diff)
clang:optin.performance.Padding
Excessive padding in 'struct ValueSetItem' (8 padding bytes, where 0 is optimal). Excessive padding in 'struct framework::CommandInfo' (12 padding bytes, where 4 is optimal). Optimal fields order: aIds, nId, nImageInfo, consider reordering the fields or adding explicit padding members [optin.performance.Padding] Excessive padding in 'class drawinglayer::attribute::ImpFillGradientAttribute' (10 padding bytes, where 2 is optimal). Excessive padding in 'class drawinglayer::attribute::ImpSdrLineAttribute' (8 padding bytes, where 0 is optimal). Change-Id: I606f2bfc2c0c51b386182b900401dd15b5404451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--drawinglayer/source/attribute/fillgradientattribute.cxx10
-rw-r--r--drawinglayer/source/attribute/sdrlineattribute.cxx22
-rw-r--r--framework/inc/uielement/commandinfo.hxx2
-rw-r--r--svtools/source/control/valueacc.cxx4
-rw-r--r--svtools/source/control/valueimp.hxx10
5 files changed, 24 insertions, 24 deletions
diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx b/drawinglayer/source/attribute/fillgradientattribute.cxx
index 1d3a67b02a7a..0e42954e35e6 100644
--- a/drawinglayer/source/attribute/fillgradientattribute.cxx
+++ b/drawinglayer/source/attribute/fillgradientattribute.cxx
@@ -28,13 +28,13 @@ namespace drawinglayer::attribute
{
public:
// data definitions
- GradientStyle meStyle;
double mfBorder;
double mfOffsetX;
double mfOffsetY;
double mfAngle;
basegfx::BColor maStartColor;
basegfx::BColor maEndColor;
+ GradientStyle meStyle;
sal_uInt16 mnSteps;
ImpFillGradientAttribute(
@@ -46,23 +46,23 @@ namespace drawinglayer::attribute
const basegfx::BColor& rStartColor,
const basegfx::BColor& rEndColor,
sal_uInt16 nSteps)
- : meStyle(eStyle),
- mfBorder(fBorder),
+ : mfBorder(fBorder),
mfOffsetX(fOffsetX),
mfOffsetY(fOffsetY),
mfAngle(fAngle),
maStartColor(rStartColor),
maEndColor(rEndColor),
+ meStyle(eStyle),
mnSteps(nSteps)
{
}
ImpFillGradientAttribute()
- : meStyle(GradientStyle::Linear),
- mfBorder(0.0),
+ : mfBorder(0.0),
mfOffsetX(0.0),
mfOffsetY(0.0),
mfAngle(0.0),
+ meStyle(GradientStyle::Linear),
mnSteps(0)
{
}
diff --git a/drawinglayer/source/attribute/sdrlineattribute.cxx b/drawinglayer/source/attribute/sdrlineattribute.cxx
index 3dd7e16d6ab6..217ed813cdcd 100644
--- a/drawinglayer/source/attribute/sdrlineattribute.cxx
+++ b/drawinglayer/source/attribute/sdrlineattribute.cxx
@@ -28,13 +28,13 @@ namespace drawinglayer::attribute
{
public:
// line definitions
- basegfx::B2DLineJoin meJoin; // B2DLINEJOIN_* defines
double mfWidth; // 1/100th mm, 0.0==hair
double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
+ double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
basegfx::BColor maColor; // color of line
+ std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
+ basegfx::B2DLineJoin meJoin; // B2DLINEJOIN_* defines
css::drawing::LineCap meCap; // BUTT, ROUND, or SQUARE
- std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
- double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
ImpSdrLineAttribute(
basegfx::B2DLineJoin eJoin,
@@ -44,22 +44,22 @@ namespace drawinglayer::attribute
css::drawing::LineCap eCap,
const std::vector< double >& rDotDashArray,
double fFullDotDashLen)
- : meJoin(eJoin),
- mfWidth(fWidth),
+ : mfWidth(fWidth),
mfTransparence(fTransparence),
+ mfFullDotDashLen(fFullDotDashLen),
maColor(rColor),
- meCap(eCap),
maDotDashArray(rDotDashArray),
- mfFullDotDashLen(fFullDotDashLen)
+ meJoin(eJoin),
+ meCap(eCap)
{
}
ImpSdrLineAttribute()
- : meJoin(basegfx::B2DLineJoin::Round),
- mfWidth(0.0),
+ : mfWidth(0.0),
mfTransparence(0.0),
- meCap(css::drawing::LineCap_BUTT),
- mfFullDotDashLen(0.0)
+ mfFullDotDashLen(0.0),
+ meJoin(basegfx::B2DLineJoin::Round),
+ meCap(css::drawing::LineCap_BUTT)
{
}
diff --git a/framework/inc/uielement/commandinfo.hxx b/framework/inc/uielement/commandinfo.hxx
index 2a35b3363aa4..a93c693e6a2e 100644
--- a/framework/inc/uielement/commandinfo.hxx
+++ b/framework/inc/uielement/commandinfo.hxx
@@ -33,8 +33,8 @@ struct CommandInfo
CommandInfo() : nId( 0 ),
nImageInfo( 0 ) {}
- ToolBoxItemId nId;
::std::vector< ToolBoxItemId > aIds;
+ ToolBoxItemId nId;
sal_Int16 nImageInfo;
};
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 7c12373f5982..2f47f2616ae0 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -36,11 +36,11 @@ using namespace ::com::sun::star;
ValueSetItem::ValueSetItem( ValueSet& rParent )
: mrParent(rParent)
+ , mpData(nullptr)
+ , mxAcc()
, mnId(0)
, meType(VALUESETITEM_NONE)
, mbVisible(true)
- , mpData(nullptr)
- , mxAcc()
{
}
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index 707493443b75..ca25ddbc12cf 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -52,14 +52,14 @@ class ValueSet;
struct ValueSetItem
{
ValueSet& mrParent;
- sal_uInt16 mnId;
- sal_uInt8 meType;
- bool mbVisible;
- Image maImage;
- Color maColor;
OUString maText;
void* mpData;
rtl::Reference< ValueItemAcc > mxAcc;
+ Image maImage;
+ Color maColor;
+ sal_uInt16 mnId;
+ sal_uInt8 meType;
+ bool mbVisible;
explicit ValueSetItem( ValueSet& rParent );
~ValueSetItem();