From 819bc6fa15478703a339fc43306ed0abd018a6f5 Mon Sep 17 00:00:00 2001 From: Cinder Biscuits <cinder@cinderblocks.biz> Date: Thu, 26 Sep 2019 07:43:12 -0500 Subject: [PATCH] Avoid more unnecessary copying --- indra/llappearance/llavatarappearance.cpp | 5 +- .../llavatarappearancedefines.cpp | 6 ++- .../llappearance/llavatarappearancedefines.h | 2 +- indra/llappearance/llpolymorph.cpp | 6 ++- indra/llappearance/llpolymorph.h | 2 +- indra/llappearance/llwearabletype.cpp | 6 ++- indra/llaudio/llaudiodecodemgr.cpp | 7 +-- indra/llaudio/llaudioengine_fmodstudio.cpp | 5 +- indra/llaudio/llaudioengine_fmodstudio.h | 2 +- indra/llcharacter/llgesture.cpp | 10 ++-- indra/llcharacter/llgesture.h | 4 +- indra/llcommon/llapr.cpp | 4 +- indra/llcommon/llapr.h | 2 +- indra/llcommon/llcallstack.h | 5 +- indra/llcommon/llcommonprecompiled.h | 1 + indra/llcommon/llcoros.cpp | 4 +- indra/llcommon/llcoros.h | 2 +- indra/llcommon/lldictionary.cpp | 4 +- indra/llcommon/lldictionary.h | 2 +- indra/llcommon/llevent.h | 5 +- indra/llcommon/lleventapi.cpp | 16 +++---- indra/llcommon/lleventapi.h | 4 +- indra/llcommon/lleventdispatcher.cpp | 14 +++--- indra/llcommon/lleventfilter.cpp | 19 ++++---- indra/llcommon/lleventfilter.h | 4 +- indra/llcommon/llinitparam.h | 5 +- indra/llcommon/llleaplistener.cpp | 5 +- indra/llcommon/llleaplistener.h | 2 +- indra/llcommon/lllivefile.cpp | 7 +-- indra/llcommon/llprocess.cpp | 11 ++--- indra/llcommon/llsdserialize.h | 5 +- indra/llcommon/llsdutil.h | 9 ++-- indra/llcommon/llstring.h | 3 +- indra/llcommon/llthread.cpp | 5 +- indra/llcommon/llthread.h | 2 +- indra/llcorehttp/_thread.h | 3 +- indra/llinventory/llinventory.cpp | 11 +++-- indra/llinventory/llinventory.h | 8 ++-- indra/llinventory/llinventorytype.cpp | 6 ++- indra/llkdu/llimagej2ckdu.cpp | 5 +- indra/llmessage/llcoproceduremanager.cpp | 8 ++-- indra/llmessage/llcorehttputil.cpp | 5 +- indra/llmessage/llcorehttputil.h | 2 +- indra/llmessage/lliohttpserver.cpp | 7 +-- indra/llmessage/lliosocket.cpp | 9 ++-- indra/llmessage/llioutil.h | 5 +- indra/llmessage/llmessagelog.cpp | 13 +++--- indra/llmessage/llmessagelog.h | 6 +-- indra/llmessage/llstoredmessage.cpp | 3 +- indra/llmessage/llstoredmessage.h | 2 +- indra/llplugin/llpluginmessagepipe.cpp | 5 +- indra/llprimitive/llmodel.h | 5 +- indra/llprimitive/llmodelloader.cpp | 12 +++-- indra/llrender/llfontregistry.cpp | 21 +++++---- indra/llrender/llfontregistry.h | 4 +- indra/llrender/lluiimage.cpp | 8 ++-- indra/llrender/lluiimage.h | 2 +- indra/llui/llbadgeowner.cpp | 4 +- indra/llui/llcallbackmap.h | 3 +- indra/llui/llchat.h | 5 +- indra/llui/llconsole.cpp | 3 +- indra/llui/llconsole.h | 3 +- indra/llui/lldockcontrol.cpp | 6 ++- indra/llui/lldockcontrol.h | 2 +- indra/llui/llflashtimer.cpp | 4 +- indra/llui/llfloater.cpp | 5 +- indra/llui/llfloater.h | 2 +- indra/llui/llkeywords.h | 9 ++-- indra/llui/llnotifications.h | 3 +- indra/llui/lltexteditor.cpp | 5 +- indra/llui/lltrans.h | 6 ++- indra/llui/lluistring.cpp | 5 +- indra/llui/lluistring.h | 2 +- indra/llvfs/lllfsthread.cpp | 5 +- indra/llvfs/lllfsthread.h | 2 +- indra/llxml/llcontrol.cpp | 9 ++-- indra/llxml/llcontrol.h | 4 +- indra/llxml/llxmltree.cpp | 5 +- indra/llxml/llxmltree.h | 2 +- indra/newview/llagentwearables.cpp | 6 ++- indra/newview/llaoset.h | 5 +- indra/newview/llappearancemgr.cpp | 35 +++++++------- indra/newview/llappviewerlistener.cpp | 8 ++-- indra/newview/llappviewerlistener.h | 2 +- indra/newview/llattachmentsmgr.cpp | 5 +- indra/newview/llattachmentsmgr.h | 2 +- indra/newview/llcompilequeue.cpp | 7 +-- indra/newview/llconversationmodel.cpp | 3 +- indra/newview/lldelayedgestureerror.h | 3 +- indra/newview/lldrawpoolbump.h | 3 +- indra/newview/lleasymessagelogentry.cpp | 3 +- indra/newview/lleasymessagereader.cpp | 2 +- indra/newview/lleasymessagereader.h | 2 +- indra/newview/llenvmanager.h | 13 +++--- indra/newview/lleventnotifier.cpp | 7 +-- indra/newview/lleventnotifier.h | 7 +-- indra/newview/llexpandabletextbox.cpp | 5 +- indra/newview/llfavoritesbar.h | 5 +- indra/newview/llfeaturemanager.cpp | 9 ++-- indra/newview/llfeaturemanager.h | 4 +- indra/newview/llfloatereditdaycycle.h | 3 +- indra/newview/llfloaterpreference.cpp | 3 +- indra/newview/llfloaterreporter.cpp | 3 +- .../newview/llfloatertexturefetchdebugger.cpp | 10 ++-- indra/newview/llfloatertexturepicker.cpp | 8 ++-- indra/newview/llfloatertexturepicker.h | 2 +- indra/newview/llfloateruipreview.cpp | 3 +- indra/newview/llfloaterurlentry.cpp | 3 +- indra/newview/llfriendcard.cpp | 3 +- indra/newview/llgroupmgr.cpp | 9 ++-- indra/newview/llgroupmgr.h | 4 +- indra/newview/llhudeffectlookat.cpp | 5 +- indra/newview/llhudnametag.h | 5 +- indra/newview/llhudtext.h | 5 +- indra/newview/llimview.cpp | 6 ++- indra/newview/llimview.h | 2 +- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llinventoryfunctions.h | 3 +- indra/newview/llinventorymodel.cpp | 11 +++-- indra/newview/llinventorymodel.h | 2 +- .../llinventorymodelbackgroundfetch.cpp | 7 +-- indra/newview/llinventoryobserver.cpp | 5 +- indra/newview/llinventorypanel.cpp | 2 +- indra/newview/lllocationhistory.h | 6 ++- indra/newview/lllogchat.cpp | 5 +- indra/newview/lllogchat.h | 6 ++- indra/newview/llmaterialmgr.cpp | 10 ++-- indra/newview/llmediadataclient.cpp | 20 ++++---- indra/newview/llmediadataclient.h | 4 +- indra/newview/llmeshrepository.cpp | 9 ++-- indra/newview/llmeshrepository.h | 15 +++--- indra/newview/llmutelist.cpp | 5 +- indra/newview/llmutelist.h | 2 +- indra/newview/llnotificationstorage.cpp | 3 +- indra/newview/llpanelavatartag.cpp | 2 +- indra/newview/llpanelavatartag.h | 2 +- indra/newview/llpaneleditwearable.cpp | 46 +++++++++---------- indra/newview/llpanelobjectinventory.cpp | 7 +-- indra/newview/llpaneloutfitedit.h | 5 +- indra/newview/llpanelpeople.cpp | 3 +- indra/newview/llpanelplaces.cpp | 3 +- indra/newview/llpanelteleporthistory.cpp | 15 +++--- indra/newview/llparticipantlist.cpp | 5 +- indra/newview/llpathfindingmanager.cpp | 3 +- indra/newview/llphysicsmotion.cpp | 17 +++---- indra/newview/llpostcard.cpp | 9 ++-- indra/newview/llpreviewgesture.cpp | 5 +- indra/newview/llpreviewscript.cpp | 11 +++-- indra/newview/llpreviewscript.h | 2 +- indra/newview/llscreenchannel.h | 3 +- indra/newview/llscriptruntimeperms.h | 6 ++- indra/newview/llsculptidsize.h | 3 +- indra/newview/llsearchcombobox.cpp | 7 +-- indra/newview/llsearchhistory.h | 5 +- indra/newview/llsecapi.h | 3 +- indra/newview/llsecapicerthandler.h | 2 +- indra/newview/llspeakers.cpp | 5 +- indra/newview/llteleporthistory.h | 3 +- indra/newview/llteleporthistorystorage.h | 9 ++-- indra/newview/lltexturecache.cpp | 7 +-- indra/newview/lltexturefetch.cpp | 13 +++--- indra/newview/lltool.cpp | 5 +- indra/newview/lltool.h | 2 +- indra/newview/llviewerassetupload.cpp | 25 +++++----- indra/newview/llviewerfoldertype.cpp | 18 ++++---- indra/newview/llviewerinventory.cpp | 3 +- indra/newview/llviewerinventory.h | 5 +- indra/newview/llviewermenufile.h | 5 +- indra/newview/llviewermessage.cpp | 5 +- indra/newview/llviewerprecompiledheaders.h | 1 + indra/newview/llviewertexteditor.cpp | 3 +- indra/newview/llviewertexture.cpp | 5 +- indra/newview/llviewertexture.h | 2 +- indra/newview/llviewerwindow.cpp | 3 +- indra/newview/llvoicechannel.cpp | 6 +-- indra/newview/llvoicechannel.h | 2 +- indra/newview/llvoiceclient.h | 7 +-- indra/newview/llvoicevivox.cpp | 12 ++--- indra/newview/llvoicevivox.h | 2 +- indra/newview/llwaterparammanager.h | 21 +++++---- indra/newview/llwearablelist.cpp | 5 +- indra/newview/llwindowlistener.cpp | 8 ++-- indra/newview/llwindowlistener.h | 2 +- indra/newview/llwlparammanager.h | 9 ++-- indra/newview/llworldmap.cpp | 5 +- indra/newview/llworldmap.h | 2 +- indra/newview/llxmlrpclistener.cpp | 5 +- indra/newview/llxmlrpctransaction.cpp | 13 +++--- 188 files changed, 640 insertions(+), 508 deletions(-) diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index b25239431b..2d732d6b98 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -28,6 +28,7 @@ #include "indra_constants.h" #include "llavatarappearance.h" + #include "llavatarappearancedefines.h" #include "llavatarjointmesh.h" #include "llstl.h" @@ -35,10 +36,10 @@ #include "llpolymorph.h" #include "llpolymesh.h" #include "llpolyskeletaldistortion.h" -#include "llstl.h" #include "lltexglobalcolor.h" #include "llwearabledata.h" #include "boost/tokenizer.hpp" +#include <utility> using namespace LLAvatarAppearanceDefines; @@ -2108,7 +2109,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer) : mMorphTarget(morph_target), mInvert(invert), - mLayer(layer) + mLayer(std::move(layer)) { LLPolyMorphTarget *target = dynamic_cast<LLPolyMorphTarget*>(morph_target); if (target) diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 0dce40a51c..2656d3a2be 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -26,7 +26,9 @@ #include "linden_common.h" #include "llavatarappearancedefines.h" + #include "indra_constants.h" +#include <utility> const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024; const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024; @@ -204,10 +206,10 @@ void LLAvatarAppearanceDictionary::createAssociations() LLAvatarAppearanceDictionary::TextureEntry::TextureEntry(const std::string &name, bool is_local_texture, EBakedTextureIndex baked_texture_index, - const std::string &default_image_name, + std::string default_image_name, LLWearableType::EType wearable_type) : LLDictionaryEntry(name), - mDefaultImageName(default_image_name), + mDefaultImageName(std::move(default_image_name)), mWearableType(wearable_type), mIsLocalTexture(is_local_texture), mIsBakedTexture(!is_local_texture), diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index ea2cec11fe..8993488a24 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -162,7 +162,7 @@ public: TextureEntry(const std::string &name, // this must match the xml name used by LLTexLayerInfo::parseXml bool is_local_texture, EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES, - const std::string& default_image_name = "", + std::string default_image_name = "", LLWearableType::EType wearable_type = LLWearableType::WT_INVALID); const std::string mDefaultImageName; const LLWearableType::EType mWearableType; diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index e3fe067c7a..3b5f3ab9e2 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -29,6 +29,7 @@ //----------------------------------------------------------------------------- #include "llpolymorph.h" + #include "llavatarappearance.h" #include "llavatarjoint.h" #include "llwearable.h" @@ -36,14 +37,15 @@ #include "llendianswizzle.h" #include "llpolymesh.h" #include "llfasttimer.h" +#include <utility> const F32 NORMAL_SOFTEN_FACTOR = 0.65f; //----------------------------------------------------------------------------- // LLPolyMorphData() //----------------------------------------------------------------------------- -LLPolyMorphData::LLPolyMorphData(const std::string& morph_name) - : mName(morph_name) +LLPolyMorphData::LLPolyMorphData(std::string morph_name) + : mName(std::move(morph_name)) { mNumIndices = 0; mCurrentIndex = 0; diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 54fa1b408f..61938aa664 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -42,7 +42,7 @@ LL_ALIGN_PREFIX(16) class LLPolyMorphData { public: - LLPolyMorphData(const std::string& morph_name); + LLPolyMorphData(std::string morph_name); ~LLPolyMorphData(); LLPolyMorphData(const LLPolyMorphData &rhs); diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index ec34a89f38..75787d68ed 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -26,8 +26,10 @@ #include "linden_common.h" #include "llwearabletype.h" + #include "llinventorytype.h" #include "llinventorydefines.h" +#include <utility> static LLTranslationBridge* sTrans = nullptr; @@ -45,7 +47,7 @@ void LLWearableType::cleanupClass() struct WearableEntry : public LLDictionaryEntry { WearableEntry(const std::string &name, - const std::string& default_new_name, + std::string default_new_name, LLAssetType::EType assetType, LLInventoryType::EIconName iconName, BOOL disable_camera_switch = FALSE, @@ -53,7 +55,7 @@ struct WearableEntry : public LLDictionaryEntry LLDictionaryEntry(name), mAssetType(assetType), mLabel(sTrans->getString(name)), - mDefaultNewName(default_new_name), + mDefaultNewName(std::move(default_new_name)), mIconName(iconName), mDisableCameraSwitch(disable_camera_switch), mAllowMultiwear(allow_multiwear) diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index d130e12851..4befd0048b 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -42,6 +42,7 @@ #include "vorbis/vorbisfile.h" #include <iterator> #include <deque> +#include <utility> extern LLAudioEngine *gAudiop; @@ -68,7 +69,7 @@ public: LLPointer<LLVorbisDecodeState> mDecoder; }; - LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename); + LLVorbisDecodeState(const LLUUID &uuid, std::string out_filename); BOOL initDecode(); BOOL decodeSection(); // Return TRUE if done. @@ -164,13 +165,13 @@ long vfs_tell (void *datasource) return file->tell(); } -LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename) : +LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, std::string out_filename) : mValid(FALSE), mDone(FALSE), mBytesRead(-1), mUUID(uuid), #if !defined(USE_WAV_VFILE) - mOutFilename(out_filename), + mOutFilename(std::move(out_filename)), mFileHandle(LLLFSThread::nullHandle()), #endif mInFilep(nullptr), diff --git a/indra/llaudio/llaudioengine_fmodstudio.cpp b/indra/llaudio/llaudioengine_fmodstudio.cpp index c0ce87c7c6..9fd8bd5968 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.cpp +++ b/indra/llaudio/llaudioengine_fmodstudio.cpp @@ -31,6 +31,7 @@ #include "llstreamingaudio_fmodstudio.h" #include "llaudioengine_fmodstudio.h" +#include <utility> #include "lllistener_fmodstudio.h" #include "llerror.h" @@ -49,7 +50,7 @@ FMOD_RESULT F_CALLBACK windDSPCallback(FMOD_DSP_STATE *dsp_state, float *inbuffe FMOD::ChannelGroup *LLAudioEngine_FMODSTUDIO::mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT] = {nullptr}; -LLAudioEngine_FMODSTUDIO::LLAudioEngine_FMODSTUDIO(const std::string& app_name, bool enable_profiler, U32 resample_method) +LLAudioEngine_FMODSTUDIO::LLAudioEngine_FMODSTUDIO(std::string app_name, bool enable_profiler, U32 resample_method) : mInited(false) , mWindGen(nullptr) , mWindDSPDesc(nullptr) @@ -57,7 +58,7 @@ LLAudioEngine_FMODSTUDIO::LLAudioEngine_FMODSTUDIO(const std::string& app_name, , mSystem(nullptr) , mEnableProfiler(enable_profiler) , mResampleMethod(resample_method) - , mAppName(app_name) + , mAppName(std::move(app_name)) { } diff --git a/indra/llaudio/llaudioengine_fmodstudio.h b/indra/llaudio/llaudioengine_fmodstudio.h index b2cf934e3c..05cde86777 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.h +++ b/indra/llaudio/llaudioengine_fmodstudio.h @@ -53,7 +53,7 @@ public: RESAMPLE_CUBIC, RESAMPLE_SPLINE }; - LLAudioEngine_FMODSTUDIO(const std::string& app_name, bool enable_profiler, U32 resample_method); + LLAudioEngine_FMODSTUDIO(std::string app_name, bool enable_profiler, U32 resample_method); virtual ~LLAudioEngine_FMODSTUDIO(); // initialization/startup/shutdown diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index a3695ddf46..efc8a17c4e 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -47,17 +47,17 @@ LLGesture::LLGesture() { } LLGesture::LLGesture(KEY key, MASK mask, const std::string &trigger, - const LLUUID &sound_item_id, - const std::string &animation, - const std::string &output_string) + const LLUUID &sound_item_id, + std::string animation, + std::string output_string) : mKey(key), mMask(mask), mTrigger(trigger), mTriggerLower(trigger), mSoundItemID(sound_item_id), - mAnimation(animation), - mOutputString(output_string) + mAnimation(std::move(animation)), + mOutputString(std::move(output_string)) { mTriggerLower = utf8str_tolower(mTriggerLower); } diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h index cd4c2c0347..bf8d307f27 100644 --- a/indra/llcharacter/llgesture.h +++ b/indra/llcharacter/llgesture.h @@ -35,8 +35,8 @@ class LLGesture public: LLGesture(); LLGesture(KEY key, MASK mask, const std::string &trigger, - const LLUUID &sound_item_id, const std::string &animation, - const std::string &output_string); + const LLUUID &sound_item_id, std::string animation, + std::string output_string); LLGesture(U8 **buffer, S32 max_size); // deserializes, advances buffer LLGesture(const LLGesture &gesture); diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index c99169908e..2e64ecccc0 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -138,9 +138,9 @@ apr_pool_t* LLAPRPool::getAPRPool() return mPool ; } -LLVolatileAPRPool::LLVolatileAPRPool(const std::string& name, BOOL is_local, apr_pool_t *parent, apr_size_t size, BOOL releasePoolFlag) +LLVolatileAPRPool::LLVolatileAPRPool(std::string name, BOOL is_local, apr_pool_t *parent, apr_size_t size, BOOL releasePoolFlag) : LLAPRPool(parent, size, releasePoolFlag), - mName(name), + mName(std::move(name)), mNumActiveRef(0), mNumTotalRef(0) { diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index fde7b867f7..455f85ab0f 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -111,7 +111,7 @@ protected: class LL_COMMON_API LLVolatileAPRPool : public LLAPRPool { public: - LLVolatileAPRPool(const std::string& name, BOOL is_local = TRUE, apr_pool_t *parent = nullptr, apr_size_t size = 0, BOOL releasePoolFlag = TRUE); + LLVolatileAPRPool(std::string name, BOOL is_local = TRUE, apr_pool_t *parent = nullptr, apr_size_t size = 0, BOOL releasePoolFlag = TRUE); virtual ~LLVolatileAPRPool(); /*virtual*/ apr_pool_t* getAPRPool() override; //define this virtual function to avoid any mistakenly calling LLAPRPool::getAPRPool(). diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 4313b70e30..8190f09aa3 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -28,6 +28,7 @@ #define LL_CALLSTACK_H #include <map> +#include <utility> class LLCallStackImpl; @@ -61,8 +62,8 @@ private: class LLScopedContextString { public: - LLScopedContextString(const std::string& str): - m_str(str) + LLScopedContextString(std::string str): + m_str(std::move(str)) { LLContextStrings::addContextString(m_str); } diff --git a/indra/llcommon/llcommonprecompiled.h b/indra/llcommon/llcommonprecompiled.h index 2db1d090a6..c29e40c651 100644 --- a/indra/llcommon/llcommonprecompiled.h +++ b/indra/llcommon/llcommonprecompiled.h @@ -55,6 +55,7 @@ #include <shared_mutex> #include <typeinfo> #include <type_traits> +#include <utility> #include <apr_pools.h> #include <apr_dso.h> diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 8e190c3fc3..85cdb6894e 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -383,10 +383,10 @@ void LLCoros::toplevel(coro::self& self, CoroData* data, const callable_t& calla //#pragma optimize("", off) //#endif // LL_MSVC -LLCoros::CoroData::CoroData(CoroData* prev, const std::string& name, +LLCoros::CoroData::CoroData(CoroData* prev, std::string name, const callable_t& callable, S32 stacksize): mPrev(prev), - mName(name), + mName(std::move(name)), // Wrap the caller's callable in our toplevel() function so we can manage // Current appropriately at startup and shutdown of each coroutine. mCoro(boost::bind(toplevel, _1, this, callable), stacksize), diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index ed055cbb23..5e5223e462 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -217,7 +217,7 @@ private: // coroutine-local storage, as it were: one per coro we track struct CoroData { - CoroData(CoroData* prev, const std::string& name, + CoroData(CoroData* prev, std::string name, const callable_t& callable, S32 stacksize); // The boost::dcoroutines library supports asymmetric coroutines. Every diff --git a/indra/llcommon/lldictionary.cpp b/indra/llcommon/lldictionary.cpp index e16c35ed6a..53441498e4 100644 --- a/indra/llcommon/lldictionary.cpp +++ b/indra/llcommon/lldictionary.cpp @@ -31,8 +31,8 @@ #include "llstring.h" // Define in .cpp file to prevent header include of llstring.h -LLDictionaryEntry::LLDictionaryEntry(const std::string &name) -: mName(name) +LLDictionaryEntry::LLDictionaryEntry(std::string name) +: mName(std::move(name)) { mNameCapitalized = mName; LLStringUtil::replaceChar(mNameCapitalized, '-', ' '); diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index b8df25a07d..abd3a94321 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -34,7 +34,7 @@ struct LL_COMMON_API LLDictionaryEntry { - LLDictionaryEntry(const std::string &name); + LLDictionaryEntry(std::string name); virtual ~LLDictionaryEntry() = default; const std::string mName; std::string mNameCapitalized; diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h index fdb1d2c0b3..93806663ff 100644 --- a/indra/llcommon/llevent.h +++ b/indra/llcommon/llevent.h @@ -28,6 +28,7 @@ #ifndef LL_EVENT_H #define LL_EVENT_H +#include <utility> #include "llsd.h" #include "llrefcount.h" #include "llpointer.h" @@ -47,7 +48,7 @@ protected: virtual ~LLEvent() = default; public: - LLEvent(LLObservable* source, const std::string& desc = "") : mSource(source), mDesc(desc) { } + LLEvent(LLObservable* source, std::string desc = "") : mSource(source), mDesc(std::move(desc)) { } LLObservable* getSource() { return mSource; } virtual LLSD getValue() { return LLSD(); } @@ -186,7 +187,7 @@ protected: class LLValueChangedEvent : public LLEvent { public: - LLValueChangedEvent(LLObservable* source, LLSD value) : LLEvent(source, "value_changed"), mValue(value) { } + LLValueChangedEvent(LLObservable* source, LLSD value) : LLEvent(source, "value_changed"), mValue(std::move(value)) { } LLSD getValue() override { return mValue; } LLSD mValue; }; diff --git a/indra/llcommon/lleventapi.cpp b/indra/llcommon/lleventapi.cpp index ff5459c1eb..3819a39b68 100644 --- a/indra/llcommon/lleventapi.cpp +++ b/indra/llcommon/lleventapi.cpp @@ -30,16 +30,14 @@ #include "linden_common.h" // associated header #include "lleventapi.h" -// STL headers -// std headers -// external library headers + // other Linden headers #include "llerror.h" -LLEventAPI::LLEventAPI(const std::string& name, const std::string& desc, const std::string& field): +LLEventAPI::LLEventAPI(const std::string& name, std::string desc, const std::string& field): lbase(name, field), ibase(name), - mDesc(desc) + mDesc(std::move(desc)) { } @@ -47,10 +45,10 @@ LLEventAPI::~LLEventAPI() { } -LLEventAPI::Response::Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey): - mResp(seed), - mReq(request), - mKey(replyKey) +LLEventAPI::Response::Response(LLSD seed, LLSD request, LLSD::String replyKey): + mResp(std::move(seed)), + mReq(std::move(request)), + mKey(std::move(replyKey)) {} LLEventAPI::Response::~Response() diff --git a/indra/llcommon/lleventapi.h b/indra/llcommon/lleventapi.h index 5991fe8fd5..2eea535317 100644 --- a/indra/llcommon/lleventapi.h +++ b/indra/llcommon/lleventapi.h @@ -56,7 +56,7 @@ public: * @param field LLSD::Map key used by LLDispatchListener to look up the * subclass method to invoke [default "op"]. */ - LLEventAPI(const std::string& name, const std::string& desc, const std::string& field="op"); + LLEventAPI(const std::string& name, std::string desc, const std::string& field="op"); virtual ~LLEventAPI(); /// Get the string name of this LLEventAPI @@ -113,7 +113,7 @@ public: * on which the caller wants a reply. If <tt>(! * request.has(replyKey))</tt>, no reply will be sent. */ - Response(const LLSD& seed, const LLSD& request, const LLSD::String& replyKey="reply"); + Response(LLSD seed, LLSD request, LLSD::String replyKey="reply"); ~Response(); /** diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp index ef6a8676bc..3d0f83ee0a 100644 --- a/indra/llcommon/lleventdispatcher.cpp +++ b/indra/llcommon/lleventdispatcher.cpp @@ -30,9 +30,7 @@ #include "linden_common.h" // associated header #include "lleventdispatcher.h" -// STL headers -// std headers -// external library headers + // other Linden headers #include "llevents.h" #include "llerror.h" @@ -49,7 +47,7 @@ class LL_COMMON_API LLSDArgsSource { public: - LLSDArgsSource(const std::string function, const LLSD& args); + LLSDArgsSource(const std::string function, LLSD args); ~LLSDArgsSource(); LLSD next(); @@ -62,9 +60,9 @@ private: LLSD::Integer _index; }; -LLSDArgsSource::LLSDArgsSource(const std::string function, const LLSD& args): +LLSDArgsSource::LLSDArgsSource(const std::string function, LLSD args): _function(function), - _args(args), + _args(std::move(args)), _index(0) { if (! (_args.isUndefined() || _args.isArray())) @@ -430,9 +428,9 @@ struct LLEventDispatcher::LLSDDispatchEntry: public LLEventDispatcher::DispatchE */ struct LLEventDispatcher::ParamsDispatchEntry: public LLEventDispatcher::DispatchEntry { - ParamsDispatchEntry(const std::string& desc, const invoker_function& func): + ParamsDispatchEntry(const std::string& desc, invoker_function func): DispatchEntry(desc), - mInvoker(func) + mInvoker(std::move(func)) {} invoker_function mInvoker; diff --git a/indra/llcommon/lleventfilter.cpp b/indra/llcommon/lleventfilter.cpp index 32d3e86f93..67e6f5a442 100644 --- a/indra/llcommon/lleventfilter.cpp +++ b/indra/llcommon/lleventfilter.cpp @@ -30,9 +30,8 @@ #include "linden_common.h" // associated header #include "lleventfilter.h" -// STL headers -// std headers -// external library headers +#include <utility> + // other Linden headers #include "llerror.h" // LL_ERRS #include "llsdutil.h" // llsd_matches() @@ -49,15 +48,15 @@ LLEventFilter::LLEventFilter(LLEventPump& source, const std::string& name, bool /***************************************************************************** * LLEventMatching *****************************************************************************/ -LLEventMatching::LLEventMatching(const LLSD& pattern): +LLEventMatching::LLEventMatching(LLSD pattern): LLEventFilter("matching"), - mPattern(pattern) + mPattern(std::move(pattern)) { } -LLEventMatching::LLEventMatching(LLEventPump& source, const LLSD& pattern): +LLEventMatching::LLEventMatching(LLEventPump& source, LLSD pattern): LLEventFilter(source, "matching"), - mPattern(pattern) + mPattern(std::move(pattern)) { } @@ -96,7 +95,7 @@ void LLEventTimeoutBase::actionAfter(F32 seconds, const Action& action) class ErrorAfter { public: - ErrorAfter(const std::string& message): mMessage(message) {} + ErrorAfter(std::string message): mMessage(std::move(message)) {} void operator()() { @@ -115,9 +114,9 @@ void LLEventTimeoutBase::errorAfter(F32 seconds, const std::string& message) class EventAfter { public: - EventAfter(LLEventPump& pump, const LLSD& event): + EventAfter(LLEventPump& pump, LLSD event): mPump(pump), - mEvent(event) + mEvent(std::move(event)) {} void operator()() diff --git a/indra/llcommon/lleventfilter.h b/indra/llcommon/lleventfilter.h index e285edf0c6..2a5598f410 100644 --- a/indra/llcommon/lleventfilter.h +++ b/indra/llcommon/lleventfilter.h @@ -60,9 +60,9 @@ class LLEventMatching: public LLEventFilter { public: /// Pass an LLSD map with keys and values the incoming event must match - LLEventMatching(const LLSD& pattern); + LLEventMatching(LLSD pattern); /// instantiate and connect - LLEventMatching(LLEventPump& source, const LLSD& pattern); + LLEventMatching(LLEventPump& source, LLSD pattern); /// Only pass through events matching the pattern bool post(const LLSD& event) override; diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 40417bc858..2b5cc12225 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -28,6 +28,7 @@ #ifndef LL_LLPARAM_H #define LL_LLPARAM_H +#include <utility> #include <vector> #include <list> #include <boost/function.hpp> @@ -2619,8 +2620,8 @@ namespace LLInitParam ParamValue() {} - ParamValue(const default_value_t& other) - : mValue(other) + ParamValue(default_value_t other) + : mValue(std::move(other)) {} void setValue(const value_t& val) { mValue = val; } diff --git a/indra/llcommon/llleaplistener.cpp b/indra/llcommon/llleaplistener.cpp index 3f9bf22357..5d14052f6e 100644 --- a/indra/llcommon/llleaplistener.cpp +++ b/indra/llcommon/llleaplistener.cpp @@ -13,6 +13,7 @@ #include "linden_common.h" // associated header #include "llleaplistener.h" + // other Linden headers #include "lluuid.h" #include "llsdutil.h" @@ -46,12 +47,12 @@ return features; } -LLLeapListener::LLLeapListener(const ConnectFunc& connect): +LLLeapListener::LLLeapListener(ConnectFunc connect): // Each LEAP plugin has an instance of this listener. Make the command // pump name difficult for other such plugins to guess. LLEventAPI(LLUUID::generateNewID().asString(), "Operations relating to the LLSD Event API Plugin (LEAP) protocol"), - mConnect(connect) + mConnect(std::move(connect)) { LLSD need_name(LLSDMap("name", LLSD())); add("newpump", diff --git a/indra/llcommon/llleaplistener.h b/indra/llcommon/llleaplistener.h index 73fb972030..73d886ea1f 100644 --- a/indra/llcommon/llleaplistener.h +++ b/indra/llcommon/llleaplistener.h @@ -32,7 +32,7 @@ public: */ typedef std::function<LLBoundListener(LLEventPump&, const std::string& listener)> ConnectFunc; - LLLeapListener(const ConnectFunc& connect); + LLLeapListener(ConnectFunc connect); ~LLLeapListener(); static LLSD getFeatures(); diff --git a/indra/llcommon/lllivefile.cpp b/indra/llcommon/lllivefile.cpp index 6d4815f963..106ab2c718 100644 --- a/indra/llcommon/lllivefile.cpp +++ b/indra/llcommon/lllivefile.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" #include "lllivefile.h" + #include "llframetimer.h" #include "lleventtimer.h" @@ -35,7 +36,7 @@ const F32 DEFAULT_CONFIG_FILE_REFRESH = 5.0f; class LLLiveFile::Impl { public: - Impl(const std::string& filename, const F32 refresh_period); + Impl(std::string filename, const F32 refresh_period); ~Impl(); bool check(); @@ -55,11 +56,11 @@ private: LOG_CLASS(LLLiveFile); }; -LLLiveFile::Impl::Impl(const std::string& filename, const F32 refresh_period) +LLLiveFile::Impl::Impl(std::string filename, const F32 refresh_period) : mForceCheck(true), mRefreshPeriod(refresh_period), - mFilename(filename), + mFilename(std::move(filename)), mLastModTime(0), mLastStatTime(0), mLastExists(false), diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 148ffe7825..d6cd4dfce9 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -37,13 +37,12 @@ #include <boost/asio/streambuf.hpp> #include <boost/asio/buffers_iterator.hpp> -#include <iostream> #include <stdexcept> #include <limits> #include <algorithm> +#include <utility> #include <vector> #include <typeinfo> -#include <utility> /***************************************************************************** * Helpers @@ -140,8 +139,8 @@ class WritePipeImpl: public LLProcess::WritePipe { LOG_CLASS(WritePipeImpl); public: - WritePipeImpl(const std::string& desc, apr_file_t* pipe): - mDesc(desc), + WritePipeImpl(std::string desc, apr_file_t* pipe): + mDesc(std::move(desc)), mPipe(pipe), // Essential to initialize our std::ostream with our special streambuf! mStream(&mStreambuf) @@ -254,8 +253,8 @@ class ReadPipeImpl: public LLProcess::ReadPipe { LOG_CLASS(ReadPipeImpl); public: - ReadPipeImpl(const std::string& desc, apr_file_t* pipe, LLProcess::FILESLOT index): - mDesc(desc), + ReadPipeImpl(std::string desc, apr_file_t* pipe, LLProcess::FILESLOT index): + mDesc(std::move(desc)), mPipe(pipe), mIndex(index), // Essential to initialize our std::istream with our special streambuf! diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index fd99116ffe..b1b8efdb5e 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -30,6 +30,7 @@ #define LL_LLSDSERIALIZE_H #include <iosfwd> +#include <utility> #include "llpointer.h" #include "llrefcount.h" #include "llsd.h" @@ -669,8 +670,8 @@ public: /** * @brief Constructor */ - LLSDOStreamer(const LLSD& data, U32 options = LLSDFormatter::OPTIONS_NONE) : - mSD(data), mOptions(options) {} + LLSDOStreamer(LLSD data, U32 options = LLSDFormatter::OPTIONS_NONE) : + mSD(std::move(data)), mOptions(options) {} /** * @brief Stream operator. diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index b6d7fe82fd..a30ab1351e 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -29,6 +29,7 @@ #ifndef LL_LLSDUTIL_H #define LL_LLSDUTIL_H +#include <utility> #include "llsd.h" // U32 @@ -380,8 +381,8 @@ namespace llsd class inArray { public: - inArray(const LLSD& array): - _array(array) + inArray(LLSD array): + _array(std::move(array)) {} typedef LLSD::array_const_iterator const_iterator; @@ -403,8 +404,8 @@ typedef std::map<LLSD::String, LLSD>::value_type MapEntry; class inMap { public: - inMap(const LLSD& map): - _map(map) + inMap(LLSD map): + _map(std::move(map)) {} typedef LLSD::map_const_iterator const_iterator; diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 710c0836af..1b414ad2bd 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -35,6 +35,7 @@ //#include <locale> #include <iomanip> #include <algorithm> +#include <utility> #include <vector> #include <map> #include "llformat.h" @@ -228,7 +229,7 @@ class LLFormatMapString public: LLFormatMapString() {}; LLFormatMapString(const char* s) : mString(ll_safe_string(s)) {}; - LLFormatMapString(const std::string& s) : mString(s) {}; + LLFormatMapString(std::string s) : mString(std::move(s)) {}; operator std::string() const { return mString; } bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; } std::size_t length() const { return mString.length(); } diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index e776a7b68d..4a2c3e50e9 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -35,6 +35,7 @@ #include "llexception.h" #include <chrono> + using namespace std::chrono_literals; #ifdef LL_WINDOWS @@ -143,10 +144,10 @@ void LLThread::threadRun() mStatus = STOPPED; } -LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : +LLThread::LLThread(std::string name, apr_pool_t *poolp) : mPaused(false), mNativeHandle(nullptr), - mName(name), + mName(std::move(name)), mRunCondition(std::make_unique<LLCondition>()), mDataLock(std::make_unique<LLMutex>()), mStatus(STOPPED) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index dd1dc2253b..c86a8f6fde 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -54,7 +54,7 @@ public: CRASHED = -1 // An uncaught exception was thrown by the thread } EThreadStatus; - LLThread(const std::string& name, apr_pool_t *poolp = NULL); + LLThread(std::string name, apr_pool_t *poolp = NULL); virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. virtual void shutdown(); // stops the thread diff --git a/indra/llcorehttp/_thread.h b/indra/llcorehttp/_thread.h index b91b29ac4b..147bf8dcef 100644 --- a/indra/llcorehttp/_thread.h +++ b/indra/llcorehttp/_thread.h @@ -31,6 +31,7 @@ #include <boost/chrono.hpp> #include <boost/thread.hpp> +#include <utility> #include "llwin32headerslean.h" @@ -104,7 +105,7 @@ public: /// out for the exit handler. explicit HttpThread(std::function<void (HttpThread *)> threadFunc) : RefCounted(true), // implicit reference - mThreadFunc(threadFunc) + mThreadFunc(std::move(threadFunc)) { // this creates a boost thread that will call HttpThread::run on this instance // and pass it the threadfunc callable... diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 4c4479b1e2..8e68e0e116 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -34,6 +34,7 @@ #include "llsd.h" #include "message.h" #include <boost/tokenizer.hpp> +#include <utility> #include "llsdutil.h" @@ -73,12 +74,12 @@ const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730"); LLInventoryObject::LLInventoryObject(const LLUUID& uuid, const LLUUID& parent_uuid, LLAssetType::EType type, - const std::string& name) + std::string name) : LLTrace::MemTrackable<LLInventoryObject>("LLInventoryObject"), mUUID(uuid), mParentUUID(parent_uuid), mType(type), - mName(name), + mName(std::move(name)), mCreationDate(0) { claimMem(mName); @@ -310,15 +311,15 @@ LLInventoryItem::LLInventoryItem(const LLUUID& uuid, const LLUUID& asset_uuid, LLAssetType::EType type, LLInventoryType::EType inv_type, - const std::string& name, - const std::string& desc, + const std::string& name, + std::string desc, const LLSaleInfo& sale_info, U32 flags, S32 creation_date_utc) : LLInventoryObject(uuid, parent_uuid, type, name), mPermissions(permissions), mAssetUUID(asset_uuid), - mDescription(desc), + mDescription(std::move(desc)), mSaleInfo(sale_info), mInventoryType(inv_type), mFlags(flags) diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 1b2bb55306..6a310e09cc 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -57,8 +57,8 @@ public: LLInventoryObject(); LLInventoryObject(const LLUUID& uuid, const LLUUID& parent_uuid, - LLAssetType::EType type, - const std::string& name); + LLAssetType::EType type, + std::string name); void copyObject(const LLInventoryObject* other); // LLRefCount requires custom copy protected: virtual ~LLInventoryObject(); @@ -134,8 +134,8 @@ public: const LLUUID& asset_uuid, LLAssetType::EType type, LLInventoryType::EType inv_type, - const std::string& name, - const std::string& desc, + const std::string& name, + std::string desc, const LLSaleInfo& sale_info, U32 flags, S32 creation_date_utc); diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index c96c3fbbcf..49e30f3867 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -27,9 +27,11 @@ #include "linden_common.h" #include "llinventorytype.h" + #include "lldictionary.h" #include "llmemory.h" #include "llsingleton.h" +#include <utility> ///---------------------------------------------------------------------------- /// Class LLInventoryType @@ -37,11 +39,11 @@ struct InventoryEntry : public LLDictionaryEntry { InventoryEntry(const std::string &name, // unlike asset type names, not limited to 8 characters; need not match asset type names - const std::string &human_name, // for decoding to human readable form; put any and as many printable characters you want in each one. + std::string human_name, // for decoding to human readable form; put any and as many printable characters you want in each one. int num_asset_types = 0, ...) : LLDictionaryEntry(name), - mHumanName(human_name) + mHumanName(std::move(human_name)) { va_list argp; va_start(argp, num_asset_types); diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index f3f3134825..e0f612fd25 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -38,6 +38,7 @@ #include <boost/exception/diagnostic_information.hpp> #include <sstream> #include <iomanip> +#include <utility> // stream kdu_dims to std::ostream // Turns out this must NOT be in the anonymous namespace! @@ -171,8 +172,8 @@ private: class LLKDUMessage: public kdu_message { public: - LLKDUMessage(const std::string& type): - mType(type) + LLKDUMessage(std::string type): + mType(std::move(type)) {} virtual void put_text(const char *s) diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 7eb68d3abf..2e24ed96c5 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -27,8 +27,10 @@ #include "linden_common.h" #include "llcoproceduremanager.h" + #include "llexception.h" #include "stringize.h" +#include <utility> //========================================================================= // Map of pool sizes for known pools @@ -96,10 +98,10 @@ private: { typedef std::shared_ptr<QueuedCoproc> ptr_t; - QueuedCoproc(const std::string &name, const LLUUID &id, CoProcedure_t proc) : - mName(name), + QueuedCoproc(std::string name, const LLUUID &id, CoProcedure_t proc) : + mName(std::move(name)), mId(id), - mProc(proc) + mProc(std::move(proc)) {} std::string mName; diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 9289e5dbd3..79659d79e0 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -31,6 +31,7 @@ #include <algorithm> #include <iterator> #include <nlohmann/json.hpp> // JSON +#include <utility> #include "llcorehttputil.h" #include "lleventcoro.h" #include "llhttpconstants.h" @@ -671,9 +672,9 @@ const std::string HttpCoroutineAdapter::HTTP_RESULTS_HEADERS("headers"); const std::string HttpCoroutineAdapter::HTTP_RESULTS_CONTENT("content"); const std::string HttpCoroutineAdapter::HTTP_RESULTS_RAW("raw"); -HttpCoroutineAdapter::HttpCoroutineAdapter(const std::string &name, +HttpCoroutineAdapter::HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId, LLCore::HttpRequest::priority_t priority) : - mAdapterName(name), + mAdapterName(std::move(name)), mPriority(priority), mPolicyId(policyId), mYieldingHandle(LLCORE_HTTP_HANDLE_INVALID), diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 1c602833d3..ac1ed652a7 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -325,7 +325,7 @@ public: typedef std::shared_ptr<HttpCoroutineAdapter> ptr_t; typedef std::weak_ptr<HttpCoroutineAdapter> wptr_t; - HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId, + HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId, LLCore::HttpRequest::priority_t priority = 0L); ~HttpCoroutineAdapter(); diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index 64042106f2..7c7ba5013f 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -49,6 +49,7 @@ #include <sstream> #include <boost/tokenizer.hpp> +#include <utility> static const char HTTP_VERSION_STR[] = "HTTP/1.0"; @@ -527,7 +528,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl( class LLHTTPResponder : public LLIOPipe { public: - LLHTTPResponder(const LLHTTPNode& tree, const LLSD& ctx); + LLHTTPResponder(const LLHTTPNode& tree, LLSD ctx); ~LLHTTPResponder(); protected: @@ -603,8 +604,8 @@ protected: const LLHTTPNode& mRootNode; }; -LLHTTPResponder::LLHTTPResponder(const LLHTTPNode& tree, const LLSD& ctx) : - mBuildContext(ctx), +LLHTTPResponder::LLHTTPResponder(const LLHTTPNode& tree, LLSD ctx) : + mBuildContext(std::move(ctx)), mState(STATE_NOTHING), mLastRead(NULL), mContentLength(0), diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index 446f8eb109..257825bd34 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -28,6 +28,7 @@ #include "linden_common.h" #include "lliosocket.h" +#include <utility> #include "llapr.h" @@ -287,7 +288,7 @@ void LLSocket::setNonBlocking() /// LLIOSocketReader::LLIOSocketReader(LLSocket::ptr_t socket) : - mSource(socket), + mSource(std::move(socket)), mInitialized(false) { } @@ -386,7 +387,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( /// LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) : - mDestination(socket), + mDestination(std::move(socket)), mLastWritten(nullptr), mInitialized(false) { @@ -536,8 +537,8 @@ LLIOServerSocket::LLIOServerSocket( LLIOServerSocket::socket_t listener, factory_t factory) : mPool(pool), - mListenSocket(listener), - mReactor(factory), + mListenSocket(std::move(listener)), + mReactor(std::move(factory)), mInitialized(false), mResponseTimeout(DEFAULT_CHAIN_EXPIRY_SECS) { diff --git a/indra/llmessage/llioutil.h b/indra/llmessage/llioutil.h index cc588d7988..24b2c0468d 100644 --- a/indra/llmessage/llioutil.h +++ b/indra/llmessage/llioutil.h @@ -29,6 +29,7 @@ #ifndef LL_LLIOUTIL_H #define LL_LLIOUTIL_H +#include <utility> #include "llbuffer.h" #include "lliopipe.h" #include "llpumpio.h" @@ -102,8 +103,8 @@ protected: class LLIOAddChain : public LLIOPipe { public: - LLIOAddChain(const LLPumpIO::chain_t& chain, F32 timeout) : - mChain(chain), + LLIOAddChain(LLPumpIO::chain_t chain, F32 timeout) : + mChain(std::move(chain)), mTimeout(timeout) {} virtual ~LLIOAddChain() {} diff --git a/indra/llmessage/llmessagelog.cpp b/indra/llmessage/llmessagelog.cpp index 81cc864146..05dbc35aba 100644 --- a/indra/llmessage/llmessagelog.cpp +++ b/indra/llmessage/llmessagelog.cpp @@ -23,11 +23,12 @@ #include "httpresponse.h" #include "llmemory.h" #include <boost/circular_buffer.hpp> +#include <utility> #include "_httpoprequest.h" static boost::circular_buffer<LogPayload> sRingBuffer = boost::circular_buffer<LogPayload>(2048); -LLMessageLogEntry::LLMessageLogEntry(LLHost from_host, LLHost to_host, U8* data, size_t data_size) +LLMessageLogEntry::LLMessageLogEntry(LLHost const& from_host, LLHost const& to_host, U8* data, size_t data_size) : mType(TEMPLATE) , mFromHost(from_host) , mToHost(to_host) @@ -48,15 +49,15 @@ LLMessageLogEntry::LLMessageLogEntry(LLHost from_host, LLHost to_host, U8* data, } } -LLMessageLogEntry::LLMessageLogEntry(EEntryType etype, U8* data, size_t data_size, const std::string& url, - const std::string& content_type, const LLCore::HttpHeaders::ptr_t& headers, +LLMessageLogEntry::LLMessageLogEntry(EEntryType etype, U8* data, size_t data_size, std::string url, + std::string content_type, LLCore::HttpHeaders::ptr_t headers, EHTTPMethod method, U8 status_code, U64 request_id) : mType(etype) , mDataSize(data_size) , mData(nullptr) -, mURL(url) -, mContentType(content_type) -, mHeaders(headers) +, mURL(std::move(url)) +, mContentType(std::move(content_type)) +, mHeaders(std::move(headers)) , mMethod(method) , mStatusCode(status_code) , mRequestId(request_id) diff --git a/indra/llmessage/llmessagelog.h b/indra/llmessage/llmessagelog.h index 3b9af325db..b8084c5d12 100644 --- a/indra/llmessage/llmessagelog.h +++ b/indra/llmessage/llmessagelog.h @@ -46,10 +46,10 @@ struct LLMessageLogEntry } EEntryType; /// Ctor for TEMPLATE lludp message - LLMessageLogEntry(LLHost from_host, LLHost to_host, U8* data, size_t data_size); + LLMessageLogEntry(LLHost const& from_host, LLHost const& to_host, U8* data, size_t data_size); /// Ctor for HTTP message - LLMessageLogEntry(EEntryType etype, U8* data, size_t data_size, const std::string& url, - const std::string& content_type, const LLCore::HttpHeaders::ptr_t& headers, EHTTPMethod method, + LLMessageLogEntry(EEntryType etype, U8* data, size_t data_size, std::string url, + std::string content_type, LLCore::HttpHeaders::ptr_t headers, EHTTPMethod method, U8 status_code, U64 request_id); /// Copy ctor LLMessageLogEntry(const LLMessageLogEntry& entry); diff --git a/indra/llmessage/llstoredmessage.cpp b/indra/llmessage/llstoredmessage.cpp index 9f2f2bcda7..e67d2f480b 100644 --- a/indra/llmessage/llstoredmessage.cpp +++ b/indra/llmessage/llstoredmessage.cpp @@ -25,8 +25,9 @@ */ #include "llstoredmessage.h" +#include <utility> -LLStoredMessage::LLStoredMessage(const std::string& name, const LLSD& message) : mMessage(message), mName(name) +LLStoredMessage::LLStoredMessage(std::string name, LLSD message) : mMessage(std::move(message)), mName(std::move(name)) { } diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h index fb5eee80ee..6e53379558 100644 --- a/indra/llmessage/llstoredmessage.h +++ b/indra/llmessage/llstoredmessage.h @@ -35,7 +35,7 @@ class LLMessageSystem; class LLStoredMessage { public: - LLStoredMessage(const std::string& name, const LLSD& message); + LLStoredMessage(std::string name, LLSD message); private: friend class LLMessageSystem; diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index 99e270f7b4..5eba649d35 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -29,6 +29,7 @@ #include "linden_common.h" #include "llpluginmessagepipe.h" +#include <utility> #include "llapr.h" @@ -95,7 +96,7 @@ LLPluginMessagePipe::LLPluginMessagePipe(LLPluginMessagePipeOwner *owner, LLSock mOutputMutex(), mOutputStartIndex(0), mOwner(owner), - mSocket(socket) + mSocket(std::move(socket)) { mOwner->setMessagePipe(this); } @@ -176,7 +177,7 @@ bool LLPluginMessagePipe::pumpOutput() LLMutexLock lock(&mOutputMutex); - const char * output_data = &(mOutput.data()[mOutputStartIndex]); + const char * output_data = &(mOutput[mOutputStartIndex]); if(*output_data != '\0') { // write any outgoing messages diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 787d0a7faf..c4d1ff664a 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -33,6 +33,7 @@ #include "m4math.h" #include <queue> #include <boost/align/aligned_allocator.hpp> +#include <utility> class daeElement; class domMesh; @@ -366,8 +367,8 @@ public: LLUUID mMeshID; S32 mLocalMeshID; - LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, material_map& materials) - : LLModelInstanceBase(model, transform, materials), mLabel(label) + LLModelInstance(LLModel* model, std::string label, LLMatrix4& transform, material_map& materials) + : LLModelInstanceBase(model, transform, materials), mLabel(std::move(label)) { mLocalMeshID = -1; } diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index b45f61f4be..69c0956400 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -25,11 +25,13 @@ */ #include "llmodelloader.h" + #include "llsdserialize.h" #include "lljoint.h" #include "llcallbacklist.h" #include "llmatrix4a.h" +#include <utility> std::list<LLModelLoader*> LLModelLoader::sActiveLoaderList; @@ -112,7 +114,7 @@ LLModelLoader::LLModelLoader( JointMap& legalJointNamesMap, U32 maxJointsPerMesh) : LLThread("Model Loader") -, mFilename(filename) +, mFilename(std::move(filename)) , mLod(lod) , mFirstTransform(TRUE) , mTrySLM(false) @@ -122,10 +124,10 @@ LLModelLoader::LLModelLoader( , mJointsFromNode( jointsFromNodes ) , mMaxJointsPerMesh(maxJointsPerMesh) , mNumOfFetchingTextures(0) -, mLoadCallback(load_cb) -, mJointLookupFunc(joint_lookup_func) -, mTextureLoadFunc(texture_load_func) -, mStateCallback(state_cb) +, mLoadCallback(std::move(load_cb)) +, mJointLookupFunc(std::move(joint_lookup_func)) +, mTextureLoadFunc(std::move(texture_load_func)) +, mStateCallback(std::move(state_cb)) , mOpaqueData(opaque_userdata) , mRigValidJointUpload(true) , mLegacyRigValid(true) diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 538e2dbfba..c0715c3108 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -31,6 +31,7 @@ #include "llfontgl.h" #include "llfontregistry.h" #include <boost/tokenizer.hpp> +#include <utility> #include "llcontrol.h" #include "lldir.h" #include "llwindow.h" @@ -46,13 +47,13 @@ LLFontDescriptor::LLFontDescriptor(): { } -LLFontDescriptor::LLFontDescriptor(const std::string& name, - const std::string& size, +LLFontDescriptor::LLFontDescriptor(std::string name, + std::string size, const U8 style, - const string_vec_t& file_names): - mName(name), - mSize(size), - mFileNames(file_names), + string_vec_t file_names): + mName(std::move(name)), + mSize(std::move(size)), + mFileNames(std::move(file_names)), mStyle(style) { } @@ -67,11 +68,11 @@ LLFontDescriptor::LLFontDescriptor(const std::string& name, mFontCollectionsList = ft_collection_listections; } -LLFontDescriptor::LLFontDescriptor(const std::string& name, - const std::string& size, +LLFontDescriptor::LLFontDescriptor(std::string name, + std::string size, const U8 style): - mName(name), - mSize(size), + mName(std::move(name)), + mSize(std::move(size)), mStyle(style) { } diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h index a87a7fd9c5..7c3760da09 100644 --- a/indra/llrender/llfontregistry.h +++ b/indra/llrender/llfontregistry.h @@ -38,8 +38,8 @@ class LLFontDescriptor { public: LLFontDescriptor(); - LLFontDescriptor(const std::string& name, const std::string& size, const U8 style); - LLFontDescriptor(const std::string& name, const std::string& size, const U8 style, const string_vec_t& file_names); + LLFontDescriptor(std::string name, std::string size, const U8 style); + LLFontDescriptor(std::string name, std::string size, const U8 style, string_vec_t file_names); LLFontDescriptor(const std::string& name, const std::string& size, const U8 style, const string_vec_t& file_names, const string_vec_t& font_collections); LLFontDescriptor normalize() const; diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index 9125999afd..a8cb58f3d4 100644 --- a/indra/llrender/lluiimage.cpp +++ b/indra/llrender/lluiimage.cpp @@ -31,14 +31,16 @@ // Project includes #include "lluiimage.h" + #include "llrender2dutils.h" +#include <utility> -LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) +LLUIImage::LLUIImage(std::string name, LLPointer<LLTexture> image) : mImageLoaded(nullptr), - mName(name), + mName(std::move(name)), mScaleRegion(0.f, 1.f, 1.f, 0.f), mClipRegion(0.f, 1.f, 1.f, 0.f), - mImage(image), + mImage(std::move(image)), mScaleStyle(SCALE_INNER) {} diff --git a/indra/llrender/lluiimage.h b/indra/llrender/lluiimage.h index 59edbe47f2..4b1961e5f1 100644 --- a/indra/llrender/lluiimage.h +++ b/indra/llrender/lluiimage.h @@ -48,7 +48,7 @@ public: typedef boost::signals2::signal<void (void)> image_loaded_signal_t; - LLUIImage(const std::string& name, LLPointer<LLTexture> image); + LLUIImage(std::string name, LLPointer<LLTexture> image); virtual ~LLUIImage(); void setClipRegion(const LLRectf& region); diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index c3038206f7..155264c476 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -28,7 +28,9 @@ #include "llbadgeholder.h" #include "llbadgeowner.h" + #include "llpanel.h" +#include <utility> // // Classes @@ -37,7 +39,7 @@ LLBadgeOwner::LLBadgeOwner(LLHandle< LLView > viewHandle) : mHasBadgeHolderParent(false), mBadge(nullptr), - mBadgeOwnerView(viewHandle) + mBadgeOwnerView(std::move(viewHandle)) { } diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index 50e160e6e6..802ba14666 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -28,6 +28,7 @@ #define LLCALLBACKMAP_H #include <functional> +#include <utility> class LLCallbackMap { @@ -47,7 +48,7 @@ public: } LLCallbackMap() : mCallback(NULL), mData(NULL) { } - LLCallbackMap(callback_t callback, void* data = NULL) : mCallback(callback), mData(data) { } + LLCallbackMap(callback_t callback, void* data = NULL) : mCallback(std::move(callback)), mData(data) { } callback_t mCallback; void* mData; diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index f5b242fdfc..b7f9f3757b 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -28,6 +28,7 @@ #ifndef LL_LLCHAT_H #define LL_LLCHAT_H +#include <utility> #include "lluuid.h" #include "v3math.h" @@ -71,8 +72,8 @@ typedef enum e_chat_style class LLChat { public: - LLChat(const std::string& text = std::string()) - : mText(text), + LLChat(std::string text = std::string()) + : mText(std::move(text)), mFromName(), mFromID(), mNotifId(), diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index b0865729bb..c831644a26 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -28,6 +28,7 @@ #include "linden_common.h" #include "llconsole.h" +#include <utility> // linden library includes #include "llmath.h" @@ -359,7 +360,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b //Pass in the string and the default color for this block of text. LLConsole::Paragraph::Paragraph (LLWString str, const LLColor4 &color, F32 add_time, const LLFontGL* font, F32 screen_width) -: mParagraphText(str), mAddTime(add_time), mMaxWidth(-1) +: mParagraphText(std::move(str)), mAddTime(add_time), mMaxWidth(-1) { makeParagraphColorSegments(color); updateLines( screen_width, font ); diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h index 58c03343ea..e607ee9459 100644 --- a/indra/llui/llconsole.h +++ b/indra/llui/llconsole.h @@ -31,6 +31,7 @@ #include "lluictrl.h" #include "v4color.h" #include <deque> +#include <utility> class LLSD; @@ -84,7 +85,7 @@ public: class LineColorSegment { public: - LineColorSegment(LLWString text, LLColor4 color, F32 xpos) : mText(text), mColor(color), mXPosition(xpos) {} + LineColorSegment(LLWString text, LLColor4 color, F32 xpos) : mText(std::move(text)), mColor(color), mXPosition(xpos) {} public: LLWString mText; LLColor4 mColor; diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 266dd417ce..1904319746 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -27,15 +27,17 @@ #include "linden_common.h" #include "lldockcontrol.h" + #include "lldockablefloater.h" #include "llui.h" +#include <utility> static LLLayoutPanel* sToolbarPanel = nullptr; LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, - const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) : + LLUIImagePtr dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) : mDockableFloater(dockableFloater), - mDockTongue(dockTongue), + mDockTongue(std::move(dockTongue)), mDockTongueX(0), mDockTongueY(0) { diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index d66850d0d2..d0223c4d5d 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -53,7 +53,7 @@ public: LOG_CLASS(LLDockControl); LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, - const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_rect_callback = NULL); + LLUIImagePtr dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_rect_callback = NULL); virtual ~LLDockControl(); public: diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index ca0a692de7..f932547a44 100644 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -27,12 +27,14 @@ #include "linden_common.h" #include "llflashtimer.h" + #include "lleventtimer.h" #include "llui.h" +#include <utility> LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) : LLEventTimer(period), - mCallback(cb), + mCallback(std::move(cb)), mCurrentTickCount(0), mIsCurrentlyHighlighted(false), mIsFlashingInProgress(false), diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 2202d85424..e8782cd4d7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -31,6 +31,7 @@ #include "linden_common.h" #include "llviewereventrecorder.h" #include "llfloater.h" +#include <utility> #include "llfocusmgr.h" @@ -236,10 +237,10 @@ void LLFloater::initClass() // defaults for floater param block pulled from widgets/floater.xml static LLWidgetNameRegistry::StaticRegistrar sRegisterFloaterParams(&typeid(LLFloater::Params), "floater"); -LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) +LLFloater::LLFloater(LLSD key, const LLFloater::Params& p) : LLPanel(), // intentionally do not pass params here, see initFromParams mMinimizeSignal(NULL), - mKey(key), + mKey(std::move(key)), mDragHandle(nullptr), mTitle(p.title), mShortTitle(p.short_title), // reuse single-instance floaters by default diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 41f389834e..a34219e8a7 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -202,7 +202,7 @@ public: // Load translations for tooltips for standard buttons static void initClass(); - LLFloater(const LLSD& key, const Params& params = getDefaultParams()); + LLFloater(LLSD key, const Params& params = getDefaultParams()); virtual ~LLFloater(); diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 4245adde46..91bac92925 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -35,6 +35,7 @@ #include "llpointer.h" #include <deque> +#include <utility> class LLTextSegment; typedef LLPointer<LLTextSegment> LLTextSegmentPtr; @@ -70,13 +71,13 @@ public: TT_TYPE // WORD } ETokenType; - LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) + LLKeywordToken( ETokenType type, const LLColor4& color, LLWString token, LLWString tool_tip, LLWString delimiter ) : mType( type ), - mToken( token ), + mToken(std::move(token)), mColor( color ), - mToolTip( tool_tip ), - mDelimiter( delimiter ) // right delimiter + mToolTip(std::move(tool_tip)), + mDelimiter(std::move(delimiter)) // right delimiter { } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index ac8d48fbcc..ff3bdc4afd 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -76,6 +76,7 @@ */ #include <iomanip> +#include <utility> #include "llevents.h" #include "llfunctorregistry.h" @@ -728,7 +729,7 @@ class LLNotificationChannelBase : public: LLNotificationChannelBase(LLNotificationFilter filter) : mItems(), - mFilter(filter) + mFilter(std::move(filter)) {} virtual ~LLNotificationChannelBase() {} // you can also connect to a Channel, so you can be notified of diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 667d233244..d330252d9a 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -61,6 +61,7 @@ #include "llmenugl.h" #include <queue> +#include <utility> #include "llcombobox.h" // @@ -83,8 +84,8 @@ const F32 SPELLCHECK_DELAY = 0.5f; // delay between the last keypress and spell class LLTextEditor::TextCmdInsert final: public LLTextBase::TextCmd { public: - TextCmdInsert(S32 pos, BOOL group_with_next, const LLWString &ws, LLTextSegmentPtr segment) - : TextCmd(pos, group_with_next, segment), mWString(ws) + TextCmdInsert(S32 pos, BOOL group_with_next, LLWString ws, LLTextSegmentPtr segment) + : TextCmd(pos, group_with_next, segment), mWString(std::move(ws)) { } virtual ~TextCmdInsert() {} diff --git a/indra/llui/lltrans.h b/indra/llui/lltrans.h index c7f67a8f49..9f002ef0c4 100644 --- a/indra/llui/lltrans.h +++ b/indra/llui/lltrans.h @@ -30,6 +30,7 @@ #include "llpointer.h" #include "llstring.h" #include <set> +#include <utility> #include "absl/container/flat_hash_map.h" class LLXMLNode; @@ -42,7 +43,10 @@ class LLSD; class LLTransTemplate { public: - LLTransTemplate(const std::string& name = LLStringUtil::null, const std::string& text = LLStringUtil::null) : mName(name), mText(text) {} + LLTransTemplate(std::string name = LLStringUtil::null, std::string text = LLStringUtil::null) : mName( + std:: + move(name)), mText( + std::move(text)) {} std::string mName; std::string mText; diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index 889a0ad2f0..6ef16f072a 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" #include "lluistring.h" +#include <utility> #include "llfasttimer.h" #include "llsd.h" @@ -35,8 +36,8 @@ LLTrace::BlockTimerStatHandle FTM_UI_STRING("UI String"); -LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) -: mOrig(instring), +LLUIString::LLUIString(std::string instring, const LLStringUtil::format_map_t& args) +: mOrig(std::move(instring)), mArgs(new LLStringUtil::format_map_t(args)) { dirty(); diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index 2b2fdabbb1..05836df1fb 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -58,7 +58,7 @@ public: // These methods all perform appropriate argument substitution // and modify mOrig where appropriate LLUIString() : mArgs(nullptr), mNeedsResult(false), mNeedsWResult(false) {} - LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); + LLUIString(std::string instring, const LLStringUtil::format_map_t& args); LLUIString(const std::string& instring) : mArgs(nullptr) { assign(instring); } ~LLUIString() { delete mArgs; } diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp index 74f95553e1..e59a51ccdf 100644 --- a/indra/llvfs/lllfsthread.cpp +++ b/indra/llvfs/lllfsthread.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" #include "lllfsthread.h" +#include <utility> #include "llstl.h" #include "llapr.h" @@ -131,13 +132,13 @@ LLLFSThread::handle_t LLLFSThread::write(const std::string& filename, LLLFSThread::Request::Request(LLLFSThread* thread, handle_t handle, U32 priority, - operation_t op, const std::string& filename, + operation_t op, std::string filename, U8* buffer, S32 offset, S32 numbytes, Responder* responder) : QueuedRequest(handle, priority, FLAG_AUTO_COMPLETE), mThread(thread), mOperation(op), - mFileName(filename), + mFileName(std::move(filename)), mBuffer(buffer), mOffset(offset), mBytes(numbytes), diff --git a/indra/llvfs/lllfsthread.h b/indra/llvfs/lllfsthread.h index 76e965c4fe..4b38729bd5 100644 --- a/indra/llvfs/lllfsthread.h +++ b/indra/llvfs/lllfsthread.h @@ -64,7 +64,7 @@ public: public: Request(LLLFSThread* thread, handle_t handle, U32 priority, - operation_t op, const std::string& filename, + operation_t op, std::string filename, U8* buffer, S32 offset, S32 numbytes, Responder* responder); diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index ecc5448538..bcc686a63b 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -49,6 +49,7 @@ #include <boost/exception/diagnostic_information.hpp> #include <boost/exception_ptr.hpp> +#include <utility> #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG #define CONTROL_ERRS LL_ERRS("ControlErrors") @@ -147,11 +148,11 @@ bool LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b) return result; } -LLControlVariable::LLControlVariable(const std::string& name, eControlType type, - LLSD initial, const std::string& comment, +LLControlVariable::LLControlVariable(std::string name, eControlType type, + LLSD initial, std::string comment, ePersist persist, bool hidefromsettingseditor) - : mName(name), - mComment(comment), + : mName(std::move(name)), + mComment(std::move(comment)), mType(type), mPersist(persist), mHideFromSettingsEditor(hidefromsettingseditor) diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index d244a022c5..e57dd57f3f 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -91,8 +91,8 @@ private: validate_signal_t mValidateSignal; public: - LLControlVariable(const std::string& name, eControlType type, - LLSD initial, const std::string& comment, + LLControlVariable(std::string name, eControlType type, + LLSD initial, std::string comment, ePersist persist = PERSIST_NONDFT, bool hidefromsettingseditor = false); virtual ~LLControlVariable(); diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index 00ee2d8c99..a7091e4d2a 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "llxmltree.h" +#include <utility> #include "v3color.h" #include "v4color.h" #include "v4coloru.h" @@ -99,8 +100,8 @@ void LLXmlTree::dumpNode( LLXmlTreeNode* node, const std::string& prefix ) ////////////////////////////////////////////////////////////// // LLXmlTreeNode -LLXmlTreeNode::LLXmlTreeNode( const std::string& name, LLXmlTreeNode* parent, LLXmlTree* tree ) - : mName(name), +LLXmlTreeNode::LLXmlTreeNode(std::string name, LLXmlTreeNode* parent, LLXmlTree* tree ) + : mName(std::move(name)), mParent(parent), mTree(tree) { diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h index 16989d8434..7ffd89c50b 100644 --- a/indra/llxml/llxmltree.h +++ b/indra/llxml/llxmltree.h @@ -86,7 +86,7 @@ class LLXmlTreeNode protected: // Protected since nodes are only created and destroyed by friend classes and other LLXmlTreeNodes - LLXmlTreeNode( const std::string& name, LLXmlTreeNode* parent, LLXmlTree* tree ); + LLXmlTreeNode(std::string name, LLXmlTreeNode* parent, LLXmlTree* tree ); public: virtual ~LLXmlTreeNode(); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 66248ec9eb..2ea06f93f9 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -52,6 +52,8 @@ #include "llwearablelist.h" #include "llfloaterperms.h" +#include <utility> + #include "llagentwearablesfetch.h" #include "llviewernetwork.h" LLAgentWearables gAgentWearables; @@ -175,7 +177,7 @@ void LLAgentWearables::dump() struct LLAgentDumper { LLAgentDumper(std::string name): - mName(name) + mName(std::move(name)) { LL_INFOS() << LL_ENDL; LL_INFOS() << "LLAgentDumper " << mName << LL_ENDL; @@ -243,7 +245,7 @@ LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInvento mIndex(index), mWearable(wearable), mTodo(todo), - mCB(cb), + mCB(std::move(cb)), mDescription(description) { LL_INFOS() << "constructor" << LL_ENDL; diff --git a/indra/newview/llaoset.h b/indra/newview/llaoset.h index 9b671ee5b9..76f57418f3 100644 --- a/indra/newview/llaoset.h +++ b/indra/newview/llaoset.h @@ -26,6 +26,7 @@ #ifndef LL_AOSET_H #define LL_AOSET_H +#include <utility> #include "lleventtimer.h" class LLAOSet : public LLEventTimer @@ -69,8 +70,8 @@ public: struct AOAnimation { AOAnimation(): mSortOrder( 0 ) {} - AOAnimation(const std::string& name, const LLUUID& asset_id, const LLUUID& inv_id, S32 sort_order) - : mName(name) + AOAnimation(std::string name, const LLUUID& asset_id, const LLUUID& inv_id, S32 sort_order) + : mName(std::move(name)) , mAssetUUID(asset_id) , mInventoryUUID(inv_id) , mSortOrder(sort_order) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d076675a69..4d01f08983 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -26,7 +26,6 @@ #include "llviewerprecompiledheaders.h" -#include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" #include "llagentwearables.h" @@ -49,8 +48,6 @@ #include "llvoavatarself.h" #include "llviewerregion.h" #include "llwearablelist.h" -#include "llsdutil.h" -#include "llsdserialize.h" #include "llhttpretrypolicy.h" #include "llaisapi.h" #include "llhttpsdhandler.h" @@ -168,17 +165,17 @@ class LLCallAfterInventoryBatchMgr: public LLEventTimer { public: LLCallAfterInventoryBatchMgr(const LLUUID& dst_cat_id, - const std::string& phase_name, + std::string phase_name, nullary_func_t on_completion_func, nullary_func_t on_failure_func = no_op, F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, S32 max_retries = DEFAULT_MAX_RETRIES ): LLEventTimer(5.0), - mTrackingPhase(phase_name), + mTrackingPhase(std::move(phase_name)), mDstCatID(dst_cat_id), - mOnCompletionFunc(on_completion_func), - mOnFailureFunc(on_failure_func), + mOnCompletionFunc(std::move(on_completion_func)), + mOnFailureFunc(std::move(on_failure_func)), mRetryAfter(retry_after), mMaxRetries(max_retries), mPendingRequests(0), @@ -445,9 +442,9 @@ private: class LLTrackPhaseWrapper : public LLInventoryCallback { public: - LLTrackPhaseWrapper(const std::string& phase_name, LLPointer<LLInventoryCallback> cb = nullptr): - mTrackingPhase(phase_name), - mCB(cb) + LLTrackPhaseWrapper(std::string phase_name, LLPointer<LLInventoryCallback> cb = nullptr): + mTrackingPhase(std::move(phase_name)), + mCB(std::move(cb)) { selfStartPhase(mTrackingPhase); } @@ -479,7 +476,7 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool enforce_item_restr mFireCount(0), mEnforceItemRestrictions(enforce_item_restrictions), mEnforceOrdering(enforce_ordering), - mPostUpdateFunc(post_update_func) + mPostUpdateFunc(std::move(post_update_func)) { selfStartPhase("update_appearance_on_destroy"); } @@ -561,14 +558,14 @@ struct LLFoundData LLFoundData(const LLUUID& item_id, const LLUUID& asset_id, - const std::string& name, + std::string name, const LLAssetType::EType& asset_type, const LLWearableType::EType& wearable_type, const bool is_replacement = false ) : mItemID(item_id), mAssetID(asset_id), - mName(name), + mName(std::move(name)), mAssetType(asset_type), mWearableType(wearable_type), mWearable( NULL ), @@ -2682,10 +2679,10 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor class LLDeferredCOFLinkObserver: public LLInventoryObserver { public: - LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb, const std::string& description): + LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb, std::string description): mItemID(item_id), - mDescription(description), - mCallback(cb) + mDescription(std::move(description)), + mCallback(std::move(cb)) { } @@ -2870,7 +2867,7 @@ class LLUpdateOnCOFLinkRemove : public LLInventoryCallback public: LLUpdateOnCOFLinkRemove(const LLUUID& remove_item_id, LLPointer<LLInventoryCallback> cb = NULL): mItemID(remove_item_id), - mCB(cb) + mCB(std::move(cb)) { } @@ -4090,7 +4087,7 @@ public: CallAfterCategoryFetchStage2(const uuid_vec_t& ids, nullary_func_t callable) : LLInventoryFetchItemsObserver(ids), - mCallable(callable) + mCallable(std::move(callable)) { } ~CallAfterCategoryFetchStage2() @@ -4115,7 +4112,7 @@ class CallAfterCategoryFetchStage1: public LLInventoryFetchDescendentsObserver public: CallAfterCategoryFetchStage1(const LLUUID& cat_id, nullary_func_t callable) : LLInventoryFetchDescendentsObserver(cat_id), - mCallable(callable) + mCallable(std::move(callable)) { } ~CallAfterCategoryFetchStage1() diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp index 94250f1fc2..aba48b1a21 100644 --- a/indra/newview/llappviewerlistener.cpp +++ b/indra/newview/llappviewerlistener.cpp @@ -30,16 +30,14 @@ #include "llviewerprecompiledheaders.h" // associated header #include "llappviewerlistener.h" -// STL headers -// std headers -// external library headers + // other Linden headers #include "llappviewer.h" -LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter): +LLAppViewerListener::LLAppViewerListener(LLAppViewerGetter getter): LLEventAPI("LLAppViewer", "LLAppViewer listener to (e.g.) request shutdown"), - mAppViewerGetter(getter) + mAppViewerGetter(std::move(getter)) { // add() every method we want to be able to invoke via this event API. add("requestQuit", diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h index a785d5f696..eb6c055ead 100644 --- a/indra/newview/llappviewerlistener.h +++ b/indra/newview/llappviewerlistener.h @@ -40,7 +40,7 @@ class LLAppViewerListener: public LLEventAPI public: typedef std::function<LLAppViewer*(void)> LLAppViewerGetter; /// Bind the LLAppViewer instance to use (e.g. LLAppViewer::instance()). - LLAppViewerListener(const LLAppViewerGetter& getter); + LLAppViewerListener(LLAppViewerGetter getter); private: void requestQuit(const LLSD& event); diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index d68119493d..205569e2fc 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llattachmentsmgr.h" +#include <utility> #include "llvoavatarself.h" #include "llagent.h" @@ -269,9 +270,9 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments() } } -LLAttachmentsMgr::LLItemRequestTimes::LLItemRequestTimes(const std::string& op_name, F32 timeout): +LLAttachmentsMgr::LLItemRequestTimes::LLItemRequestTimes(std::string op_name, F32 timeout): mTimeout(timeout), - mOpName(op_name) + mOpName(std::move(op_name)) { } diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index d41ee815cd..029c1ec720 100644 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -92,7 +92,7 @@ private: class LLItemRequestTimes: public std::map<LLUUID,LLTimer> { public: - LLItemRequestTimes(const std::string& op_name, F32 timeout); + LLItemRequestTimes(std::string op_name, F32 timeout); void addTime(const LLUUID& inv_item_id); void removeTime(const LLUUID& inv_item_id); BOOL wasRequestedRecently(const LLUUID& item_id) const; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index ece64e6411..17bebe2cbd 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -35,6 +35,7 @@ #include "llviewerprecompiledheaders.h" #include "llcompilequeue.h" +#include <utility> #include "llagent.h" #include "llchat.h" @@ -102,8 +103,8 @@ namespace class HandleScriptUserData { public: - HandleScriptUserData(const std::string &pumpname) : - mPumpname(pumpname) + HandleScriptUserData(std::string pumpname) : + mPumpname(std::move(pumpname)) { } const std::string &getPumpName() const { return mPumpname; } @@ -126,7 +127,7 @@ public: LLScriptAssetUpload(taskId, itemId, targetType, isRunning, exerienceId, std::string(), finish), mQueueId(queueId), - mScriptName(scriptName) + mScriptName(std::move(scriptName)) { setAssetId(assetId); } diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 9c63b1c25d..4e2309099e 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -36,6 +36,7 @@ #include "llconversationmodel.h" #include "llimview.h" //For LLIMModel #include "lltrans.h" +#include <utility> // // Conversation items : common behaviors @@ -43,7 +44,7 @@ LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), - mName(display_name), + mName(std::move(display_name)), mUUID(uuid), mConvType(CONV_UNKNOWN), mNeedsRefresh(true), diff --git a/indra/newview/lldelayedgestureerror.h b/indra/newview/lldelayedgestureerror.h index 7ecadb4e7d..77e3b87ffb 100644 --- a/indra/newview/lldelayedgestureerror.h +++ b/indra/newview/lldelayedgestureerror.h @@ -30,6 +30,7 @@ #define LL_DELAYEDGESTUREERROR_H #include <list> +#include <utility> #include "lltimer.h" // TODO: Refactor to be more generic - this may be useful for other delayed notifications in the future @@ -56,7 +57,7 @@ private: struct LLErrorEntry { - LLErrorEntry(const std::string& notify, const LLUUID &item) : mTimer(), mNotifyName(notify), mItemID(item) {} + LLErrorEntry(std::string notify, const LLUUID &item) : mTimer(), mNotifyName(std::move(notify)), mItemID(item) {} LLTimer mTimer; std::string mNotifyName; diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 2fc508cd31..e6a95eee0f 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -27,6 +27,7 @@ #ifndef LL_LLDRAWPOOLBUMP_H #define LL_LLDRAWPOOLBUMP_H +#include <utility> #include "lldrawpool.h" #include "llstring.h" #include "lltextureentry.h" @@ -111,7 +112,7 @@ class LLStandardBumpmap { public: LLStandardBumpmap() : mLabel() {} - LLStandardBumpmap( const std::string& label ) : mLabel(label) {} + LLStandardBumpmap(std::string label ) : mLabel(std::move(label)) {} std::string mLabel; LLPointer<LLViewerFetchedTexture> mImage; diff --git a/indra/newview/lleasymessagelogentry.cpp b/indra/newview/lleasymessagelogentry.cpp index 16966b19b6..8c574c1fef 100644 --- a/indra/newview/lleasymessagelogentry.cpp +++ b/indra/newview/lleasymessagelogentry.cpp @@ -29,9 +29,10 @@ #include <libxml/HTMLparser.h> #include <libxml/HTMLtree.h> #include <boost/algorithm/string.hpp> +#include <utility> LLEasyMessageLogEntry::LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader) -: mEntry(entry) +: mEntry(std::move(entry)) , mResponseMsg(nullptr) , mEasyMessageReader(message_reader) { diff --git a/indra/newview/lleasymessagereader.cpp b/indra/newview/lleasymessagereader.cpp index e285c42aa6..b85cfaf3c5 100644 --- a/indra/newview/lleasymessagereader.cpp +++ b/indra/newview/lleasymessagereader.cpp @@ -31,7 +31,7 @@ LLEasyMessageReader::~LLEasyMessageReader() //we might want the sequenceid of the packet, which we can't get from //a messagetemplate pointer, allow for passing in a U32 to be replaced //with the sequenceid -LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data_len, LLHost from_host) +LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data_len, LLHost const& from_host) { U32 fake_id = 0; return decodeTemplateMessage(data, data_len, from_host, fake_id); diff --git a/indra/newview/lleasymessagereader.h b/indra/newview/lleasymessagereader.h index 39a70b6781..506ce32176 100644 --- a/indra/newview/lleasymessagereader.h +++ b/indra/newview/lleasymessagereader.h @@ -31,7 +31,7 @@ public: LLEasyMessageReader(); ~LLEasyMessageReader(); - LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, LLHost from_host); + LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, LLHost const& from_host); LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, LLHost from_host, U32& sequence_id); S32 getNumberOfBlocks(const char *blockname); diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h index 4c0811adbb..1de1029d9f 100644 --- a/indra/newview/llenvmanager.h +++ b/indra/newview/llenvmanager.h @@ -27,6 +27,7 @@ #ifndef LL_LLENVMANAGER_H #define LL_LLENVMANAGER_H +#include <utility> #include "llmemory.h" #include "llsd.h" @@ -59,8 +60,8 @@ public: static const int NAME_IDX = 0; static const int SCOPE_IDX = 1; - inline LLWLParamKey(const std::string& n, EScope s) - : name(n), scope(s) + inline LLWLParamKey(std::string n, EScope s) + : name(std::move(n)), scope(s) { } @@ -138,10 +139,10 @@ public: mSkyMap(LLSD::emptyMap()), mDayTime(0.f) {} - LLEnvironmentSettings(const LLSD& dayCycle, const LLSD& skyMap, const LLSD& waterParams, F64 dayTime) : - mWLDayCycle(dayCycle), - mWaterParams(waterParams), - mSkyMap(skyMap), + LLEnvironmentSettings(LLSD dayCycle, LLSD skyMap, LLSD waterParams, F64 dayTime) : + mWLDayCycle(std::move(dayCycle)), + mWaterParams(std::move(waterParams)), + mSkyMap(std::move(skyMap)), mDayTime(dayTime) {} ~LLEnvironmentSettings() {} diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index dd03d3df10..06b266d2a9 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "lleventnotifier.h" +#include <utility> #include "llnotificationsutil.h" #include "message.h" @@ -275,11 +276,11 @@ void LLEventNotifier::serverPushRequest(U32 event_id, bool add) } -LLEventNotification::LLEventNotification(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName) : +LLEventNotification::LLEventNotification(U32 eventId, F64 eventEpoch, std::string eventDateStr, std::string eventName) : mEventID(eventId), - mEventName(eventName), + mEventName(std::move(eventName)), mEventDateEpoch(eventEpoch), - mEventDateStr(eventDateStr) + mEventDateStr(std::move(eventDateStr)) { } diff --git a/indra/newview/lleventnotifier.h b/indra/newview/lleventnotifier.h index 5587f57b0c..024cc5c270 100644 --- a/indra/newview/lleventnotifier.h +++ b/indra/newview/lleventnotifier.h @@ -27,6 +27,7 @@ #ifndef LL_LLEVENTNOTIFIER_H #define LL_LLEVENTNOTIFIER_H +#include <utility> #include "llframetimer.h" #include "v3dmath.h" @@ -47,8 +48,8 @@ typedef struct event_st{ std::string simName; LLVector3d globalPos; U32 flags = 0; - event_st(U32 id, F64 epoch, const std::string& date_str, const std::string& name) - : eventId(id), eventEpoch(epoch), eventDateStr(date_str), eventName(name){} + event_st(U32 id, F64 epoch, std::string date_str, std::string name) + : eventId(id), eventEpoch(epoch), eventDateStr(std::move(date_str)), eventName(std::move(name)){} event_st(){} } LLEventStruct; @@ -90,7 +91,7 @@ protected: class LLEventNotification { public: - LLEventNotification(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName); + LLEventNotification(U32 eventId, F64 eventEpoch, std::string eventDateStr, std::string eventName); U32 getEventID() const { return mEventID; } diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 52e4da217a..ca41afcc18 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llexpandabletextbox.h" +#include <utility> #include "llscrollcontainer.h" #include "lltrans.h" @@ -37,10 +38,10 @@ static LLDefaultChildRegistry::Register<LLExpandableTextBox> t1("expandable_text class LLExpanderSegment final : public LLTextSegment { public: - LLExpanderSegment(const LLStyleSP& style, S32 start, S32 end, const std::string& more_text, LLTextBase& editor ) + LLExpanderSegment(LLStyleSP style, S32 start, S32 end, const std::string& more_text, LLTextBase& editor ) : LLTextSegment(start, end), mEditor(editor), - mStyle(style), + mStyle(std::move(style)), mExpanderLabel(utf8str_to_wstring(more_text)) {} diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index b912accf61..0a12fb2fc4 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -27,6 +27,7 @@ #ifndef LL_LLFAVORITESBARCTRL_H #define LL_LLFAVORITESBARCTRL_H +#include <utility> #include "llbutton.h" #include "lluictrl.h" #include "lltextbox.h" @@ -240,8 +241,8 @@ private: struct IsNotInFavorites { - IsNotInFavorites(const LLInventoryModel::item_array_t& items) - : mFavoriteItems(items) + IsNotInFavorites(LLInventoryModel::item_array_t items) + : mFavoriteItems(std::move(items)) { } diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 368170ec20..7cc6cc6922 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -28,6 +28,7 @@ #include <iostream> #include <fstream> +#include <utility> #include "llfeaturemanager.h" #include "lldir.h" @@ -65,13 +66,13 @@ const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; #if 0 // consuming code in #if 0 below #endif -LLFeatureInfo::LLFeatureInfo(const std::string& name, const BOOL available, const F32 level) - : mValid(TRUE), mName(name), mAvailable(available), mRecommendedLevel(level) +LLFeatureInfo::LLFeatureInfo(std::string name, const BOOL available, const F32 level) + : mValid(TRUE), mName(std::move(name)), mAvailable(available), mRecommendedLevel(level) { } -LLFeatureList::LLFeatureList(const std::string& name) - : mName(name) +LLFeatureList::LLFeatureList(std::string name) + : mName(std::move(name)) { } diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 8dd12104cd..a9e6fa00e2 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -51,7 +51,7 @@ class LLFeatureInfo { public: LLFeatureInfo() : mValid(FALSE), mAvailable(FALSE), mRecommendedLevel(-1) {} - LLFeatureInfo(const std::string& name, const BOOL available, const F32 level); + LLFeatureInfo(std::string name, const BOOL available, const F32 level); BOOL isValid() const { return mValid; }; @@ -68,7 +68,7 @@ class LLFeatureList public: typedef std::map<std::string, LLFeatureInfo> feature_map_t; - LLFeatureList(const std::string& name); + LLFeatureList(std::string name); virtual ~LLFeatureList(); BOOL isFeatureAvailable(const std::string& name); diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index a88cb6e594..e46c12bf7b 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -27,6 +27,7 @@ #ifndef LL_LLFLOATEREDITDAYCYCLE_H #define LL_LLFLOATEREDITDAYCYCLE_H +#include <utility> #include "llfloater.h" #include "llwlparammanager.h" // for LLWLParamKey @@ -112,7 +113,7 @@ private: struct SliderKey { public: - SliderKey(LLWLParamKey kf, F32 t) : keyframe(kf), time(t) {} + SliderKey(LLWLParamKey kf, F32 t) : keyframe(std::move(kf)), time(t) {} SliderKey() : keyframe(), time(0.f) {} // Don't use this default constructor LLWLParamKey keyframe; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 3192d24950..db832aeb6e 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -123,6 +123,7 @@ #include "llviewertexturelist.h" #include <nlohmann/json.hpp> +#include <utility> #include "llsearchableui.h" @@ -2241,7 +2242,7 @@ public: Updater(callback_t cb, F32 period) :LLEventTimer(period), - mCallback(cb) + mCallback(std::move(cb)) { mEventTimer.stop(); } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 85de31850f..e551fabd79 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -30,6 +30,7 @@ #include "llfloaterreporter.h" #include <sstream> +#include <utility> // linden library includes #include "llassetstorage.h" @@ -114,7 +115,7 @@ private: LLARScreenShotUploader::LLARScreenShotUploader(LLSD report, LLUUID assetId, LLAssetType::EType assetType) : LLResourceUploadInfo(assetId, assetType, "Abuse Report"), - mReport(report) + mReport(std::move(report)) { } diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index 320d9d7341..917c63eb7a 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -97,15 +97,15 @@ LLFloaterTextureFetchDebugger::~LLFloaterTextureFetchDebugger() void LLFloaterTextureFetchDebugger::updateButtons() { - for(std::map<std::string, bool>::iterator iter = mButtonStateMap.begin(); iter != mButtonStateMap.end(); ++iter) - { - if(iter->second) + for (auto& iter : mButtonStateMap) + { + if(iter.second) { - childEnable(iter->first.c_str()); + childEnable(iter.first); } else { - childDisable(iter->first.c_str()); + childDisable(iter.first); } } } diff --git a/indra/newview/llfloatertexturepicker.cpp b/indra/newview/llfloatertexturepicker.cpp index a06dd7d23c..a85d56b8bc 100644 --- a/indra/newview/llfloatertexturepicker.cpp +++ b/indra/newview/llfloatertexturepicker.cpp @@ -43,6 +43,8 @@ #include "llviewercontrol.h" #include "llavatarappearancedefines.h" +#include <utility> + static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; static const F32 CONTEXT_FADE_TIME = 0.08f; @@ -57,7 +59,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( LLUUID blank_image_asset_id, BOOL tentative, BOOL allow_no_texture, - const std::string& label, + std::string label, PermissionMask immediate_filter_perm_mask, PermissionMask dnd_filter_perm_mask, PermissionMask non_immediate_filter_perm_mask, @@ -66,14 +68,14 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( : LLFloater(LLSD()), mOwner(owner), mImageAssetID(image_asset_id), - mFallbackImage(fallback_image), + mFallbackImage(std::move(fallback_image)), mDefaultImageAssetID(default_image_asset_id), mTransparentImageAssetID(transparent_image_asset_id), mBlankImageAssetID(blank_image_asset_id), mTentative(tentative), mAllowNoTexture(allow_no_texture), mOriginalImageAssetID(image_asset_id), - mLabel(label), + mLabel(std::move(label)), mTentativeLabel(nullptr), mResolutionLabel(nullptr), mActive(TRUE), diff --git a/indra/newview/llfloatertexturepicker.h b/indra/newview/llfloatertexturepicker.h index 9a4ee60ecd..e77aac2e5f 100644 --- a/indra/newview/llfloatertexturepicker.h +++ b/indra/newview/llfloatertexturepicker.h @@ -51,7 +51,7 @@ public: LLUUID blank_image_asset_id, BOOL tentative, BOOL allow_no_texture, - const std::string& label, + std::string label, PermissionMask immediate_filter_perm_mask, PermissionMask dnd_filter_perm_mask, PermissionMask non_immediate_filter_perm_mask, diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 1b45c31a56..ccd0ab2e56 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -64,6 +64,7 @@ // Boost (for linux/unix command-line execv) #include <boost/tokenizer.hpp> +#include <utility> #if LL_DARWIN #include <CoreFoundation/CFURL.h> @@ -309,7 +310,7 @@ LLGUIPreviewLiveFile::LLGUIPreviewLiveFile(std::string path, std::string name, L mParent(parent), mFadeTimer(nullptr), mFirstFade(TRUE), - mFileName(name) + mFileName(std::move(name)) {} LLGUIPreviewLiveFile::~LLGUIPreviewLiveFile() diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 1444d378f1..c75feb81a6 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterurlentry.h" +#include <utility> #include "llpanellandmedia.h" #include "llpanelface.h" @@ -47,7 +48,7 @@ static LLFloaterURLEntry* sInstance = nullptr; LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) : LLFloater(LLSD()), mMediaURLEdit(nullptr), - mPanelLandMediaHandle(parent) + mPanelLandMediaHandle(std::move(parent)) { buildFromFile("floater_url_entry.xml"); } diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 5bfd3fc962..185924404a 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llfriendcard.h" +#include <utility> #include "llagent.h" #include "llavatarnamecache.h" @@ -141,7 +142,7 @@ public: LLInitialFriendCardsFetch(const LLUUID& folder_id, callback_t cb) : LLInventoryFetchDescendentsObserver(folder_id), - mCheckFolderCallback(cb) + mCheckFolderCallback(std::move(cb)) {} void done() override; diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index b4dcc1c138..e83a93890e 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -55,6 +55,7 @@ #include "roles_constants.h" #include <boost/format.hpp> #include <boost/regex.hpp> +#include <utility> constexpr U32 MAX_CACHED_GROUPS = 20; @@ -79,14 +80,14 @@ LLRoleActionSet::~LLRoleActionSet() LLGroupMemberData::LLGroupMemberData(const LLUUID& id, S32 contribution, U64 agent_powers, - const std::string& title, - const std::string& online_status, + std::string title, + std::string online_status, BOOL is_owner) : mID(id), mContribution(contribution), mAgentPowers(agent_powers), - mTitle(title), - mOnlineStatus(online_status), + mTitle(std::move(title)), + mOnlineStatus(std::move(online_status)), mIsOwner(is_owner) { } diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 102f15b05b..c8aa17ca60 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -81,8 +81,8 @@ public: LLGroupMemberData(const LLUUID& id, S32 contribution, U64 agent_powers, - const std::string& title, - const std::string& online_status, + std::string title, + std::string online_status, BOOL is_owner); ~LLGroupMemberData(); diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 86ba8e5440..50f0c5eb62 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llhudeffectlookat.h" +#include <utility> #include "llrender.h" @@ -76,8 +77,8 @@ public: : mTimeout(0.f), mPriority(0.f) {} - LLAttention(F32 timeout, F32 priority, const std::string& name, LLColor3 color) : - mTimeout(timeout), mPriority(priority), mName(name), mColor(color) + LLAttention(F32 timeout, F32 priority, std::string name, LLColor3 color) : + mTimeout(timeout), mPriority(priority), mName(std::move(name)), mColor(color) { } F32 mTimeout, mPriority; diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h index 79f00e2e1a..cae1957c57 100644 --- a/indra/newview/llhudnametag.h +++ b/indra/newview/llhudnametag.h @@ -39,6 +39,7 @@ #include "llfontgl.h" #include "lluiimage.h" #include <set> +#include <utility> class LLDrawable; class LLHUDNameTag; @@ -54,11 +55,11 @@ protected: class LLHUDTextSegment { public: - LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) + LLHUDTextSegment(LLWString text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) : mColor(color), mStyle(style), mFont(font), - mText(text) + mText(std::move(text)) {} F32 getWidth(const LLFontGL* font); const LLWString& getText() const { return mText; } diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 6009473747..5ca2e5b62c 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -36,6 +36,7 @@ #include "llrect.h" #include "llfontgl.h" #include <set> +#include <utility> // Renders a 2D text billboard floating at the location specified. class LLDrawable; @@ -52,11 +53,11 @@ protected: class LLHUDTextSegment { public: - LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) + LLHUDTextSegment(LLWString text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) : mColor(color), mStyle(style), mFont(font), - mText(text) + mText(std::move(text)) {} F32 getWidth(const LLFontGL* font); const LLWString& getText() const { return mText; } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c23fc53d24..30a3c626a5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llimview.h" +#include <utility> #include "llavatarnamecache.h" // IDEVO #include "llavataractions.h" @@ -527,12 +528,13 @@ LLIMModel::LLIMModel() addNewMsgCallback(boost::bind(&on_new_message, _1)); } -LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice, bool has_offline_msg) +LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, + uuid_vec_t ids, bool voice, bool has_offline_msg) : mSessionID(session_id), mName(name), mType(type), mOtherParticipantID(other_participant_id), - mInitialTargetIDs(ids), + mInitialTargetIDs(std::move(ids)), mParticipantUnreadMessageCount(0), mNumUnread(0), mVoiceChannel(nullptr), diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index de20d8694a..c5a1030bc2 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -77,7 +77,7 @@ public: } SType; LLIMSession(const LLUUID& session_id, const std::string& name, - const EInstantMessage& type, const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice, bool has_offline_msg); + const EInstantMessage& type, const LLUUID& other_participant_id, uuid_vec_t ids, bool voice, bool has_offline_msg); virtual ~LLIMSession(); void sessionInitReplyReceived(const LLUUID& new_session_id); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f6b38c9f0d..a761b95dc5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3453,7 +3453,7 @@ LLFolderType::EType LLFolderBridge::getPreferredType() const LLViewerInventoryCategory* cat = getCategory(); if(cat) { - const std::string cat_name(cat->getName()); + const std::string& cat_name(cat->getName()); if (cat_name == ROOT_AO_FOLDER) preferred_type = LLFolderType::FT_ANIM_OVERRIDES; else if (cat_name == "#Firestorm" || cat_name == "#Phoenix" diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 39119aa836..b7e098fc8c 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -28,6 +28,7 @@ #ifndef LL_LLINVENTORYFUNCTIONS_H #define LL_LLINVENTORYFUNCTIONS_H +#include <utility> #include "llinventorymodel.h" #include "llinventory.h" #include "llhandle.h" @@ -284,7 +285,7 @@ protected: class LLNameCategoryCollector : public LLInventoryCollectFunctor { public: - LLNameCategoryCollector(const std::string& name) : mName(name) {} + LLNameCategoryCollector(std::string name) : mName(std::move(name)) {} virtual ~LLNameCategoryCollector() {} bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 30db8fc9e7..10e18870e8 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include <typeinfo> +#include <utility> #include "llinventorymodel.h" @@ -2636,7 +2637,7 @@ void LLInventoryModel::createCommonSystemCategories() struct LLUUIDAndName { LLUUIDAndName() {} - LLUUIDAndName(const LLUUID& id, const std::string& name); + LLUUIDAndName(const LLUUID& id, std::string name); bool operator==(const LLUUIDAndName& rhs) const; bool operator<(const LLUUIDAndName& rhs) const; bool operator>(const LLUUIDAndName& rhs) const; @@ -2645,8 +2646,8 @@ struct LLUUIDAndName std::string mName; }; -LLUUIDAndName::LLUUIDAndName(const LLUUID& id, const std::string& name) : - mID(id), mName(name) +LLUUIDAndName::LLUUIDAndName(const LLUUID& id, std::string name) : + mID(id), mName(std::move(name)) { } @@ -4172,9 +4173,9 @@ BOOL decompress_file(const char* src_filename, const char* dst_filename) /// Class LLInventoryModel::FetchItemHttpHandler ///---------------------------------------------------------------------------- -LLInventoryModel::FetchItemHttpHandler::FetchItemHttpHandler(const LLSD & request_sd) +LLInventoryModel::FetchItemHttpHandler::FetchItemHttpHandler(LLSD request_sd) : LLCore::HttpHandler(), - mRequestSD(request_sd) + mRequestSD(std::move(request_sd)) {} LLInventoryModel::FetchItemHttpHandler::~FetchItemHttpHandler() diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 5c1fe9d36e..d582e32745 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -85,7 +85,7 @@ public: public: LOG_CLASS(FetchItemHttpHandler); - FetchItemHttpHandler(const LLSD & request_sd); + FetchItemHttpHandler(LLSD request_sd); virtual ~FetchItemHttpHandler(); FetchItemHttpHandler(const FetchItemHttpHandler &) = delete; // Not defined diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 14b2b00477..0b94ec5fa7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llinventorymodelbackgroundfetch.h" +#include <utility> #include "llagent.h" #include "llappviewer.h" @@ -139,10 +140,10 @@ class BGFolderHttpHandler : public LLCore::HttpHandler LOG_CLASS(BGFolderHttpHandler); public: - BGFolderHttpHandler(const LLSD & request_sd, const uuid_vec_t & recursive_cats) + BGFolderHttpHandler(LLSD request_sd, uuid_vec_t recursive_cats) : LLCore::HttpHandler(), - mRequestSD(request_sd), - mRecursiveCatUUIDs(recursive_cats) + mRequestSD(std::move(request_sd)), + mRecursiveCatUUIDs(std::move(recursive_cats)) { LLInventoryModelBackgroundFetch::instance().incrFetchCount(1); } diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index a6d689dd13..afbf6ba214 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -55,6 +55,7 @@ #include "llvoavatarself.h" #include "llsdutil.h" #include <deque> +#include <utility> const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 60.0f; @@ -744,7 +745,7 @@ void LLInventoryCategoriesObserver::removeCategory(const LLUUID& cat_id) LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents) - : mCallback(cb) + : mCallback(std::move(cb)) , mVersion(version) , mDescendentsCount(num_descendents) , mIsNameHashInitialized(false) @@ -756,7 +757,7 @@ LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash) - : mCallback(cb) + : mCallback(std::move(cb)) , mVersion(version) , mDescendentsCount(num_descendents) , mItemNameHash(name_hash) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0f237a2f45..a60156abdd 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -106,7 +106,7 @@ public: typedef std::function<void()> callback_t; LLInvPanelComplObserver(callback_t cb) - : mCallback(cb) + : mCallback(std::move(cb)) { } diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h index 1678461bdf..05e0dc2526 100644 --- a/indra/newview/lllocationhistory.h +++ b/indra/newview/lllocationhistory.h @@ -27,6 +27,8 @@ #ifndef LL_LLLOCATIONHISTORY_H #define LL_LLLOCATIONHISTORY_H +#include <utility> + class LLSD; /** * This enum is responsible for identifying of history item. @@ -43,8 +45,8 @@ public: LLLocationHistoryItem(std::string typed_location, LLVector3d global_position, std::string tooltip,ELocationType type ): mGlobalPos(global_position), - mToolTip(tooltip), - mLocation(typed_location), + mToolTip(std::move(tooltip)), + mLocation(std::move(typed_location)), mType(type) {} LLLocationHistoryItem(const LLLocationHistoryItem& item): diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index be092b2e46..0fd5e8e325 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -46,6 +46,7 @@ #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/local_time_adjustor.hpp> +#include <utility> const S32 LOG_RECALL_SIZE = 2048; @@ -997,11 +998,11 @@ void LLActionThread::setFinished() mRunCondition.signal(); } -LLLoadHistoryThread::LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params) +LLLoadHistoryThread::LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, LLSD load_params) : LLActionThread("load chat history"), mFileName(file_name), mMessages(messages), - mLoadParams(load_params), + mLoadParams(std::move(load_params)), mNewLoad(true), mLoadEndSignal(nullptr) { diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 380fbf1a4e..7244e48747 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -26,6 +26,8 @@ #ifndef LL_LLLOGCHAT_H #define LL_LLLOGCHAT_H + +#include <utility> #include "llthread.h" class LLChat; @@ -54,7 +56,7 @@ private: LLSD mLoadParams; bool mNewLoad; public: - LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params); + LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, LLSD load_params); ~LLLoadHistoryThread(); //void setHistoryParams(const std::string& file_name, const LLSD& load_params); virtual void loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params); @@ -146,7 +148,7 @@ private: class LLChatLogFormatter { public: - LLChatLogFormatter(const LLSD& im) : mIM(im) {} + LLChatLogFormatter(LLSD im) : mIM(std::move(im)) {} virtual ~LLChatLogFormatter() {}; friend std::ostream& operator<<(std::ostream& str, const LLChatLogFormatter& formatter) diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 1f748f8bd2..9371534492 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -40,6 +40,8 @@ #include "httpcommon.h" #include "llcorehttputil.h" +#include <utility> + /** * Materials cap parameters */ @@ -70,7 +72,7 @@ public: typedef std::function<void(bool, const LLSD&)> CallbackFunction; typedef std::shared_ptr<LLMaterialHttpHandler> ptr_t; - LLMaterialHttpHandler(const std::string& method, CallbackFunction cback); + LLMaterialHttpHandler(std::string method, CallbackFunction cback); virtual ~LLMaterialHttpHandler(); @@ -83,10 +85,10 @@ private: CallbackFunction mCallback; }; -LLMaterialHttpHandler::LLMaterialHttpHandler(const std::string& method, CallbackFunction cback): +LLMaterialHttpHandler::LLMaterialHttpHandler(std::string method, CallbackFunction cback): LLHttpSDHandler(), - mMethod(method), - mCallback(cback) + mMethod(std::move(method)), + mCallback(std::move(cback)) { } diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index a92359e067..7f3047c9ef 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -27,14 +27,15 @@ #include "llviewerprecompiledheaders.h" #include "llmediadataclient.h" -#include "llviewercontrol.h" +#include "llviewercontrol.h" #include "llhttpconstants.h" #include "llsdutil.h" #include "llmediaentry.h" #include "lltextureentry.h" #include "llviewerregion.h" #include "llcorehttputil.h" +#include <utility> // // When making a request @@ -94,7 +95,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q); class PredicateMatchRequest { public: - PredicateMatchRequest(const LLMediaDataClient::Request::ptr_t &request, LLMediaDataClient::Request::Type matchType = LLMediaDataClient::Request::ANY); + PredicateMatchRequest(LLMediaDataClient::Request::ptr_t request, LLMediaDataClient::Request::Type matchType = LLMediaDataClient::Request::ANY); PredicateMatchRequest(const LLUUID &id, LLMediaDataClient::Request::Type matchType = LLMediaDataClient::Request::ANY); PredicateMatchRequest(const PredicateMatchRequest &other); @@ -108,8 +109,8 @@ private: }; -PredicateMatchRequest::PredicateMatchRequest(const LLMediaDataClient::Request::ptr_t &request, LLMediaDataClient::Request::Type matchType) : - mRequest(request), +PredicateMatchRequest::PredicateMatchRequest(LLMediaDataClient::Request::ptr_t request, LLMediaDataClient::Request::Type matchType) : + mRequest(std::move(request)), mMatchType(matchType), mId() {} @@ -438,7 +439,7 @@ BOOL LLMediaDataClient::QueueTimer::tick() ////////////////////////////////////////////////////////////////////////////////////// LLMediaDataClient::RetryTimer::RetryTimer(F32 time, Request::ptr_t request) -: LLEventTimer(time), mRequest(request) +: LLEventTimer(time), mRequest(std::move(request)) { mRequest->startTracking(); } @@ -596,8 +597,8 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &r) //======================================================================== -LLMediaDataClient::Handler::Handler(const Request::ptr_t &request): - mRequest(request) +LLMediaDataClient::Handler::Handler(Request::ptr_t request): + mRequest(std::move(request)) { } @@ -1038,9 +1039,10 @@ void LLObjectMediaNavigateClient::navigate(LLMediaDataClientObject *object, U8 t enqueue(std::static_pointer_cast<Request>(std::make_shared<RequestNavigate>(object, this, texture_index, url))); } -LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url): +LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, + std::string url): LLMediaDataClient::Request(LLMediaDataClient::Request::NAVIGATE, obj, mdc, (S32)texture_index), - mURL(url) + mURL(std::move(url)) { } diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index beaf44288f..cbc0684486 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -203,7 +203,7 @@ protected: { LOG_CLASS(Handler); public: - Handler(const Request::ptr_t &request); + Handler(Request::ptr_t request); Request::ptr_t getRequest() const { return mRequest; } protected: @@ -407,7 +407,7 @@ public: class RequestNavigate: public Request { public: - RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url); + RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, std::string url); /*virtual*/ LLSD getPayload() const override; /*virtual*/ LLCore::HttpHandler::ptr_t createHandler() override; /*virtual*/ std::string getURL() override { return mURL; } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index ad8236672a..d68608361e 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -75,6 +75,7 @@ #include <boost/iostreams/device/array.hpp> #include <boost/iostreams/stream.hpp> +#include <utility> #ifndef LL_WINDOWS #include "netdb.h" @@ -2054,15 +2055,15 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, - const std::string & upload_url, bool do_upload, + std::string upload_url, bool do_upload, LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer) : LLThread("mesh upload"), LLCore::HttpHandler(), mDiscarded(false), - mWholeModelUploadURL(upload_url), - mFeeObserverHandle(fee_observer), - mUploadObserverHandle(upload_observer), + mWholeModelUploadURL(std::move(upload_url)), + mFeeObserverHandle(std::move(fee_observer)), + mUploadObserverHandle(std::move(upload_observer)), mDoUpload(do_upload) { mInstanceList = data; diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 7c86411617..2dd9e001c7 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -27,6 +27,7 @@ #ifndef LL_MESH_REPOSITORY_H #define LL_MESH_REPOSITORY_H +#include <utility> #include "llassettype.h" #include "llmodel.h" #include "lluuid.h" @@ -451,11 +452,11 @@ public: std::string mWholeModelFeeCapability; std::string mWholeModelUploadURL; - LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, - const std::string & upload_url, bool do_upload = true, - LLHandle<LLWholeModelFeeObserver> fee_observer = (LLHandle<LLWholeModelFeeObserver>()), - LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>())); + LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures, + bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, + std::string upload_url, bool do_upload, + LLHandle<LLWholeModelFeeObserver> fee_observer, + LLHandle<LLWholeModelUploadObserver> upload_observer); ~LLMeshUploadThread(); bool finished() const { return mFinished; } @@ -671,8 +672,8 @@ public: LLSD mPostData; LLSD mResponse; - inventory_data(const LLSD& data, const LLSD& content) - : mPostData(data), mResponse(content) + inventory_data(LLSD data, LLSD content) + : mPostData(std::move(data)), mResponse(std::move(content)) { } }; diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 37dbdbd23f..99de02b5aa 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -49,6 +49,7 @@ #include <boost/tokenizer.hpp> #include <boost/bind.hpp> #include <boost/algorithm/string/replace.hpp> +#include <utility> #include "lldispatcher.h" #include "llxfermanager.h" @@ -107,9 +108,9 @@ static LLDispatchEmptyMuteList sDispatchEmptyMuteList; // LLMute() //----------------------------------------------------------------------------- -LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) +LLMute::LLMute(const LLUUID& id, std::string name, EType type, U32 flags) : mID(id), - mName(name), + mName(std::move(name)), mType(type), mFlags(flags) { diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 3fd35d7454..f571e800e5 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -57,7 +57,7 @@ public: flagAll = 0x0000000F // Mask of all currently defined flags }; - LLMute(const LLUUID& id, const std::string& name = std::string(), EType type = BY_NAME, U32 flags = 0); + LLMute(const LLUUID& id, std::string name = std::string(), EType type = BY_NAME, U32 flags = 0); // Returns localized type name of muted item std::string getDisplayType() const; diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 59f6172f02..a85e3c5011 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationstorage.h" +#include <utility> #include "llerror.h" #include "llfile.h" @@ -74,7 +75,7 @@ LLResponderRegistry::StaticRegistrar sRegisterOfferInfo("offer_info", &LLRespond LLNotificationStorage::LLNotificationStorage(std::string pFileName) - : mFileName(pFileName) + : mFileName(std::move(pFileName)) { } diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp index cd6b60c734..aea7752ac0 100644 --- a/indra/newview/llpanelavatartag.cpp +++ b/indra/newview/llpanelavatartag.cpp @@ -31,7 +31,7 @@ #include "llavatariconctrl.h" #include "lltextbox.h" -LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string im_time) +LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string& im_time) : LLPanel() , mAvatarId(LLUUID::null) // , mFadeTimer() diff --git a/indra/newview/llpanelavatartag.h b/indra/newview/llpanelavatartag.h index e259806434..7516572d52 100644 --- a/indra/newview/llpanelavatartag.h +++ b/indra/newview/llpanelavatartag.h @@ -44,7 +44,7 @@ class LLTextBox; class LLPanelAvatarTag : public LLPanel { public: - LLPanelAvatarTag(const LLUUID& key, const std::string im_time); + LLPanelAvatarTag(const LLUUID& key, const std::string& im_time); virtual ~LLPanelAvatarTag() = default; /** diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 9841c5d6f4..362dd22a48 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llpaneleditwearable.h" + #include "llpanel.h" #include "llviewerwearable.h" #include "lluictrl.h" @@ -52,7 +53,6 @@ #include "llcolorswatch.h" #include "llfilepicker.h" #include "lltexturectrl.h" -#include "lltextureentry.h" #include "llviewercontrol.h" // gSavedSettings #include "llviewerregion.h" #include "llviewertexturelist.h" @@ -60,8 +60,8 @@ #include "llmorphview.h" #include "llcommandhandler.h" -#include "lltextutil.h" #include "llappearancemgr.h" +#include <utility> // register panel with appropriate XML static LLPanelInjector<LLPanelEditWearable> t_edit_wearable("panel_edit_wearable"); @@ -130,10 +130,10 @@ public: { WearableEntry(LLWearableType::EType type, const std::string &title, - const std::string &desc_title, - const texture_vec_t& color_swatches, // 'color_swatches' - const texture_vec_t& texture_pickers, // 'texture_pickers' - const subpart_vec_t& subparts); // subparts + std::string desc_title, + texture_vec_t color_swatches, // 'color_swatches' + texture_vec_t texture_pickers, // 'texture_pickers' + subpart_vec_t subparts); // subparts const LLWearableType::EType mWearableType; @@ -158,10 +158,10 @@ public: struct SubpartEntry final : public LLDictionaryEntry { SubpartEntry(ESubpart part, - const std::string &joint, + std::string joint, const std::string &edit_group, - const std::string ¶m_list, - const std::string &accordion_tab, + std::string param_list, + std::string accordion_tab, const LLVector3d &target_offset, const LLVector3d &camera_offset, const ESex &sex); @@ -249,17 +249,17 @@ LLEditWearableDictionary::Wearables::Wearables() LLEditWearableDictionary::WearableEntry::WearableEntry(LLWearableType::EType type, const std::string &title, - const std::string &desc_title, - const texture_vec_t& color_swatches, - const texture_vec_t& texture_pickers, - const subpart_vec_t& subparts) : + std::string desc_title, + texture_vec_t color_swatches, + texture_vec_t texture_pickers, + subpart_vec_t subparts) : LLDictionaryEntry(title), mWearableType(type), mTitle(title), - mDescTitle(desc_title), - mSubparts(subparts), - mColorSwatchCtrls(color_swatches), - mTextureCtrls(texture_pickers) + mDescTitle(std::move(desc_title)), + mSubparts(std::move(subparts)), + mColorSwatchCtrls(std::move(color_swatches)), + mTextureCtrls(std::move(texture_pickers)) {} LLEditWearableDictionary::Subparts::Subparts() @@ -309,19 +309,19 @@ LLEditWearableDictionary::Subparts::Subparts() } LLEditWearableDictionary::SubpartEntry::SubpartEntry(ESubpart part, - const std::string &joint, + std::string joint, const std::string &edit_group, - const std::string ¶m_list, - const std::string &accordion_tab, + std::string param_list, + std::string accordion_tab, const LLVector3d &target_offset, const LLVector3d &camera_offset, const ESex &sex) : LLDictionaryEntry(edit_group), mSubpart(part), - mTargetJoint(joint), + mTargetJoint(std::move(joint)), mEditGroup(edit_group), - mParamList(param_list), - mAccordionTab(accordion_tab), + mParamList(std::move(param_list)), + mAccordionTab(std::move(accordion_tab)), mTargetOffset(target_offset), mCameraOffset(camera_offset), mSex(sex) diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 5a3e826d05..ac0854be8a 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llpanelobjectinventory.h" +#include <utility> #include "llmenugl.h" #include "llnotificationsutil.h" @@ -92,7 +93,7 @@ protected: public: LLTaskInvFVBridge(LLPanelObjectInventory* panel, const LLUUID& uuid, - const std::string& name, + std::string name, U32 flags=0); virtual ~LLTaskInvFVBridge() = default; @@ -160,11 +161,11 @@ public: LLTaskInvFVBridge::LLTaskInvFVBridge( LLPanelObjectInventory* panel, const LLUUID& uuid, - const std::string& name, + std::string name, U32 flags) : LLFolderViewModelItemInventory(panel->getRootViewModel()), mUUID(uuid), - mName(name), + mName(std::move(name)), mPanel(panel), mFlags(flags), mAssetType(LLAssetType::AT_NONE), diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index cd84312fbb..66a98d5b07 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -27,6 +27,7 @@ #ifndef LL_LLPANELOUTFITEDIT_H #define LL_LLPANELOUTFITEDIT_H +#include <utility> #include "llpanel.h" #include "v3dmath.h" @@ -107,14 +108,14 @@ public: std::string displayName; U64 inventoryMask; LLLookItemType() : displayName("NONE"), inventoryMask(0) {} - LLLookItemType(std::string name, U64 mask) : displayName(name), inventoryMask(mask) {} + LLLookItemType(std::string name, U64 mask) : displayName(std::move(name)), inventoryMask(mask) {} }; struct LLFilterItem { std::string displayName; LLInventoryCollectFunctor* collector; LLFilterItem() : displayName("NONE"), collector(nullptr) {} - LLFilterItem(std::string name, LLInventoryCollectFunctor* _collector) : displayName(name), collector(_collector) {} + LLFilterItem(std::string name, LLInventoryCollectFunctor* _collector) : displayName(std::move(name)), collector(_collector) {} ~LLFilterItem() { delete collector; } //the struct is not supposed to by copied, either way the destructor kills collector diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 7327fde88b..3e6a0cea0c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -40,6 +40,7 @@ #include "lltoggleablemenu.h" #include "llpanelpeople.h" +#include <utility> // newview #include "llaccordionctrl.h" @@ -253,7 +254,7 @@ class LLPanelPeople::Updater public: typedef std::function<void()> callback_t; Updater(callback_t cb) - : mCallback(cb) + : mCallback(std::move(cb)) { } diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 834aff8255..4171da2806 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llpanelplaces.h" +#include <utility> #include "llassettype.h" #include "lltimer.h" @@ -720,7 +721,7 @@ class LLUpdateLandmarkParent final : public LLInventoryCallback { public: LLUpdateLandmarkParent(LLPointer<LLViewerInventoryItem> item, LLUUID new_parent) : - mItem(item), + mItem(std::move(item)), mNewParentId(new_parent) {}; void fire(const LLUUID& inv_item_id) override diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 038a4b0f29..0baba0ab54 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -41,11 +41,11 @@ #include "llfloatersidepanelcontainer.h" #include "llnotificationsutil.h" #include "lltextbox.h" -#include "lltoggleablemenu.h" #include "llviewermenu.h" #include "lllandmarkactions.h" #include "llclipboard.h" #include "lltrans.h" +#include <utility> // Maximum number of items that can be added to a list in one pass. // Used to limit time spent for items list update per frame. @@ -56,8 +56,8 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; class LLTeleportHistoryFlatItem final : public LLPanel { public: - LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, - LLDate date, const std::string &hl); + LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, std::string region_name, + LLDate date, std::string hl); virtual ~LLTeleportHistoryFlatItem(); BOOL postBuild() override; @@ -130,13 +130,14 @@ private: //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, - LLDate date, const std::string &hl) +LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, + std::string region_name, + LLDate date, std::string hl) : LLPanel(), mContextMenu(context_menu), mIndex(index), - mRegionName(region_name), - mHighlight(hl), + mRegionName(std::move(region_name)), + mHighlight(std::move(hl)), mDate(date) { buildFromFile( "panel_teleport_history_item.xml"); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 0911404b63..44096eca41 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -32,6 +32,7 @@ #include "llfloaterimcontainer.h" #include "llparticipantlist.h" #include "llspeakers.h" +#include <utility> //LLParticipantList retrieves add, clear and remove events and updates view accordingly @@ -54,8 +55,8 @@ public: typedef std::function<void(const LLUUID& speaker_id)> process_avaline_callback_t; LLAvalineUpdater(process_avaline_callback_t found_cb, process_avaline_callback_t removed_cb) - : mAvalineFoundCallback(found_cb) - , mAvalineRemovedCallback(removed_cb) + : mAvalineFoundCallback(std::move(found_cb)) + , mAvalineRemovedCallback(std::move(removed_cb)) { LLVoiceClient::getInstance()->addObserver(this); } diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 7a4759aeb2..131c5f41f7 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -29,6 +29,7 @@ #include "llviewerprecompiledheaders.h" #include "llpathfindingmanager.h" +#include <utility> #include "llagent.h" #include "llhttpnode.h" @@ -829,7 +830,7 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c //--------------------------------------------------------------------------- LinksetsResponder::LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested) : mRequestId(pRequestId), - mLinksetsCallback(pLinksetsCallback), + mLinksetsCallback(std::move(pLinksetsCallback)), mObjectMessagingState(pIsObjectRequested ? kWaiting : kNotRequested), mTerrainMessagingState(pIsTerrainRequested ? kWaiting : kNotRequested), mObjectLinksetListPtr(), diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index f9a43c3726..2c6249aa0a 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -30,15 +30,12 @@ #include "llviewerprecompiledheaders.h" #include "linden_common.h" -#include "m3math.h" -#include "v3dmath.h" - #include "llphysicsmotion.h" -#include "llagent.h" #include "llcharacter.h" #include "llviewercontrol.h" #include "llviewervisualparam.h" #include "llvoavatarself.h" +#include <utility> typedef std::map<std::string, std::string> controller_map_t; typedef std::map<std::string, F32> default_controller_map_t; @@ -96,19 +93,19 @@ public: controllers: The various settings (e.g. spring force, mass) that determine how the body part behaves. */ - LLPhysicsMotion(const std::string ¶m_driver_name, - const std::string &joint_name, + LLPhysicsMotion(std::string param_driver_name, + std::string joint_name, LLCharacter *character, const LLVector3 &motion_direction_vec, - const controller_map_t &controllers) : - mParamDriverName(param_driver_name), + controller_map_t controllers) : + mParamDriverName(std::move(param_driver_name)), mMotionDirectionVec(motion_direction_vec), - mJointName(joint_name), + mJointName(std::move(joint_name)), mPosition_local(0), mVelocityJoint_local(0), mPositionLastUpdate_local(0), mParamDriver(nullptr), - mParamControllers(controllers), + mParamControllers(std::move(controllers)), mCharacter(character), mLastTime(0) { diff --git a/indra/newview/llpostcard.cpp b/indra/newview/llpostcard.cpp index d5775042c1..995b51d6f7 100644 --- a/indra/newview/llpostcard.cpp +++ b/indra/newview/llpostcard.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llpostcard.h" +#include <utility> #include "llvfile.h" #include "llvfs.h" @@ -44,10 +45,10 @@ LLPostcardUploadInfo::LLPostcardUploadInfo(std::string nameFrom, std::string ema std::string subject, std::string message, LLVector3d globalPosition, LLPointer<LLImageFormatted> image, invnUploadFinish_f finish) : LLBufferedAssetUploadInfo(LLUUID::null, image, finish), - mNameFrom(nameFrom), - mEmailTo(emailTo), - mSubject(subject), - mMessage(message), + mNameFrom(std::move(nameFrom)), + mEmailTo(std::move(emailTo)), + mSubject(std::move(subject)), + mMessage(std::move(message)), mGlobalPosition(globalPosition) { } diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 6ad33f92e8..b586bff6e9 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llpreviewgesture.h" +#include <utility> #include "llagent.h" #include "llanimstatelabels.h" @@ -1017,9 +1018,9 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture) // after the save finishes. struct LLSaveInfo { - LLSaveInfo(const LLUUID& item_id, const LLUUID& object_id, const std::string& desc, + LLSaveInfo(const LLUUID& item_id, const LLUUID& object_id, std::string desc, const LLTransactionID tid) - : mItemUUID(item_id), mObjectUUID(object_id), mDesc(desc), mTransactionID(tid) + : mItemUUID(item_id), mObjectUUID(object_id), mDesc(std::move(desc)), mTransactionID(tid) { } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 11b44e784e..3dd69eb952 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llpreviewscript.h" +#include <utility> #include "llassetstorage.h" #include "llbutton.h" @@ -122,7 +123,7 @@ static bool have_script_upload_cap(LLUUID& object_id) LLLiveLSLFile::LLLiveLSLFile(std::string file_path, change_callback_t change_cb) : LLLiveFile(file_path, 1.0) -, mOnChangeCallback(change_cb) +, mOnChangeCallback(std::move(change_cb)) , mIgnoreNextUpdate(false) { llassert(mOnChangeCallback); @@ -340,7 +341,7 @@ struct LLSECKeywordCompare LLScriptEdCore::LLScriptEdCore( LLScriptEdContainer* container, - const std::string& sample, + std::string sample, const LLHandle<LLFloater>& floater_handle, void (*load_callback)(void*), void (*save_callback)(void*, BOOL), @@ -351,7 +352,7 @@ LLScriptEdCore::LLScriptEdCore( : LLPanel(), mLive(live), - mSampleText(sample), + mSampleText(std::move(sample)), mEditor( NULL ), mLoadCallback( load_callback ), mSaveCallback( save_callback ), @@ -1481,8 +1482,8 @@ struct LLScriptSaveInfo std::string mDescription; LLTransactionID mTransactionID; - LLScriptSaveInfo(const LLUUID& uuid, const std::string& desc, LLTransactionID tid) : - mItemUUID(uuid), mDescription(desc), mTransactionID(tid) {} + LLScriptSaveInfo(const LLUUID& uuid, std::string desc, LLTransactionID tid) : + mItemUUID(uuid), mDescription(std::move(desc)), mTransactionID(tid) {} }; diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index fd9e414a2c..fd8fcd0548 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -82,7 +82,7 @@ protected: // Supposed to be invoked only by the container. LLScriptEdCore( LLScriptEdContainer* container, - const std::string& sample, + std::string sample, const LLHandle<LLFloater>& floater_handle, void (*load_callback)(void* userdata), void (*save_callback)(void* userdata, BOOL close_after_save), diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index d72f8afc51..41730c9d39 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -27,6 +27,7 @@ #ifndef LL_LLSCREENCHANNEL_H #define LL_LLSCREENCHANNEL_H +#include <utility> #include "lltoast.h" namespace LLNotificationsUI @@ -233,7 +234,7 @@ private: class ToastElem { public: - ToastElem(const LLHandle<LLToast>& toast) : mToast(toast) + ToastElem(LLHandle<LLToast> toast) : mToast(std::move(toast)) { } diff --git a/indra/newview/llscriptruntimeperms.h b/indra/newview/llscriptruntimeperms.h index 0508041f36..edefa8917e 100644 --- a/indra/newview/llscriptruntimeperms.h +++ b/indra/newview/llscriptruntimeperms.h @@ -27,12 +27,14 @@ #ifndef LL_LLSCRIPTRUNTIME_PERMS_H #define LL_LLSCRIPTRUNTIME_PERMS_H +#include <utility> + typedef struct _script_perm { std::string question; U32 permbit; bool caution; - _script_perm(const std::string& q, const U32 b, const bool c) : - question(q), permbit(b), caution(c) {} + _script_perm(std::string q, const U32 b, const bool c) : + question(std::move(q)), permbit(b), caution(c) {} } script_perm_t; const U32 NUM_SCRIPT_PERMISSIONS = 16; diff --git a/indra/newview/llsculptidsize.h b/indra/newview/llsculptidsize.h index 679fcbd44c..5dff03a4df 100644 --- a/indra/newview/llsculptidsize.h +++ b/indra/newview/llsculptidsize.h @@ -31,6 +31,7 @@ //std #include <set> +#include <utility> //boost #include "boost/multi_index_container.hpp" #include "boost/multi_index/ordered_index.hpp" @@ -57,7 +58,7 @@ public: Info(const LLDrawable *drawable, int size, PtrSizeSum sizeInfo, LLUUID sculptId) : mDrawable(drawable) , mSize(size) - , mSharedSizeSum(sizeInfo) + , mSharedSizeSum(std::move(sizeInfo)) , mSculptId(sculptId) {} diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp index a559739e52..611d2defa6 100644 --- a/indra/newview/llsearchcombobox.cpp +++ b/indra/newview/llsearchcombobox.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llsearchcombobox.h" +#include <utility> #include "llkeyboard.h" #include "lltrans.h" // for LLTrans::getString() @@ -35,7 +36,7 @@ static LLDefaultChildRegistry::Register<LLSearchComboBox> r1("search_combo_box") class LLSearchHistoryBuilder { public: - LLSearchHistoryBuilder(LLSearchComboBox* combo_box, const std::string& filter); + LLSearchHistoryBuilder(LLSearchComboBox* combo_box, std::string filter); virtual void buildSearchHistory(); @@ -202,9 +203,9 @@ BOOL LLSearchComboBox::handleKeyHere(KEY key,MASK mask ) return LLComboBox::handleKeyHere(key, mask); } -LLSearchHistoryBuilder::LLSearchHistoryBuilder(LLSearchComboBox* combo_box, const std::string& filter) +LLSearchHistoryBuilder::LLSearchHistoryBuilder(LLSearchComboBox* combo_box, std::string filter) : mComboBox(combo_box) -, mFilter(filter) +, mFilter(std::move(filter)) { } diff --git a/indra/newview/llsearchhistory.h b/indra/newview/llsearchhistory.h index 1c881add64..ccaf675327 100644 --- a/indra/newview/llsearchhistory.h +++ b/indra/newview/llsearchhistory.h @@ -27,6 +27,7 @@ #ifndef LL_LLSEARCHHISTORY_H #define LL_LLSEARCHHISTORY_H +#include <utility> #include "llsingleton.h" #include "llinitdestroyclass.h" #include "llui.h" @@ -84,8 +85,8 @@ public: LLSearchHistoryItem() {} - LLSearchHistoryItem(const std::string& query) - : search_query(query) + LLSearchHistoryItem(std::string query) + : search_query(std::move(query)) {} LLSearchHistoryItem(const LLSD& item) diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 22968a9110..ea78919e47 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -32,6 +32,7 @@ #include "llpointer.h" #include "llsdutil.h" +#include <utility> #include <vector> #include <ostream> @@ -63,7 +64,7 @@ class LLCredential : public LLThreadSafeRefCount { public: LLCredential() {} - LLCredential(const std::string& grid) : mGrid(grid) {} + LLCredential(std::string grid) : mGrid(std::move(grid)) {} virtual ~LLCredential() {} diff --git a/indra/newview/llsecapicerthandler.h b/indra/newview/llsecapicerthandler.h index 0436abe7ce..c14b13c438 100644 --- a/indra/newview/llsecapicerthandler.h +++ b/indra/newview/llsecapicerthandler.h @@ -167,7 +167,7 @@ public: class iterator { public: - iterator(const LLPointer<iterator_impl>& impl) : mImpl(impl) {} + iterator(LLPointer<iterator_impl> impl) : mImpl(std::move(impl)) {} iterator() : mImpl(nullptr) {} iterator(const iterator& _iter) {mImpl = _iter.mImpl->clone(); } ~iterator() = default; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index c8228295ed..ba5536042e 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llspeakers.h" +#include <utility> #include "llagent.h" #include "llavatarnamecache.h" @@ -176,7 +177,7 @@ bool LLSortRecentSpeakers::operator()(const LLPointer<LLSpeaker> lhs, const LLPo LLSpeakerActionTimer::LLSpeakerActionTimer(action_callback_t action_cb, F32 action_period, const LLUUID& speaker_id) : LLEventTimer(action_period) -, mActionCallback(action_cb) +, mActionCallback(std::move(action_cb)) , mSpeakerId(speaker_id) { } @@ -196,7 +197,7 @@ void LLSpeakerActionTimer::unset() } LLSpeakersDelayActionsStorage::LLSpeakersDelayActionsStorage(LLSpeakerActionTimer::action_callback_t action_cb, F32 action_delay) -: mActionCallback(action_cb) +: mActionCallback(std::move(action_cb)) , mActionDelay(action_delay) { } diff --git a/indra/newview/llteleporthistory.h b/indra/newview/llteleporthistory.h index b637e72f40..346e56b80d 100644 --- a/indra/newview/llteleporthistory.h +++ b/indra/newview/llteleporthistory.h @@ -27,6 +27,7 @@ #ifndef LL_LLTELEPORTHISTORY_H #define LL_LLTELEPORTHISTORY_H +#include <utility> #include "llteleporthistorystorage.h" @@ -42,7 +43,7 @@ public: {} LLTeleportHistoryItem(std::string title, LLVector3d global_pos) - : mTitle(title), mGlobalPos(global_pos) + : mTitle(std::move(title)), mGlobalPos(global_pos) {} /** diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index 68d2ef5374..11a0bcad0d 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -27,6 +27,7 @@ #ifndef LL_LLTELEPORTHISTORYSTORAGE_H #define LL_LLTELEPORTHISTORYSTORAGE_H +#include <utility> #include "lldate.h" #include "v3dmath.h" @@ -43,12 +44,12 @@ public: LLTeleportHistoryPersistentItem() {} - LLTeleportHistoryPersistentItem(const std::string& title, const LLVector3d& global_pos) - : mTitle(title), mGlobalPos(global_pos), mDate(LLDate::now()) + LLTeleportHistoryPersistentItem(std::string title, const LLVector3d& global_pos) + : mTitle(std::move(title)), mGlobalPos(global_pos), mDate(LLDate::now()) {} - LLTeleportHistoryPersistentItem(const std::string& title, const LLVector3d& global_pos, const LLDate& date) - : mTitle(title), mGlobalPos(global_pos), mDate(date) + LLTeleportHistoryPersistentItem(std::string title, const LLVector3d& global_pos, const LLDate& date) + : mTitle(std::move(title)), mGlobalPos(global_pos), mDate(date) {} LLTeleportHistoryPersistentItem(const LLSD& val); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index d68fc7440d..5b563142ee 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "lltexturecache.h" +#include <utility> #include "llapr.h" #include "lldir.h" @@ -161,12 +162,12 @@ protected: class LLTextureCacheLocalFileWorker final : public LLTextureCacheWorker { public: - LLTextureCacheLocalFileWorker(LLTextureCache* cache, U32 priority, const std::string& filename, const LLUUID& id, + LLTextureCacheLocalFileWorker(LLTextureCache* cache, U32 priority, std::string filename, const LLUUID& id, U8* data, S32 datasize, S32 offset, S32 imagesize, // for writes LLTextureCache::Responder* responder) : LLTextureCacheWorker(cache, priority, id, data, datasize, offset, imagesize, responder), - mFileName(filename) + mFileName(std::move(filename)) { } @@ -290,7 +291,7 @@ public: LLTextureCache::Responder* responder) : LLTextureCacheWorker(cache, priority, id, data, datasize, offset, imagesize, responder), mState(INIT), - mRawImage(raw), + mRawImage(std::move(raw)), mRawDiscardLevel(discardlevel) { } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index dd4cba9684..49cb68fc75 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "lltexturefetch.h" +#include <utility> #include "lldir.h" #include "llhttpconstants.h" @@ -436,7 +437,7 @@ public: protected: LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, - const std::string& url, const LLUUID& id, const LLHost& host, + std::string url, const LLUUID& id, const LLHost& host, F32 priority, S32 discard, S32 size); private: @@ -824,7 +825,7 @@ public: * ownership of the copy and disposes of it * when done. */ - TFReqSendMetrics(const std::string & caps_url, + TFReqSendMetrics(std::string caps_url, const LLUUID & session_id, const LLUUID & agent_id, LLSD& stats_sd); @@ -887,7 +888,7 @@ volatile bool LLTextureFetch::svMetricsDataBreak(true); // Start with a data bre LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, // Fetched image type - const std::string& url, // Optional URL + std::string url, // Optional URL const LLUUID& id, // Image UUID const LLHost& host, // Simulator host F32 priority, // Priority @@ -901,7 +902,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mFTType(f_type), mID(id), mHost(host), - mUrl(url), + mUrl(std::move(url)), mImagePriority(priority), mWorkPriority(0), mRequestedPriority(0.f), @@ -4009,12 +4010,12 @@ TFReqSetRegion::doWork(LLTextureFetch *) return true; } -TFReqSendMetrics::TFReqSendMetrics(const std::string & caps_url, +TFReqSendMetrics::TFReqSendMetrics(std::string caps_url, const LLUUID & session_id, const LLUUID & agent_id, LLSD& stats_sd): LLTextureFetch::TFRequest(), - mCapsURL(caps_url), + mCapsURL(std::move(caps_url)), mSessionID(session_id), mAgentID(agent_id), mStatsSD(stats_sd), diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 2f6e002c37..6308f59fcd 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "lltool.h" +#include <utility> #include "indra_constants.h" #include "llerror.h" @@ -45,9 +46,9 @@ extern BOOL gDebugClicks; //static const std::string LLTool::sNameNull("null"); -LLTool::LLTool( const std::string& name, LLToolComposite* composite ) : +LLTool::LLTool(std::string name, LLToolComposite* composite ) : mComposite( composite ), - mName(name) + mName(std::move(name)) { } diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index 1548d4d051..dbf5613787 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -42,7 +42,7 @@ class LLTool : public LLMouseHandler, public LLThreadSafeRefCount { public: - LLTool( const std::string& name, LLToolComposite* composite = nullptr ); + LLTool(std::string name, LLToolComposite* composite = nullptr ); virtual ~LLTool(); // Hack to support LLFocusMgr diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 467709dd55..ad6b37b9b7 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -40,10 +40,8 @@ #include "lleconomy.h" #include "llfloaterreg.h" #include "llfloatersnapshot.h" -#include "llgesturemgr.h" #include "llinventorypanel.h" #include "llnotificationsutil.h" -#include "llpreviewnotecard.h" #include "llpreviewgesture.h" #include "llpreviewscript.h" #include "llstatusbar.h" @@ -54,6 +52,7 @@ #include "llviewerstats.h" #include "llviewertexturelist.h" #include "llvoavatarself.h" +#include <utility> void dialog_refresh_all(); @@ -66,8 +65,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId, U32 groupPerms, U32 everyonePerms, S32 expectedCost, bool showInventory) : mTransactionId(transactId), mAssetType(assetType), - mName(name), - mDescription(description), + mName(std::move(name)), + mDescription(std::move(description)), mCompressionInfo(compressionInfo), mDestinationFolderType(destinationType), mInventoryType(inventoryType), @@ -88,8 +87,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name, U32 nextOWnerPerms, U32 groupPerms, U32 everyonePerms, S32 expectedCost, bool showInventory) : mTransactionId(), mAssetType(LLAssetType::AT_NONE), - mName(name), - mDescription(description), + mName(std::move(name)), + mDescription(std::move(description)), mCompressionInfo(compressionInfo), mDestinationFolderType(destinationType), mInventoryType(inventoryType), @@ -108,7 +107,7 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name, LLResourceUploadInfo::LLResourceUploadInfo(LLAssetID assetId, LLAssetType::EType assetType, std::string name) : mTransactionId(), mAssetType(assetType), - mName(name), + mName(std::move(name)), mDescription(), mCompressionInfo(0), mDestinationFolderType(LLFolderType::FT_NONE), @@ -342,7 +341,7 @@ LLNewFileResourceUploadInfo::LLNewFileResourceUploadInfo( LLResourceUploadInfo(name, description, compressionInfo, destinationType, inventoryType, nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory), - mFileName(fileName) + mFileName(std::move(fileName)) { } @@ -559,8 +558,8 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID itemId, LLAssetType: 0, 0, 0, 0), mTaskUpload(false), mTaskId(LLUUID::null), - mContents(buffer), - mInvnFinishFn(finish), + mContents(std::move(buffer)), + mInvnFinishFn(std::move(finish)), mTaskFinishFn(NULL), mStoredToVFS(false) { @@ -574,7 +573,7 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID itemId, LLPointer<LL mTaskUpload(false), mTaskId(LLUUID::null), mContents(), - mInvnFinishFn(finish), + mInvnFinishFn(std::move(finish)), mTaskFinishFn(NULL), mStoredToVFS(false) { @@ -607,9 +606,9 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID taskId, LLUUID itemI 0, 0, 0, 0), mTaskUpload(true), mTaskId(taskId), - mContents(buffer), + mContents(std::move(buffer)), mInvnFinishFn(NULL), - mTaskFinishFn(finish), + mTaskFinishFn(std::move(finish)), mStoredToVFS(false) { setItemId(itemId); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 0173fcaf0e..d1f19919ab 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -28,27 +28,27 @@ #include "llviewerfoldertype.h" #include "lldictionary.h" -#include "llmemory.h" #include "llvisualparam.h" #include "llviewercontrol.h" +#include <utility> static const std::string empty_string; struct ViewerFolderEntry : public LLDictionaryEntry { // Constructor for non-ensembles - ViewerFolderEntry(const std::string &new_category_name, // default name when creating a new category of this type - const std::string &icon_name_open, // name of the folder icon - const std::string &icon_name_closed, + ViewerFolderEntry(std::string new_category_name, // default name when creating a new category of this type + std::string icon_name_open, // name of the folder icon + std::string icon_name_closed, BOOL is_quiet, // folder doesn't need a UI update when changed bool hide_if_empty, // folder not shown if empty const std::string &dictionary_name = empty_string // no reverse lookup needed on non-ensembles, so in most cases just leave this blank ) : LLDictionaryEntry(dictionary_name), - mIconNameOpen(icon_name_open), - mIconNameClosed(icon_name_closed), - mNewCategoryName(new_category_name), + mIconNameOpen(std::move(icon_name_open)), + mIconNameClosed(std::move(icon_name_closed)), + mNewCategoryName(std::move(new_category_name)), mIsQuiet(is_quiet), mHideIfEmpty(hide_if_empty) { @@ -57,7 +57,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry // Constructor for ensembles ViewerFolderEntry(const std::string &xui_name, // name of the xui menu item - const std::string &new_category_name, // default name when creating a new category of this type + std::string new_category_name, // default name when creating a new category of this type const std::string &icon_name, // name of the folder icon const std::string allowed_names // allowed item typenames for this folder type ) @@ -68,7 +68,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry mIconNameClosed(icon_name), */ mIconNameOpen("Inv_FolderOpen"), mIconNameClosed("Inv_FolderClosed"), - mNewCategoryName(new_category_name), + mNewCategoryName(std::move(new_category_name)), mIsQuiet(FALSE), mHideIfEmpty(false) { diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d13d551aab..41af5f4c39 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llviewerinventory.h" +#include <utility> #include "llnotificationsutil.h" #include "llsdserialize.h" @@ -1640,7 +1641,7 @@ class LLRemoveCategoryOnDestroy: public LLInventoryCallback public: LLRemoveCategoryOnDestroy(const LLUUID& cat_id, LLPointer<LLInventoryCallback> cb): mID(cat_id), - mCB(cb) + mCB(std::move(cb)) { } /* virtual */ void fire(const LLUUID& item_id) override {} diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 6b473ba602..0f08869af0 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -27,6 +27,7 @@ #ifndef LL_LLVIEWERINVENTORY_H #define LL_LLVIEWERINVENTORY_H +#include <utility> #include "llinventory.h" #include "llframetimer.h" #include "llwearable.h" @@ -286,8 +287,8 @@ public: LLBoostFuncInventoryCallback(inventory_func_type fire_func = no_op_inventory_func, nullary_func_type destroy_func = no_op): - mFireFunc(fire_func), - mDestroyFunc(destroy_func) + mFireFunc(std::move(fire_func)), + mDestroyFunc(std::move(destroy_func)) { } diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 56c5505381..6c238455a7 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -33,6 +33,7 @@ #include "llfilepicker.h" #include "llthread.h" #include <queue> +#include <utility> #include "llviewerassetupload.h" @@ -130,8 +131,8 @@ public: { } - LLFilePickerThread(LLFilePicker::ESaveFilter filter, const std::string &proposed_name) - : LLThread("file picker"), mProposedName(proposed_name), mSaveFilter(filter), mIsSaveDialog(true) + LLFilePickerThread(LLFilePicker::ESaveFilter filter, std::string proposed_name) + : LLThread("file picker"), mProposedName(std::move(proposed_name)), mSaveFilter(filter), mIsSaveDialog(true) { } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0a89ff9920..62a70b0c1a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -33,6 +33,7 @@ #include <boost/algorithm/string/replace.hpp> #include <boost/regex.hpp> #include <boost/tokenizer.hpp> +#include <utility> // Linden libraries #include "llanimationstates.h" @@ -817,9 +818,9 @@ class LLOpenAgentOffer : public LLInventoryFetchItemsObserver { public: LLOpenAgentOffer(const LLUUID& object_id, - const std::string& from_name) : + std::string from_name) : LLInventoryFetchItemsObserver(object_id), - mFromName(from_name) + mFromName(std::move(from_name)) { } diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index d9f4db4d11..7d3f2f6c35 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -59,6 +59,7 @@ #include <unordered_map> #include <unordered_set> #include <vector> +#include <utility> #include <absl/container/node_hash_set.h> #include <absl/container/node_hash_map.h> diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index e4e4da116a..8e7c4c7730 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -29,6 +29,7 @@ #include "llviewertexteditor.h" #include <stack> +#include <utility> #include "llagent.h" #include "llaudioengine.h" #include "llavataractions.h" @@ -166,7 +167,7 @@ class LLEmbeddedItemSegment final : public LLTextSegment public: LLEmbeddedItemSegment(S32 pos, LLUIImagePtr image, LLPointer<LLInventoryItem> inv_item, LLTextEditor& editor) : LLTextSegment(pos, pos + 1), - mImage(image), + mImage(std::move(image)), mLabel(utf8str_to_wstring(inv_item->getName())), mItem(inv_item), mEditor(editor) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e7be70900e..033bc4da99 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llviewertexture.h" +#include <utility> // Library includes #include "llmath.h" @@ -1090,9 +1091,9 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLImageRaw* raw, FTType f_t mGLTexturep->setNeedsAlphaAndPickMask(TRUE); } -LLViewerFetchedTexture::LLViewerFetchedTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps) +LLViewerFetchedTexture::LLViewerFetchedTexture(std::string url, FTType f_type, const LLUUID& id, BOOL usemipmaps) : LLViewerTexture(id, usemipmaps), - mUrl(url) + mUrl(std::move(url)) { init(TRUE); mFTType = f_type; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 8acefd8775..cb1653ef2d 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -278,7 +278,7 @@ protected: public: LLViewerFetchedTexture(const LLUUID& id, FTType f_type, const LLHost& host = LLHost(), BOOL usemipmaps = TRUE); LLViewerFetchedTexture(const LLImageRaw* raw, FTType f_type, BOOL usemipmaps); - LLViewerFetchedTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps = TRUE); + LLViewerFetchedTexture(std::string url, FTType f_type, const LLUUID& id, BOOL usemipmaps = TRUE); public: static F32 maxDecodePriority(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a1b453c0be..65d118477a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -36,6 +36,7 @@ #include <boost/filesystem.hpp> #include <boost/lambda/core.hpp> #include <boost/regex.hpp> +#include <utility> #include "llagent.h" #include "llagentcamera.h" @@ -246,7 +247,7 @@ class LLDebugText private: struct Line { - Line(const std::string& in_text, S32 in_x, S32 in_y) : text(in_text), x(in_x), y(in_y) {} + Line(std::string in_text, S32 in_x, S32 in_y) : text(std::move(in_text)), x(in_x), y(in_y) {} std::string text; S32 x,y; }; diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index d84b6de9a9..8e393d862a 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -31,12 +31,12 @@ #include "llimview.h" #include "llnotifications.h" #include "llnotificationsutil.h" -#include "llpanel.h" #include "llrecentpeople.h" #include "llviewercontrol.h" #include "llviewerregion.h" #include "llvoicechannel.h" #include "llcorehttputil.h" +#include <utility> LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; @@ -54,11 +54,11 @@ const U32 DEFAULT_RETRIES_COUNT = 3; // // LLVoiceChannel // -LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& session_name) : +LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, std::string session_name) : mCallDirection(OUTGOING_CALL), mSessionID(session_id), mState(STATE_NO_CHANNEL_INFO), - mSessionName(session_name), + mSessionName(std::move(session_name)), mCallEndedByAgent(false), mIgnoreNextSessionLeave(FALSE) { diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 1b13585bf9..334c589c87 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -63,7 +63,7 @@ public: static boost::signals2::connection setCurrentVoiceChannelChangedCallback(channel_changed_callback_t cb, bool at_front = false); - LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); + LLVoiceChannel(const LLUUID& session_id, std::string session_name); virtual ~LLVoiceChannel(); /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override; diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index c0a0cd7940..f1d7589375 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -28,6 +28,7 @@ class LLVOAvatar; +#include <utility> #include "lliopipe.h" #include "llpumpio.h" #include "llchainio.h" @@ -46,9 +47,9 @@ class LLVoiceDevice std::string display_name; // friendly value for the user std::string full_name; // internal value for selection - LLVoiceDevice(const std::string& display_name, const std::string& full_name) - :display_name(display_name) - ,full_name(full_name) + LLVoiceDevice(std::string display_name, std::string full_name) + :display_name(std::move(display_name)) + ,full_name(std::move(full_name)) { }; }; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 12de85b88f..6391ee6d9a 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -25,10 +25,12 @@ */ #include "llviewerprecompiledheaders.h" -#include <algorithm> + #include "llvoicevivox.h" #include "llsdutil.h" +#include <algorithm> +#include <utility> // Linden library includes #include "llavatarnamecache.h" @@ -39,7 +41,7 @@ #ifdef LL_USESYSTEMLIBS # include "expat.h" #else -# include "expat/expat.h" +# include <expat/expat.h> #endif #include "llcallbacklist.h" #include "llviewerregion.h" @@ -52,7 +54,6 @@ // Viewer includes #include "llmutelist.h" // to check for muted avatars #include "llagent.h" -#include "llcachename.h" #include "llimview.h" // for LLIMMgr #include "llparcel.h" #include "llviewerparcelmgr.h" @@ -63,7 +64,6 @@ #include "llviewercamera.h" #include "llversioninfo.h" -#include "llviewernetwork.h" #include "llnotificationsutil.h" #include "llcorehttputil.h" @@ -4189,8 +4189,8 @@ void LLVivoxVoiceClient::muteListChanged() ///////////////////////////// // Managing list of participants -LLVivoxVoiceClient::participantState::participantState(const std::string &uri) : - mURI(uri), +LLVivoxVoiceClient::participantState::participantState(std::string uri) : + mURI(std::move(uri)), mLastSpokeTimestamp(0.f), mPower(0.f), mVolume(LLVoiceClient::VOLUME_DEFAULT), diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index af4d1e2349..ef27c32eaf 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -270,7 +270,7 @@ protected: struct participantState { public: - participantState(const std::string &uri); + participantState(std::string uri); bool updateMuteState(); // true if mute state has changed bool isAvatar(); diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index bdffec2e2b..e617371274 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -27,6 +27,7 @@ #ifndef LL_WATER_PARAMMANAGER_H #define LL_WATER_PARAMMANAGER_H +#include <utility> #include "llwaterparamset.h" #include "llviewercamera.h" #include "v4color.h" @@ -42,8 +43,8 @@ struct WaterColorControl { bool mHasSliderName; /// only set slider name for true color types inline WaterColorControl(F32 red, F32 green, F32 blue, F32 alpha, - F32 intensity, const std::string& n, const std::string& sliderName = LLStringUtil::null) - : mR(red), mG(green), mB(blue), mA(alpha), mI(intensity), mName(n), mSliderName(sliderName) + F32 intensity, std::string n, std::string sliderName = LLStringUtil::null) + : mR(red), mG(green), mB(blue), mA(alpha), mI(intensity), mName(std::move(n)), mSliderName(std::move(sliderName)) { // if there's a slider name, say we have one mHasSliderName = false; @@ -100,8 +101,8 @@ struct WaterVector3Control std::string mName; // basic constructor - inline WaterVector3Control(F32 valX, F32 valY, F32 valZ, const std::string& n) - : mX(valX), mY(valY), mZ(valZ), mName(n) + inline WaterVector3Control(F32 valX, F32 valY, F32 valZ, std::string n) + : mX(valX), mY(valY), mZ(valZ), mName(std::move(n)) { } @@ -129,8 +130,8 @@ struct WaterVector2Control std::string mName; // basic constructor - inline WaterVector2Control(F32 valX, F32 valY, const std::string& n) - : mX(valX), mY(valY), mName(n) + inline WaterVector2Control(F32 valX, F32 valY, std::string n) + : mX(valX), mY(valY), mName(std::move(n)) { } @@ -155,8 +156,8 @@ struct WaterFloatControl std::string mName; F32 mMult; - inline WaterFloatControl(F32 val, const std::string& n, F32 m=1.0f) - : mX(val), mName(n), mMult(m) + inline WaterFloatControl(F32 val, std::string n, F32 m=1.0f) + : mX(val), mName(std::move(n)), mMult(m) { } @@ -185,8 +186,8 @@ struct WaterExpFloatControl std::string mName; F32 mBase; - inline WaterExpFloatControl(F32 val, const std::string& n, F32 b) - : mExp(val), mName(n), mBase(b) + inline WaterExpFloatControl(F32 val, std::string n, F32 b) + : mExp(val), mName(std::move(n)), mBase(b) { } diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 03b1725d8c..c493e12fcb 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llwearablelist.h" +#include <utility> #include "message.h" #include "llassetstorage.h" @@ -41,14 +42,14 @@ struct LLWearableArrivedData { LLWearableArrivedData(LLAssetType::EType asset_type, - const std::string& wearable_name, + std::string wearable_name, LLAvatarAppearance* avatarp, void(*asset_arrived_callback)(LLViewerWearable*, void* userdata), void* userdata) : mAssetType( asset_type ), mCallback( asset_arrived_callback ), mUserdata( userdata ), - mName( wearable_name ), + mName(std::move(wearable_name)), mRetries(0), mAvatarp(avatarp) {} diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index e9a0aa3327..70ddc8b285 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -42,10 +42,12 @@ #include "llsdutil.h" #include "stringize.h" -LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) +#include <utility> + +LLWindowListener::LLWindowListener(LLViewerWindow *window, KeyboardGetter kbgetter) : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), mWindow(window), - mKbGetter(kbgetter) + mKbGetter(std::move(kbgetter)) { std::string keySomething = "Given [\"keysym\"], [\"keycode\"] or [\"char\"], inject the specified "; @@ -115,7 +117,7 @@ private: Map mMap; public: - StringLookup(const std::string& desc): mDesc(desc) {} + StringLookup(std::string desc): mDesc(std::move(desc)) {} MAPPED lookup(const typename Map::key_type& key) const { diff --git a/indra/newview/llwindowlistener.h b/indra/newview/llwindowlistener.h index 426440c9ca..1aee63030f 100644 --- a/indra/newview/llwindowlistener.h +++ b/indra/newview/llwindowlistener.h @@ -37,7 +37,7 @@ class LLWindowListener : public LLEventAPI { public: typedef std::function<LLKeyboard*()> KeyboardGetter; - LLWindowListener(LLViewerWindow * window, const KeyboardGetter& kbgetter); + LLWindowListener(LLViewerWindow * window, KeyboardGetter kbgetter); void getInfo(LLSD const & evt); void getPaths(LLSD const & evt); diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index bb5d69ab64..2c57aa16a2 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -27,6 +27,7 @@ #ifndef LL_WLPARAMMANAGER_H #define LL_WLPARAMMANAGER_H +#include <utility> #include "llenvmanager.h" #include "llwlparamset.h" #include "llwlanimator.h" @@ -47,8 +48,8 @@ struct WLColorControl { bool isBlueHorizonOrDensity; /// flag for if it's the Blue Horizon or Density color controller inline WLColorControl(F32 red, F32 green, F32 blue, F32 intensity, - const std::string& n, const std::string& sliderName = LLStringUtil::null) - : r(red), g(green), b(blue), i(intensity), mName(n), mSliderName(sliderName) + std::string n, std::string sliderName = LLStringUtil::null) + : r(red), g(green), b(blue), i(intensity), mName(std::move(n)), mSliderName(std::move(sliderName)) { // if there's a slider name, say we have one hasSliderName = false; @@ -95,8 +96,8 @@ struct WLFloatControl { std::string mName; F32 mult; - inline WLFloatControl(F32 val, const std::string& n, F32 m=1.0f) - : x(val), mName(n), mult(m) + inline WLFloatControl(F32 val, std::string n, F32 m=1.0f) + : x(val), mName(std::move(n)), mult(m) { } diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 94037ead3d..f6e4f44d3b 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llworldmap.h" +#include <utility> #include "llworldmapmessage.h" #include "message.h" @@ -45,9 +46,9 @@ const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // Seconds before we consider re-re //--------------------------------------------------------------------------- LLItemInfo::LLItemInfo(F32 global_x, F32 global_y, - const std::string& name, + std::string name, LLUUID id) -: mName(name), +: mName(std::move(name)), mToolTip(""), mPosGlobal(global_x, global_y, 40.0), mID(id), diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index 236b8fb1dc..374e112e4b 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -57,7 +57,7 @@ const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a; class LLItemInfo { public: - LLItemInfo(F32 global_x, F32 global_y, const std::string& name, LLUUID id); + LLItemInfo(F32 global_x, F32 global_y, std::string name, LLUUID id); // Setters void setTooltip(const std::string& tooltip) { mToolTip = tooltip; } diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index e87b8f9b77..7ae291aa9e 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -32,6 +32,7 @@ // associated header #include "llxmlrpclistener.h" // external library headers +#include <utility> #include <xmlrpc-epi/xmlrpc.h> #include <curl/curl.h> @@ -47,8 +48,8 @@ class StatusMapperBase typedef std::map<STATUS, std::string> MapType; public: - StatusMapperBase(const std::string& desc): - mDesc(desc) + StatusMapperBase(std::string desc): + mDesc(std::move(desc)) {} std::string lookup(STATUS status) const diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 197637646d..1db1b91093 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -44,6 +44,7 @@ // Have to include these last to avoid queue redefinition! #include <xmlrpc-epi/xmlrpc.h> +#include <utility> #include "llappviewer.h" #include "lltrans.h" @@ -201,8 +202,8 @@ public: std::string mCertStore; LLSD mErrorCertData; - Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams); - Impl(const std::string& uri, + Impl(std::string uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams); + Impl(std::string uri, const std::string& method, LLXMLRPCValue params, bool useGzip); ~Impl(); @@ -307,22 +308,22 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, //========================================================================= -LLXMLRPCTransaction::Impl::Impl(const std::string& uri, +LLXMLRPCTransaction::Impl::Impl(std::string uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) : mHttpRequest(), mStatus(LLXMLRPCTransaction::StatusNotStarted), - mURI(uri), + mURI(std::move(uri)), mResponse(nullptr) { init(request, useGzip, httpParams); } -LLXMLRPCTransaction::Impl::Impl(const std::string& uri, +LLXMLRPCTransaction::Impl::Impl(std::string uri, const std::string& method, LLXMLRPCValue params, bool useGzip) : mHttpRequest(), mStatus(LLXMLRPCTransaction::StatusNotStarted), - mURI(uri), + mURI(std::move(uri)), mResponse(nullptr) { XMLRPC_REQUEST request = XMLRPC_RequestNew(); -- GitLab