diff --git a/indra/newview/alviewermenu.cpp b/indra/newview/alviewermenu.cpp index 346a2c19c293b2c5c5a5b67ec4e5a057508c9681..cce4bdc6ee35e29075c1f49a4498954005197a11 100644 --- a/indra/newview/alviewermenu.cpp +++ b/indra/newview/alviewermenu.cpp @@ -69,7 +69,7 @@ void al_handle_object_derender() LLSelectMgr* select_mgr = LLSelectMgr::getInstance(); LLObjectSelectionHandle selection = select_mgr->getSelection(); std::vector<LLViewerObject*> objects; - for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); iter++) + for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter) { LLSelectNode* nodep = *iter; if (!nodep) @@ -124,7 +124,7 @@ class LLEnableEditParticleSource : public view_listener_t { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::valid_root_iterator iter = selection->valid_root_begin(); - iter != selection->valid_root_end(); iter++) + iter != selection->valid_root_end(); ++iter) { LLSelectNode* node = *iter; if (node->mPermissions->getOwner() == gAgent.getID()) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 02bf9a433b90bf6a533e7929d147eb410b67ab90..d6ba90114bdd1893627f019de13b740d0d9e2e86 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2684,7 +2684,7 @@ bool LLAgent::canAccessMaturityInRegion( U64 region_handle ) const return true; } -bool LLAgent::canAccessMaturityAtGlobal( LLVector3d pos_global ) const +bool LLAgent::canAccessMaturityAtGlobal(const LLVector3d& pos_global ) const { U64 region_handle = to_region_handle_global( pos_global.mdV[0], pos_global.mdV[1] ); return canAccessMaturityInRegion( region_handle ); diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 6b622bd49217bfaca4129ed201d6e2495f2fa0d3..0d45a82c48e3fe21f00b22d6af9ac0f224cb81df 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -794,7 +794,7 @@ public: bool canAccessMature() const; bool canAccessAdult() const; bool canAccessMaturityInRegion( U64 region_handle ) const; - bool canAccessMaturityAtGlobal( LLVector3d pos_global ) const; + bool canAccessMaturityAtGlobal( const LLVector3d& pos_global ) const; bool prefersPG() const; bool prefersMature() const; bool prefersAdult() const; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 5ba2235d0604f1caf6491fd6c3dcb75dd486fca8..970a3691344729ac1fe5600e6567fe6fb9057875 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -395,7 +395,7 @@ void LLAgentCamera::slamLookAt(const LLVector3 &look_at) //----------------------------------------------------------------------------- // calcFocusOffset() //----------------------------------------------------------------------------- -LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 original_focus_point, S32 x, S32 y) const +LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, const LLVector3& original_focus_point, S32 x, S32 y) const { LLMatrix4 obj_matrix = object->getRenderMatrix(); LLQuaternion obj_rot = object->getRenderRotation(); @@ -2027,7 +2027,7 @@ bool LLAgentCamera::allowFocusOffsetChange(const LLVector3d& offsetFocus) return true; } -bool LLAgentCamera::clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d posCamRefGlobal, float nDistMin, float nDistMax) +bool LLAgentCamera::clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d& posCamRefGlobal, float nDistMin, float nDistMax) { const LLVector3d offsetCamera = posCamGlobal - posCamRefGlobal; diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 83b83d22730882a228021275a05c938849b866d7..1ab90242f2a7d1d8c86bce09eb8a2f5af5853eb1 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -204,7 +204,7 @@ private: //-------------------------------------------------------------------- public: LLVector3d calcFocusPositionTargetGlobal(); - LLVector3 calcFocusOffset(LLViewerObject *object, LLVector3 pos_agent, S32 x, S32 y) const; + LLVector3 calcFocusOffset(LLViewerObject *object, const LLVector3& pos_agent, S32 x, S32 y) const; BOOL getFocusOnAvatar() const { return mFocusOnAvatar; } LLPointer<LLViewerObject>& getFocusObject() { return mFocusObject; } F32 getFocusObjectDist() const { return mFocusObjectDist; } @@ -252,7 +252,7 @@ public: //-------------------------------------------------------------------- public: LLVector3d calcThirdPersonFocusOffset(); - void setThirdPersonHeadOffset(LLVector3 offset) { mThirdPersonHeadOffset = offset; } + void setThirdPersonHeadOffset(const LLVector3& offset) { mThirdPersonHeadOffset = offset; } private: LLVector3 mThirdPersonHeadOffset; // Head offset for third person camera position @@ -316,7 +316,7 @@ public: //-------------------------------------------------------------------- protected: bool allowFocusOffsetChange(const LLVector3d& offsetFocus); - bool clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d posCamRefGlobal, float nDistMin, float nDistMax); + bool clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d& posCamRefGlobal, float nDistMin, float nDistMax); bool m_fRlvMaxDist; // True if the camera is at max distance bool m_fRlvMinDist; // True if the camera is at min distance diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index c42d02137ed72e2009158b8b4e810896fed2d8b2..33c2a67657732d8bc5c0ad11e4c7c900c2012545 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -180,11 +180,11 @@ LLAvatarList::~LLAvatarList() void LLAvatarList::setShowIcons(std::string param_name) { - mIconParamName= param_name; + mIconParamName = std::move(param_name); mShowIcons = gSavedSettings.getBOOL(mIconParamName); } -std::string LLAvatarList::getAvatarName(LLAvatarName av_name) +std::string LLAvatarList::getAvatarName(const LLAvatarName& av_name) { return mShowCompleteName? av_name.getCompleteName(false) : av_name.getDisplayName(); } @@ -691,7 +691,7 @@ BOOL LLAvalineListItem::postBuild() setShowProfileBtn(false); setShowInfoBtn(false); mAvatarIcon->setValue("Avaline_Icon"); - mAvatarIcon->setToolTip(std::string("")); + mAvatarIcon->setToolTip(std::string()); } return rv; } diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 4faf689bc739a494a8ed80dbeb195a49e587fb4c..f083ec7c8ce7ec28a443d70fa1b43ee036ed8391 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -84,7 +84,7 @@ public: void setShowIcons(std::string param_name); bool getIconsVisible() const { return mShowIcons; } const std::string getIconParamName() const {return mIconParamName;} - std::string getAvatarName(LLAvatarName av_name); + std::string getAvatarName(const LLAvatarName& av_name); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 7602c79676d9c6d3105d4e43e4e5d1a12dbe9f77..2088cdf0b937b2db7231651a46b808956d1a348c 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -105,9 +105,9 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 const LLSD & agents = result[KEY_AGENTS]; if (agents.isMap()) { - for (LLSD::map_const_iterator agent_iter = agents.beginMap(); - agent_iter != agents.endMap(); - agent_iter++ + for (LLSD::map_const_iterator agent_iter = agents.beginMap(), agent_iter_end = agents.endMap(); + agent_iter != agent_iter_end; + ++agent_iter ) { LLUUID target_agent_id = LLUUID(agent_iter->first); @@ -209,10 +209,11 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U { avatar->calculateUpdateRenderComplexity(); // Make sure the numbers are up-to-date - LLSD info = LLSD::emptyMap(); U32 avatar_complexity = avatar->getVisualComplexity(); if (avatar_complexity > 0) { + LLSD info = LLSD::emptyMap(); + // the weight/complexity is unsigned, but LLSD only stores signed integers, // so if it's over that (which would be ridiculously high), just store the maximum signed int value info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); @@ -224,7 +225,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U num_avs++; } } - iter++; + ++iter; } // Reset this regions timer, moving to longer intervals if there are lots of avatars around diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 642473cfdeeb54f7f2f7389676de338631fb6b3c..3b173dc4616b41957a74992fb8b9324011646ffd 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -280,8 +280,8 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) int chars = 0; //Remove excessive chars if message does not fit in available height. MAINT-6891 - std::string::iterator it; - for (it = messageText.begin(); it < messageText.end() && lines < max_lines; it++) + std::string::iterator it = messageText.begin(); + for (auto it_end = messageText.end(); it < it_end && lines < max_lines; ++it) { if (*it == '\n') ++lines; diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 3eb4701cea3e8a09dae77cba0bf69e58133aa14c..5648ba5bb5dc3689bcbeccae94e773a6cc490b00 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -484,8 +484,7 @@ void LLChicletPanel::objectChicletCallback(const LLSD& data) bool new_message = data["new_message"]; std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(notification_id); - std::list<LLChiclet *>::iterator iter; - for (iter = chiclets.begin(); iter != chiclets.end(); iter++) + for (auto iter = chiclets.begin(), iter_end = chiclets.end(); iter != iter_end; ++iter) { LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*iter); if (chiclet != nullptr) diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 89dce658fa1d2cbcb1e3089efb58944ddfcd1d58..0fe99974df91decef6420d9fc45cf64335f00005 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -494,7 +494,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat std::string buffer = std::string("Compilation of \"") + inventory->getName() + std::string("\" failed:"); floater->addStringMessage(buffer); for (LLSD::array_const_iterator line = compile_errors.beginArray(); - line < compile_errors.endArray(); line++) + line < compile_errors.endArray(); ++line) { std::string str = line->asString(); str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index a3e74a5dc0a61e33636f1acf8742ac74cf60e6b5..f4ba0cb840d15bb79b143f6a77b7e569ee5914f1 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -505,8 +505,8 @@ void LLControlAvatar::updateAnimations() LLVOVolume *volp = *vol_it; //LL_INFOS("AnimatedObjects") << "updating anim for vol " << volp->getID() << " root " << mRootVolp->getID() << LL_ENDL; signaled_animation_map_t& signaled_animations = LLObjectSignaledAnimationMap::instance().getMap()[volp->getID()]; - for (auto anim_it = signaled_animations.begin(); - anim_it != signaled_animations.end(); + for (auto anim_it = signaled_animations.begin(), anim_it_end = signaled_animations.end(); + anim_it != anim_it_end; ++anim_it) { auto found_anim_it = anims.find(anim_it->first); diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 3cbecc064d5d97d6f31c38114f38a44349332557..40b8567eb3df6717a6bdee102aa3af8c37839f92 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -337,16 +337,15 @@ LLConversationItemParticipant* LLConversationItemSession::findParticipant(const // This is *not* a general tree parsing algorithm. It assumes that a session contains only // items (LLConversationItemParticipant) that have themselve no children. LLConversationItemParticipant* participant = nullptr; - child_list_t::iterator iter; - for (iter = mChildren.begin(); iter != mChildren.end(); iter++) + for (auto iter = mChildren.begin(), iter_end = mChildren.end(); iter != iter_end; ++iter) { participant = dynamic_cast<LLConversationItemParticipant*>(*iter); if (participant->hasSameValue(participant_id)) { - break; + return (iter == mChildren.end() ? NULL : participant); } } - return (iter == mChildren.end() ? NULL : participant); + return nullptr; } void LLConversationItemSession::setParticipantIsMuted(const LLUUID& participant_id, bool is_muted) @@ -449,8 +448,7 @@ bool LLConversationItemSession::getTime(F64& time) const F64 most_recent_time = mLastActiveTime; bool has_time = (most_recent_time > 0.1); LLConversationItemParticipant* participant = nullptr; - child_list_t::const_iterator iter; - for (iter = mChildren.begin(); iter != mChildren.end(); iter++) + for (auto iter = mChildren.begin(), iter_end = mChildren.end(); iter != iter_end; ++iter) { participant = dynamic_cast<LLConversationItemParticipant*>(*iter); F64 participant_time; diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index f4cc062ccba4ab9bb1bd8ee98eeac884e915781b..1aa2f055a5661c7939efcd7af16af9ff9de49e85 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -453,7 +453,7 @@ void LLConversationViewSession::refresh() } LLConversationViewParticipant* participant = nullptr; - for (auto iter = getItemsBegin(); iter != getItemsEnd(); iter++) + for (auto iter = getItemsBegin(); iter != getItemsEnd(); ++iter) { participant = dynamic_cast<LLConversationViewParticipant*>(*iter); if (participant) diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp index c91f8350cca4cc292045066218cc79d6d5ee885a..54584ad7029107d09e8a3cfcfe00f07864c04874 100644 --- a/indra/newview/lldaycyclemanager.cpp +++ b/indra/newview/lldaycyclemanager.cpp @@ -82,7 +82,7 @@ void LLDayCycleManager::getUserPresetNames(preset_name_list_t& user) const getPresetNames(user, sys); } -bool LLDayCycleManager::getPreset(const std::string name, LLWLDayCycle& day_cycle) const +bool LLDayCycleManager::getPreset(const std::string& name, LLWLDayCycle& day_cycle) const { dc_map_t::const_iterator it = mDayCycleMap.find(name); if (it == mDayCycleMap.end()) @@ -94,7 +94,7 @@ bool LLDayCycleManager::getPreset(const std::string name, LLWLDayCycle& day_cycl return true; } -bool LLDayCycleManager::getPreset(const std::string name, LLSD& day_cycle) const +bool LLDayCycleManager::getPreset(const std::string& name, LLSD& day_cycle) const { LLWLDayCycle dc; if (!getPreset(name, dc)) @@ -106,7 +106,7 @@ bool LLDayCycleManager::getPreset(const std::string name, LLSD& day_cycle) const return true; } -bool LLDayCycleManager::presetExists(const std::string name) const +bool LLDayCycleManager::presetExists(const std::string& name) const { LLWLDayCycle dummy; return getPreset(name, dummy); diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h index dab4f6458983d02d853215073ca52c5e5cb108ac..aaa34680ffad9eb9fcb0eab6a363fc852bb6b9bb 100644 --- a/indra/newview/lldaycyclemanager.h +++ b/indra/newview/lldaycyclemanager.h @@ -53,9 +53,9 @@ public: const std::string& findPreset(const std::string& strPresetName); // [/RLVa:KB] - bool getPreset(const std::string name, LLWLDayCycle& day_cycle) const; - bool getPreset(const std::string name, LLSD& day_cycle) const; - bool presetExists(const std::string name) const; + bool getPreset(const std::string& name, LLWLDayCycle& day_cycle) const; + bool getPreset(const std::string& name, LLSD& day_cycle) const; + bool presetExists(const std::string& name) const; bool isSystemPreset(const std::string& name) const; bool savePreset(const std::string& name, const LLSD& data); bool deletePreset(const std::string& name); diff --git a/indra/newview/lleasymessagereader.cpp b/indra/newview/lleasymessagereader.cpp index b85cfaf3c590b5fe41047b65819551d4580ceb93..43e20ed16b09f80b86bd8e3c3e791fd1bba0c3d2 100644 --- a/indra/newview/lleasymessagereader.cpp +++ b/indra/newview/lleasymessagereader.cpp @@ -31,13 +31,13 @@ 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 const& from_host) +LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data_len, const LLHost& from_host) { U32 fake_id = 0; return decodeTemplateMessage(data, data_len, from_host, fake_id); } -LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data_len, LLHost from_host, U32& sequence_id) +LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data_len, const LLHost& from_host, U32& sequence_id) { if(data_len > MAX_BUFFER_SIZE) { diff --git a/indra/newview/lleasymessagereader.h b/indra/newview/lleasymessagereader.h index 506ce32176f8f00b579d3d2af1ff3c639ec1eff2..2047906bb3a1684d9165dd5fac0be155fd29a855 100644 --- a/indra/newview/lleasymessagereader.h +++ b/indra/newview/lleasymessagereader.h @@ -31,8 +31,8 @@ public: LLEasyMessageReader(); ~LLEasyMessageReader(); - LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, LLHost const& from_host); - LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, LLHost from_host, U32& sequence_id); + LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, const LLHost& from_host); + LLMessageTemplate* decodeTemplateMessage(U8* data, S32 data_len, const LLHost& from_host, U32& sequence_id); S32 getNumberOfBlocks(const char *blockname); diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h index d981a86adbf6fcdfd09523389b68178674883b4d..29b8dc15bd5db11daa22f9eae4f306ac0253b770 100644 --- a/indra/newview/llenvmanager.h +++ b/indra/newview/llenvmanager.h @@ -106,7 +106,7 @@ public: scope = EScope(llsd[SCOPE_IDX].asInteger()); } - inline bool operator <(const LLWLParamKey other) const + inline bool operator <(const LLWLParamKey& other) const { if (name < other.name) { @@ -122,7 +122,7 @@ public: } } - inline bool operator ==(const LLWLParamKey other) const + inline bool operator ==(const LLWLParamKey& other) const { return (name == other.name) && (scope == other.scope); } diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 06b266d2a96e9142efdb8b11429a97c7b70b6cb6..63aaab3e28a0ffbc407ad97b34bc31f1e5258206 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -103,7 +103,7 @@ LLEventNotifier::~LLEventNotifier() for (iter = mEventNotifications.begin(); iter != mEventNotifications.end(); - iter++) + ++iter) { delete iter->second; } @@ -124,7 +124,7 @@ void LLEventNotifier::update() { LLEventNotification *np = iter->second; - iter++; + ++iter; if (np->getEventDateEpoch() < alert_time) { LLSD args; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 7c339dae839c86ac3ffc099bd2d6909057feaeef..de5c111c8071d899d608101c653e2690f96c02be 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1630,9 +1630,9 @@ S32 LLFastTimerView::updateTimerBarOffsets(LLTrace::BlockTimerStatHandle* time_b return timer_bar_index; } -S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered, bool visible, S32 bar_index) +S32 LLFastTimerView::drawBar(const LLRect& bar_rect, const TimerBarRow& row, S32 image_width, S32 image_height, bool hovered, bool visible, S32 bar_index) { - TimerBar& timer_bar = row.mBars[bar_index]; + const TimerBar& timer_bar = row.mBars[bar_index]; LLTrace::BlockTimerStatHandle* time_block = timer_bar.mTimeBlock; hovered |= mHoverID == time_block; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 74d79357272dfdd40c0827cdfbd6483d019dfe0b..d8ace6e014b1e2cde664c30f005f7c00a6817bc9 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -121,7 +121,7 @@ private: F32Seconds updateTimerBarWidths(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); S32 updateTimerBarOffsets(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 timer_bar_index = 0); - S32 drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0); + S32 drawBar(const LLRect& bar_rect, const TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0); void setPauseState(bool pause_state); std::deque<TimerBarRow> mTimerBarRows; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index a35bf3a9f1768c599c5a7cb6091bae1edc683a56..4c0bf246a0945075e36c4ccc39bcc8cdaa1a6ce5 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1012,7 +1012,7 @@ void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) void LLFavoritesBarCtrl::fitLabelWidth(LLMenuItemCallGL* menu_item) { U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); - std::string item_name = menu_item->getName(); + const std::string& item_name = menu_item->getName(); // Check whether item name wider than menu if (menu_item->getNominalWidth() > max_width) diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp index a02d1ad9757ef367370f502c5f25fe225de131dc..2a7a57f5f2382f9c7f8b63b0e88678bde48738fa 100644 --- a/indra/newview/llfloaterautoreplacesettings.cpp +++ b/indra/newview/llfloaterautoreplacesettings.cpp @@ -244,7 +244,7 @@ void LLFloaterAutoReplaceSettings::updateReplacementsList() const LLSD* mappings = mSettings.getListEntries(mSelectedListName); for ( LLSD::map_const_iterator entry = mappings->beginMap(), end = mappings->endMap(); entry != end; - entry++ + ++entry ) { LLSD row; @@ -641,7 +641,7 @@ bool LLFloaterAutoReplaceSettings::selectedListIsLast() LLSD lists = mSettings.getListNames(); // an Array of Strings for ( LLSD::array_const_iterator list = lists.beginArray(), listEnd = lists.endArray(); list != listEnd; - list++ + ++list ) { last = *list; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index b4a57387b5019552ac244328fdbb0201fb13dfe0..62be0069a5c4676c79ef824a796db70948a1eb7b 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -202,7 +202,7 @@ LLViewerFetchedTexture* bindMaterialDiffuseTexture(const LLImportMaterial& mater return nullptr; } -std::string stripSuffix(std::string name) +std::string stripSuffix(const std::string& name) { if ((name.find("_LOD") != std::string::npos) || (name.find("_PHYS") != std::string::npos)) { @@ -4569,7 +4569,7 @@ void LLFloaterModelPreview::DecompRequest::completed() } } -void dump_llsd_to_file(const LLSD& content, std::string filename); +void dump_llsd_to_file(const LLSD& content, const std::string& filename); void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result) { diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index f85e0eaf65980f468c8f1469782bd81f28567e3e..7fc1c65e3dad0497aee2b4d6d22a37fe86c355e8 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -769,7 +769,6 @@ skin_t manifestFromJson(const std::string& filename, const ESkinType type) { skin_t skin; nlohmann::json root; - std::string errors; llifstream in; in.open(filename); if (in.is_open()) diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index a016a4920026476d83a8508a3541fe6477f568ab..bb84c74d1faafa9509251019550df69d9fa98819 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -153,7 +153,7 @@ public: S32 getTotalMembersInRole() const { return mMemberCount ? mMemberCount : mMemberIDs.size(); } //FIXME: Returns 0 for Everyone role when Member list isn't yet loaded, see MAINT-5225 LLRoleData getRoleData() const { return mRoleData; } - void setRoleData(LLRoleData data) { mRoleData = data; } + void setRoleData(const LLRoleData& data) { mRoleData = data; } void addMember(const LLUUID& member); bool removeMember(const LLUUID& member); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index fb97a83dc31b31815e178fd24a2a6bc635fe4977..bce24f67c5454916d1f9e5bd0bfacbd0a6def2c7 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -408,12 +408,12 @@ namespace { } static S32 dump_num = 0; -std::string make_dump_name(std::string prefix, S32 num) +std::string make_dump_name(const std::string& prefix, S32 num) { return prefix + fmt::to_string(num) + LLStringExplicit(".xml"); } -void dump_llsd_to_file(const LLSD& content, std::string filename); -LLSD llsd_from_file(std::string filename); +void dump_llsd_to_file(const LLSD& content, const std::string& filename); +LLSD llsd_from_file(const std::string& filename); const std::string header_lod[] = { @@ -2158,7 +2158,7 @@ void LLMeshUploadThread::run() } } -void dump_llsd_to_file(const LLSD& content, std::string filename) +void dump_llsd_to_file(const LLSD& content, const std::string& filename) { if (gSavedSettings.getBOOL("MeshUploadLogXML")) { @@ -2167,9 +2167,9 @@ void dump_llsd_to_file(const LLSD& content, std::string filename) } } -LLSD llsd_from_file(std::string filename) +LLSD llsd_from_file(const std::string& filename) { - llifstream ifs(filename.c_str()); + llifstream ifs(filename); LLSD result; LLSDSerialize::fromXML(result,ifs); return result; @@ -3821,18 +3821,19 @@ void LLMeshRepository::notifyLoadedMeshes() } hold_offs = 0; - if (gAgent.getRegion()) + LLViewerRegion* regionp = gAgent.getRegion(); + if (regionp) { // Update capability urls static std::string region_name("never name a region this"); - if (gAgent.getRegion()->getName() != region_name && gAgent.getRegion()->capabilitiesReceived()) + if (regionp->getName() != region_name && regionp->capabilitiesReceived()) { - region_name = gAgent.getRegion()->getName(); + region_name = regionp->getName(); const bool use_v1(gSavedSettings.getBOOL("MeshUseGetMesh1")); - const std::string mesh_cap(gAgent.getRegion()->getViewerAssetUrl()); - const std::string legacy_mesh1_cap(gAgent.getRegion()->getCapability("GetMesh")); - const std::string legacy_mesh2_cap(gAgent.getRegion()->getCapability("GetMesh2")); + const std::string mesh_cap(regionp->getViewerAssetUrl()); + const std::string legacy_mesh1_cap(regionp->getCapability("GetMesh")); + const std::string legacy_mesh2_cap(regionp->getCapability("GetMesh2")); mLegacyGetMeshVersion = ((mesh_cap.empty() && legacy_mesh2_cap.empty()) || use_v1) ? 1 : (!mesh_cap.empty() ? 0 : 2); mThread->setGetMeshCap(mesh_cap, legacy_mesh1_cap, legacy_mesh2_cap, mLegacyGetMeshVersion); LL_DEBUGS(LOG_MESH) << "Retrieving caps for region '" << region_name diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index d689c7bb263b347e03821ffdaa6abc1792ff485e..8e9f37afc1c985bb21dfd7330dba2eec88e2f912 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -93,6 +93,7 @@ public: LLSD mPostData; LLTextureUploadData() + : mTexture(nullptr) { mRetries = 0; } diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index a4ab621bc912e247d1be1446a87c7a7b85499215..71f061ce88fd2e54c70681d7b3f287e15195578f 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -267,7 +267,7 @@ public: void setOutfitName(std::string name); void setOutfitWorn(bool value); void setSelected(bool value); - void setUUID(LLUUID outfit_id) {mUUID = outfit_id;} + void setUUID(const LLUUID& outfit_id) {mUUID = outfit_id;} std::string getItemName() {return mOutfitName;} bool isDefaultImage() {return mDefaultImage;} diff --git a/indra/newview/llsecapicerthandler.h b/indra/newview/llsecapicerthandler.h index c14b13c438acb7d700a1642dd96a1590df58b62f..04a2f4690be52a0aa7dc009e713e28992b290006 100644 --- a/indra/newview/llsecapicerthandler.h +++ b/indra/newview/llsecapicerthandler.h @@ -484,9 +484,8 @@ class LLCertValidationExpirationException : public LLCertException public: LLCertValidationExpirationException(const LLSD& cert_data, const LLDate& current_time) : LLCertException(cert_data, "CertExpired") - { - mTime = current_time; - } + , mTime(current_time) + { } virtual ~LLCertValidationExpirationException() noexcept = default; LLDate GetTime() const { return mTime; } protected: diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 976e746f872754d2b313e3680976a8a577fe485f..8552a1896d504ad23b55282faaf3e6510ad55a42 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -896,7 +896,7 @@ template <typename T> bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGet // Now iterate through all TEs to test for sameness bool identical = TRUE; - for (iterator iter = begin(); iter != end(); iter++) + for (iterator iter = begin(); iter != end(); ++iter) { LLSelectNode* node = *iter; LLViewerObject* object = node->getObject(); @@ -967,7 +967,7 @@ template <typename T> bool LLObjectSelection::isMultipleTEValue(LLSelectedTEGetF // Now iterate through all TEs to test for sameness bool unique = TRUE; - for (iterator iter = begin(); iter != end(); iter++) + for (iterator iter = begin(); iter != end(); ++iter) { LLSelectNode* node = *iter; LLViewerObject* object = node->getObject(); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 8cd5ae557af128d3cc5363d3aef9ad463d190100..2a5c86b4c885965022d699db3b087247ef605b30 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -234,7 +234,7 @@ public: struct CompareUpdateUrgency { - bool operator()(const LLPointer<LLSpatialGroup> lhs, const LLPointer<LLSpatialGroup> rhs) + bool operator()(const LLPointer<LLSpatialGroup>& lhs, const LLPointer<LLSpatialGroup>& rhs) { return lhs->getUpdateUrgency() > rhs->getUpdateUrgency(); } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index ca84e3da55a43d01a26257136dee55c6b9caf5e3..d379dbc68458156aacd2b1cb71cccdab6a22c4ef 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -332,7 +332,7 @@ public: BOOL needsAux() const { return mNeedsAux; } // Host we think might have this image, used for baked av textures. - void setTargetHost(LLHost host) { mTargetHost = host; } + void setTargetHost(const LLHost& host) { mTargetHost = host; } LLHost getTargetHost() const { return mTargetHost; } // Set the decode priority for this image... diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 648221130e302825b5c08c95a3ce94e3acfc3edc..f9278ac3bf6d0f3a8d108df14b86861921bb5105 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -206,7 +206,7 @@ private: // Request image from a specific host, used for baked avatar textures. // Implemented in header in case someone changes default params above. JC - LLViewerFetchedTexture* getImageFromHost(const LLUUID& image_id, FTType f_type, LLHost host) + LLViewerFetchedTexture* getImageFromHost(const LLUUID& image_id, FTType f_type, const LLHost& host) { return getImage(image_id, f_type, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); } public: diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cdec2e00ec2cf08144505d9cabb15fb8b4e3f2d3..e9c4ddcca5e48bea9ba2ca990016eeb530da8c29 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5601,7 +5601,7 @@ void LLVOAvatar::resolveHeightAgent(const LLVector3 &in_pos_agent, LLVector3 &ou } -void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm) +void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d& start_pt, const LLVector3d& end_pt, LLVector3d &out_pos, LLVector3 &out_norm) { LLViewerObject *obj; LLWorld::getInstance()->resolveStepHeightGlobal(this, start_pt, end_pt, out_pos, out_norm, &obj); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 481b192aad7f929609f0f5a3606cf23341c708f9..f72cee4d3954b2a1f87f05ee7dc378fa66226afc 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -915,7 +915,7 @@ public: void resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm); bool distanceToGround( const LLVector3d &startPoint, LLVector3d &collisionPoint, F32 distToIntersectionAlongRay ); void resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); - void resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm); + void resolveRayCollisionAgent(const LLVector3d& start_pt, const LLVector3d& end_pt, LLVector3d &out_pos, LLVector3 &out_norm); void slamPosition(); // Slam position to transmitted position (for teleport); protected: diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a2b1a06eb17231ee92fe0b072fe001a2d810f21d..efc44346d24269454ceaac63f9affdfcd33e5090 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3125,7 +3125,7 @@ S32 LLVOVolume::getFaceIndexWithMediaImpl(const LLViewerMediaImpl* media_impl, S //---------------------------------------------------------------------------- -void LLVOVolume::setLightTextureID(LLUUID id) +void LLVOVolume::setLightTextureID(const LLUUID& id) { LLViewerTexture* old_texturep = getLightTexture(); // same as mLightTexture, but inits if nessesary if (id.notNull()) @@ -3166,7 +3166,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) } } -void LLVOVolume::setSpotLightParams(LLVector3 params) +void LLVOVolume::setSpotLightParams(const LLVector3& params) { LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); if (param_block && param_block->getParams() != params) diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 00566ced070967f4cc613747b0e56c81f86c2d68..b45be1823a792f7237324e09921ee84f95763a34 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -249,8 +249,8 @@ public: void setLightRadius(F32 radius); void setLightFalloff(F32 falloff); void setLightCutoff(F32 cutoff); - void setLightTextureID(LLUUID id); - void setSpotLightParams(LLVector3 params); + void setLightTextureID(const LLUUID& id); + void setSpotLightParams(const LLVector3& params); BOOL getIsLight() const; LLColor3 getLightBaseColor() const; // not scaled by intensity diff --git a/indra/newview/llwaterparamset.h b/indra/newview/llwaterparamset.h index c8648d5f70b0418bba787ed348f94e2451692b18..75729e68bc0b9111b4a871b9f071b9a9ace2932e 100644 --- a/indra/newview/llwaterparamset.h +++ b/indra/newview/llwaterparamset.h @@ -132,8 +132,8 @@ public: inline void LLWaterParamSet::setAll(const LLSD& val) { if(val.isMap()) { - LLSD::map_const_iterator mIt = val.beginMap(); - for(; mIt != val.endMap(); mIt++) + + for(LLSD::map_const_iterator mIt = val.beginMap(), end_it = val.endMap(); mIt != end_it; ++mIt) { mParamValues[mIt->first] = mIt->second; } diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index b606665b00564c0a7884b576f57a790d214303b9..4f2ac27b47b09ab7debfe34d3f091d969d38cd93 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -59,9 +59,9 @@ class CapUrlMatches { public: CapUrlMatches(std::set<LLViewerRegion*>& regions, std::set<std::string>& cap_names) + : mRegions(regions) + , mCapNames(cap_names) { - mRegions = regions; - mCapNames = cap_names; } std::set<LLViewerRegion*> mRegions;