From 12d789be176cf96d7455e9b30904d93bb2912743 Mon Sep 17 00:00:00 2001 From: Drake Arconis <drake@alchemyviewer.org> Date: Thu, 3 Oct 2019 01:08:30 -0400 Subject: [PATCH] Fix more warnings --- indra/newview/llfloatermodelpreview.cpp | 2 -- indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/llfriendcard.cpp | 4 ++-- indra/newview/llsidepaneliteminfo.cpp | 6 +++--- indra/newview/lltexturecache.cpp | 5 ++--- indra/newview/llviewertexteditor.cpp | 18 +++++++----------- indra/newview/llwlparammanager.cpp | 2 +- 7 files changed, 16 insertions(+), 23 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index add3cafaf7..4c99bc2ca5 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3182,14 +3182,12 @@ void LLModelPreview::updateLodControls(S32 lod) "lod_triangle_limit_", "lod_error_threshold_" }; - const U32 num_lod_controls = sizeof(lod_controls)/sizeof(char*); const char* file_controls[] = { "lod_browse_", "lod_file_", }; - const U32 num_file_controls = sizeof(file_controls)/sizeof(char*); LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; if (!fmp) return; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 0db9ad2006..c02c561ff4 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -823,7 +823,7 @@ void LLFloaterPreference::reloadSkinList() skin_list->clearRows(); // User Downloaded Skins - for (const std::pair<std::string, skin_t>& skin : mUserSkins) + for (const auto& skin : mUserSkins) { LLSD row; row["id"] = skin.first; diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 8e9e35b2c1..0314558454 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -599,7 +599,7 @@ void LLFriendCardsManager::onFriendListUpdate(U32 changed_mask) // Try to add cards into inventory. // If cards already exist they won't be created. const std::set<LLUUID>& changed_items = at.getChangedIDs(); - for (const auto card : changed_items) + for (const auto& card : changed_items) { cards_manager.addFriendCardToInventory(card); } @@ -620,7 +620,7 @@ void LLFriendCardsManager::onFriendListUpdate(U32 changed_mask) case LLFriendObserver::REMOVE: { const std::set<LLUUID>& changed_items = at.getChangedIDs(); - for (const auto card : changed_items) + for (const auto& card : changed_items) { LLFriendCardsManager::instance().removeFriendCardFromInventory(card); } diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index dd15de6a93..ce0037c668 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -452,12 +452,12 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // or ui elements don't apply to these objects and return from function if (!not_in_trash || cannot_restrict_permissions) { - for(const std::string item : perm_and_sale_items) + for(const std::string& item : perm_and_sale_items) { getChildView(item)->setVisible(false); } - for(const std::string item : debug_items) + for(const std::string& item : debug_items) { getChildView(item)->setVisible(false); } @@ -465,7 +465,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } else // Make sure perms and sale ui elements are visible { - for(const std::string item : perm_and_sale_items) + for(const std::string& item : perm_and_sale_items) { getChildView(item)->setVisible(true); } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index dc74611488..0ddb30c585 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -872,7 +872,7 @@ S32 LLTextureCache::update(F32 max_time_ms) lockWorkers(); - for (std::_Vector_iterator<std::_Vector_val<std::_Simple_types<unsigned int>>>::value_type handle : priorty_list) + for (auto handle : priorty_list) { handle_map_t::iterator iter2 = mWriters.find(handle); if(iter2 != mWriters.end()) @@ -1567,8 +1567,7 @@ void LLTextureCache::readHeaderCache() if (!purge_list.empty()) { - for (std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned int>>>::value_type iter : - purge_list) + for (auto iter : purge_list) { std::string tex_filename = getTextureFileName(entries[iter].mID); removeEntry((S32)iter, entries[iter], tex_filename); diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 8e7c4c7730..fa049ca2e9 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -455,9 +455,9 @@ void LLEmbeddedItems::removeUnusedChars() } } // Remove chars not actually used - for (std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned int>>>::value_type iter : used) + for (auto val : used) { - removeEmbeddedItem(iter); + removeEmbeddedItem(val); } } @@ -468,8 +468,7 @@ void LLEmbeddedItems::copyUsedCharsToIndexed() // Copy all used llwchars to mEmbeddedIndexedChars mEmbeddedIndexedChars.clear(); - for (std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned int>>>::value_type mEmbeddedUsedChar - : mEmbeddedUsedChars) + for (auto mEmbeddedUsedChar : mEmbeddedUsedChars) { mEmbeddedIndexedChars.push_back(mEmbeddedUsedChar); } @@ -478,8 +477,7 @@ void LLEmbeddedItems::copyUsedCharsToIndexed() S32 LLEmbeddedItems::getIndexFromEmbeddedChar(llwchar wch) { S32 idx = 0; - for (std::_Vector_iterator<std::_Vector_val<std::_Simple_types<unsigned int>>>::value_type& mEmbeddedIndexedChar : - mEmbeddedIndexedChars) + for (auto mEmbeddedIndexedChar : mEmbeddedIndexedChars) { if (wch == mEmbeddedIndexedChar) break; @@ -568,8 +566,7 @@ void LLEmbeddedItems::addItems(const std::vector<LLPointer<LLInventoryItem> >& i void LLEmbeddedItems::getEmbeddedItemList( std::vector<LLPointer<LLInventoryItem> >& items ) { - for (std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned int>>>::value_type wc : - mEmbeddedUsedChars) + for (auto wc : mEmbeddedUsedChars) { LLPointer<LLInventoryItem> item = getEmbeddedItemPtr(wc); if (item) @@ -581,8 +578,7 @@ void LLEmbeddedItems::getEmbeddedItemList( std::vector<LLPointer<LLInventoryItem void LLEmbeddedItems::markSaved() { - for (std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned int>>>::value_type wc : - mEmbeddedUsedChars) + for (auto wc : mEmbeddedUsedChars) { sEntries[wc].mSaved = TRUE; } @@ -953,7 +949,7 @@ void LLViewerTextEditor::setASCIIEmbeddedText(const std::string& instr) void LLViewerTextEditor::setEmbeddedText(const std::string& instr) { LLWString wtext = utf8str_to_wstring(instr); - for (unsigned int& i : wtext) + for (auto& i : wtext) { llwchar wch = i; if( wch >= FIRST_EMBEDDED_CHAR && wch <= LAST_EMBEDDED_CHAR ) diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index cd871dbbad..b227ac658f 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -710,7 +710,7 @@ std::string LLWLParamManager::escapeString(const std::string& str) { static const char hex[] = "0123456789ABCDEF"; std::stringstream escaped_str; - for (std::_String_const_iterator<std::_String_val<std::_Simple_types<char>>>::value_type iter : str) + for (auto iter : str) { switch (iter) { case '0': case '1': case '2': case '3': case '4': -- GitLab