diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-08 12:38:39 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-10 14:18:09 +0200 |
commit | 53ebbad48c8c2a71044917a5cbac9657126e5adc (patch) | |
tree | 32ae305d00d765b2f0d1bbb7f9bc4cefcac8cd18 /include | |
parent | e32d864dbe086d630a8b17c2d376e320aee0253a (diff) |
warning: Excessive padding in 'struct OutDevState'
experiment with optin.performance.Padding analyzer and tuning
AllowedPad to 2
with clang as compiler;
export ENVCFLAGSCXX="-Xclang -analyze -Xclang -analyzer-checker=optin.performance -Xclang -analyzer-config -Xclang optin.performance.Padding:AllowedPad=2"
and get a report of:
OutDevState (13 padding bytes, where 5 is optimal)
UIControlOptions (9 padding bytes, where 1 is optimal)
Change-Id: I174f6f62d6e32df057d5e0f21d4274166f6ed8c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121812
Tested-by: Jenkins
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/borderline.hxx | 17 | ||||
-rw-r--r-- | include/svtools/brwbox.hxx | 2 | ||||
-rw-r--r-- | include/vcl/commandevent.hxx | 5 | ||||
-rw-r--r-- | include/vcl/outdevstate.hxx | 8 | ||||
-rw-r--r-- | include/vcl/print.hxx | 6 | ||||
-rw-r--r-- | include/vcl/transfer.hxx | 8 |
6 files changed, 21 insertions, 25 deletions
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx index e48b461a8b02..d22e0c586317 100644 --- a/include/editeng/borderline.hxx +++ b/include/editeng/borderline.hxx @@ -143,20 +143,17 @@ double EDITENG_DLLPUBLIC ConvertBorderWidthFromWord(SvxBorderLineStyle, class EDITENG_DLLPUBLIC SvxBorderLine final { - Color aColor; - tools::Long m_nWidth; - bool m_bMirrorWidths; - BorderWidthImpl m_aWidthImpl; tools::Long m_nMult; tools::Long m_nDiv; - + Color (*m_pColorOutFn)(Color); + Color (*m_pColorInFn)(Color); + Color (*m_pColorGapFn)(Color); + BorderWidthImpl m_aWidthImpl; + Color aColor; SvxBorderLineStyle m_nStyle; - - bool m_bUseLeftTop; - Color (*m_pColorOutFn)( Color ); - Color (*m_pColorInFn)( Color ); - Color (*m_pColorGapFn)( Color ); + bool m_bMirrorWidths; + bool m_bUseLeftTop; public: SvxBorderLine( const Color *pCol = nullptr, diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index 1c7d6e5404cc..60e37de7d432 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -118,8 +118,8 @@ namespace o3tl class BrowseEvent { VclPtr<vcl::Window> pWin; - sal_Int32 nRow; tools::Rectangle aRect; + sal_Int32 nRow; sal_uInt16 nCol; sal_uInt16 nColId; diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx index 9edcdb4d6f13..883147fad491 100644 --- a/include/vcl/commandevent.hxx +++ b/include/vcl/commandevent.hxx @@ -309,16 +309,15 @@ class VCL_DLLPUBLIC CommandGestureData public: double const mfX; double const mfY; - GestureEventType const meEventType; - double const mfOffset; + GestureEventType const meEventType; PanningOrientation const meOrientation; CommandGestureData(double fX, double fY, GestureEventType eEventType, double fOffset, PanningOrientation eOrientation) : mfX(fX) , mfY(fY) - , meEventType(eEventType) , mfOffset(fOffset) + , meEventType(eEventType) , meOrientation(eOrientation) {} }; diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx index 60d12ac523f5..a80620f957b6 100644 --- a/include/vcl/outdevstate.hxx +++ b/include/vcl/outdevstate.hxx @@ -79,22 +79,22 @@ struct OutDevState OutDevState() = default; OutDevState(OutDevState&&) = default; - std::optional<MapMode> mpMapMode; - bool mbMapActive = false; std::unique_ptr<vcl::Region> mpClipRegion; + std::optional<MapMode> mpMapMode; + std::optional<vcl::Font> mpFont; + std::optional<Point> mpRefPoint; std::optional<Color> mpLineColor; std::optional<Color> mpFillColor; - std::optional<vcl::Font> mpFont; std::optional<Color> mpTextColor; std::optional<Color> mpTextFillColor; std::optional<Color> mpTextLineColor; std::optional<Color> mpOverlineColor; - std::optional<Point> mpRefPoint; TextAlign meTextAlign = ALIGN_TOP; RasterOp meRasterOp = RasterOp::OverPaint; ComplexTextLayoutFlags mnTextLayoutMode = ComplexTextLayoutFlags::Default; LanguageType meTextLanguage = LANGUAGE_SYSTEM; PushFlags mnFlags = PushFlags::NONE; + bool mbMapActive = false; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index dba696eebf18..e487e8aa82b5 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -533,13 +533,13 @@ public: struct UIControlOptions { OUString maDependsOnName; + OUString maGroupHint; + std::vector< css::beans::PropertyValue > + maAddProps; sal_Int32 mnDependsOnEntry; bool mbAttachToDependency; - OUString maGroupHint; bool mbInternalOnly; bool mbEnabled; - std::vector< css::beans::PropertyValue > - maAddProps; UIControlOptions( const OUString& i_rDependsOnName = OUString(), sal_Int32 i_nDependsOnEntry = -1, bool i_bAttachToDependency = false) diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx index 99413ad189e3..45fa55176e3a 100644 --- a/include/vcl/transfer.hxx +++ b/include/vcl/transfer.hxx @@ -90,9 +90,9 @@ struct TransferableObjectDescriptor struct AcceptDropEvent { - sal_Int8 mnAction; Point maPosPixel; const css::datatransfer::dnd::DropTargetDragEvent maDragEvent; + sal_Int8 mnAction; bool mbLeaving; bool mbDefault; @@ -104,26 +104,26 @@ struct AcceptDropEvent AcceptDropEvent( sal_Int8 nAction, const Point& rPosPixel, const css::datatransfer::dnd::DropTargetDragEvent& rDragEvent ) : - mnAction( nAction ), maPosPixel( rPosPixel ), maDragEvent( rDragEvent ), + mnAction( nAction ), mbLeaving( false ), mbDefault( false ) {} }; struct ExecuteDropEvent { - sal_Int8 mnAction; Point maPosPixel; const css::datatransfer::dnd::DropTargetDropEvent maDropEvent; + sal_Int8 mnAction; bool mbDefault; ExecuteDropEvent( sal_Int8 nAction, const Point& rPosPixel, const css::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) : - mnAction( nAction ), maPosPixel( rPosPixel ), maDropEvent( rDropEvent ), + mnAction( nAction ), mbDefault( false ) {} }; |