[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 11 10:45:34 UTC 2021


 include/vcl/BitmapBuffer.hxx      |   12 ++++++------
 include/vcl/GraphicAttributes.hxx |   12 ++++++------
 vcl/inc/accel.hxx                 |    4 ++--
 vcl/inc/salwtype.hxx              |   12 ++++++------
 vcl/source/app/svapp.cxx          |   16 ++++++++--------
 vcl/source/edit/textdat2.hxx      |    6 +++---
 vcl/source/gdi/mapmod.cxx         |    2 +-
 7 files changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 349e1a7ce141d11432dda730ab8d34ab123117c5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 10 20:20:05 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Sep 11 12:45:01 2021 +0200

    clang:optin.performance.Padding in vcl
    
    Excessive padding in 'class ImplAccelEntry' (13 padding bytes, where 5
    is optimal).
    Excessive padding in 'struct SalQueryCharPositionEvent' (14 padding
    bytes, where 6 is optimal).
    Excessive padding in 'struct SalFrameState' (8 padding bytes, where 0 is
    optimal).
    Excessive padding in 'struct BitmapBuffer' (10 padding bytes, where 2 is
    optimal).
    Excessive padding in 'class GraphicAttr' (10 padding bytes, where 2 is
    optimal).
    Excessive padding in 'struct ImplPostEventData' (12 padding bytes, where
    4 is optimal).
    Excessive padding in 'class TETextPortion' (10 padding bytes, where 2 is
    optimal).
    Excessive padding in 'struct MapMode::ImplMapMode' (11 padding bytes,
    where 3 is optimal).
    
    Change-Id: I41801e0fd676981cc9f386d814fe2f0ea670a673
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121925
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/BitmapBuffer.hxx b/include/vcl/BitmapBuffer.hxx
index d67e42ac6cad..54efeea5e1bc 100644
--- a/include/vcl/BitmapBuffer.hxx
+++ b/include/vcl/BitmapBuffer.hxx
@@ -35,14 +35,14 @@ struct SalTwoRect;
 
 struct VCL_DLLPUBLIC BitmapBuffer
 {
-    ScanlineFormat       mnFormat;
-    tools::Long            mnWidth;
-    tools::Long            mnHeight;
-    tools::Long            mnScanlineSize;
-    sal_uInt16      mnBitCount;
-    ColorMask       maColorMask;
+    tools::Long     mnWidth;
+    tools::Long     mnHeight;
+    tools::Long     mnScanlineSize;
     BitmapPalette   maPalette;
     sal_uInt8*      mpBits;
+    ScanlineFormat  mnFormat;
+    ColorMask       maColorMask;
+    sal_uInt16      mnBitCount;
 };
 
 VCL_DLLPUBLIC std::unique_ptr<BitmapBuffer> StretchAndConvert(
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index b5e73625c467..442158cda2e9 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -35,38 +35,38 @@ class VCL_DLLPUBLIC GraphicAttr
 {
 private:
     double mfGamma;
-    BmpMirrorFlags mnMirrFlags;
     tools::Long mnLeftCrop;
     tools::Long mnTopCrop;
     tools::Long mnRightCrop;
     tools::Long mnBottomCrop;
+    BmpMirrorFlags mnMirrFlags;
+    GraphicDrawMode meDrawMode;
     Degree10 mnRotate10;
     short mnContPercent;
     short mnLumPercent;
     short mnRPercent;
     short mnGPercent;
     short mnBPercent;
-    bool mbInvert;
     sal_uInt8 mcAlpha;
-    GraphicDrawMode meDrawMode;
+    bool mbInvert;
 
 public:
     GraphicAttr()
         : mfGamma(1.0)
-        , mnMirrFlags(BmpMirrorFlags::NONE)
         , mnLeftCrop(0)
         , mnTopCrop(0)
         , mnRightCrop(0)
         , mnBottomCrop(0)
+        , mnMirrFlags(BmpMirrorFlags::NONE)
+        , meDrawMode(GraphicDrawMode::Standard)
         , mnRotate10(0)
         , mnContPercent(0)
         , mnLumPercent(0)
         , mnRPercent(0)
         , mnGPercent(0)
         , mnBPercent(0)
-        , mbInvert(false)
         , mcAlpha(255)
-        , meDrawMode(GraphicDrawMode::Standard)
+        , mbInvert(false)
     {
     }
 
diff --git a/vcl/inc/accel.hxx b/vcl/inc/accel.hxx
index 9d597f76fd47..b00950b30095 100644
--- a/vcl/inc/accel.hxx
+++ b/vcl/inc/accel.hxx
@@ -35,10 +35,10 @@ class Accelerator;
 class ImplAccelEntry
 {
 public:
-    sal_uInt16      mnId;
-    vcl::KeyCode    maKeyCode;
     Accelerator*    mpAccel;
     Accelerator*    mpAutoAccel;
+    vcl::KeyCode    maKeyCode;
+    sal_uInt16      mnId;
     bool            mbEnabled;
 };
 
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 2b07854271ef..c9f50cd63982 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -214,13 +214,13 @@ struct SalSurroundingTextSelectionChangeEvent
 
 struct SalQueryCharPositionEvent
 {
-    bool            mbValid;                // The data is valid or not.
     sal_uLong       mnCharPos;              // The index of character in a composition.
+    tools::Long     mnCursorBoundX;         // The cursor bounds corresponding to the character specified by mnCharPos - X
+    tools::Long     mnCursorBoundY;         // The cursor bounds corresponding to the character specified by mnCharPos - Y
+    tools::Long     mnCursorBoundWidth;     // The cursor bounds corresponding to the character specified by mnCharPos - Width
+    tools::Long     mnCursorBoundHeight;    // The cursor bounds corresponding to the character specified by mnCharPos - Height
+    bool            mbValid;                // The data is valid or not.
     bool            mbVertical;             // The text is vertical or not.
-    tools::Long            mnCursorBoundX;         // The cursor bounds corresponding to the character specified by mnCharPos - X
-    tools::Long            mnCursorBoundY;         // The cursor bounds corresponding to the character specified by mnCharPos - Y
-    tools::Long            mnCursorBoundWidth;     // The cursor bounds corresponding to the character specified by mnCharPos - Width
-    tools::Long            mnCursorBoundHeight;    // The cursor bounds corresponding to the character specified by mnCharPos - Height
 };
 
 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
@@ -233,7 +233,6 @@ enum class SalObjEvent {
 
 struct SalFrameState
 {
-    WindowStateMask mnMask;
     tools::Long            mnX;
     tools::Long            mnY;
     tools::Long            mnWidth;
@@ -242,6 +241,7 @@ struct SalFrameState
     tools::Long            mnMaximizedY;
     tools::Long            mnMaximizedWidth;
     tools::Long            mnMaximizedHeight;
+    WindowStateMask  mnMask;
     WindowStateState mnState;
 };
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index b65bfade3a25..af0353043f51 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -121,29 +121,29 @@ extern "C" {
 
 struct ImplPostEventData
 {
-    VclEventId      mnEvent;
     VclPtr<vcl::Window> mpWin;
     ImplSVEvent *   mnEventId;
-    KeyEvent        maKeyEvent;
     MouseEvent      maMouseEvent;
+    VclEventId      mnEvent;
+    KeyEvent        maKeyEvent;
     GestureEvent    maGestureEvent;
 
     ImplPostEventData(VclEventId nEvent, vcl::Window* pWin, const KeyEvent& rKeyEvent)
-        : mnEvent(nEvent)
-        , mpWin(pWin)
+        : mpWin(pWin)
         , mnEventId(nullptr)
+        , mnEvent(nEvent)
         , maKeyEvent(rKeyEvent)
     {}
     ImplPostEventData(VclEventId nEvent, vcl::Window* pWin, const MouseEvent& rMouseEvent)
-        : mnEvent(nEvent)
-        , mpWin(pWin)
+        : mpWin(pWin)
         , mnEventId(nullptr)
         , maMouseEvent(rMouseEvent)
+        , mnEvent(nEvent)
     {}
     ImplPostEventData(VclEventId nEvent, vcl::Window* pWin, const GestureEvent& rGestureEvent)
-        : mnEvent(nEvent)
-        , mpWin(pWin)
+        : mpWin(pWin)
         , mnEventId(nullptr)
+        , mnEvent(nEvent)
         , maGestureEvent(rGestureEvent)
     {}
 };
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx
index 1f9d2428d9f2..c620f91ad4e2 100644
--- a/vcl/source/edit/textdat2.hxx
+++ b/vcl/source/edit/textdat2.hxx
@@ -49,15 +49,15 @@ class TextView;
 class TETextPortion
 {
 private:
+    tools::Long     nWidth;
     sal_Int32       nLen;
-    tools::Long            nWidth;
     sal_uInt8       nKind;
     bool            bRightToLeft;
 
 public:
                 TETextPortion( sal_Int32 nL )
-                    : nLen {nL}
-                    , nWidth {-1}
+                    : nWidth {-1}
+                    , nLen {nL}
                     , nKind {PORTIONKIND_TEXT}
                     , bRightToLeft {false}
                 {}
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index 2a61b271df9b..0e74157dec86 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -27,8 +27,8 @@
 
 struct MapMode::ImplMapMode
 {
-    MapUnit         meUnit;
     Point           maOrigin;
+    MapUnit         meUnit;
     // NOTE: these Fraction must NOT have more than 32 bits precision
     // because ReadFraction / WriteFraction do only 32 bits, so more than
     // that cannot be stored in MetaFiles!


More information about the Libreoffice-commits mailing list