diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-18 11:52:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-18 14:08:28 +0200 |
commit | 225328b1e3994fcd6b293f007fee10c27e98291e (patch) | |
tree | ddead398248e0cab5fe003c19371bd074e2db267 /codemaker | |
parent | 2c6cea672a852b85cfb6d2e313d806f257481417 (diff) |
clang-tidy modernize-pass-by-value in codemaker
Change-Id: I2bd9c4c8ced5f0edb9dbf560fe0ed126b9233c26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134519
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 12 | ||||
-rw-r--r-- | codemaker/source/cppumaker/includes.cxx | 5 | ||||
-rw-r--r-- | codemaker/source/cppumaker/includes.hxx | 2 | ||||
-rw-r--r-- | codemaker/source/javamaker/javatype.cxx | 42 |
4 files changed, 31 insertions, 30 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index e5436c9049f5..03fcd033beca 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -27,6 +27,7 @@ #include <set> #include <string_view> #include <memory> +#include <utility> #include <vector> #include <iostream> @@ -152,8 +153,7 @@ bool isBootstrapType(OUString const & name) class CppuType { public: - CppuType( - OUString const & name, rtl::Reference< TypeManager > const & typeMgr); + CppuType(OUString name, rtl::Reference< TypeManager > const & typeMgr); virtual ~CppuType() {} @@ -273,12 +273,12 @@ private: }; CppuType::CppuType( - OUString const & name, rtl::Reference< TypeManager > const & typeMgr): + OUString name, rtl::Reference< TypeManager > const & typeMgr): m_inheritedMemberCount(0) , m_cppuTypeLeak(false) , m_cppuTypeDynamic(true) , m_indentLength(0) - , name_(name) + , name_(std::move(name)) , id_(name_.copy(name_.lastIndexOf('.') + 1)) , m_typeMgr(typeMgr) , m_dependencies(typeMgr, name_) @@ -1051,9 +1051,9 @@ class BaseOffset { public: BaseOffset( - rtl::Reference< TypeManager > const & manager, + rtl::Reference< TypeManager > manager, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity): - manager_(manager), offset_(0) { + manager_(std::move(manager)), offset_(0) { calculateBases(entity); } BaseOffset(const BaseOffset&) = delete; diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx index db7dae46bccc..9dacdf268265 100644 --- a/codemaker/source/cppumaker/includes.cxx +++ b/codemaker/source/cppumaker/includes.cxx @@ -33,14 +33,15 @@ #include <rtl/ustring.hxx> #include <sal/types.h> +#include <utility> #include <vector> using codemaker::cppumaker::Includes; Includes::Includes( - rtl::Reference< TypeManager > const & manager, + rtl::Reference< TypeManager > manager, codemaker::cppumaker::Dependencies const & dependencies, bool hpp): - m_manager(manager), m_map(dependencies.getMap()), m_hpp(hpp), + m_manager(std::move(manager)), m_map(dependencies.getMap()), m_hpp(hpp), m_includeCassert(false), m_includeAny(dependencies.hasAnyDependency()), m_includeReference(false), m_includeSequence(dependencies.hasSequenceDependency()), diff --git a/codemaker/source/cppumaker/includes.hxx b/codemaker/source/cppumaker/includes.hxx index 0362c417ac2a..8cd830b4a731 100644 --- a/codemaker/source/cppumaker/includes.hxx +++ b/codemaker/source/cppumaker/includes.hxx @@ -33,7 +33,7 @@ namespace codemaker::cppumaker { class Includes { public: Includes( - rtl::Reference< TypeManager > const & manager, + rtl::Reference< TypeManager > manager, Dependencies const & dependencies, bool hpp); ~Includes(); diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index 563506221721..3db9572e5c7c 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -320,7 +320,7 @@ SpecialType getFieldDescriptor( class MethodDescriptor { public: MethodDescriptor( - rtl::Reference< TypeManager > const & manager, + rtl::Reference< TypeManager > manager, std::set<OUString> * dependencies, std::u16string_view returnType, SpecialType * specialReturnType, PolymorphicUnoType * polymorphicUnoType); @@ -346,10 +346,10 @@ private: }; MethodDescriptor::MethodDescriptor( - rtl::Reference< TypeManager > const & manager, std::set<OUString> * dependencies, + rtl::Reference< TypeManager > manager, std::set<OUString> * dependencies, std::u16string_view returnType, SpecialType * specialReturnType, PolymorphicUnoType * polymorphicUnoType): - m_manager(manager), m_dependencies(dependencies), m_needsSignature(false) + m_manager(std::move(manager)), m_dependencies(dependencies), m_needsSignature(false) { assert(dependencies != nullptr); m_descriptorStart.append('('); @@ -400,20 +400,20 @@ public: // KIND_MEMBER: TypeInfo( - OString const & name, SpecialType specialType, sal_Int32 index, + OString name, SpecialType specialType, sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType, sal_Int32 typeParameterIndex); // KIND_ATTRIBUTE/METHOD: TypeInfo( - Kind kind, OString const & name, SpecialType specialType, Flags flags, - sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType); + Kind kind, OString name, SpecialType specialType, Flags flags, + sal_Int32 index, PolymorphicUnoType polymorphicUnoType); // KIND_PARAMETER: TypeInfo( - OString const & parameterName, SpecialType specialType, - bool inParameter, bool outParameter, OString const & methodName, - sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType); + OString parameterName, SpecialType specialType, + bool inParameter, bool outParameter, OString methodName, + sal_Int32 index, PolymorphicUnoType polymorphicUnoType); sal_uInt16 generateCode(ClassFile::Code & code, std::set<OUString> * dependencies) const; @@ -447,10 +447,10 @@ sal_Int32 translateSpecialTypeFlags( } TypeInfo::TypeInfo( - OString const & name, SpecialType specialType, sal_Int32 index, + OString name, SpecialType specialType, sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType, sal_Int32 typeParameterIndex): - m_kind(KIND_MEMBER), m_name(name), + m_kind(KIND_MEMBER), m_name(std::move(name)), m_flags(translateSpecialTypeFlags(specialType, false, false)), m_index(index), m_polymorphicUnoType(polymorphicUnoType), m_typeParameterIndex(typeParameterIndex) @@ -461,24 +461,24 @@ TypeInfo::TypeInfo( } TypeInfo::TypeInfo( - Kind kind, OString const & name, SpecialType specialType, Flags flags, - sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType): - m_kind(kind), m_name(name), + Kind kind, OString name, SpecialType specialType, Flags flags, + sal_Int32 index, PolymorphicUnoType polymorphicUnoType): + m_kind(kind), m_name(std::move(name)), m_flags(flags | translateSpecialTypeFlags(specialType, false, false)), - m_index(index), m_polymorphicUnoType(polymorphicUnoType), + m_index(index), m_polymorphicUnoType(std::move(polymorphicUnoType)), m_typeParameterIndex(0) { assert(kind == KIND_ATTRIBUTE || kind == KIND_METHOD); } TypeInfo::TypeInfo( - OString const & parameterName, SpecialType specialType, bool inParameter, - bool outParameter, OString const & methodName, sal_Int32 index, - PolymorphicUnoType const & polymorphicUnoType): - m_kind(KIND_PARAMETER), m_name(parameterName), + OString parameterName, SpecialType specialType, bool inParameter, + bool outParameter, OString methodName, sal_Int32 index, + PolymorphicUnoType polymorphicUnoType): + m_kind(KIND_PARAMETER), m_name(std::move(parameterName)), m_flags(translateSpecialTypeFlags(specialType, inParameter, outParameter)), - m_index(index), m_methodName(methodName), - m_polymorphicUnoType(polymorphicUnoType), + m_index(index), m_methodName(std::move(methodName)), + m_polymorphicUnoType(std::move(polymorphicUnoType)), m_typeParameterIndex(0) {} |