From e8c940b73840868f26a537e159047e99d7ddae2c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 10 Sep 2021 15:45:35 +0200 Subject: clang:optin.performance.Padding in binaryurp Excessive padding in 'struct binaryurp::OutgoingRequest' (11 padding bytes, where 3 is optimal). Excessive padding in 'struct binaryurp::Writer::Item' (28 padding bytes, where 4 is optimal). Excessive padding in 'class binaryurp::IncomingRequest' (19 padding bytes, where 3 is optimal). Change-Id: I43ef9c513ad2bbb1151edbf5db578d69d35ccfbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121919 Tested-by: Jenkins Reviewed-by: Noel Grandin --- binaryurp/source/incomingrequest.cxx | 6 +++--- binaryurp/source/incomingrequest.hxx | 6 +++--- binaryurp/source/outgoingrequest.hxx | 6 +++--- binaryurp/source/writer.cxx | 13 +++++++------ binaryurp/source/writer.hxx | 19 ++++--------------- 5 files changed, 20 insertions(+), 30 deletions(-) (limited to 'binaryurp') diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx index eed6f7cb8466..62e88697769b 100644 --- a/binaryurp/source/incomingrequest.cxx +++ b/binaryurp/source/incomingrequest.cxx @@ -50,9 +50,9 @@ IncomingRequest::IncomingRequest( std::vector< BinaryAny > const & inArguments, bool currentContextMode, css::uno::UnoInterfaceReference const & currentContext): bridge_(bridge), tid_(tid), oid_(oid), object_(object), type_(type), - functionId_(functionId), synchronous_(synchronous), member_(member), - setter_(setter), inArguments_(inArguments), - currentContextMode_(currentContextMode), currentContext_(currentContext) + member_(member), currentContext_(currentContext), + inArguments_(inArguments), functionId_(functionId), + synchronous_(synchronous), setter_(setter), currentContextMode_(currentContextMode) { assert(bridge.is()); assert(member.is()); diff --git a/binaryurp/source/incomingrequest.hxx b/binaryurp/source/incomingrequest.hxx index f85171b15a93..6a79126b4f65 100644 --- a/binaryurp/source/incomingrequest.hxx +++ b/binaryurp/source/incomingrequest.hxx @@ -65,13 +65,13 @@ private: OUString oid_; // initial object queryInterface; release com::sun::star::uno::UnoInterfaceReference object_; com::sun::star::uno::TypeDescription type_; + com::sun::star::uno::TypeDescription member_; + com::sun::star::uno::UnoInterfaceReference currentContext_; + std::vector< BinaryAny > inArguments_; sal_uInt16 functionId_; bool synchronous_; - com::sun::star::uno::TypeDescription member_; bool setter_; - std::vector< BinaryAny > inArguments_; bool currentContextMode_; - com::sun::star::uno::UnoInterfaceReference currentContext_; }; } diff --git a/binaryurp/source/outgoingrequest.hxx b/binaryurp/source/outgoingrequest.hxx index f5abda34a302..eb2c8a7e5212 100644 --- a/binaryurp/source/outgoingrequest.hxx +++ b/binaryurp/source/outgoingrequest.hxx @@ -31,13 +31,13 @@ struct OutgoingRequest { OutgoingRequest( Kind theKind, com::sun::star::uno::TypeDescription const & theMember, bool theSetter): - kind(theKind), member(theMember), setter(theSetter) + member(theMember), kind(theKind), setter(theSetter) {} - Kind kind; - com::sun::star::uno::TypeDescription member; + Kind kind; + bool setter; }; diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx index 585f375d7a58..9fb609180e4a 100644 --- a/binaryurp/source/writer.cxx +++ b/binaryurp/source/writer.cxx @@ -56,9 +56,9 @@ Writer::Item::Item( css::uno::TypeDescription const & theMember, std::vector< BinaryAny > const & inArguments, css::uno::UnoInterfaceReference const & theCurrentContext): - request(true), tid(theTid), oid(theOid), type(theType), member(theMember), - setter(false), arguments(inArguments), exception(false), - currentContext(theCurrentContext), setCurrentContextMode(false) + tid(theTid), oid(theOid), type(theType), member(theMember), + currentContext(theCurrentContext), arguments(inArguments), + request(true), setter(false), exception(false), setCurrentContextMode(false) {} Writer::Item::Item( @@ -67,9 +67,10 @@ Writer::Item::Item( bool theException, BinaryAny const & theReturnValue, std::vector< BinaryAny > const & outArguments, bool theSetCurrentContextMode): - request(false), tid(theTid), member(theMember), setter(theSetter), - arguments(outArguments), exception(theException), - returnValue(theReturnValue), setCurrentContextMode(theSetCurrentContextMode) + tid(theTid), member(theMember), + returnValue(theReturnValue), arguments(outArguments), + request(false), setter(theSetter), + exception(theException), setCurrentContextMode(theSetCurrentContextMode) {} Writer::Writer(rtl::Reference< Bridge > const & bridge): diff --git a/binaryurp/source/writer.hxx b/binaryurp/source/writer.hxx index 8a6f60de0d03..65945a66b6f3 100644 --- a/binaryurp/source/writer.hxx +++ b/binaryurp/source/writer.hxx @@ -119,27 +119,16 @@ private: std::vector< BinaryAny > const & outArguments, bool theSetCurrentContextMode); - bool request; - rtl::ByteSequence tid; // request + reply - OUString oid; // request - com::sun::star::uno::TypeDescription type; // request - com::sun::star::uno::TypeDescription member; // request + reply - + com::sun::star::uno::UnoInterfaceReference currentContext; // request + BinaryAny returnValue; // reply + std::vector< BinaryAny > arguments; // request: inArguments; reply: outArguments + bool request; bool setter; // reply - - std::vector< BinaryAny > arguments; - // request: inArguments; reply: outArguments - bool exception; // reply - - BinaryAny returnValue; // reply - - com::sun::star::uno::UnoInterfaceReference currentContext; // request - bool setCurrentContextMode; // reply }; -- cgit