From 09f4528bfb161968f880dbf069f4133534c66915 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 19 Jun 2015 18:27:21 -0500 Subject: [PATCH] Removed LLDynamicArray, LLDynamicArrayIndexed, LLDynamicArrayPtr, LLDLinked, LLDynamicQueuePtr, LLEnum, and LLIndexedQueue. Added new LLPointer variants. --- indra/llappearance/llpolymesh.cpp | 6 +- indra/llappearance/llpolyskeletaldistortion.h | 1 - indra/llcommon/CMakeLists.txt | 8 +- indra/llcommon/lldarray.h | 224 ----------- indra/llcommon/lldarrayptr.h | 42 -- indra/llcommon/lldlinked.h | 99 ----- indra/llcommon/lldqueueptr.h | 358 ------------------ indra/llcommon/llenum.h | 84 ---- indra/llcommon/llindexedqueue.h | 161 -------- indra/llcommon/llindexedvector.h | 100 +++++ indra/llcommon/llpointer.h | 216 +++++++++-- indra/llinventory/llinventory.h | 6 +- indra/llinventory/llparcel.cpp | 2 +- indra/llmath/llvolume.cpp | 1 - indra/llmath/llvolume.h | 1 - indra/llmessage/llmessagetemplate.h | 9 +- indra/llmessage/message.cpp | 1 - indra/llui/llscrolllistctrl.h | 1 - indra/llui/lltexteditor.h | 2 - indra/newview/ascentfloatercontactgroups.cpp | 1 - indra/newview/ascentfloatercontactgroups.h | 1 - indra/newview/awavefront.cpp | 6 +- indra/newview/floaterao.cpp | 2 +- indra/newview/floaterlocalassetbrowse.cpp | 2 +- indra/newview/llagent.cpp | 11 +- indra/newview/llagentpilot.cpp | 19 +- indra/newview/llagentpilot.h | 3 +- indra/newview/llagentwearables.cpp | 20 +- indra/newview/llagentwearables.h | 2 +- indra/newview/llagentwearablesfetch.cpp | 8 +- indra/newview/llappearancemgr.cpp | 102 ++--- indra/newview/llavataractions.cpp | 7 +- indra/newview/llcloud.h | 1 - indra/newview/llcompilequeue.cpp | 10 +- indra/newview/llcompilequeue.h | 3 +- indra/newview/lldebugmessagebox.h | 1 - indra/newview/lldrawable.cpp | 6 +- indra/newview/lldrawable.h | 3 +- indra/newview/llface.h | 1 - indra/newview/llfloateravatarlist.cpp | 4 +- indra/newview/llfloaterbulkpermission.cpp | 16 +- indra/newview/llfloaterbulkpermission.h | 5 +- indra/newview/llfloatercustomize.cpp | 2 +- indra/newview/llfloatergesture.h | 2 - indra/newview/llfloaterlandmark.cpp | 4 +- indra/newview/llfloateroutbox.cpp | 2 +- indra/newview/llfloaterworldmap.cpp | 30 +- indra/newview/llfloaterworldmap.h | 5 +- indra/newview/llfolderview.cpp | 12 +- indra/newview/llfolderview.h | 1 - indra/newview/llfoldervieweventlistener.h | 3 +- indra/newview/llfolderviewitem.h | 1 - indra/newview/llframestats.cpp | 16 +- indra/newview/llframestats.h | 3 +- indra/newview/llgiveinventory.cpp | 22 +- indra/newview/llgroupactions.cpp | 2 +- indra/newview/llgroupnotify.h | 1 - indra/newview/llhoverview.h | 1 - indra/newview/llhudicon.h | 2 - indra/newview/llhudmanager.cpp | 18 +- indra/newview/llhudmanager.h | 3 +- indra/newview/llimpanel.cpp | 22 +- indra/newview/llimpanel.h | 4 +- indra/newview/llimview.cpp | 24 +- indra/newview/llimview.h | 8 +- indra/newview/llinventoryactions.cpp | 10 +- indra/newview/llinventorybridge.cpp | 110 +++--- indra/newview/llinventorybridge.h | 4 +- indra/newview/llinventoryclipboard.cpp | 22 +- indra/newview/llinventoryclipboard.h | 7 +- indra/newview/llinventoryfilter.cpp | 2 +- indra/newview/llinventorymodel.cpp | 114 +++--- indra/newview/llinventorymodel.h | 5 +- indra/newview/llinventoryobserver.cpp | 10 +- indra/newview/llinventorypanel.h | 1 - indra/newview/llnetmap.cpp | 4 +- indra/newview/llpanelavatar.cpp | 2 +- indra/newview/llpaneldirclassified.cpp | 2 - indra/newview/llpaneldirevents.cpp | 1 - indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llpanelmaininventory.cpp | 30 +- indra/newview/llpanelmaininventory.h | 6 +- indra/newview/llpanelobject.cpp | 4 +- indra/newview/llpanelobjectinventory.cpp | 18 +- indra/newview/llpanelpermissions.cpp | 2 +- indra/newview/llparticipantlist.cpp | 2 +- indra/newview/llpreviewgesture.cpp | 8 +- indra/newview/llpreviewscript.cpp | 6 +- indra/newview/llpreviewscript.h | 3 +- indra/newview/lltexturectrl.cpp | 4 +- indra/newview/lltooldraganddrop.cpp | 38 +- indra/newview/lltooldraganddrop.h | 1 - indra/newview/lltracker.cpp | 2 - indra/newview/lltracker.h | 5 +- indra/newview/llviewergesture.h | 1 - indra/newview/llviewerinventory.h | 4 +- indra/newview/llviewermenu.cpp | 20 +- indra/newview/llviewermessage.cpp | 10 +- indra/newview/llviewerparcelmgr.cpp | 12 +- indra/newview/llviewerparcelmgr.h | 3 +- indra/newview/llviewerparceloverlay.cpp | 89 +++-- indra/newview/llviewerparceloverlay.h | 7 +- indra/newview/llviewerpartsim.h | 1 - indra/newview/llviewerprecompiledheaders.h | 3 - indra/newview/llviewerregion.cpp | 34 +- indra/newview/llviewerregion.h | 9 +- indra/newview/llvlmanager.cpp | 16 +- indra/newview/llvlmanager.h | 3 +- indra/newview/llvoavatarself.cpp | 6 +- indra/newview/llvocache.h | 1 - indra/newview/llvograss.h | 1 - indra/newview/llvotree.h | 1 - indra/newview/llvotreenew.h | 3 +- indra/newview/llworld.cpp | 12 +- indra/newview/pipeline.h | 2 - indra/newview/rlvhandler.cpp | 40 +- indra/newview/rlvhelper.cpp | 16 +- indra/newview/rlvinventory.cpp | 24 +- indra/newview/rlvlocks.cpp | 20 +- .../statemachine/aifetchinventoryfolder.cpp | 4 +- indra/test/lljoint_tut.cpp | 2 +- indra/test/lltemplatemessagebuilder_tut.cpp | 2 +- 122 files changed, 883 insertions(+), 1632 deletions(-) delete mode 100644 indra/llcommon/lldarray.h delete mode 100644 indra/llcommon/lldarrayptr.h delete mode 100644 indra/llcommon/lldlinked.h delete mode 100644 indra/llcommon/lldqueueptr.h delete mode 100644 indra/llcommon/llenum.h delete mode 100644 indra/llcommon/llindexedqueue.h create mode 100644 indra/llcommon/llindexedvector.h diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 9e6b6d406..b9e70fd83 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -547,13 +547,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) // S32 j; // for(j = 0; j < 3; j++) // { -// LLDynamicArray *face_list = mVertFaceMap.getIfThere(face[j]); +// std::vector *face_list = mVertFaceMap.getIfThere(face[j]); // if (!face_list) // { -// face_list = new LLDynamicArray; +// face_list = new std::vector; // mVertFaceMap.addData(face[j], face_list); // } -// face_list->put(i); +// face_list->push_back(i); // } numTris++; diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index e6ffbfe4e..c915a822f 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -39,7 +39,6 @@ //#include "llpolymorph.h" #include "lljoint.h" #include "llviewervisualparam.h" -//#include "lldarray.h" //class LLSkinJoint; class LLAvatarAppearance; diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 9ad8b0b15..72e03e709 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -142,20 +142,14 @@ set(llcommon_HEADER_FILES llcrc.h llcriticaldamp.h llcursortypes.h - lldarray.h - lldarrayptr.h lldate.h lldefs.h lldependencies.h lldepthstack.h lldictionary.h - lldlinked.h - lldqueueptr.h llendianswizzle.h - llenum.h llerror.h llerrorcontrol.h - llerrorlegacy.h llerrorthread.h llevent.h lleventapi.h @@ -176,7 +170,7 @@ set(llcommon_HEADER_FILES llhandle.h llheartbeat.h llhttpstatuscodes.h - llindexedqueue.h + llindexedvector.h llinitparam.h llinstancetracker.h llkeythrottle.h diff --git a/indra/llcommon/lldarray.h b/indra/llcommon/lldarray.h deleted file mode 100644 index b6834796b..000000000 --- a/indra/llcommon/lldarray.h +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file lldarray.h - * @brief Wrapped std::vector for backward compatibility. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLDARRAY_H -#define LL_LLDARRAY_H - -#include "llerror.h" - -#include -#include - -// class LLDynamicArray<>; // = std::vector + reserves elements -// class LLDynamicArrayIndexed<>; // = std::vector + std::map if indices, only supports operator[] and begin(),end() - -//-------------------------------------------------------- -// LLDynamicArray declaration -//-------------------------------------------------------- -// NOTE: BlockSize is used to reserve a minimal initial amount -template -class LLDynamicArray : public std::vector -{ -public: - enum - { - OKAY = 0, - FAIL = -1 - }; - - LLDynamicArray(S32 size=0) : std::vector(size) { if (size < BlockSize) std::vector::reserve(BlockSize); } - LLDynamicArray(const std::vector& copy) : std::vector(copy) {} - - void reset() { std::vector::clear(); } - - // ACCESSORS - const Type& get(S32 index) const { return std::vector::operator[](index); } - Type& get(S32 index) { return std::vector::operator[](index); } - S32 find(const Type &obj) const; - - S32 count() const { return std::vector::size(); } - S32 getLength() const { return std::vector::size(); } - S32 getMax() const { return std::vector::capacity(); } - - // MANIPULATE - S32 put(const Type &obj); // add to end of array, returns index -// Type* reserve(S32 num); // reserve a block of indices in advance - Type* reserve_block(U32 num); // reserve a block of indices in advance - - S32 remove(S32 index); // remove by index, no bounds checking - S32 removeObj(const Type &obj); // remove by object - S32 removeLast(); - - void operator+=(const LLDynamicArray &other); -}; - -//-------------------------------------------------------- -// LLDynamicArray implementation -//-------------------------------------------------------- - -template -inline S32 LLDynamicArray::find(const Type &obj) const -{ - typename std::vector::const_iterator iter = std::find(this->begin(), this->end(), obj); - if (iter != this->end()) - { - return iter - this->begin(); - } - return FAIL; -} - - -template -inline S32 LLDynamicArray::remove(S32 i) -{ - // This is a fast removal by swapping with the last element - S32 sz = this->size(); - if (i < 0 || i >= sz) - { - return FAIL; - } - if (i < sz-1) - { - this->operator[](i) = this->back(); - } - this->pop_back(); - return i; -} - -template -inline S32 LLDynamicArray::removeObj(const Type& obj) -{ - typename std::vector::iterator iter = std::find(this->begin(), this->end(), obj); - if (iter != this->end()) - { - S32 res = iter - this->begin(); - typename std::vector::iterator last = this->end(); - --last; - *iter = *last; - this->pop_back(); - return res; - } - return FAIL; -} - -template -inline S32 LLDynamicArray::removeLast() -{ - if (!this->empty()) - { - this->pop_back(); - return OKAY; - } - return FAIL; -} - -template -inline Type* LLDynamicArray::reserve_block(U32 num) -{ - U32 sz = this->size(); - this->resize(sz+num); - return &(this->operator[](sz)); -} - -template -inline S32 LLDynamicArray::put(const Type &obj) -{ - this->push_back(obj); - return this->size() - 1; -} - -template -inline void LLDynamicArray::operator+=(const LLDynamicArray &other) -{ - this->insert(this->end(), other.begin(), other.end()); -} - -//-------------------------------------------------------- -// LLDynamicArrayIndexed declaration -//-------------------------------------------------------- - -template -class LLDynamicArrayIndexed -{ -public: - typedef typename std::vector::iterator iterator; - typedef typename std::vector::const_iterator const_iterator; - typedef typename std::vector::reverse_iterator reverse_iterator; - typedef typename std::vector::const_reverse_iterator const_reverse_iterator; - typedef typename std::vector::size_type size_type; -protected: - std::vector mVector; - std::map mIndexMap; - -public: - LLDynamicArrayIndexed() { mVector.reserve(BlockSize); } - - iterator begin() { return mVector.begin(); } - const_iterator begin() const { return mVector.begin(); } - iterator end() { return mVector.end(); } - const_iterator end() const { return mVector.end(); } - - reverse_iterator rbegin() { return mVector.rbegin(); } - const_reverse_iterator rbegin() const { return mVector.rbegin(); } - reverse_iterator rend() { return mVector.rend(); } - const_reverse_iterator rend() const { return mVector.rend(); } - - void reset() { mVector.resize(0); mIndexMap.resize(0); } - bool empty() const { return mVector.empty(); } - size_type size() const { return mVector.size(); } - - Type& operator[](const Key& k) - { - typename std::map::const_iterator iter = mIndexMap.find(k); - if (iter == mIndexMap.end()) - { - U32 n = mVector.size(); - mIndexMap[k] = n; - mVector.push_back(Type()); - llassert(mVector.size() == mIndexMap.size()); - return mVector[n]; - } - else - { - return mVector[iter->second]; - } - } - - const_iterator find(const Key& k) const - { - typename std::map::const_iterator iter = mIndexMap.find(k); - if(iter == mIndexMap.end()) - { - return mVector.end(); - } - else - { - return mVector.begin() + iter->second; - } - } -}; - -#endif diff --git a/indra/llcommon/lldarrayptr.h b/indra/llcommon/lldarrayptr.h deleted file mode 100644 index 7fde52bdc..000000000 --- a/indra/llcommon/lldarrayptr.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file lldarrayptr.h - * @brief Wrapped std::vector for backward compatibility. - * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ -#ifndef LL_LLDARRAYPTR_H -#define LL_LLDARRAYPTR_H - -#include "lldarray.h" - -template -class LLDynamicArrayPtr : public LLDynamicArray -{ -}; - -#endif // LL_LLDARRAYPTR_H diff --git a/indra/llcommon/lldlinked.h b/indra/llcommon/lldlinked.h deleted file mode 100644 index 8b6853212..000000000 --- a/indra/llcommon/lldlinked.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file lldlinked.h - * @brief Declaration of the LLDLinked class. - * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ -#ifndef LL_LLDLINKED_H -#define LL_LLDLINKED_H - -template class LLDLinked -{ - LLDLinked* mNextp; - LLDLinked* mPrevp; -public: - - Type* getNext() { return (Type*)mNextp; } - Type* getPrev() { return (Type*)mPrevp; } - Type* getFirst() { return (Type*)mNextp; } - - void init() - { - mNextp = mPrevp = NULL; - } - - void unlink() - { - if (mPrevp) mPrevp->mNextp = mNextp; - if (mNextp) mNextp->mPrevp = mPrevp; - } - - LLDLinked() { mNextp = mPrevp = NULL; } - virtual ~LLDLinked() { unlink(); } - - virtual void deleteAll() - { - Type *curp = getFirst(); - while(curp) - { - Type *nextp = curp->getNext(); - curp->unlink(); - delete curp; - curp = nextp; - } - } - - void relink(Type &after) - { - LLDLinked *afterp = (LLDLinked*)&after; - afterp->mPrevp = this; - mNextp = afterp; - } - - virtual void append(Type& after) - { - LLDLinked *afterp = (LLDLinked*)&after; - afterp->mPrevp = this; - afterp->mNextp = mNextp; - if (mNextp) mNextp->mPrevp = afterp; - mNextp = afterp; - } - - virtual void insert(Type& before) - { - LLDLinked *beforep = (LLDLinked*)&before; - beforep->mNextp = this; - beforep->mPrevp = mPrevp; - if (mPrevp) mPrevp->mNextp = beforep; - mPrevp = beforep; - } - - virtual void put(Type& obj) { append(obj); } -}; - -#endif diff --git a/indra/llcommon/lldqueueptr.h b/indra/llcommon/lldqueueptr.h deleted file mode 100644 index 77df47b1f..000000000 --- a/indra/llcommon/lldqueueptr.h +++ /dev/null @@ -1,358 +0,0 @@ -/** - * @file lldqueueptr.h - * @brief LLDynamicQueuePtr declaration - * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ -#ifndef LL_LLDQUEUEPTR_H -#define LL_LLDQUEUEPTR_H - -template -class LLDynamicQueuePtr -{ -public: - enum - { - OKAY = 0, - FAIL = -1 - }; - - LLDynamicQueuePtr(const S32 size=8); - ~LLDynamicQueuePtr(); - - void init(); - void destroy(); - void reset(); - void reallocate(U32 newsize); - - // ACCESSORS - const Type& get(const S32 index) const; // no bounds checking - Type& get(const S32 index); // no bounds checking - const Type& operator [] (const S32 index) const { return get(index); } - Type& operator [] (const S32 index) { return get(index); } - S32 find(const Type &obj) const; - - S32 count() const { return (mLastObj >= mFirstObj ? mLastObj - mFirstObj : mLastObj + mMaxObj - mFirstObj); } - S32 getMax() const { return mMaxObj; } - S32 getFirst() const { return mFirstObj; } - S32 getLast () const { return mLastObj; } - - // MANIPULATE - S32 push(const Type &obj); // add to end of Queue, returns index from start - S32 pull( Type &obj); // pull from Queue, returns index from start - - S32 remove (S32 index); // remove by index - S32 removeObj(const Type &obj); // remove by object - -protected: - S32 mFirstObj, mLastObj, mMaxObj; - Type* mMemory; - -public: - - void print() - { - /* - Convert this to llinfos if it's intended to be used - djs 08/30/02 - - printf("Printing from %d to %d (of %d): ",mFirstObj, mLastObj, mMaxObj); - - if (mFirstObj <= mLastObj) - { - for (S32 i=mFirstObj;i -inline LLDynamicQueuePtr::LLDynamicQueuePtr(const S32 size) -{ - init(); - reallocate(size); -} - -template -inline LLDynamicQueuePtr::~LLDynamicQueuePtr() -{ - destroy(); -} - -template -inline void LLDynamicQueuePtr::init() -{ - mFirstObj = 0; - mLastObj = 0; - mMaxObj = 0; - mMemory = NULL; -} - -template -inline void LLDynamicQueuePtr::reallocate(U32 newsize) -{ - if (newsize) - { - if (mFirstObj > mLastObj && newsize > mMaxObj) - { - Type* new_memory = new Type[newsize]; - - llassert(new_memory); - - S32 _count = count(); - S32 i, m = 0; - for (i=mFirstObj; i < mMaxObj; i++) - { - new_memory[m++] = mMemory[i]; - } - for (i=0; i <=mLastObj; i++) - { - new_memory[m++] = mMemory[i]; - } - - delete[] mMemory; - mMemory = new_memory; - - mFirstObj = 0; - mLastObj = _count; - } - else - { - Type* new_memory = new Type[newsize]; - - llassert(new_memory); - - S32 i, m = 0; - for (i=0; i < mLastObj; i++) - { - new_memory[m++] = mMemory[i]; - } - delete[] mMemory; - mMemory = new_memory; - } - } - else if (mMemory) - { - delete[] mMemory; - mMemory = NULL; - } - - mMaxObj = newsize; -} - -template -inline void LLDynamicQueuePtr::destroy() -{ - reset(); - delete[] mMemory; - mMemory = NULL; -} - - -template -void LLDynamicQueuePtr::reset() -{ - for (S32 i=0; i < mMaxObj; i++) - { - get(i) = NULL; // unrefs for pointers - } - - mFirstObj = 0; - mLastObj = 0; -} - - -template -inline S32 LLDynamicQueuePtr::find(const Type &obj) const -{ - S32 i; - if (mFirstObj <= mLastObj) - { - for ( i = mFirstObj; i < mLastObj; i++ ) - { - if (mMemory[i] == obj) - { - return i; - } - } - } - else - { - for ( i = mFirstObj; i < mMaxObj; i++ ) - { - if (mMemory[i] == obj) - { - return i; - } - } - for ( i = 0; i < mLastObj; i++ ) - { - if (mMemory[i] == obj) - { - return i; - } - } - } - - return FAIL; -} - -template -inline S32 LLDynamicQueuePtr::remove(S32 i) -{ - if (mFirstObj > mLastObj) - { - if (i >= mFirstObj && i < mMaxObj) - { - while( i > mFirstObj) - { - mMemory[i] = mMemory[i-1]; - i--; - } - mMemory[mFirstObj] = NULL; - mFirstObj++; - if (mFirstObj >= mMaxObj) mFirstObj = 0; - - return count(); - } - else if (i < mLastObj && i >= 0) - { - while(i < mLastObj) - { - mMemory[i] = mMemory[i+1]; - i++; - } - mMemory[mLastObj] = NULL; - mLastObj--; - if (mLastObj < 0) mLastObj = mMaxObj-1; - - return count(); - } - } - else if (i <= mLastObj && i >= mFirstObj) - { - while(i < mLastObj) - { - mMemory[i] = mMemory[i+1]; - i++; - } - mMemory[mLastObj] = NULL; - mLastObj--; - if (mLastObj < 0) mLastObj = mMaxObj-1; - - return count(); - } - - - return FAIL; -} - -template -inline S32 LLDynamicQueuePtr::removeObj(const Type& obj) -{ - S32 ind = find(obj); - if (ind >= 0) - { - return remove(ind); - } - return FAIL; -} - -template -inline S32 LLDynamicQueuePtr::push(const Type &obj) -{ - if (mMaxObj - count() <= 1) - { - reallocate(mMaxObj * 2); - } - - mMemory[mLastObj++] = obj; - - if (mLastObj >= mMaxObj) - { - mLastObj = 0; - } - - return count(); -} - -template -inline S32 LLDynamicQueuePtr::pull(Type &obj) -{ - obj = NULL; - - if (count() < 1) return -1; - - obj = mMemory[mFirstObj]; - mMemory[mFirstObj] = NULL; - - mFirstObj++; - - if (mFirstObj >= mMaxObj) - { - mFirstObj = 0; - } - - return count(); -} - -template -inline const Type& LLDynamicQueuePtr::get(const S32 i) const -{ - return mMemory[i]; -} - -template -inline Type& LLDynamicQueuePtr::get(const S32 i) -{ - return mMemory[i]; -} - - -#endif // LL_LLDQUEUEPTR_H diff --git a/indra/llcommon/llenum.h b/indra/llcommon/llenum.h deleted file mode 100644 index ac6d46baa..000000000 --- a/indra/llcommon/llenum.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file llenum.h - * @author Tom Yedwab - * @brief Utility class for storing enum value <-> string lookup. - * - * $LicenseInfo:firstyear=2006&license=viewergpl$ - * - * Copyright (c) 2006-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLENUM_H -#define LL_LLENUM_H - -class LLEnum -{ -public: - typedef std::pair enum_t; - enum - { - UNDEFINED = 0xffffffff, - }; - - LLEnum(const enum_t values_array[], const U32 length) - { - for (U32 i=0; i= mEnumArray.size()) - { - mEnumArray.resize(values_array[i].second+1); - } - mEnumArray[values_array[i].second] = values_array[i].first; - } - } - - U32 operator[](std::string str) - { - std::map::iterator itor; - itor = mEnumMap.find(str); - if (itor != mEnumMap.end()) - { - return itor->second; - } - return UNDEFINED; - } - - const std::string operator[](U32 index) - { - if (index < mEnumArray.size()) - { - return mEnumArray[index]; - } - return ""; - } - -private: - std::map mEnumMap; - std::vector mEnumArray; -}; - -#endif // LL_LLENUM_H diff --git a/indra/llcommon/llindexedqueue.h b/indra/llcommon/llindexedqueue.h deleted file mode 100644 index 1b80e6eda..000000000 --- a/indra/llcommon/llindexedqueue.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @file llindexedqueue.h - * @brief An indexed FIFO queue, where only one element with each key - * can be in the queue. - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLINDEXEDQUEUE_H -#define LL_LLINDEXEDQUEUE_H - -// An indexed FIFO queue, where only one element with each key can be in the queue. -// This is ONLY used in the interest list, you'll probably want to review this code -// carefully if you want to use it elsewhere - Doug - -template -class LLIndexedQueue -{ -protected: - typedef std::deque type_deque; - type_deque mQueue; - std::set mKeySet; - -public: - LLIndexedQueue() {} - - // move_if_there is an O(n) operation - bool push_back(const Type &value, bool move_if_there = false) - { - if (mKeySet.find(value) != mKeySet.end()) - { - // Already on the queue - if (move_if_there) - { - // Remove the existing entry. - typename type_deque::iterator it; - for (it = mQueue.begin(); it != mQueue.end(); ++it) - { - if (*it == value) - { - break; - } - } - - // This HAS to succeed, otherwise there's a serious bug in the keyset implementation - // (although this isn't thread safe, at all) - - mQueue.erase(it); - } - else - { - // We're not moving it, leave it alone - return false; - } - } - else - { - // Doesn't exist, add it to the key set - mKeySet.insert(value); - } - - mQueue.push_back(value); - - // We succeeded in adding the new element. - return true; - } - - bool push_front(const Type &value, bool move_if_there = false) - { - if (mKeySet.find(value) != mKeySet.end()) - { - // Already on the queue - if (move_if_there) - { - // Remove the existing entry. - typename type_deque::iterator it; - for (it = mQueue.begin(); it != mQueue.end(); ++it) - { - if (*it == value) - { - break; - } - } - - // This HAS to succeed, otherwise there's a serious bug in the keyset implementation - // (although this isn't thread safe, at all) - - mQueue.erase(it); - } - else - { - // We're not moving it, leave it alone - return false; - } - } - else - { - // Doesn't exist, add it to the key set - mKeySet.insert(value); - } - - mQueue.push_front(value); - return true; - } - - void pop() - { - Type value = mQueue.front(); - mKeySet.erase(value); - mQueue.pop_front(); - } - - Type &front() - { - return mQueue.front(); - } - - S32 size() const - { - return mQueue.size(); - } - - bool empty() const - { - return mQueue.empty(); - } - - void clear() - { - // Clear out all elements on the queue - mQueue.clear(); - mKeySet.clear(); - } -}; - -#endif // LL_LLINDEXEDQUEUE_H diff --git a/indra/llcommon/llindexedvector.h b/indra/llcommon/llindexedvector.h new file mode 100644 index 000000000..68c382180 --- /dev/null +++ b/indra/llcommon/llindexedvector.h @@ -0,0 +1,100 @@ +/** + * @file lldarray.h + * @brief Wrapped std::vector for backward compatibility. + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLDARRAY_H +#define LL_LLDARRAY_H + +#include "llerror.h" + +#include +#include + +//-------------------------------------------------------- +// LLIndexedVector +//-------------------------------------------------------- + +template +class LLIndexedVector +{ +public: + typedef typename std::vector::iterator iterator; + typedef typename std::vector::const_iterator const_iterator; + typedef typename std::vector::reverse_iterator reverse_iterator; + typedef typename std::vector::const_reverse_iterator const_reverse_iterator; + typedef typename std::vector::size_type size_type; +protected: + std::vector mVector; + std::map mIndexMap; + +public: + LLIndexedVector() { mVector.reserve(BlockSize); } + + iterator begin() { return mVector.begin(); } + const_iterator begin() const { return mVector.begin(); } + iterator end() { return mVector.end(); } + const_iterator end() const { return mVector.end(); } + + reverse_iterator rbegin() { return mVector.rbegin(); } + const_reverse_iterator rbegin() const { return mVector.rbegin(); } + reverse_iterator rend() { return mVector.rend(); } + const_reverse_iterator rend() const { return mVector.rend(); } + + void reset() { mVector.resize(0); mIndexMap.resize(0); } + bool empty() const { return mVector.empty(); } + size_type size() const { return mVector.size(); } + + Type& operator[](const Key& k) + { + typename std::map::const_iterator iter = mIndexMap.find(k); + if (iter == mIndexMap.end()) + { + U32 n = mVector.size(); + mIndexMap[k] = n; + mVector.push_back(Type()); + llassert(mVector.size() == mIndexMap.size()); + return mVector[n]; + } + else + { + return mVector[iter->second]; + } + } + + const_iterator find(const Key& k) const + { + typename std::map::const_iterator iter = mIndexMap.find(k); + if(iter == mIndexMap.end()) + { + return mVector.end(); + } + else + { + return mVector.begin() + iter->second; + } + } +}; + +#endif diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index d3f2b3d13..6e08b01cc 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -97,24 +97,13 @@ public: LLPointer& operator =(Type* ptr) { - if( mPointer != ptr ) - { - unref(); - mPointer = ptr; - ref(); - } - + assign(ptr); return *this; } LLPointer& operator =(const LLPointer& ptr) { - if( mPointer != ptr.mPointer ) - { - unref(); - mPointer = ptr.mPointer; - ref(); - } + assign(ptr); return *this; } @@ -122,12 +111,7 @@ public: template LLPointer& operator =(const LLPointer& ptr) { - if( mPointer != ptr.get() ) - { - unref(); - mPointer = ptr.get(); - ref(); - } + assign(ptr.get()); return *this; } @@ -140,6 +124,20 @@ public: } protected: +#ifdef LL_LIBRARY_INCLUDE + void ref(); + void unref(); +#else + + void assign(const LLPointer& ptr) + { + if( mPointer != ptr.mPointer ) + { + unref(); + mPointer = ptr.mPointer; + ref(); + } + } void ref() { if (mPointer) @@ -152,7 +150,133 @@ protected: { if (mPointer) { - Type *tempp = mPointer; + Type *temp = mPointer; + mPointer = NULL; + temp->unref(); + if (mPointer != NULL) + { + LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; + unref(); + } + } + } +#endif +protected: + Type* mPointer; +}; + +template class LLConstPointer +{ +public: + LLConstPointer() : + mPointer(NULL) + { + } + + LLConstPointer(const Type* ptr) : + mPointer(ptr) + { + ref(); + } + + LLConstPointer(const LLConstPointer& ptr) : + mPointer(ptr.mPointer) + { + ref(); + } + + // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template + LLConstPointer(const LLConstPointer& ptr) : + mPointer(ptr.get()) + { + ref(); + } + + ~LLConstPointer() + { + unref(); + } + + const Type* get() const { return mPointer; } + const Type* operator->() const { return mPointer; } + const Type& operator*() const { return *mPointer; } + + operator BOOL() const { return (mPointer != NULL); } + operator bool() const { return (mPointer != NULL); } + bool operator!() const { return (mPointer == NULL); } + bool isNull() const { return (mPointer == NULL); } + bool notNull() const { return (mPointer != NULL); } + + operator const Type*() const { return mPointer; } + bool operator !=(const Type* ptr) const { return (mPointer != ptr); } + bool operator ==(const Type* ptr) const { return (mPointer == ptr); } + bool operator ==(const LLConstPointer& ptr) const { return (mPointer == ptr.mPointer); } + bool operator < (const LLConstPointer& ptr) const { return (mPointer < ptr.mPointer); } + bool operator > (const LLConstPointer& ptr) const { return (mPointer > ptr.mPointer); } + + LLConstPointer& operator =(const Type* ptr) + { + if( mPointer != ptr ) + { + unref(); + mPointer = ptr; + ref(); + } + + return *this; + } + + LLConstPointer& operator =(const LLConstPointer& ptr) + { + if( mPointer != ptr.mPointer ) + { + unref(); + mPointer = ptr.mPointer; + ref(); + } + return *this; + } + + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template + LLConstPointer& operator =(const LLConstPointer& ptr) + { + if( mPointer != ptr.get() ) + { + unref(); + mPointer = ptr.get(); + ref(); + } + return *this; + } + + // Just exchange the pointers, which will not change the reference counts. + static void swap(LLConstPointer& a, LLConstPointer& b) + { + const Type* temp = a.mPointer; + a.mPointer = b.mPointer; + b.mPointer = temp; + } + +protected: +#ifdef LL_LIBRARY_INCLUDE + void ref(); + void unref(); +#else + void ref() + { + if (mPointer) + { + mPointer->ref(); + } + } + + void unref() + { + if (mPointer) + { + const Type *tempp = mPointer; mPointer = NULL; tempp->unref(); if (mPointer != NULL) @@ -162,9 +286,57 @@ protected: } } } - +#endif protected: - Type* mPointer; + const Type* mPointer; +}; + +template +class LLCopyOnWritePointer : public LLPointer +{ +public: + typedef LLCopyOnWritePointer self_t; + typedef LLPointer pointer_t; + + LLCopyOnWritePointer() + : mStayUnique(false) + {} + + LLCopyOnWritePointer(Type* ptr) + : LLPointer(ptr), + mStayUnique(false) + {} + + LLCopyOnWritePointer(LLPointer& ptr) + : LLPointer(ptr), + mStayUnique(false) + { + if (ptr.mForceUnique) + { + makeUnique(); + } + } + + Type* write() + { + makeUnique(); + return pointer_t::mPointer; + } + + void makeUnique() + { + if (pointer_t::notNull() && pointer_t::mPointer->getNumRefs() > 1) + { + *(pointer_t* )(this) = new Type(*pointer_t::mPointer); + } + } + + const Type* operator->() const { return pointer_t::mPointer; } + const Type& operator*() const { return *pointer_t::mPointer; } + + void setStayUnique(bool stay) { makeUnique(); mStayUnique = stay; } +private: + bool mStayUnique; }; #endif diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index b3c141cfd..c93b0f07a 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -27,7 +27,6 @@ #ifndef LL_LLINVENTORY_H #define LL_LLINVENTORY_H -#include "lldarray.h" #include "llfoldertype.h" #include "llinventorytype.h" #include "llpermissions.h" @@ -48,6 +47,7 @@ class LLInventoryObject : public LLRefCount { public: typedef std::list > object_list_t; + typedef std::list > const_object_list_t; //-------------------------------------------------------------------- // Initialization @@ -125,7 +125,7 @@ protected: class LLInventoryItem : public LLInventoryObject { public: - typedef LLDynamicArray > item_array_t; + typedef std::vector > item_array_t; //-------------------------------------------------------------------- // Initialization @@ -238,7 +238,7 @@ protected: class LLInventoryCategory : public LLInventoryObject { public: - typedef LLDynamicArray > cat_array_t; + typedef std::vector > cat_array_t; //-------------------------------------------------------------------- // Initialization diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index f32e61e53..02cc55e1e 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -137,7 +137,7 @@ LLParcel::LLParcel(const LLUUID &owner_id, // virtual LLParcel::~LLParcel() { - // user list cleaned up by LLDynamicArray destructor. + // user list cleaned up by std::vector destructor. } void LLParcel::init(const LLUUID &owner_id, diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 29c0c9b91..c38075610 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -44,7 +44,6 @@ #include "m3math.h" #include "llmatrix3a.h" #include "lloctree.h" -#include "lldarray.h" #include "llvolume.h" #include "llvolumeoctree.h" #include "llstl.h" diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 2f52a5949..058d17132 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -44,7 +44,6 @@ class LLVolumeFace; class LLVolume; class LLVolumeTriangle; -#include "lldarray.h" #include "lluuid.h" #include "v4color.h" //#include "vmath.h" diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index 88ad2667a..6effb63c0 100644 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -27,10 +27,10 @@ #ifndef LL_LLMESSAGETEMPLATE_H #define LL_LLMESSAGETEMPLATE_H -#include "lldarray.h" #include "message.h" // TODO: babbage: Remove... #include "llstat.h" #include "llstl.h" +#include "llindexedvector.h" class LLMsgVarData { @@ -103,7 +103,7 @@ public: } S32 mBlockNumber; - typedef LLDynamicArrayIndexed msg_var_data_map_t; + typedef LLIndexedVector msg_var_data_map_t; msg_var_data_map_t mMemberVarData; char *mName; S32 mTotalSize; @@ -119,6 +119,7 @@ public: ~LLMsgData() { for_each(mMemberBlocks.begin(), mMemberBlocks.end(), DeletePairedPointer()); + mMemberBlocks.clear(); } void addBlock(LLMsgBlkData *blockp) @@ -226,7 +227,7 @@ public: friend std::ostream& operator<<(std::ostream& s, LLMessageBlock &msg); - typedef LLDynamicArrayIndexed message_variable_map_t; + typedef LLIndexedVector message_variable_map_t; message_variable_map_t mMemberVariables; char *mName; EMsgBlockType mType; @@ -391,7 +392,7 @@ public: } public: - typedef LLDynamicArrayIndexed message_block_map_t; + typedef LLIndexedVector message_block_map_t; message_block_map_t mMemberBlocks; char *mName; EMsgFrequency mFrequency; diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 34ff1036c..5037a9284 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -47,7 +47,6 @@ // linden library headers #include "indra_constants.h" -#include "lldarray.h" #include "lldir.h" #include "llerror.h" #include "llfasttimer.h" diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 9753013f1..96df91b80 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -34,7 +34,6 @@ #include "lluictrl.h" #include "llctrlselectioninterface.h" -//#include "lldarray.h" #include "llfontgl.h" #include "llui.h" #include "llstring.h" // LLWString diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 6016b7e94..7f68c41f8 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -39,10 +39,8 @@ #include "llkeywords.h" #include "lluictrl.h" #include "llframetimer.h" -#include "lldarray.h" #include "llstyle.h" #include "lleditmenuhandler.h" -#include "lldarray.h" #include "llpreeditor.h" #include "llmenugl.h" diff --git a/indra/newview/ascentfloatercontactgroups.cpp b/indra/newview/ascentfloatercontactgroups.cpp index d4276fcbb..d4032a6e8 100644 --- a/indra/newview/ascentfloatercontactgroups.cpp +++ b/indra/newview/ascentfloatercontactgroups.cpp @@ -24,7 +24,6 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" #include "llsdserialize.h" -#include "lldarray.h" #include "llfile.h" #include "llchat.h" #include "llfloaterchat.h" diff --git a/indra/newview/ascentfloatercontactgroups.h b/indra/newview/ascentfloatercontactgroups.h index e20a67d38..25422cbd9 100644 --- a/indra/newview/ascentfloatercontactgroups.h +++ b/indra/newview/ascentfloatercontactgroups.h @@ -16,7 +16,6 @@ #define ASCENT_CONTACT_GROUPS #include "llfloater.h" -#include "lldarray.h" #include "llsdserialize.h" class LLScrollListCtrl; diff --git a/indra/newview/awavefront.cpp b/indra/newview/awavefront.cpp index b3a0c7d9c..f682c87ec 100644 --- a/indra/newview/awavefront.cpp +++ b/indra/newview/awavefront.cpp @@ -252,7 +252,7 @@ namespace asset_id_matches); // See if any of the inventory items matching this sculpt id are exportable - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { const LLPermissions item_permissions = items[i]->getPermissions(); if (item_permissions.allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy())) @@ -365,9 +365,9 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too! LLViewerObject* o = *itero; if (!o) continue; - LLDynamicArray prims = LLDynamicArray(); + std::vector prims; o->addThisAndAllChildren(prims); - for (LLDynamicArray::iterator iterc = prims.begin(); iterc != prims.end(); ++iterc) + for (std::vector::iterator iterc = prims.begin(); iterc != prims.end(); ++iterc) { const LLViewerObject* c = *iterc; if (!c) continue; diff --git a/indra/newview/floaterao.cpp b/indra/newview/floaterao.cpp index 565f510f3..e254a8f3b 100644 --- a/indra/newview/floaterao.cpp +++ b/indra/newview/floaterao.cpp @@ -1320,7 +1320,7 @@ const LLUUID& LLFloaterAO::getAssetIDByName(const std::string& name) ObjectNameMatches objectnamematches(name); gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE,objectnamematches); - if (items.count()) + if (items.size()) { return items[0]->getAssetUUID(); } diff --git a/indra/newview/floaterlocalassetbrowse.cpp b/indra/newview/floaterlocalassetbrowse.cpp index 75ff12fb4..f58754779 100644 --- a/indra/newview/floaterlocalassetbrowse.cpp +++ b/indra/newview/floaterlocalassetbrowse.cpp @@ -369,7 +369,7 @@ std::vector LocalBitmap::getUsingObjects(bool seek_by_type, boo { std::vector affected_vector; - for( LLDynamicArrayPtr< LLPointer, 256 >::iterator iter = gObjectList.mObjects.begin(); + for (std::vector< LLPointer>::iterator iter = gObjectList.mObjects.begin(); iter != gObjectList.mObjects.end(); iter++ ) { LLViewerObject* obj = *iter; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ae475e2c4..b6abc2514 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4474,11 +4474,12 @@ void LLAgent::fidget() void LLAgent::stopFidget() { - LLDynamicArray anims; - anims.put(ANIM_AGENT_STAND_1); - anims.put(ANIM_AGENT_STAND_2); - anims.put(ANIM_AGENT_STAND_3); - anims.put(ANIM_AGENT_STAND_4); + std::vector anims; + anims.reserve(4); + anims.push_back(ANIM_AGENT_STAND_1); + anims.push_back(ANIM_AGENT_STAND_2); + anims.push_back(ANIM_AGENT_STAND_3); + anims.push_back(ANIM_AGENT_STAND_4); gAgent.sendAnimationRequests(anims, ANIM_REQUEST_STOP); } diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 4d50cec81..5a13ffe10 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -92,7 +92,7 @@ void LLAgentPilot::load(const std::string& filename) file >> new_action.mTime >> action_type; file >> new_action.mTarget.mdV[VX] >> new_action.mTarget.mdV[VY] >> new_action.mTarget.mdV[VZ]; new_action.mType = (EActionType)action_type; - mActions.put(new_action); + mActions.push_back(new_action); } file.close(); @@ -108,13 +108,14 @@ void LLAgentPilot::save(const std::string& filename) LL_INFOS() << "Couldn't open " << filename << ", aborting agentpilot save!" << LL_ENDL; } - file << mActions.count() << '\n'; + file << mActions.size() << '\n'; S32 i; - for (i = 0; i < mActions.count(); i++) + for (i = 0; i < mActions.size(); i++) { file << mActions[i].mTime << "\t" << mActions[i].mType << "\t"; - file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ] << '\n'; + file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ]; + file << '\n'; } file.close(); @@ -122,7 +123,7 @@ void LLAgentPilot::save(const std::string& filename) void LLAgentPilot::startRecord() { - mActions.reset(); + mActions.clear(); mTimer.reset(); addAction(STRAIGHT); mRecording = TRUE; @@ -143,7 +144,7 @@ void LLAgentPilot::addAction(enum EActionType action_type) action.mTarget = gAgent.getPositionGlobal(); action.mTime = mTimer.getElapsedTimeF32(); mLastRecordTime = (F32)action.mTime; - mActions.put(action); + mActions.push_back(action); } void LLAgentPilot::startPlayback() @@ -154,7 +155,7 @@ void LLAgentPilot::startPlayback() mCurrentAction = 0; mTimer.reset(); - if (mActions.count()) + if (mActions.size()) { LL_INFOS() << "Starting playback, moving to waypoint 0" << LL_ENDL; gAgent.startAutoPilotGlobal(mActions[0].mTarget); @@ -183,7 +184,7 @@ void LLAgentPilot::updateTarget() { if (mPlaying) { - if (mCurrentAction < mActions.count()) + if (mCurrentAction < mActions.size()) { if (0 == mCurrentAction) { @@ -208,7 +209,7 @@ void LLAgentPilot::updateTarget() //gAgent.stopAutoPilot(); mCurrentAction++; - if (mCurrentAction < mActions.count()) + if (mCurrentAction < mActions.size()) { gAgent.startAutoPilotGlobal(mActions[mCurrentAction].mTarget); } diff --git a/indra/newview/llagentpilot.h b/indra/newview/llagentpilot.h index 0ad4772f6..96f39eead 100644 --- a/indra/newview/llagentpilot.h +++ b/indra/newview/llagentpilot.h @@ -36,7 +36,6 @@ #include "stdtypes.h" #include "lltimer.h" #include "v3dmath.h" -#include "lldarray.h" // Class that drives the agent around according to a "script". @@ -92,7 +91,7 @@ private: F64 mTime; }; - LLDynamicArray mActions; + std::vector mActions; LLTimer mTimer; }; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8f7571404..386354e97 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1082,7 +1082,7 @@ public: { LL_INFOS() << "One item created " << inv_item.asString() << LL_ENDL; LLViewerInventoryItem *item = gInventory.getItem(inv_item); - mItemsToLink.put(item); + mItemsToLink.push_back(item); updatePendingWearable(inv_item); } ~OnWearableItemCreatedCB() @@ -1366,7 +1366,7 @@ void LLAgentWearables::removeWearableFinal( LLWearableType::EType type, bool do_ // Assumes existing wearables are not dirty. void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, - const LLDynamicArray< LLViewerWearable* >& wearables, + const std::vector< LLViewerWearable* >& wearables, BOOL remove) { LL_INFOS() << "setWearableOutfit() start" << LL_ENDL; @@ -1385,8 +1385,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it } } - S32 count = wearables.count(); - llassert(items.count() == count); + S32 count = wearables.size(); + llassert(items.size() == count); S32 i; for (i = 0; i < count; i++) @@ -1690,7 +1690,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj std::set requested_item_ids; std::set current_item_ids; - for (S32 i=0; igetLinkedUUID()); // Build up list of objects to be removed and items currently attached. @@ -1816,12 +1816,12 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra if ( (rlv_handler_t::isEnabled()) && (sInitialAttachmentsRequested) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) ) { // Fall-back code: everything should really already have been pruned before we get this far - for (S32 idxItem = obj_item_array.count() - 1; idxItem >= 0; idxItem--) + for (S32 idxItem = obj_item_array.size() - 1; idxItem >= 0; idxItem--) { - const LLInventoryItem* pItem = obj_item_array.get(idxItem).get(); + const LLInventoryItem* pItem = obj_item_array.at(idxItem).get(); if (!gRlvAttachmentLocks.canAttach(pItem)) { - obj_item_array.remove(idxItem); + obj_item_array.erase(obj_item_array.begin() + idxItem); RLV_ASSERT(false); } } @@ -1829,7 +1829,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra // [/RLVa:KB] // Build a compound message to send all the objects that need to be rezzed. - S32 obj_count = obj_item_array.count(); + S32 obj_count = obj_item_array.size(); // Limit number of packets to send const S32 MAX_PACKETS_TO_SEND = 10; @@ -1860,7 +1860,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra msg->addBOOLFast(_PREHASH_FirstDetachAll, false ); } - const LLInventoryItem* item = obj_item_array.get(i).get(); + const LLInventoryItem* item = obj_item_array.at(i).get(); bool replace = !gHippoGridManager->getConnectedGrid()->supportsInvLinks(); msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 5f8ece16e..29ba8f076 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -114,7 +114,7 @@ private: /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed); public: // void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); - void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLViewerWearable* >& wearables, BOOL remove); + void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables, BOOL remove); void setWearableName(const LLUUID& item_id, const std::string& new_name); void nameOrDescriptionChanged(LLUUID const& item_id); // *TODO: Move this into llappearance/LLWearableData ? diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index ad6937c1b..9fbf401c9 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -408,7 +408,7 @@ void LLLibraryOutfitsFetch::folderDone() // Early out if we already have items in My Outfits // except the case when My Outfits contains just initial outfit - if (cat_array.count() > 1) + if (cat_array.size() > 1) { mOutfitsPopulated = true; return; @@ -424,9 +424,9 @@ void LLLibraryOutfitsFetch::folderDone() cat_array, wearable_array, LLInventoryModel::EXCLUDE_TRASH, matchFolderFunctor); - if (cat_array.count() > 0) + if (cat_array.size() > 0) { - const LLViewerInventoryCategory *cat = cat_array.get(0); + const LLViewerInventoryCategory *cat = cat_array.at(0); mLibraryClothingID = cat->getUUID(); } @@ -483,7 +483,7 @@ void LLLibraryOutfitsFetch::outfitsDone() matchFolderFunctor); if (cat_array.size() > 0) { - const LLViewerInventoryCategory *cat = cat_array.get(0); + const LLViewerInventoryCategory *cat = cat_array.at(0); mImportedClothingID = cat->getUUID(); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b3d1fb1b8..5d44aa1a8 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -772,9 +772,9 @@ void LLWearableHoldingPattern::onAllComplete() } // Activate all gestures in this folder - if (mGestItems.count() > 0) + if (mGestItems.size() > 0) { - LL_DEBUGS("Avatar") << self_av_string() << "Activating " << mGestItems.count() << " gestures" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Activating " << mGestItems.size() << " gestures" << LL_ENDL; LLGestureMgr::instance().activateGestures(mGestItems); @@ -798,8 +798,8 @@ void LLWearableHoldingPattern::onAllComplete() // // Update attachments to match those requested. // if (isAgentAvatarValid()) // { -// LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; -// LL_INFOS() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; +// LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; +// LL_INFOS() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; // LLAgentWearables::userUpdateAttachments(mObjItems); // } @@ -1235,9 +1235,9 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) // encountered, so we actually keep the *last* of each duplicate // item. This is needed to give the right priority when adding // duplicate items to an existing outfit. - for (S32 i=items.count()-1; i>=0; i--) + for (S32 i=items.size()-1; i>=0; i--) { - LLViewerInventoryItem *item = items.get(i); + LLViewerInventoryItem *item = items.at(i); LLUUID item_id = item->getLinkedUUID(); if (items_seen.find(item_id)!=items_seen.end()) continue; @@ -1248,7 +1248,7 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) it != tmp_list.end(); ++it) { - new_items.put(*it); + new_items.push_back(*it); } items = new_items; } @@ -1257,15 +1257,15 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t& items) { std::set idsAsset; - for (S32 idxItem = items.count() - 1; idxItem >= 0; idxItem--) + for (S32 idxItem = items.size() - 1; idxItem >= 0; idxItem--) { - const LLViewerInventoryItem* pItem = items.get(idxItem); + const LLViewerInventoryItem* pItem = items.at(idxItem); if (!pItem->isWearableType()) continue; if (idsAsset.end() == idsAsset.find(pItem->getAssetUUID())) idsAsset.insert(pItem->getAssetUUID()); else - items.remove(idxItem); + items.erase(items.begin() + idxItem); } } // [/SL:KB] @@ -1555,9 +1555,9 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id) // deactivate all gestures in the outfit folder LLInventoryModel::item_array_t gest_items; getDescendentsOfAssetType(cat_id, gest_items, LLAssetType::AT_GESTURE, true); - for(S32 i = 0; i < gest_items.count(); ++i) + for(S32 i = 0; i < gest_items.size(); ++i) { - LLViewerInventoryItem* gest_item = gest_items.get(i); + LLViewerInventoryItem* gest_item = gest_items.at(i); if (LLGestureMgr::instance().isGestureActive(gest_item->getLinkedUUID())) { LLGestureMgr::instance().deactivateGesture(gest_item->getLinkedUUID()); @@ -1596,7 +1596,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(src_id, cats, items); - LL_INFOS() << "copying " << items->count() << " items" << LL_ENDL; + LL_INFOS() << "copying " << items->size() << " items" << LL_ENDL; copyItems(dst_id, items, cb); } @@ -1744,11 +1744,11 @@ bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id) if (items.size()) return true; // Is there an active gesture in outfit_cat_id? - items.reset(); + items.clear(); LLIsType is_gesture(LLAssetType::AT_GESTURE); gInventory.collectDescendentsIf(outfit_cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_gesture, /*follow_folder_links=*/ true); - for(S32 i = 0; i < items.count(); ++i) - if (LLGestureMgr::instance().isGestureActive(items.get(i)->getLinkedUUID())) + for(S32 i = 0; i < items.size(); ++i) + if (LLGestureMgr::instance().isGestureActive(items.at(i)->getLinkedUUID())) return true; return false; } @@ -1807,9 +1807,9 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) LLInventoryModel::item_array_t items; gInventory.collectDescendents(category, cats, items, LLInventoryModel::EXCLUDE_TRASH); - for (S32 i = 0; i < items.count(); ++i) + for (S32 i = 0; i < items.size(); ++i) { - LLViewerInventoryItem *item = items.get(i); + LLViewerInventoryItem *item = items.at(i); if (item->getActualType() != LLAssetType::AT_LINK_FOLDER) continue; if (item->getIsLinkType()) @@ -1829,9 +1829,9 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin LLInventoryModel::item_array_t items; gInventory.collectDescendents(category, cats, items, LLInventoryModel::EXCLUDE_TRASH); - for (S32 i = 0; i < items.count(); ++i) + for (S32 i = 0; i < items.size(); ++i) { - LLViewerInventoryItem *item = items.get(i); + LLViewerInventoryItem *item = items.at(i); if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER)) continue; if (item->getIsLinkType()) @@ -1891,9 +1891,9 @@ void LLAppearanceMgr::syncCOF(const LLInventoryModel::item_array_t& items, gInventory.collectDescendents(getCOF(), cats, cur_cof_items, LLInventoryModel::EXCLUDE_TRASH); // Purge everything in cur_cof_items that isn't part of new_cof_items - for (S32 idxCurItem = 0, cntCurItem = cur_cof_items.count(); idxCurItem < cntCurItem; idxCurItem++) + for (S32 idxCurItem = 0, cntCurItem = cur_cof_items.size(); idxCurItem < cntCurItem; idxCurItem++) { - LLViewerInventoryItem* pItem = cur_cof_items.get(idxCurItem); + LLViewerInventoryItem* pItem = cur_cof_items.at(idxCurItem); if (std::find_if(new_cof_items.begin(), new_cof_items.end(), RlvPredIsEqualOrLinkedItem(pItem)) == new_cof_items.end()) { // Item doesn't exist in new_cof_items => purge (if it's a link) @@ -1913,9 +1913,9 @@ void LLAppearanceMgr::syncCOF(const LLInventoryModel::item_array_t& items, } // Whatever remains in new_cof_items will need to have a link created - for (S32 idxNewItem = 0, cntNewItem = new_cof_items.count(); idxNewItem < cntNewItem; idxNewItem++) + for (S32 idxNewItem = 0, cntNewItem = new_cof_items.size(); idxNewItem < cntNewItem; idxNewItem++) { - LLViewerInventoryItem* pItem = new_cof_items.get(idxNewItem); + LLViewerInventoryItem* pItem = new_cof_items.at(idxNewItem); if (items_to_add.end() == std::find(items_to_add.begin(), items_to_add.end(), pItem)) { items_to_add.push_back(pItem); @@ -1956,9 +1956,9 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, LLInventoryModel::item_array_t& items, LLPointer cb) { - for (S32 i=0; igetLinkedUUID(), cat_uuid, @@ -2009,9 +2009,9 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new, { LLInventoryModel::item_array_t gest_items; getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false); - for(S32 i = 0; i < gest_items.count(); ++i) + for(S32 i = 0; i < gest_items.size(); ++i) { - LLViewerInventoryItem *gest_item = gest_items.get(i); + LLViewerInventoryItem *gest_item = gest_items.at(i); if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) ) { LLGestureMgr::instance().deactivateGesture( gest_item->getLinkedUUID() ); @@ -2103,10 +2103,10 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new, // Create links to new COF contents. LLInventoryModel::item_array_t all_items; - all_items += body_items; - all_items += wear_items; - all_items += obj_items; - all_items += gest_items; + std::copy(body_items.begin(), body_items.end(), std::back_inserter(all_items)); + std::copy(wear_items.begin(), wear_items.end(), std::back_inserter(all_items)); + std::copy(obj_items.begin(), obj_items.end(), std::back_inserter(all_items)); + std::copy(gest_items.begin(), gest_items.end(), std::back_inserter(all_items)); // [SL:KB] // Synchronize COF @@ -2187,7 +2187,7 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo { LL_DEBUGS() << "updateAgentWearables()" << LL_ENDL; LLInventoryItem::item_array_t items; - LLDynamicArray< LLViewerWearable* > wearables; + std::vector< LLViewerWearable* > wearables; // [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0f) | Added: RLVa-1.3.0f uuid_vec_t idsCurrent; LLInventoryModel::item_array_t itemsNew; if (rlv_handler_t::isEnabled()) @@ -2229,8 +2229,8 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo } #endif // RLV_DEBUG // [/RLVa:KB] - items.put(item); - wearables.put(wearable); + items.push_back(item); + wearables.push_back(wearable); // [RLVa:KB] - Checked: 2011-03-31 (RLVa-1.3.0f) | Added: RLVa-1.3.0f if ( (rlv_handler_t::isEnabled()) && (gAgentWearables.areInitalWearablesLoaded()) ) { @@ -2257,14 +2257,14 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo if (pWearable) RlvBehaviourNotifyHandler::onTakeOff(pWearable->getType(), true); } - for (S32 idxItem = 0, cntItem = itemsNew.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = itemsNew.size(); idxItem < cntItem; idxItem++) { - RlvBehaviourNotifyHandler::onWear(itemsNew.get(idxItem)->getWearableType(), true); + RlvBehaviourNotifyHandler::onWear(itemsNew.at(idxItem)->getWearableType(), true); } } // [/RLVa:KB] - if(wearables.count() > 0) + if(wearables.size() > 0) { gAgentWearables.setWearableOutfit(items, wearables, !append); } @@ -2308,7 +2308,7 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list, ++it) { LLViewerInventoryItem *item = *it; - if (keep_list.find(item) < 0) // Why on earth does LLDynamicArray need to redefine find()? + if (std::find(keep_list.begin(), keep_list.end(), item) == keep_list.end()) { kill_list.push_back(item); } @@ -2458,12 +2458,12 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } // Don't remove attachments until avatar is fully loaded (should reduce random attaching/detaching/reattaching at log-on) - LL_DEBUGS("Avatar") << self_av_string() << "Updating " << obj_items.count() << " attachments" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Updating " << obj_items.size() << " attachments" << LL_ENDL; LLAgentWearables::userUpdateAttachments(obj_items, !gAgentAvatarp->isFullyLoaded()); } // [/SL:KB] - if(!wear_items.count()) + if(!wear_items.size()) { LLNotificationsUtil::add("CouldNotPutOnOutfit"); return; @@ -2483,9 +2483,9 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) // callback will be called (and this object deleted) // before the final getNextData(). - for(S32 i = 0; i < wear_items.count(); ++i) + for(S32 i = 0; i < wear_items.size(); ++i) { - LLViewerInventoryItem *item = wear_items.get(i); + LLViewerInventoryItem *item = wear_items.at(i); LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; // Fault injection: use debug setting to test asset @@ -4143,23 +4143,23 @@ void LLAppearanceMgr::dumpCat(const LLUUID& cat_id, const std::string& msg) LL_INFOS() << LL_ENDL; LL_INFOS() << str << LL_ENDL; S32 hitcount = 0; - for(S32 i=0; igetName() <getLinkedItem() : NULL; LLUUID asset_id; if (linked_item) @@ -4399,7 +4399,7 @@ public: cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH); - S32 count = item_array.count(); + S32 count = item_array.size(); if(!count) { LL_WARNS() << "Nothing fetched in category " << mComplete.front() @@ -4414,11 +4414,11 @@ public: return; } - LL_INFOS() << "stage1 got " << item_array.count() << " items, passing to stage2 " << LL_ENDL; + LL_INFOS() << "stage1 got " << item_array.size() << " items, passing to stage2 " << LL_ENDL; uuid_vec_t ids; for(S32 i = 0; i < count; ++i) { - ids.push_back(item_array.get(i)->getUUID()); + ids.push_back(item_array.at(i)->getUUID()); } gInventory.removeObserver(this); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 6d404d68d..5062fe9eb 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -162,7 +162,7 @@ void LLAvatarActions::offerTeleport(const LLUUID& invitee) if (invitee.isNull()) return; - LLDynamicArray ids; + std::vector ids; ids.push_back(invitee); offerTeleport(ids); } @@ -258,8 +258,6 @@ void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids) return; } - // convert vector into LLDynamicArray for addSession - LLDynamicArray id_array; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { // [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0) @@ -270,7 +268,6 @@ void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids) RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF); return; } - id_array.push_back(idAgent); // [/RLVa:KB] // id_array.push_back(*it); } @@ -278,7 +275,7 @@ void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids) // create the new ad hoc voice session const std::string title = LLTrans::getString("conference-title"); LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, - ids[0], id_array); + ids[0], ids); if (session_id.isNull()) { return; diff --git a/indra/newview/llcloud.h b/indra/newview/llcloud.h index b3fd6f681..d7863c27f 100644 --- a/indra/newview/llcloud.h +++ b/indra/newview/llcloud.h @@ -73,7 +73,6 @@ #include "v4math.h" #include "v4color.h" #include "llmemory.h" -#include "lldarray.h" #include "llframetimer.h" diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 357b916bb..af15459da 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -183,7 +183,7 @@ void LLFloaterScriptQueue::onCloseBtn(void* user_data) void LLFloaterScriptQueue::addObject(const LLUUID& id) { - mObjectIDs.put(id); + mObjectIDs.push_back(id); } BOOL LLFloaterScriptQueue::start() @@ -193,7 +193,7 @@ BOOL LLFloaterScriptQueue::start() LLStringUtil::format_map_t args; args["[START]"] = mStartString; - args["[COUNT]"] = llformat ("%d", mObjectIDs.count()); + args["[COUNT]"] = llformat ("%d", mObjectIDs.size()); buffer = getString ("Starting", args); getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); @@ -648,7 +648,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, { // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. - LLDynamicArray names; + std::vector names; LLInventoryObject::object_list_t::const_iterator it = inv->begin(); LLInventoryObject::object_list_t::const_iterator end = inv->end(); @@ -709,7 +709,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, { // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. - LLDynamicArray names; + std::vector names; LLInventoryObject::object_list_t::const_iterator it = inv->begin(); LLInventoryObject::object_list_t::const_iterator end = inv->end(); @@ -793,7 +793,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, { // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. - LLDynamicArray names; + std::vector names; LLInventoryObject::object_list_t::const_iterator it = inv->begin(); LLInventoryObject::object_list_t::const_iterator end = inv->end(); diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 9114ce484..281929445 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -33,7 +33,6 @@ #ifndef LL_LLCOMPILEQUEUE_H #define LL_LLCOMPILEQUEUE_H -#include "lldarray.h" #include "llinventory.h" #include "llviewerobject.h" #include "llvoinventorylistener.h" @@ -103,7 +102,7 @@ protected: LLButton* mCloseBtn; // Object Queue - LLDynamicArray mObjectIDs; + std::vector mObjectIDs; LLUUID mCurrentObjectID; bool mDone; diff --git a/indra/newview/lldebugmessagebox.h b/indra/newview/lldebugmessagebox.h index 6da5b6b1c..1f38e39c6 100644 --- a/indra/newview/lldebugmessagebox.h +++ b/indra/newview/lldebugmessagebox.h @@ -34,7 +34,6 @@ #ifndef LL_LLDEBUGMESSAGEBOX_H #define LL_LLDEBUGMESSAGEBOX_H -#include "lldarray.h" #include "llfloater.h" #include "v3math.h" #include "lltextbox.h" diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index abf1e74ec..5e725cd1a 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -78,7 +78,7 @@ extern bool gShiftFrame; U32 LLDrawable::sCurVisible = 0; U32 LLDrawable::sNumZombieDrawables = 0; F32 LLDrawable::sCurPixelAngle = 0; -LLDynamicArrayPtr > LLDrawable::sDeadList; +std::vector > LLDrawable::sDeadList; #define FORCE_INVISIBLE_AREA 16.f @@ -163,7 +163,7 @@ void LLDrawable::markDead() // We're dead. Free up all of our references to other objects setState(DEAD); cleanupReferences(); -// sDeadList.put(this); +// sDeadList.push_back(this); } LLVOVolume* LLDrawable::getVOVolume() const @@ -236,7 +236,7 @@ void LLDrawable::cleanupDeadDrawables() } } */ - sDeadList.reset(); + sDeadList.clear(); } S32 LLDrawable::findReferences(LLDrawable *drawablep) diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 5fddc3773..fc3167d12 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -44,7 +44,6 @@ #include "llvector4a.h" #include "llquaternion.h" #include "xform.h" -#include "lldarray.h" #include "llviewerobject.h" #include "llrect.h" #include "llappviewer.h" // for gFrameTimeSeconds @@ -341,7 +340,7 @@ private: static U32 sCurVisible; // Counter for what value of mVisible means currently visible static U32 sNumZombieDrawables; - static LLDynamicArrayPtr > sDeadList; + static std::vector > sDeadList; } LL_ALIGN_POSTFIX(16); diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 94e71c074..f76bd5ec9 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -37,7 +37,6 @@ #include "v4coloru.h" #include "llquaternion.h" #include "xform.h" -#include "lldarrayptr.h" #include "llvertexbuffer.h" #include "llviewertexture.h" #include "llstat.h" diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index bbaebf379..99da9e906 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -1235,9 +1235,9 @@ void LLFloaterAvatarList::sendKeys() const std::ostringstream ids; U32 num_ids = 0; - for (S32 i = 0; i < regionp->mMapAvatarIDs.count(); ++i) + for (S32 i = 0; i < regionp->mMapAvatarIDs.size(); ++i) { - ids << "," << regionp->mMapAvatarIDs.get(i); + ids << "," << regionp->mMapAvatarIDs.at(i); ++num_ids; if (ids.tellp() > 200) { diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 3c8e7a684..7e9589a79 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -79,17 +79,17 @@ void LLFloaterBulkPermission::doApply() class ModifiableGatherer : public LLSelectedNodeFunctor { public: - ModifiableGatherer(LLDynamicArray& q) : mQueue(q) {} + ModifiableGatherer(std::vector& q) : mQueue(q) {} virtual bool apply(LLSelectNode* node) { if( node->allowOperationOnNode(PERM_MODIFY, GP_OBJECT_MANIPULATE) ) { - mQueue.put(node->getObject()->getID()); + mQueue.push_back(node->getObject()->getID()); } return true; } private: - LLDynamicArray& mQueue; + std::vector& mQueue; }; LLScrollListCtrl* list = getChild("queue output"); list->deleteAllItems(); @@ -190,7 +190,7 @@ BOOL LLFloaterBulkPermission::nextObject() BOOL successful_start = FALSE; do { - count = mObjectIDs.count(); + count = mObjectIDs.size(); //LL_INFOS() << "Objects left to process = " << count << LL_ENDL; mCurrentObjectID.setNull(); if(count > 0) @@ -198,7 +198,7 @@ BOOL LLFloaterBulkPermission::nextObject() successful_start = popNext(); //LL_INFOS() << (successful_start ? "successful" : "unsuccessful") << LL_ENDL; } - } while((mObjectIDs.count() > 0) && !successful_start); + } while((mObjectIDs.size() > 0) && !successful_start); if(isDone() && !mDone) { @@ -214,12 +214,12 @@ BOOL LLFloaterBulkPermission::popNext() { // get the head element from the container, and attempt to get its inventory. BOOL rv = FALSE; - S32 count = mObjectIDs.count(); + S32 count = mObjectIDs.size(); if(mCurrentObjectID.isNull() && (count > 0)) { - mCurrentObjectID = mObjectIDs.get(0); + mCurrentObjectID = mObjectIDs.at(0); //LL_INFOS() << "mCurrentID: " << mCurrentObjectID << LL_ENDL; - mObjectIDs.remove(0); + mObjectIDs.erase(mObjectIDs.begin()); LLViewerObject* obj = gObjectList.findObject(mCurrentObjectID); if(obj) { diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h index cd8c5760f..428e8ae96 100644 --- a/indra/newview/llfloaterbulkpermission.h +++ b/indra/newview/llfloaterbulkpermission.h @@ -34,7 +34,6 @@ #ifndef LL_LLBULKPERMISSION_H #define LL_LLBULKPERMISSION_H -#include "lldarray.h" #include "llinventory.h" #include "llviewerobject.h" #include "llvoinventorylistener.h" @@ -82,7 +81,7 @@ private: void onUncheckAll() { doCheckUncheckAll(FALSE); } // returns true if this is done - BOOL isDone() const { return (mCurrentObjectID.isNull() || (mObjectIDs.count() == 0)); } + BOOL isDone() const { return (mCurrentObjectID.isNull() || (mObjectIDs.size() == 0)); } //Read the settings and Apply the permissions void doApply(); @@ -90,7 +89,7 @@ private: private: // Object Queue - LLDynamicArray mObjectIDs; + std::vector mObjectIDs; LLUUID mCurrentObjectID; BOOL mDone; diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index 6a1a05cb8..9f43828c5 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -741,7 +741,7 @@ void LLFloaterCustomize::saveCurrentWearables() LLAppearanceMgr::instance().findCOFItemLinks(wearable->getItemID()); if (links.size()>0) { - link_item = links.get(0).get(); + link_item = links.at(0).get(); if (link_item && link_item->getIsLinkType()) { description = link_item->getActualDescription(); diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index 40bb1de96..a64495b0a 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -39,8 +39,6 @@ #include "llfloater.h" -#include "lldarray.h" - class LLScrollContainer; class LLView; class LLButton; diff --git a/indra/newview/llfloaterlandmark.cpp b/indra/newview/llfloaterlandmark.cpp index 423718839..cf5ebef59 100644 --- a/indra/newview/llfloaterlandmark.cpp +++ b/indra/newview/llfloaterlandmark.cpp @@ -244,10 +244,10 @@ const LLUUID& LLFloaterLandmark::findItemID(const LLUUID& asset_id, BOOL copyabl LLInventoryModel::INCLUDE_TRASH, asset_id_matches); - if (items.count()) + if (items.size()) { // search for copyable version first - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { LLInventoryItem* itemp = items[i]; LLPermissions item_permissions = itemp->getPermissions(); diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index d31e4cb4a..22dbe1d87 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -328,7 +328,7 @@ void LLFloaterOutbox::updateFolderCount() LLInventoryModel::item_array_t * items; gInventory.getDirectDescendentsOf(mOutboxId, cats, items); - item_count = cats->count() + items->count(); + item_count = cats->size() + items->size(); } mOutboxItemCount = item_count; diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 83135dc9f..f60ff56e1 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -618,9 +618,9 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) buildLandmarkIDLists(); BOOL found = FALSE; S32 idx; - for (idx = 0; idx < mLandmarkItemIDList.count(); idx++) + for (idx = 0; idx < mLandmarkItemIDList.size(); idx++) { - if ( mLandmarkItemIDList.get(idx) == landmark_item_id) + if ( mLandmarkItemIDList.at(idx) == landmark_item_id) { found = TRUE; break; @@ -629,13 +629,13 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) if (found && iface->setCurrentByID( landmark_item_id ) ) { - LLUUID asset_id = mLandmarkAssetIDList.get( idx ); + LLUUID asset_id = mLandmarkAssetIDList.at( idx ); std::string name; LLComboBox* combo = getChild( "landmark combo"); if (combo) name = combo->getSimple(); mTrackedStatus = LLTracker::TRACKING_LANDMARK; - LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID - mLandmarkItemIDList.get( idx ), // itemID + LLTracker::trackLandmark(mLandmarkAssetIDList.at( idx ), // assetID + mLandmarkItemIDList.at( idx ), // itemID name); // name if( asset_id != sHomeID ) @@ -1026,15 +1026,15 @@ void LLFloaterWorldMap::buildLandmarkIDLists() list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } - mLandmarkItemIDList.reset(); - mLandmarkAssetIDList.reset(); + mLandmarkItemIDList.clear(); + mLandmarkAssetIDList.clear(); // Get all of the current landmarks - mLandmarkAssetIDList.put( LLUUID::null ); - mLandmarkItemIDList.put( LLUUID::null ); + mLandmarkAssetIDList.push_back(LLUUID::null); + mLandmarkItemIDList.push_back(LLUUID::null); - mLandmarkAssetIDList.put( sHomeID ); - mLandmarkItemIDList.put( sHomeID ); + mLandmarkAssetIDList.push_back(sHomeID); + mLandmarkItemIDList.push_back(sHomeID); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -1047,15 +1047,15 @@ void LLFloaterWorldMap::buildLandmarkIDLists() std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); - S32 count = items.count(); + S32 count = items.size(); for(S32 i = 0; i < count; ++i) { - LLInventoryItem* item = items.get(i); + LLInventoryItem* item = items.at(i); list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); - mLandmarkAssetIDList.put( item->getAssetUUID() ); - mLandmarkItemIDList.put( item->getUUID() ); + mLandmarkAssetIDList.push_back(item->getAssetUUID()); + mLandmarkItemIDList.push_back(item->getUUID()); } list->sortByColumn(std::string("landmark name"), TRUE); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 952570287..4751b15e1 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -37,7 +37,6 @@ #ifndef LL_LLFLOATERWORLDMAP_H #define LL_LLFLOATERWORLDMAP_H -#include "lldarray.h" #include "llfloater.h" #include "llhudtext.h" #include "llmapimagetype.h" @@ -170,8 +169,8 @@ private: // enable/disable teleport destination coordinates void enableTeleportCoordsDisplay( bool enabled ); - LLDynamicArray mLandmarkAssetIDList; - LLDynamicArray mLandmarkItemIDList; + std::vector mLandmarkAssetIDList; + std::vector mLandmarkItemIDList; static const LLUUID sHomeID; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 7c3dda0aa..d29fa91b4 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1053,9 +1053,9 @@ void LLFolderView::removeCutItems() return; // Get the list of clipboard item uuids and iterate through them - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); - for (LLDynamicArray::const_iterator iter = objects.begin(); + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { @@ -1123,7 +1123,7 @@ void LLFolderView::removeSelectedItems( void ) } else if (count > 1) { - LLDynamicArray listeners; + std::vector listeners; LLFolderViewEventListener* listener; LLFolderViewItem* last_item = items[count - 1]; LLFolderViewItem* new_selection = last_item->getNextOpenNode(FALSE); @@ -1151,12 +1151,12 @@ void LLFolderView::removeSelectedItems( void ) for(S32 i = 0; i < count; ++i) { listener = items[i]->getListener(); - if(listener && (listeners.find(listener) == LLDynamicArray::FAIL)) + if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end())) { - listeners.put(listener); + listeners.push_back(listener); } } - listener = listeners.get(0); + listener = listeners.at(0); if(listener) { listener->removeBatch(listeners); diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index bf89339de..76f32e1a3 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -45,7 +45,6 @@ #include "lluictrl.h" #include "v4color.h" -#include "lldarray.h" #include "stdenums.h" #include "lldepthstack.h" #include "lleditmenuhandler.h" diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 3c942352d..dd1c7957d 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -25,7 +25,6 @@ #ifndef LLFOLDERVIEWEVENTLISTENER_H #define LLFOLDERVIEWEVENTLISTENER_H -#include "lldarray.h" // *TODO: convert to std::vector #include "llfoldertype.h" #include "llfontgl.h" // just for StyleFlags enum #include "llinventorytype.h" @@ -72,7 +71,7 @@ public: virtual BOOL isItemRemovable( void ) const = 0; // Can be destroyed virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual. virtual BOOL removeItem() = 0; - virtual void removeBatch(LLDynamicArray& batch) = 0; + virtual void removeBatch(std::vector& batch) = 0; virtual void move( LLFolderViewEventListener* parent_listener ) = 0; virtual BOOL isItemCopyable() const = 0; virtual BOOL copyToClipboard() const = 0; diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 8d4362683..a8ad4ca0e 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -27,7 +27,6 @@ #define LLFOLDERVIEWITEM_H #include "llview.h" -#include "lldarray.h" // *TODO: Eliminate, forward declare #include "lluiimage.h" #include "lluictrl.h" diff --git a/indra/newview/llframestats.cpp b/indra/newview/llframestats.cpp index 47db51c27..38ba40aa7 100644 --- a/indra/newview/llframestats.cpp +++ b/indra/newview/llframestats.cpp @@ -96,7 +96,7 @@ LLFrameStats::LLFrameStats() LLFrameStats::~LLFrameStats() { - mFrameData.reset(); + mFrameData.clear(); } void LLFrameStats::start(const EStat stat) @@ -149,7 +149,7 @@ void LLFrameStats::addFrameData() gTerseObjectUpdates = 0; - mFrameData.put(frame_data); + mFrameData.push_back(frame_data); if (mUseTimer) { if (mTimer.getElapsedTimeF32() > mStopTime) @@ -162,11 +162,11 @@ void LLFrameStats::addFrameData() void LLFrameStats::dump() { - if (mFrameData.count()) + if (mFrameData.size()) { F32 total_time = 0; S64 total_triangles = 0; - S32 total_frames = mFrameData.count(); + S32 total_frames = mFrameData.size(); S32 total_num_objects = 0; time_t cur_time; @@ -191,7 +191,7 @@ void LLFrameStats::dump() LL_INFOS() << "Couldn't open file for dumping frame stats!" << LL_ENDL; return; } - LL_INFOS() << "Dumping frame statistics for " << mFrameData.count() << " frames" << LL_ENDL; + LL_INFOS() << "Dumping frame statistics for " << mFrameData.size() << " frames" << LL_ENDL; fprintf(fp, "Time\tNumTriangles\t"); @@ -203,7 +203,7 @@ void LLFrameStats::dump() fprintf(fp, "Full Updates\tTerse Updates\tTotal Vorbis\tLong Vorbis\tNum Vorbis Decodes\t"); fprintf(fp, "\n"); - for (i = 0; i < mFrameData.count(); i++) + for (i = 0; i < mFrameData.size(); i++) { total_time += mFrameData[i].mTotalDuration; total_triangles += mFrameData[i].mNumTriangles; @@ -247,7 +247,7 @@ void LLFrameStats::dump() fprintf(fp, "\n"); fclose(fp); } - mFrameData.reset(); + mFrameData.clear(); } void LLFrameStats::setTrackStats(const BOOL track_stats) @@ -267,7 +267,7 @@ void LLFrameStats::setTrackStats(const BOOL track_stats) if (track_stats) { // Reset the frame data - mFrameData.reset(); + mFrameData.clear(); } mTrackStats = track_stats; } diff --git a/indra/newview/llframestats.h b/indra/newview/llframestats.h index 1bd3e0f42..d9df00a4d 100644 --- a/indra/newview/llframestats.h +++ b/indra/newview/llframestats.h @@ -36,7 +36,6 @@ #include "stdtypes.h" #include "llstat.h" #include "llstring.h" -#include "lldarray.h" #include "v4color.h" #include "lltimer.h" @@ -119,7 +118,7 @@ private: LLStat mStats[NUM_STATS]; static std::string sStatLabels[NUM_STATS]; static LLColor4 sStatColors[NUM_STATS]; - LLDynamicArray mFrameData; + std::vector mFrameData; void stop(); }; diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index d961a349f..9ba3092a6 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -259,11 +259,11 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, items, LLInventoryModel::EXCLUDE_TRASH, giveable); - S32 count = cats.count(); + S32 count = cats.size(); bool complete = true; for(S32 i = 0; i < count; ++i) { - if(!gInventory.isCategoryComplete(cats.get(i)->getUUID())) + if(!gInventory.isCategoryComplete(cats.at(i)->getUUID())) { complete = false; break; @@ -274,7 +274,7 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, LLNotificationsUtil::add("IncompleteInventory"); give_successful = false; } - count = items.count() + cats.count(); + count = items.size() + cats.size(); if(count > MAX_ITEMS) { LLNotificationsUtil::add("TooManyItems"); @@ -475,10 +475,10 @@ bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, cons items, LLInventoryModel::EXCLUDE_TRASH, remove); - S32 count = items.count(); + S32 count = items.size(); for(S32 i = 0; i < count; ++i) { - gInventory.deleteObject(items.get(i)->getUUID()); + gInventory.deleteObject(items.at(i)->getUUID()); } gInventory.notifyObservers(); @@ -529,7 +529,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < // MTUBYTES or 18 * count < 1200 => count < 1200/18 => // 66. I've cut it down a bit from there to give some pad. - S32 count = items.count() + cats.count(); + S32 count = items.size() + cats.size(); if(count > MAX_ITEMS) { LLNotificationsUtil::add("TooManyItems"); @@ -555,21 +555,21 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ pos += UUID_BYTES; S32 i; - count = cats.count(); + count = cats.size(); for(i = 0; i < count; ++i) { memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ pos += sizeof(U8); - memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ + memcpy(pos, &(cats.at(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ pos += UUID_BYTES; } - count = items.count(); + count = items.size(); for(i = 0; i < count; ++i) { - type = (U8)items.get(i)->getType(); + type = (U8)items.at(i)->getType(); memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */ pos += sizeof(U8); - memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ + memcpy(pos, &(items.at(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ pos += UUID_BYTES; } pack_instant_message( diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 08374095e..d97cd8d35 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -222,7 +222,7 @@ void LLGroupActions::startCall(const LLUUID& group_id) } // [/RLVa:KB] - LLUUID session_id = gIMMgr->addSession(gdata.mName, IM_SESSION_GROUP_START, group_id, true); + LLUUID session_id = gIMMgr->addSession(gdata.mName, IM_SESSION_GROUP_START, group_id); if (session_id.isNull()) { LL_WARNS() << "Error adding session" << LL_ENDL; diff --git a/indra/newview/llgroupnotify.h b/indra/newview/llgroupnotify.h index 29d2454bf..ac7e5abec 100644 --- a/indra/newview/llgroupnotify.h +++ b/indra/newview/llgroupnotify.h @@ -35,7 +35,6 @@ #include "llfontgl.h" #include "llpanel.h" -#include "lldarray.h" #include "lltimer.h" #include "llviewermessage.h" #include "llnotifications.h" diff --git a/indra/newview/llhoverview.h b/indra/newview/llhoverview.h index 76f491fbb..47bfa5ada 100644 --- a/indra/newview/llhoverview.h +++ b/indra/newview/llhoverview.h @@ -41,7 +41,6 @@ #include "llcoord.h" #include "v3dmath.h" -#include "lldarray.h" #include "llviewerwindow.h" #include "llviewerobject.h" diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h index 0a65a5092..6cf15df48 100644 --- a/indra/newview/llhudicon.h +++ b/indra/newview/llhudicon.h @@ -34,7 +34,6 @@ #define LL_LLHUDICON_H #include "llpointer.h" -#include "lldarrayptr.h" #include "llhudobject.h" #include "v4color.h" @@ -45,7 +44,6 @@ #include "llfontgl.h" #include #include -#include "lldarray.h" // Renders a 2D icon billboard floating at the location specified. class LLDrawable; diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp index d91da09d9..c78880d90 100644 --- a/indra/newview/llhudmanager.cpp +++ b/indra/newview/llhudmanager.cpp @@ -67,7 +67,7 @@ void LLHUDManager::updateEffects() { LLFastTimer ftm(FTM_HUD_EFFECTS); S32 i; - for (i = 0; i < mHUDEffects.count(); i++) + for (i = 0; i < mHUDEffects.size(); i++) { LLHUDEffect *hep = mHUDEffects[i]; if (hep->isDead()) @@ -85,7 +85,7 @@ void LLHUDManager::sendEffects() static LLCachedControl broadcast_viewer_effects(gSavedSettings, "BroadcastViewerEffects", true); S32 i; - for (i = 0; i < mHUDEffects.count(); i++) + for (i = 0; i < mHUDEffects.size(); i++) { LLHUDEffect *hep = mHUDEffects[i]; if (hep->mType == LLHUDObject::LL_HUD_EFFECT_LOOKAT) @@ -136,18 +136,18 @@ void LLHUDManager::sendEffects() //static void LLHUDManager::shutdownClass() { - getInstance()->mHUDEffects.reset(); + getInstance()->mHUDEffects.clear(); } void LLHUDManager::cleanupEffects() { S32 i = 0; - while (i < mHUDEffects.count()) + while (i < mHUDEffects.size()) { if (mHUDEffects[i]->isDead()) { - mHUDEffects.remove(i); + mHUDEffects.erase(mHUDEffects.begin() + i); } else { @@ -171,7 +171,7 @@ LLHUDEffect *LLHUDManager::createViewerEffect(const U8 type, BOOL send_to_sim, B hep->setNeedsSendToSim(send_to_sim); hep->setOriginatedHere(originated_here); - mHUDEffects.put(hep); + mHUDEffects.push_back(hep); return hep; } @@ -195,20 +195,20 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat effectp = NULL; LLHUDEffect::getIDType(mesgsys, k, effect_id, effect_type); S32 i; - for (i = 0; i < LLHUDManager::getInstance()->mHUDEffects.count(); i++) + for (i = 0; i < LLHUDManager::getInstance()->mHUDEffects.size(); i++) { LLHUDEffect *cur_effectp = LLHUDManager::getInstance()->mHUDEffects[i]; if (!cur_effectp) { LL_WARNS() << "Null effect in effect manager, skipping" << LL_ENDL; - LLHUDManager::getInstance()->mHUDEffects.remove(i); + LLHUDManager::getInstance()->mHUDEffects.erase(LLHUDManager::getInstance()->mHUDEffects.begin() + i); i--; continue; } if (cur_effectp->isDead()) { // LL_WARNS() << "Dead effect in effect manager, removing" << LL_ENDL; - LLHUDManager::getInstance()->mHUDEffects.remove(i); + LLHUDManager::getInstance()->mHUDEffects.erase(LLHUDManager::getInstance()->mHUDEffects.begin() + i); i--; continue; } diff --git a/indra/newview/llhudmanager.h b/indra/newview/llhudmanager.h index 615eb93a2..f005ba0c7 100644 --- a/indra/newview/llhudmanager.h +++ b/indra/newview/llhudmanager.h @@ -36,7 +36,6 @@ // Responsible for managing all HUD elements. #include "llhudobject.h" -#include "lldarray.h" class LLViewerObject; class LLHUDEffect; @@ -65,7 +64,7 @@ public: static LLColor4 sChildColor; protected: - LLDynamicArrayPtr > mHUDEffects; + std::vector > mHUDEffects; }; #endif // LL_LLHUDMANAGER_H diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 95737c5e5..e78d982fc 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -205,7 +205,7 @@ private: bool send_start_session_messages( const LLUUID& temp_session_id, const LLUUID& other_participant_id, - const LLDynamicArray& ids, + const std::vector& ids, EInstantMessage dialog) { if ( dialog == IM_SESSION_GROUP_START ) @@ -229,7 +229,7 @@ bool send_start_session_messages( LLSD agents; for (int i = 0; i < (S32) ids.size(); i++) { - agents.append(ids.get(i)); + agents.append(ids.at(i)); } //we have a new way of starting conference calls now @@ -274,7 +274,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( const LLUUID& session_id, const LLUUID& other_participant_id, const EInstantMessage& dialog, - const LLDynamicArray& ids) : + const std::vector& ids) : LLFloater(log_label, LLRect(), log_label), mStartCallOnInitialize(false), mInputEditor(NULL), @@ -652,7 +652,7 @@ private: LLUUID mSessionID; }; -bool LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) +bool LLFloaterIMPanel::inviteToSession(const std::vector& ids) { LLViewerRegion* region = gAgent.getRegion(); if (!region) @@ -660,7 +660,7 @@ bool LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) return FALSE; } - S32 count = ids.count(); + S32 count = ids.size(); if( isInviteAllowed() && (count > 0) ) { @@ -673,7 +673,7 @@ bool LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) data["params"] = LLSD::emptyArray(); for (int i = 0; i < count; i++) { - data["params"].append(ids.get(i)); + data["params"].append(ids.at(i)); } data["method"] = "invite"; @@ -900,8 +900,8 @@ BOOL LLFloaterIMPanel::dropCallingCard(LLInventoryItem* item, BOOL drop) { if (drop) { - LLDynamicArray ids; - ids.put(item->getCreatorUUID()); + std::vector ids; + ids.push_back(item->getCreatorUUID()); inviteToSession(ids); } return true; @@ -922,17 +922,17 @@ BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop) items, LLInventoryModel::EXCLUDE_TRASH, buddies); - S32 count = items.count(); + S32 count = items.size(); if(count == 0) { return false; } else if(drop) { - LLDynamicArray ids; + std::vector ids; for(S32 i = 0; i < count; ++i) { - ids.put(items.get(i)->getCreatorUUID()); + ids.push_back(items.at(i)->getCreatorUUID()); } inviteToSession(ids); } diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index a1285dbe9..e016c4ca3 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -60,7 +60,7 @@ public: const LLUUID& session_id, const LLUUID& target_id, const EInstantMessage& dialog, - const LLDynamicArray& ids = LLDynamicArray()); + const std::vector& ids = std::vector()); virtual ~LLFloaterIMPanel(); void onAvatarNameLookup(const LLAvatarName& avatar_name); @@ -77,7 +77,7 @@ public: // add target ids to the session. // Return TRUE if successful, otherwise FALSE. - bool inviteToSession(const LLDynamicArray& agent_ids); + bool inviteToSession(const std::vector& agent_ids); void addHistoryLine(const std::string &utf8msg, LLColor4 incolor = LLColor4::white, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 988249369..52e05a19b 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -615,8 +615,8 @@ LLUUID LLIMMgr::addSession( LLFloaterIMPanel* floater = findFloaterBySession(session_id); if(!floater) { - LLDynamicArray ids; - ids.put(other_participant_id); + std::vector ids; + ids.push_back(other_participant_id); floater = createFloater(session_id, other_participant_id, name, dialog, ids, true); @@ -659,9 +659,9 @@ LLUUID LLIMMgr::addSession( const std::string& name, EInstantMessage dialog, const LLUUID& other_participant_id, - const LLDynamicArray& ids) + const std::vector& ids) { - if (0 == ids.getLength()) + if (0 == ids.size()) { return LLUUID::null; } @@ -1050,7 +1050,7 @@ LLFloaterIMPanel* LLIMMgr::createFloater( const LLUUID& other_participant_id, const std::string& session_label, const EInstantMessage& dialog, - const LLDynamicArray& ids, + const std::vector& ids, bool user_initiated) { if (session_id.isNull()) @@ -1088,9 +1088,9 @@ LLFloaterIMPanel* LLIMMgr::createFloater( void LLIMMgr::noteOfflineUsers( LLFloaterIMPanel* floater, - const LLDynamicArray& ids) + const std::vector& ids) { - S32 count = ids.count(); + S32 count = ids.size(); if(count == 0) { const std::string& only_user = LLTrans::getString("only_user_message"); @@ -1102,11 +1102,11 @@ void LLIMMgr::noteOfflineUsers( LLAvatarTracker& at = LLAvatarTracker::instance(); for(S32 i = 0; i < count; ++i) { - info = at.getBuddyInfo(ids.get(i)); + info = at.getBuddyInfo(ids.at(i)); std::string full_name; if (info && !info->isOnline() - && LLAvatarNameCache::getNSName(ids.get(i), full_name)) + && LLAvatarNameCache::getNSName(ids.at(i), full_name)) { LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[NAME]", full_name); @@ -1117,7 +1117,7 @@ void LLIMMgr::noteOfflineUsers( } void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, - const LLDynamicArray& ids) + const std::vector& ids) { // Don't do this if we don't have a mute list. LLMuteList *ml = LLMuteList::getInstance(); @@ -1126,12 +1126,12 @@ void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, return; } - S32 count = ids.count(); + S32 count = ids.size(); if(count > 0) { for(S32 i = 0; i < count; ++i) { - if( ml->isMuted(ids.get(i)) ) + if( ml->isMuted(ids.at(i)) ) { LLUIString muted = LLTrans::getString("muted_message"); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 2a2ac9dc7..122a88add 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -92,7 +92,7 @@ public: LLUUID addSession(const std::string& name, EInstantMessage dialog, const LLUUID& other_participant_id, - const LLDynamicArray& ids); + const std::vector& ids); // Creates a P2P session with the requisite handle for responding to voice calls LLUUID addP2PSession(const std::string& name, @@ -193,15 +193,15 @@ private: const LLUUID& target_id, const std::string& name, const EInstantMessage& dialog, - const LLDynamicArray& ids = LLDynamicArray(), + const std::vector& ids = std::vector(), bool user_initiated = false); // This simple method just iterates through all of the ids, and // prints a simple message if they are not online. Used to help // reduce 'hello' messages to the linden employees unlucky enough // to have their calling card in the default inventory. - void noteOfflineUsers(LLFloaterIMPanel* panel, const LLDynamicArray& ids); - void noteMutedUsers(LLFloaterIMPanel* panel, const LLDynamicArray& ids); + void noteOfflineUsers(LLFloaterIMPanel* panel, const std::vector& ids); + void noteMutedUsers(LLFloaterIMPanel* panel, const std::vector& ids); void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index 999a542a5..1ae08de33 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -463,7 +463,7 @@ class LLBeginIMSession : public inventory_panel_listener_t std::string name; static int session_num = 1; - LLDynamicArray members; + std::vector members; EInstantMessage type = IM_SESSION_CONFERENCE_START; // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) @@ -495,7 +495,7 @@ class LLBeginIMSession : public inventory_panel_listener_t item_array, LLInventoryModel::EXCLUDE_TRASH, is_buddy); - S32 count = item_array.count(); + S32 count = item_array.size(); if(count > 0) { // create the session @@ -505,13 +505,13 @@ class LLBeginIMSession : public inventory_panel_listener_t LLUUID id; for(S32 i = 0; i < count; ++i) { - id = item_array.get(i)->getCreatorUUID(); + id = item_array.at(i)->getCreatorUUID(); if(at.isBuddyOnline(id)) { // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) fRlvCanStartIM &= RlvActions::canStartIM(id); // [RLVa:KB] - members.put(id); + members.push_back(id); } } } @@ -536,7 +536,7 @@ class LLBeginIMSession : public inventory_panel_listener_t // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) fRlvCanStartIM &= RlvActions::canStartIM(id); // [RLVa:KB] - members.put(id); + members.push_back(id); } } } //if IT_CALLINGCARD diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index aff062308..cab70d45e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -286,7 +286,7 @@ void LLInvFVBridge::showProperties() */ } -void LLInvFVBridge::removeBatch(LLDynamicArray& batch) +void LLInvFVBridge::removeBatch(std::vector& batch) { // Deactivate gestures when moving them into Trash LLInvFVBridge* bridge; @@ -295,11 +295,11 @@ void LLInvFVBridge::removeBatch(LLDynamicArray& batc LLViewerInventoryCategory* cat = NULL; LLInventoryModel::cat_array_t descendent_categories; LLInventoryModel::item_array_t descendent_items; - S32 count = batch.count(); + S32 count = batch.size(); S32 i,j; for(i = 0; i < count; ++i) { - bridge = (LLInvFVBridge*)(batch.get(i)); + bridge = (LLInvFVBridge*)(batch.at(i)); if(!bridge || !bridge->isItemRemovable()) continue; item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); if (item) @@ -312,13 +312,13 @@ void LLInvFVBridge::removeBatch(LLDynamicArray& batc } for(i = 0; i < count; ++i) { - bridge = (LLInvFVBridge*)(batch.get(i)); + bridge = (LLInvFVBridge*)(batch.at(i)); if(!bridge || !bridge->isItemRemovable()) continue; cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); if (cat) { gInventory.collectDescendents( cat->getUUID(), descendent_categories, descendent_items, FALSE ); - for (j=0; jgetType()) { @@ -330,7 +330,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray& batc removeBatchNoCheck(batch); } -void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray& batch) +void LLInvFVBridge::removeBatchNoCheck(std::vector& batch) { // this method moves a bunch of items and folders to the trash. As // per design guidelines for the inventory model, the message is @@ -346,14 +346,14 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArrayisItemRemovable()) continue; item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); if(item) @@ -366,7 +366,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArrayisItemRemovable()) continue; item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); if(item) @@ -407,7 +407,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArrayisItemRemovable()) continue; LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); if(cat) @@ -481,12 +481,12 @@ BOOL LLInvFVBridge::isClipboardPasteable() const // In normal mode, we need to check each element of the clipboard to know if we can paste or not LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); + S32 count = objects.size(); for(S32 i = 0; i < count; i++) { - const LLUUID &item_id = objects.get(i); + const LLUUID &item_id = objects.at(i); // Folders are pasteable if all items in there are copyable const LLInventoryCategory *cat = model->getCategory(item_id); @@ -523,12 +523,12 @@ bool LLInvFVBridge::isClipboardPasteableAsCopy() const // In copy mode, we need to check each element of the clipboard to know if it's a link LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); - const S32 count = objects.count(); + const S32 count = objects.size(); for(S32 i = 0; i < count; i++) { - const LLUUID &item_id = objects.get(i); + const LLUUID &item_id = objects.at(i); // Folders may be links const LLInventoryCategory *cat = model->getCategory(item_id); @@ -565,12 +565,12 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const return FALSE; } - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); + S32 count = objects.size(); for(S32 i = 0; i < count; i++) { - const LLInventoryItem *item = model->getItem(objects.get(i)); + const LLInventoryItem *item = model->getItem(objects.at(i)); if (item) { if (!LLAssetType::lookupCanLink(item->getActualType())) @@ -578,7 +578,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const return FALSE; } } - const LLViewerInventoryCategory *cat = model->getCategory(objects.get(i)); + const LLViewerInventoryCategory *cat = model->getCategory(objects.at(i)); if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { return FALSE; @@ -933,7 +933,7 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const } *id = obj->getUUID(); - //object_ids.put(obj->getUUID()); + //object_ids.push_back(obj->getUUID()); if (*type == DAD_CATEGORY) { @@ -2012,15 +2012,15 @@ BOOL LLFolderBridge::isClipboardPasteable() const return FALSE; } - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); const LLViewerInventoryCategory *current_cat = getCategory(); // Search for the direct descendent of current Friends subfolder among all pasted items, // and return false if is found. - for(S32 i = objects.count() - 1; i >= 0; --i) + for(S32 i = objects.size() - 1; i >= 0; --i) { - const LLUUID &obj_id = objects.get(i); + const LLUUID &obj_id = objects.at(i); if ( LLFriendCardsManager::instance().isObjDirectDescendentOfCategory(model->getObject(obj_id), current_cat) ) { return FALSE; @@ -2060,12 +2060,12 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder(current_cat); */ const LLUUID ¤t_cat_id = current_cat->getUUID(); - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); + S32 count = objects.size(); for (S32 i = 0; i < count; i++) { - const LLUUID &obj_id = objects.get(i); + const LLUUID &obj_id = objects.at(i); const LLInventoryCategory *cat = model->getCategory(obj_id); if (cat) { @@ -2138,9 +2138,9 @@ int get_folder_levels(LLInventoryCategory* inv_cat) int max_child_levels = 0; - for (S32 i=0; i < cats->count(); ++i) + for (S32 i=0; i < cats->size(); ++i) { - LLInventoryCategory* category = cats->get(i); + LLInventoryCategory* category = cats->at(i); max_child_levels = llmax(max_child_levels, get_folder_levels(category)); } @@ -2248,7 +2248,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (is_movable) { model->collectDescendents(cat_id, descendent_categories, descendent_items, FALSE); - for (S32 i=0; i < descendent_categories.count(); ++i) + for (S32 i=0; i < descendent_categories.size(); ++i) { LLInventoryCategory* category = descendent_categories[i]; if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) @@ -2261,7 +2261,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (is_movable && move_is_into_trash) { - for (S32 i=0; i < descendent_items.count(); ++i) + for (S32 i=0; i < descendent_items.size(); ++i) { LLInventoryItem* item = descendent_items[i]; if (get_is_item_worn(item->getUUID())) @@ -2273,7 +2273,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (is_movable && move_is_into_landmarks) { - for (S32 i=0; i < descendent_items.count(); ++i) + for (S32 i=0; i < descendent_items.size(); ++i) { LLViewerInventoryItem* item = descendent_items[i]; @@ -2303,7 +2303,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { - int dragged_folder_count = descendent_categories.count(); + int dragged_folder_count = descendent_categories.size(); int existing_item_count = 0; int existing_folder_count = 0; @@ -2342,8 +2342,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - existing_folder_count += existing_categories.count(); - existing_item_count += existing_items.count(); + existing_folder_count += existing_categories.size(); + existing_item_count += existing_items.size(); } else { @@ -2353,7 +2353,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } const int nested_folder_count = existing_folder_count + dragged_folder_count; - const int nested_item_count = existing_item_count + descendent_items.count(); + const int nested_item_count = existing_item_count + descendent_items.size(); if (nested_folder_count > (S32)gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) { @@ -2366,7 +2366,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (is_movable == TRUE) { - for (S32 i=0; i < descendent_items.count(); ++i) + for (S32 i=0; i < descendent_items.size(); ++i) { LLInventoryItem* item = descendent_items[i]; if (!can_move_to_outbox(item)) @@ -2389,7 +2389,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // Look for any gestures and deactivate them if (move_is_into_trash) { - for (S32 i=0; i < descendent_items.count(); i++) + for (S32 i=0; i < descendent_items.size(); i++) { LLInventoryItem* item = descendent_items[i]; if (item->getType() == LLAssetType::AT_GESTURE @@ -2645,13 +2645,13 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) S32 item_count(0); if (item_array) { - item_count = item_array->count(); + item_count = item_array->size(); } S32 cat_count(0); if (cat_array) { - cat_count = cat_array->count(); + cat_count = cat_array->size(); } // Move to next if current folder empty @@ -2669,7 +2669,7 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) { for (S32 i = 0; i < item_count; ++i) { - ids.push_back(item_array->get(i)->getUUID()); + ids.push_back(item_array->at(i)->getUUID()); } outfit = new LLRightClickInventoryFetchObserver(ids); } @@ -2678,7 +2678,7 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) { for (S32 i = 0; i < cat_count; ++i) { - ids.push_back(cat_array->get(i)->getUUID()); + ids.push_back(cat_array->at(i)->getUUID()); } categories = new LLRightClickInventoryFetchDescendentsObserver(ids); } @@ -3074,7 +3074,7 @@ void LLFolderBridge::pasteFromClipboard(bool only_copies) const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); if (move_is_into_outbox) @@ -3087,7 +3087,7 @@ void LLFolderBridge::pasteFromClipboard(bool only_copies) BOOL can_list = TRUE; - for (LLDynamicArray::const_iterator iter = objects.begin(); + for (std::vector::const_iterator iter = objects.begin(); (iter != objects.end()) && (can_list == TRUE); ++iter) { @@ -3118,7 +3118,7 @@ void LLFolderBridge::pasteFromClipboard(bool only_copies) const LLUUID parent_id(mUUID); - for (LLDynamicArray::const_iterator iter = objects.begin(); + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { @@ -3226,9 +3226,9 @@ void LLFolderBridge::pasteLinkFromClipboard() const LLUUID parent_id(mUUID); - LLDynamicArray objects; + std::vector objects; LLInventoryClipboard::instance().retrieve(objects); - for (LLDynamicArray::const_iterator iter = objects.begin(); + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { @@ -3289,7 +3289,7 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv LLInventoryModel::EXCLUDE_TRASH, is_type, true); - return ((item_array.count() > 0) ? TRUE : FALSE ); + return ((item_array.size() > 0) ? TRUE : FALSE ); } void LLFolderBridge::buildContextMenuBaseOptions(U32 flags) @@ -4014,7 +4014,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - existing_item_count += existing_items.count(); + existing_item_count += existing_items.size(); } if (existing_item_count > (S32)gSavedSettings.getU32("InventoryOutboxMaxItemCount")) @@ -5671,7 +5671,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ is_wearable, true); S32 i; - S32 wearable_count = item_array.count(); + S32 wearable_count = item_array.size(); LLInventoryModel::cat_array_t obj_cat_array; LLInventoryModel::item_array_t obj_item_array; @@ -5682,7 +5682,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ LLInventoryModel::EXCLUDE_TRASH, is_object, true); - S32 obj_count = obj_item_array.count(); + S32 obj_count = obj_item_array.size(); // Find all gestures in this folder LLInventoryModel::cat_array_t gest_cat_array; @@ -5694,13 +5694,13 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ LLInventoryModel::EXCLUDE_TRASH, is_gesture, true); - S32 gest_count = gest_item_array.count(); + S32 gest_count = gest_item_array.size(); if (wearable_count > 0) //Loop through wearables. If worn, remove. { for(i = 0; i < wearable_count; ++i) { - LLViewerInventoryItem *item = item_array.get(i); + LLViewerInventoryItem *item = item_array.at(i); if (item->getType() == LLAssetType::AT_BODYPART) continue; if (gAgent.isTeen() && item->isWearableType() && @@ -5728,7 +5728,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ { for(i = 0; i < obj_count; ++i) { - LLViewerInventoryItem *obj_item = obj_item_array.get(i); + LLViewerInventoryItem *obj_item = obj_item_array.at(i); if (get_is_item_worn(obj_item->getUUID())) { LLVOAvatarSelf::detachAttachmentIntoInventory(obj_item->getLinkedUUID()); @@ -5740,7 +5740,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ { for(i = 0; i < gest_count; ++i) { - LLViewerInventoryItem *gest_item = gest_item_array.get(i); + LLViewerInventoryItem *gest_item = gest_item_array.at(i); if (get_is_item_worn(gest_item->getUUID())) { LLGestureMgr::instance().deactivateGesture( gest_item->getLinkedUUID() ); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3329f14f9..7dd427a66 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -103,7 +103,7 @@ public: virtual BOOL isItemInTrash() const; virtual BOOL isLink() const; //virtual BOOL removeItem() = 0; - virtual void removeBatch(LLDynamicArray& batch); + virtual void removeBatch(std::vector& batch); virtual void move(LLFolderViewEventListener* new_parent_bridge) {} virtual BOOL isItemCopyable() const { return FALSE; } virtual BOOL copyToClipboard() const; @@ -161,7 +161,7 @@ protected: LLViewerInventoryCategory* item, const LLUUID& new_parent, BOOL restamp); - void removeBatchNoCheck(LLDynamicArray& batch); + void removeBatchNoCheck(std::vector& batch); protected: LLHandle mInventoryPanel; LLFolderView* mRoot; diff --git a/indra/newview/llinventoryclipboard.cpp b/indra/newview/llinventoryclipboard.cpp index 50a9d2a92..2a6fe947d 100644 --- a/indra/newview/llinventoryclipboard.cpp +++ b/indra/newview/llinventoryclipboard.cpp @@ -52,23 +52,23 @@ LLInventoryClipboard::~LLInventoryClipboard() void LLInventoryClipboard::add(const LLUUID& object) { - mObjects.put(object); + mObjects.push_back(object); } // this stores a single inventory object void LLInventoryClipboard::store(const LLUUID& object) { reset(); - mObjects.put(object); + mObjects.push_back(object); } -void LLInventoryClipboard::store(const LLDynamicArray& inv_objects) +void LLInventoryClipboard::store(const std::vector& inv_objects) { reset(); - S32 count = inv_objects.count(); + S32 count = inv_objects.size(); for(S32 i = 0; i < count; i++) { - mObjects.put(inv_objects[i]); + mObjects.push_back(inv_objects[i]); } } @@ -82,26 +82,26 @@ void LLInventoryClipboard::cut(const LLUUID& object) mCutMode = true; add(object); } -void LLInventoryClipboard::retrieve(LLDynamicArray& inv_objects) const +void LLInventoryClipboard::retrieve(std::vector& inv_objects) const { - inv_objects.reset(); - S32 count = mObjects.count(); + inv_objects.clear(); + S32 count = mObjects.size(); for(S32 i = 0; i < count; i++) { - inv_objects.put(mObjects[i]); + inv_objects.push_back(mObjects[i]); } } void LLInventoryClipboard::reset() { - mObjects.reset(); + mObjects.clear(); mCutMode = false; } // returns true if the clipboard has something pasteable in it. BOOL LLInventoryClipboard::hasContents() const { - return (mObjects.count() > 0); + return (mObjects.size() > 0); } // returns true if the input uuid is in the list of clipboard objects. diff --git a/indra/newview/llinventoryclipboard.h b/indra/newview/llinventoryclipboard.h index 398ac5c11..35a5c6fcf 100644 --- a/indra/newview/llinventoryclipboard.h +++ b/indra/newview/llinventoryclipboard.h @@ -27,7 +27,6 @@ #ifndef LL_LLINVENTORYCLIPBOARD_H #define LL_LLINVENTORYCLIPBOARD_H -#include "lldarray.h" #include "lluuid.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -52,12 +51,12 @@ public: void store(const LLUUID& object); // this method stores an array of objects - void store(const LLDynamicArray& inventory_objects); + void store(const std::vector& inventory_objects); void cut(const LLUUID& object); // this method gets the objects in the clipboard by copying them // into the array provided. - void retrieve(LLDynamicArray& inventory_objects) const; + void retrieve(std::vector& inventory_objects) const; // this method empties out the clipboard void reset(); @@ -73,7 +72,7 @@ public: protected: static LLInventoryClipboard sInstance; - LLDynamicArray mObjects; + std::vector mObjects; bool mCutMode; public: diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 80a2bfd5e..519c7aad0 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -254,7 +254,7 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con S32 descendents_actual = 0; if (cat_array && item_array) { - descendents_actual = cat_array->count() + item_array->count(); + descendents_actual = cat_array->size() + item_array->size(); } if (descendents_actual == 0) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 74c280cbb..7a71ba201 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -122,7 +122,7 @@ bool LLCanCache::operator()(LLInventoryCategory* cat, LLInventoryItem* item) S32 descendents_actual = 0; if(cats && items) { - descendents_actual = cats->count() + items->count(); + descendents_actual = cats->size() + items->size(); } if(descendents_server == descendents_actual) { @@ -486,12 +486,12 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe cats = get_ptr_in_map(mParentChildCategoryTree, root_id); if(cats) { - S32 count = cats->count(); + S32 count = cats->size(); for(S32 i = 0; i < count; ++i) { - if (cats->get(i)->getPreferredType() == preferred_type) + if(cats->at(i)->getPreferredType() == preferred_type) { - rv = cats->get(i)->getUUID(); + rv = cats->at(i)->getUUID(); break; } } @@ -517,12 +517,12 @@ LLUUID LLInventoryModel::findCategoryByName(std::string name) cats = get_ptr_in_map(mParentChildCategoryTree, root_id); if(cats) { - S32 count = cats->count(); + S32 count = cats->size(); for(S32 i = 0; i < count; ++i) { - if(cats->get(i)->getName() == name) + if(cats->at(i)->getName() == name) { - return cats->get(i)->getUUID(); + return cats->at(i)->getUUID(); } } } @@ -715,13 +715,13 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, cat_array_t* cat_array = get_ptr_in_map(mParentChildCategoryTree, id); if(cat_array) { - S32 count = cat_array->count(); + S32 count = cat_array->size(); for(S32 i = 0; i < count; ++i) { - LLViewerInventoryCategory* cat = cat_array->get(i); + LLViewerInventoryCategory* cat = cat_array->at(i); if(add(cat,NULL)) { - cats.put(cat); + cats.push_back(cat); } collectDescendentsIf(cat->getUUID(), cats, items, include_trash, add); } @@ -733,13 +733,13 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, // Move onto items if(item_array) { - S32 count = item_array->count(); + S32 count = item_array->size(); for(S32 i = 0; i < count; ++i) { - item = item_array->get(i); + item = item_array->at(i); if(add(NULL, item)) { - items.put(item); + items.push_back(item); } } } @@ -757,10 +757,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, // Note: if making it fully recursive, need more checking against infinite loops. if (follow_folder_links && item_array) { - S32 count = item_array->count(); + S32 count = item_array->size(); for(S32 i = 0; i < count; ++i) { - item = item_array->get(i); + item = item_array->at(i); if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER) { LLViewerInventoryCategory *linked_cat = item->getLinkedCategory(); @@ -774,7 +774,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, // BAP should this be added here? May not // matter if it's only being used in current // outfit traversal. - cats.put(LLPointer(linked_cat)); + cats.push_back(LLPointer(linked_cat)); } collectDescendentsIf(linked_cat->getUUID(), cats, items, include_trash, add, FALSE); } @@ -901,12 +901,12 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) item_array = get_ptr_in_map(mParentChildItemTree, old_parent_id); if(item_array) { - item_array->removeObj(old_item); + vector_replace_with_last(*item_array, old_item); } item_array = get_ptr_in_map(mParentChildItemTree, new_parent_id); if(item_array) { - item_array->put(old_item); + item_array->push_back(old_item); } mask |= LLInventoryObserver::STRUCTURE; } @@ -936,7 +936,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) { // *FIX: bit of a hack to call update server from here... new_item->updateServer(TRUE); - item_array->put(new_item); + item_array->push_back(new_item); } else { @@ -964,7 +964,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, parent_id); if(item_array) { - item_array->put(new_item); + item_array->push_back(new_item); } else { @@ -979,7 +979,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) // *FIX: bit of a hack to call update server from // here... new_item->updateServer(TRUE); - item_array->put(new_item); + item_array->push_back(new_item); } else { @@ -1061,7 +1061,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) return; } - LLViewerInventoryCategory* old_cat = getCategory(cat->getUUID()); + LLPointer old_cat = getCategory(cat->getUUID()); if(old_cat) { // We already have an old category, modify it's values @@ -1075,12 +1075,12 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) cat_array = getUnlockedCatArray(old_parent_id); if(cat_array) { - cat_array->removeObj(old_cat); + vector_replace_with_last(*cat_array, old_cat); } cat_array = getUnlockedCatArray(new_parent_id); if(cat_array) { - cat_array->put(old_cat); + cat_array->push_back(old_cat); } mask |= LLInventoryObserver::STRUCTURE; } @@ -1103,7 +1103,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) cat_array = getUnlockedCatArray(cat->getParentUUID()); if(cat_array) { - cat_array->put(new_cat); + cat_array->push_back(new_cat); } // make space in the tree for this category's children. @@ -1132,27 +1132,27 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) << cat_id << LL_ENDL; return; } - LLViewerInventoryCategory* cat = getCategory(object_id); + LLPointer cat = getCategory(object_id); if(cat && (cat->getParentUUID() != cat_id)) { cat_array_t* cat_array; cat_array = getUnlockedCatArray(cat->getParentUUID()); - if(cat_array) cat_array->removeObj(cat); + if(cat_array) vector_replace_with_last(*cat_array, cat); cat_array = getUnlockedCatArray(cat_id); cat->setParent(cat_id); - if(cat_array) cat_array->put(cat); + if(cat_array) cat_array->push_back(cat); addChangedMask(LLInventoryObserver::STRUCTURE, object_id); return; } - LLViewerInventoryItem* item = getItem(object_id); + LLPointer item = getItem(object_id); if(item && (item->getParentUUID() != cat_id)) { item_array_t* item_array; item_array = getUnlockedItemArray(item->getParentUUID()); - if(item_array) item_array->removeObj(item); + if(item_array) vector_replace_with_last(*item_array, item); item_array = getUnlockedItemArray(cat_id); item->setParent(cat_id); - if(item_array) item_array->put(item); + if(item_array) item_array->push_back(item); addChangedMask(LLInventoryObserver::STRUCTURE, object_id); return; } @@ -1242,13 +1242,13 @@ void LLInventoryModel::deleteObject(const LLUUID& id) if(item_list) { LLViewerInventoryItem* item = (LLViewerInventoryItem*)((LLInventoryObject*)obj); - item_list->removeObj(item); + vector_replace_with_last(*item_list, item); } cat_array_t* cat_list = getUnlockedCatArray(parent_id); if(cat_list) { LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj); - cat_list->removeObj(cat); + vector_replace_with_last(*cat_list, cat); } item_list = getUnlockedItemArray(id); if(item_list) @@ -1374,16 +1374,16 @@ void LLInventoryModel::purgeDescendentsOf(const LLUUID& id) categories, items, INCLUDE_TRASH); - S32 count = items.count(); + S32 count = items.size(); for(S32 i = 0; i < count; ++i) { - deleteObject(items.get(i)->getUUID()); + deleteObject(items.at(i)->getUUID()); } - count = categories.count(); + count = categories.size(); for(S32 i = 0; i < count; ++i) { - deleteObject(categories.get(i)->getUUID()); + deleteObject(categories.at(i)->getUUID()); } } } @@ -1574,7 +1574,7 @@ void LLInventoryModel::cache( LLViewerInventoryCategory* root_cat = getCategory(parent_folder_id); if(!root_cat) return; cat_array_t categories; - categories.put(root_cat); + categories.push_back(root_cat); item_array_t items; LLCanCache can_cache(this); @@ -1687,7 +1687,7 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const S32 descendents_actual = 0; if(cats && items) { - descendents_actual = cats->count() + items->count(); + descendents_actual = cats->size() + items->size(); } if(descendents_server == descendents_actual) { @@ -1802,12 +1802,12 @@ LLInventoryModel::EHasChildren LLInventoryModel::categoryHasChildren( // Shouldn't have to run this, but who knows. parent_cat_map_t::const_iterator cat_it = mParentChildCategoryTree.find(cat->getUUID()); - if (cat_it != mParentChildCategoryTree.end() && cat_it->second->count() > 0) + if (cat_it != mParentChildCategoryTree.end() && cat_it->second->size() > 0) { return CHILDREN_YES; } parent_item_map_t::const_iterator item_it = mParentChildItemTree.find(cat->getUUID()); - if (item_it != mParentChildItemTree.end() && item_it->second->count() > 0) + if (item_it != mParentChildItemTree.end() && item_it->second->size() > 0) { return CHILDREN_YES; } @@ -1827,7 +1827,7 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const S32 descendents_actual = 0; if(cats && items) { - descendents_actual = cats->count() + items->count(); + descendents_actual = cats->size() + items->size(); } if(descendents_server == descendents_actual) { @@ -1926,7 +1926,7 @@ bool LLInventoryModel::loadSkeleton( // found to generate a set of categories we should add. We // will go through each category loaded and if the version // does not match, invalidate the version. - S32 count = categories.count(); + S32 count = categories.size(); cat_set_t::iterator not_cached = temp_cats.end(); std::set cached_ids; for (S32 i = 0; i < count; ++i) @@ -2135,7 +2135,7 @@ void LLInventoryModel::buildParentChildMap() for(cat_map_t::iterator cit = mCategoryMap.begin(); cit != mCategoryMap.end(); ++cit) { LLViewerInventoryCategory* cat = cit->second; - cats.put(cat); + cats.push_back(cat); if (mParentChildCategoryTree.count(cat->getUUID()) == 0) { llassert_always(mCategoryLock[cat->getUUID()] == false); @@ -2163,16 +2163,16 @@ void LLInventoryModel::buildParentChildMap() // Now we have a structure with all of the categories that we can // iterate over and insert into the correct place in the child // category tree. - S32 count = cats.count(); + S32 count = cats.size(); S32 i; S32 lost = 0; for(i = 0; i < count; ++i) { - LLViewerInventoryCategory* cat = cats.get(i); + LLViewerInventoryCategory* cat = cats.at(i); catsp = getUnlockedCatArray(cat->getParentUUID()); if(catsp) { - catsp->put(cat); + catsp->push_back(cat); } else { @@ -2205,7 +2205,7 @@ void LLInventoryModel::buildParentChildMap() catsp = getUnlockedCatArray(cat->getParentUUID()); if(catsp) { - catsp->put(cat); + catsp->push_back(cat); } else { @@ -2232,20 +2232,20 @@ void LLInventoryModel::buildParentChildMap() for(item_map_t::iterator iit = mItemMap.begin(); iit != mItemMap.end(); ++iit) { item = (*iit).second; - items.put(item); + items.push_back(item); } } - count = items.count(); + count = items.size(); lost = 0; uuid_vec_t lost_item_ids; for(i = 0; i < count; ++i) { LLPointer item; - item = items.get(i); + item = items.at(i); itemsp = getUnlockedItemArray(item->getParentUUID()); if(itemsp) { - itemsp->put(item); + itemsp->push_back(item); } else { @@ -2262,7 +2262,7 @@ void LLInventoryModel::buildParentChildMap() itemsp = getUnlockedItemArray(item->getParentUUID()); if(itemsp) { - itemsp->put(item); + itemsp->push_back(item); } else { @@ -2432,7 +2432,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, LLPointer inv_cat = new LLViewerInventoryCategory(LLUUID::null); if(inv_cat->importFileLocal(file)) { - categories.put(inv_cat); + categories.push_back(inv_cat); } else { @@ -2460,7 +2460,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, } else { - items.put(inv_item); + items.push_back(inv_item); } } else @@ -2500,7 +2500,7 @@ bool LLInventoryModel::saveToFile(const std::string& filename, } fprintf(file, "\tinv_cache_version\t%d\n", sCurrentInvCacheVersion); - S32 count = categories.count(); + S32 count = categories.size(); S32 i; for(i = 0; i < count; ++i) { @@ -2511,7 +2511,7 @@ bool LLInventoryModel::saveToFile(const std::string& filename, } } - count = items.count(); + count = items.size(); for(i = 0; i < count; ++i) { items[i]->exportFile(file); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index a7136cb5a..74808782a 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -29,7 +29,6 @@ #include "llassettype.h" #include "llfoldertype.h" -#include "lldarray.h" #include "llframetimer.h" #include "llhttpclient.h" #include "lluuid.h" @@ -79,8 +78,8 @@ public: CHILDREN_MAYBE }; - typedef LLDynamicArray > cat_array_t; - typedef LLDynamicArray > item_array_t; + typedef std::vector > cat_array_t; + typedef std::vector > item_array_t; typedef std::set changed_items_t; class fetchInventoryResponder : public LLHTTPClient::ResponderWithResult diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 7897bd410..822bfdc92 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -398,7 +398,7 @@ BOOL LLInventoryFetchDescendentsObserver::isCategoryComplete(const LLViewerInven // from memory. return TRUE; } - const S32 current_num_known_descendents = cats->count() + items->count(); + const S32 current_num_known_descendents = cats->size() + items->size(); // Got the number of descendents that we were expecting, so we're done. if (current_num_known_descendents == expected_num_descendents) @@ -613,9 +613,9 @@ void LLInventoryCategoryAddedObserver::changed(U32 mask) return; } - const LLInventoryModel::changed_items_t& changed_ids = gInventory.getChangedIDs(); + const LLInventoryModel::changed_items_t& added_ids = gInventory.getChangedIDs(); - for (LLInventoryModel::changed_items_t::const_iterator cit = changed_ids.begin(); cit != changed_ids.end(); ++cit) + for (LLInventoryModel::changed_items_t::const_iterator cit = added_ids.begin(); cit != added_ids.end(); ++cit) { LLViewerInventoryCategory* cat = gInventory.getCategory(*cit); @@ -733,7 +733,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask) continue; } - const S32 current_num_known_descendents = cats->count() + items->count(); + const S32 current_num_known_descendents = cats->size() + items->size(); bool cat_changed = false; @@ -804,7 +804,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t } else { - current_num_known_descendents = cats->count() + items->count(); + current_num_known_descendents = cats->size() + items->size(); } } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 27f9fbb3d..c41e1f85d 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -35,7 +35,6 @@ #define LL_LLINVENTORYPANEL_H #include "llassetstorage.h" -#include "lldarray.h" #include "llfloater.h" #include "llinventory.h" #include "llfolderview.h" diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index cff819560..f34415289 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -917,13 +917,13 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick tool_tip.assign(""); - if (region->mMapAvatarIDs.count()) + if (region->mMapAvatarIDs.size()) { if (mClosestAgentsToCursor.size()) { bool single_agent(mClosestAgentsToCursor.size() == 1); // Singu note: For old look, only add the count if we have more than one if (!single_agent) - tool_tip.append(llformat("Agents under cursor (%d/%d)\n", mClosestAgentsToCursor.size(), region->mMapAvatarIDs.count() + 1)); + tool_tip.append(llformat("Agents under cursor (%d/%d)\n", mClosestAgentsToCursor.size(), region->mMapAvatarIDs.size() + 1)); LLVector3d myPosition = gAgent.getPositionGlobal(); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index fabe94a70..94988196c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -234,7 +234,7 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType std::string font_style("NORMAL"); // Set normal color if not found or if group is visible in profile if (pAvatarGroups->avatar_id == pAvatarGroups->agent_id) // own avatar - for (LLDynamicArray::iterator i = gAgent.mGroups.begin(); i != gAgent.mGroups.end(); ++i) // Search for this group in the agent's groups list + for (std::vector::iterator i = gAgent.mGroups.begin(); i != gAgent.mGroups.end(); ++i) // Search for this group in the agent's groups list if (i->mID == it->group_id) { if (i->mListInProfile) diff --git a/indra/newview/llpaneldirclassified.cpp b/indra/newview/llpaneldirclassified.cpp index 48ee3629d..7b97163af 100644 --- a/indra/newview/llpaneldirclassified.cpp +++ b/indra/newview/llpaneldirclassified.cpp @@ -32,8 +32,6 @@ #include "llviewerprecompiledheaders.h" -#include "llenum.h" - #include "llpaneldirclassified.h" #include "llclassifiedflags.h" diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp index f38b7efa7..6f5412cef 100644 --- a/indra/newview/llpaneldirevents.cpp +++ b/indra/newview/llpaneldirevents.cpp @@ -37,7 +37,6 @@ #include // linden library includes -#include "llenum.h" #include "message.h" #include "llqueryflags.h" diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index f665e53ee..8b3f28d30 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1242,7 +1242,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as, std::string new_name) LLAppearanceMgr::instance().findCOFItemLinks(getWearable()->getItemID()); if (links.size()>0) { - link_item = links.get(0).get(); + link_item = links.at(0).get(); if (link_item && link_item->getIsLinkType()) { description = link_item->getActualDescription(); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5f8d831c6..3c80bdf13 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -51,7 +51,7 @@ const std::string FILTERS_FILENAME("filters.xml"); -LLDynamicArray LLInventoryView::sActiveViews; +std::vector LLInventoryView::sActiveViews; const S32 INV_MIN_WIDTH = 240; const S32 INV_MIN_HEIGHT = 150; const S32 INV_FINDER_WIDTH = 160; @@ -214,7 +214,7 @@ BOOL LLInventoryView::postBuild() } - sActiveViews.put(this); + sActiveViews.push_back(this); getChild("inventory filter tabs")->setCommitCallback(boost::bind(&LLInventoryView::onFilterSelected,this)); @@ -275,7 +275,7 @@ LLInventoryView::~LLInventoryView( void ) else filtersFile.close(); - sActiveViews.removeObj(this); + vector_replace_with_last(sActiveViews, this); gInventory.removeObserver(this); delete mSavedFolderState; } @@ -303,9 +303,9 @@ void LLInventoryView::onClose(bool app_quitting) // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) // See LLInventoryView::closeAll() on why we're doing it this way S32 count = 0; - for (S32 idx = 0, cnt = sActiveViews.count(); idx < cnt; idx++) + for (S32 idx = 0, cnt = sActiveViews.size(); idx < cnt; idx++) { - if (!sActiveViews.get(idx)->isDead()) + if (!sActiveViews.at(idx)->isDead()) count++; } // [/RLVa:KB] @@ -418,16 +418,16 @@ LLInventoryView* LLInventoryView::showAgentInventory(BOOL take_keyboard_focus) LLInventoryView* LLInventoryView::getActiveInventory() { LLInventoryView* iv = NULL; - S32 count = sActiveViews.count(); + S32 count = sActiveViews.size(); if(count > 0) { - iv = sActiveViews.get(0); + iv = sActiveViews.at(0); S32 z_order = gFloaterView->getZOrder(iv); S32 z_next = 0; LLInventoryView* next_iv = NULL; for(S32 i = 1; i < count; ++i) { - next_iv = sActiveViews.get(i); + next_iv = sActiveViews.at(i); z_next = gFloaterView->getZOrder(next_iv); if(z_next < z_order) { @@ -442,7 +442,7 @@ LLInventoryView* LLInventoryView::getActiveInventory() // static void LLInventoryView::toggleVisibility() { - S32 count = sActiveViews.count(); + S32 count = sActiveViews.size(); if (0 == count) { // We're using the inventory, possibly for the first time. @@ -451,9 +451,9 @@ void LLInventoryView::toggleVisibility() } else if (1 == count) { - if (sActiveViews.get(0)->getVisible()) + if (sActiveViews.at(0)->getVisible()) { - sActiveViews.get(0)->close(); + sActiveViews.at(0)->close(); gSavedSettings.setBOOL("ShowInventory", FALSE); } else @@ -467,18 +467,18 @@ void LLInventoryView::toggleVisibility() // is visible. // Close all the last one spawned. - S32 last_index = sActiveViews.count() - 1; - sActiveViews.get(last_index)->close(); + S32 last_index = sActiveViews.size() - 1; + sActiveViews.at(last_index)->close(); } } // static void LLInventoryView::cleanup() { - S32 count = sActiveViews.count(); + S32 count = sActiveViews.size(); for (S32 i = 0; i < count; i++) { - sActiveViews.get(i)->destroy(); + sActiveViews.at(i)->destroy(); } } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index c19befd78..f006aa904 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -143,9 +143,9 @@ public: // Workaround: "fix" onClose() to count only views that aren't marked as "dead" LLInventoryView* pView; U8 flagsSound; - for (S32 idx = sActiveViews.count() - 1; idx >= 0; idx--) + for (S32 idx = sActiveViews.size() - 1; idx >= 0; idx--) { - pView = sActiveViews.get(idx); + pView = sActiveViews.at(idx); flagsSound = pView->getSoundFlags(); pView->setSoundFlags(LLView::SILENT); // Suppress the window close sound pView->close(); // onClose() protects against closing the last inventory floater @@ -174,7 +174,7 @@ protected: // This container is used to hold all active inventory views. This // is here to support the inventory toggle show button. - static LLDynamicArray sActiveViews; + static std::vector sActiveViews; }; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 7bf6f9bc0..2e12406de 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -404,10 +404,10 @@ const LLUUID& LLPanelObject::findItemID(const LLUUID& asset_id) LLInventoryModel::INCLUDE_TRASH, asset_id_matches); - if (items.count()) + if (items.size()) { // search for copyable version first - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { LLInventoryItem* itemp = items[i]; LLPermissions item_permissions = itemp->getPermissions(); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index cc70a0a04..0b01837b5 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -126,7 +126,7 @@ public: virtual BOOL isItemMovable() const; virtual BOOL isItemRemovable() const; virtual BOOL removeItem(); - virtual void removeBatch(LLDynamicArray& batch); + virtual void removeBatch(std::vector& batch); virtual void move(LLFolderViewEventListener* parent_listener); virtual BOOL isItemCopyable() const; virtual BOOL copyToClipboard() const; @@ -539,7 +539,7 @@ BOOL LLTaskInvFVBridge::removeItem() return FALSE; } -void LLTaskInvFVBridge::removeBatch(LLDynamicArray& batch) +void LLTaskInvFVBridge::removeBatch(std::vector& batch) { if (!mPanel) { @@ -1713,7 +1713,7 @@ void LLPanelObjectInventory::inventoryChanged(LLViewerObject* object, // temporary object because we cannot iterate through the // object inventory twice... A pox on stateful iteration! LLFloaterProperties* floater = NULL; - LLDynamicArray refresh; + std::vector refresh; LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); LLInventoryObject::object_list_t::const_iterator end = inventory->end(); @@ -1723,13 +1723,13 @@ void LLPanelObjectInventory::inventoryChanged(LLViewerObject* object, object->getID()); if(floater) { - refresh.put(floater); + refresh.push_back(floater); } } - S32 count = refresh.count(); + S32 count = refresh.size(); for(S32 i = 0; i < count; ++i) { - refresh.get(i)->refresh(); + refresh.at(i)->refresh(); } } } @@ -1839,7 +1839,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li LLFolderViewFolder* folder) { // Find all in the first pass - LLDynamicArray child_categories; + std::vector child_categories; LLTaskInvFVBridge* bridge; LLFolderViewItem* view; @@ -1864,7 +1864,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li NULL, mFolders, bridge); - child_categories.put(new obj_folder_pair(obj, + child_categories.push_back(new obj_folder_pair(obj, (LLFolderViewFolder*)view)); } else @@ -1882,7 +1882,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li } // now, for each category, do the second pass - for(S32 i = 0; i < child_categories.count(); i++) + for(S32 i = 0; i < child_categories.size(); i++) { createViewsForCategory(inventory, child_categories[i]->first, child_categories[i]->second ); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index fb19402a2..602c8c65e 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -92,7 +92,7 @@ bool is_asset_exportable(const LLUUID& asset_id) LLAssetIDMatches asset_id_matches(asset_id); gInventory.collectDescendentsIf(LLUUID::null, cats, items, true, asset_id_matches, false); - for (int i = 0; i < items.count(); ++i) + for (int i = 0; i < items.size(); ++i) { if (perms_allow_export(items[i]->getPermissions())) return true; } diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 09f19ab79..d9b34ca93 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -289,7 +289,7 @@ void LLParticipantList::refreshSpeakers() { // Are they in this sim? if (const LLViewerRegion* regionp = *iter) - if (regionp->mMapAvatarIDs.find(speakerp->mID) != -1) + if (std::find(regionp->mMapAvatarIDs.begin(), regionp->mMapAvatarIDs.end(), speakerp->mID) != regionp->mMapAvatarIDs.end()) found = true; } if (!found) diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 168308c47..c0ab5ef97 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -595,10 +595,10 @@ void LLPreviewGesture::addAnimations() // Copy into something we can sort std::vector animations; - S32 count = items.count(); + S32 count = items.size(); for(i = 0; i < count; ++i) { - animations.push_back( items.get(i) ); + animations.push_back( items.at(i) ); } // Do the sort @@ -641,10 +641,10 @@ void LLPreviewGesture::addSounds() std::vector sounds; S32 i; - S32 count = items.count(); + S32 count = items.size(); for(i = 0; i < count; ++i) { - sounds.push_back( items.get(i) ); + sounds.push_back( items.at(i) ); } // Do the sort diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 76ceae6fa..1039544c2 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1120,15 +1120,15 @@ struct LLEntryAndEdCore void LLScriptEdCore::deleteBridges() { - S32 count = mBridges.count(); + S32 count = mBridges.size(); LLEntryAndEdCore* eandc; for(S32 i = 0; i < count; i++) { - eandc = mBridges.get(i); + eandc = mBridges.at(i); delete eandc; mBridges[i] = NULL; } - mBridges.reset(); + mBridges.clear(); } // virtual diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index ac95da40c..dd1c8c780 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -33,7 +33,6 @@ #ifndef LL_LLPREVIEWSCRIPT_H #define LL_LLPREVIEWSCRIPT_H -#include "lldarray.h" #include "llpreview.h" #include "lltabcontainer.h" #include "llinventory.h" @@ -162,7 +161,7 @@ private: BOOL mForceClose; LLPanel* mCodePanel; LLScrollListCtrl* mErrorList; - LLDynamicArray mBridges; + std::vector mBridges; LLHandle mLiveHelpHandle; LLKeywordToken* mLastHelpToken; LLFrameTimer mLiveHelpTimer; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 17e953c00..ca3c3b498 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -751,10 +751,10 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL co LLInventoryModel::INCLUDE_TRASH, asset_id_matches); - if (items.count()) + if (items.size()) { // search for copyable version first - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { LLInventoryItem* itemp = items[i]; LLPermissions item_permissions = itemp->getPermissions(); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 62aac930e..0c3d91236 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -282,13 +282,13 @@ void LLCategoryDropDescendentsObserver::done() LLInventoryModel::EXCLUDE_TRASH); } - S32 count = items.count(); + S32 count = items.size(); if(count) { std::set unique_ids; for(S32 i = 0; i < count; ++i) { - unique_ids.insert(items.get(i)->getUUID()); + unique_ids.insert(items.at(i)->getUUID()); } uuid_vec_t ids; std::back_insert_iterator copier(ids); @@ -433,16 +433,16 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, items, LLInventoryModel::EXCLUDE_TRASH, is_not_preferred); - S32 count = cats.count(); + S32 count = cats.size(); S32 i; for(i = 0; i < count; ++i) { - folder_ids.push_back(cats.get(i)->getUUID()); + folder_ids.push_back(cats.at(i)->getUUID()); } - count = items.count(); + count = items.size(); for(i = 0; i < count; ++i) { - item_ids.push_back(items.get(i)->getUUID()); + item_ids.push_back(items.at(i)->getUUID()); } if(!folder_ids.empty() || !item_ids.empty()) { @@ -504,7 +504,7 @@ void LLToolDragAndDrop::beginMultiDrag( items, LLInventoryModel::EXCLUDE_TRASH, is_not_preferred); - S32 cat_count = cats.count(); + S32 cat_count = cats.size(); for(S32 i = 0; i < cat_count; ++i) { cat_ids.insert(cat->getUUID()); @@ -2341,7 +2341,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( items, LLInventoryModel::EXCLUDE_TRASH, droppable); - cats.put(cat); + cats.push_back(cat); if(droppable.countNoCopy() > 0) { LL_WARNS() << "*** Need to confirm this step" << LL_ENDL; @@ -2583,7 +2583,7 @@ EAcceptance LLToolDragAndDrop::dad3dCategoryOnLand( items, LLInventoryModel::EXCLUDE_TRASH, droppable); - if(items.count() > 0) + if(items.size() > 0) { rv = ACCEPT_YES_SINGLE; } @@ -2610,14 +2610,14 @@ EAcceptance LLToolDragAndDrop::dad3dAssetOnLand( LLViewerInventoryItem::item_array_t items; LLViewerInventoryItem::item_array_t copyable_items; locateMultipleInventory(items, cats); - if(!items.count()) return ACCEPT_NO; + if(!items.size()) return ACCEPT_NO; EAcceptance rv = ACCEPT_NO; - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { LLInventoryItem* item = items[i]; if(item->getPermissions().allowCopyBy(gAgent.getID())) { - copyable_items.put(item); + copyable_items.push_back(item); rv = ACCEPT_YES_SINGLE; } } @@ -2692,12 +2692,12 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC LLInventoryItem* item = gInventory.getItem(mCargoIDs[i]); if (item) { - items.put(item); + items.push_back(item); } LLInventoryCategory* category = gInventory.getCategory(mCargoIDs[i]); if (category) { - cats.put(category); + cats.push_back(category); } } } @@ -2716,7 +2716,7 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC LLInventoryCategory* category = (LLInventoryCategory*)obj->getInventoryObject(mCargoIDs[i]); if (category) { - cats.put(category); + cats.push_back(category); } } } @@ -2727,7 +2727,7 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC LLInventoryItem* item = (LLInventoryItem*)obj->getInventoryObject(mCargoIDs[i]); if (item) { - items.put(item); + items.push_back(item); } } } @@ -2739,11 +2739,11 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC card = (LLPreviewNotecard*)LLPreview::find(mSourceID); if(card) { - items.put((LLInventoryItem*)card->getDragItem()); + items.push_back((LLInventoryItem*)card->getDragItem()); } } - if(items.count()) return items[0]; - if(cats.count()) return cats[0]; + if(items.size()) return items[0]; + if(cats.size()) return cats[0]; return NULL; } */ diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 0e073a583..09de0e6dd 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -38,7 +38,6 @@ #include "lluuid.h" #include "stdenums.h" #include "llassetstorage.h" -#include "lldarray.h" #include "llpermissions.h" #include "llwindow.h" #include "llviewerinventory.h" diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 2ebbf921a..a60cc892f 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -33,8 +33,6 @@ #include "llviewerprecompiledheaders.h" // library includes -#include "llcoord.h" -#include "lldarray.h" #include "llfontgl.h" #include "llgl.h" #include "llrender.h" diff --git a/indra/newview/lltracker.h b/indra/newview/lltracker.h index f7009ae20..5c62dbd1d 100644 --- a/indra/newview/lltracker.h +++ b/indra/newview/lltracker.h @@ -39,7 +39,6 @@ #ifndef LL_LLTRACKER_H #define LL_LLTRACKER_H -#include "lldarray.h" #include "llmemory.h" #include "llstring.h" #include "lluuid.h" @@ -144,8 +143,8 @@ protected: std::string mTrackedLandmarkName; LLUUID mTrackedLandmarkAssetID; LLUUID mTrackedLandmarkItemID; - LLDynamicArray mLandmarkAssetIDList; - LLDynamicArray mLandmarkItemIDList; + std::vector mLandmarkAssetIDList; + std::vector mLandmarkItemIDList; BOOL mHasReachedLandmark; BOOL mHasLandmarkPosition; BOOL mLandmarkHasBeenVisited; diff --git a/indra/newview/llviewergesture.h b/indra/newview/llviewergesture.h index de7288ca0..4bbf7596d 100644 --- a/indra/newview/llviewergesture.h +++ b/indra/newview/llviewergesture.h @@ -35,7 +35,6 @@ #include "lluuid.h" #include "llstring.h" -#include "lldarray.h" #include "llgesture.h" class LLMessageSystem; diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index a8c833947..4fb18eaa6 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -53,7 +53,7 @@ class LLViewerInventoryCategory; class LLViewerInventoryItem : public LLInventoryItem, public boost::signals2::trackable { public: - typedef LLDynamicArray > item_array_t; + typedef std::vector > item_array_t; protected: ~LLViewerInventoryItem( void ); // ref counted @@ -184,7 +184,7 @@ public: class LLViewerInventoryCategory : public LLInventoryCategory { public: - typedef LLDynamicArray > cat_array_t; + typedef std::vector > cat_array_t; protected: ~LLViewerInventoryCategory(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c84eadbb1..d09c979af 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4342,7 +4342,7 @@ static bool get_derezzable_objects( EDeRezDestination dest, std::string& error, LLViewerRegion*& first_region, - LLDynamicArray* derez_objectsp, + std::vector* derez_objectsp, bool only_check = false) { bool found = false; @@ -4427,7 +4427,7 @@ static bool get_derezzable_objects( break; if (derez_objectsp) - derez_objectsp->put(object); + derez_objectsp->push_back(object); } } @@ -4447,9 +4447,9 @@ static void derez_objects( const LLUUID& dest_id, LLViewerRegion*& first_region, std::string& error, - LLDynamicArray* objectsp) + std::vector* objectsp) { - LLDynamicArray derez_objects; + std::vector derez_objects; if (!objectsp) // if objects to derez not specified { @@ -4476,13 +4476,13 @@ static void derez_objects( // satisfy anybody. const S32 MAX_ROOTS_PER_PACKET = 250; const S32 MAX_PACKET_COUNT = 254; - F32 packets = ceil((F32)objectsp->count() / (F32)MAX_ROOTS_PER_PACKET); + F32 packets = ceil((F32)objectsp->size() / (F32)MAX_ROOTS_PER_PACKET); if(packets > (F32)MAX_PACKET_COUNT) { error = "AcquireErrorTooManyObjects"; } - if(error.empty() && objectsp->count() > 0) + if(error.empty() && objectsp->size() > 0) { U8 d = (U8)dest; LLUUID tid; @@ -4507,11 +4507,11 @@ static void derez_objects( msg->addU8Fast(_PREHASH_PacketCount, packet_count); msg->addU8Fast(_PREHASH_PacketNumber, packet_number); objects_in_packet = 0; - while((object_index < objectsp->count()) + while((object_index < objectsp->size()) && (objects_in_packet++ < MAX_ROOTS_PER_PACKET)) { - LLViewerObject* object = objectsp->get(object_index++); + LLViewerObject* object = objectsp->at(object_index++); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID()); // @@ -4621,7 +4621,7 @@ private: LLObjectSelectionHandle mObjectSelection; - LLDynamicArray mReturnableObjects; + std::vector mReturnableObjects; std::string mError; LLViewerRegion* mFirstRegion; }; @@ -5522,7 +5522,7 @@ public: }; LLObjectSelectionHandle mObjectSelection; - LLDynamicArray mReturnableObjects; + std::vector mReturnableObjects; std::string mError; LLViewerRegion *mFirstRegion; }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f1619d360..09e314969 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4389,15 +4389,15 @@ public: is_card); } LLSD args; - if ( land_items.count() > 0 ) + if ( land_items.size() > 0 ) { // Show notification that they can now teleport to landmarks. Use a random landmark from the inventory - S32 random_land = ll_rand( land_items.count() - 1 ); + S32 random_land = ll_rand(land_items.size() - 1); args["NAME"] = land_items[random_land]->getName(); LLNotificationsUtil::add("TeleportToLandmark",args); } - if ( card_items.count() > 0 ) + if ( card_items.size() > 0 ) { // Show notification that they can now contact people. Use a random calling card from the inventory - S32 random_card = ll_rand( card_items.count() - 1 ); + S32 random_card = ll_rand(card_items.size() - 1); args["NAME"] = card_items[random_card]->getName(); LLNotificationsUtil::add("TeleportToPerson",args); } @@ -7835,7 +7835,7 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) void handle_lure(const LLUUID& invitee) { - LLDynamicArray ids; + std::vector ids; ids.push_back(invitee); handle_lure(ids); } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 867a1b459..f5b2a8abe 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -633,13 +633,13 @@ void LLViewerParcelMgr::deselectLand() void LLViewerParcelMgr::addObserver(LLParcelObserver* observer) { - mObservers.put(observer); + mObservers.push_back(observer); } void LLViewerParcelMgr::removeObserver(LLParcelObserver* observer) { - mObservers.removeObj(observer); + vector_replace_with_last(mObservers, observer); } @@ -648,16 +648,16 @@ void LLViewerParcelMgr::removeObserver(LLParcelObserver* observer) // from the list. void LLViewerParcelMgr::notifyObservers() { - LLDynamicArray observers; - S32 count = mObservers.count(); + std::vector observers; + S32 count = mObservers.size(); S32 i; for(i = 0; i < count; ++i) { - observers.put(mObservers.get(i)); + observers.push_back(mObservers.at(i)); } for(i = 0; i < count; ++i) { - observers.get(i)->changed(); + observers.at(i)->changed(); } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 1e0ea2c83..3a9570710 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -28,7 +28,6 @@ #define LL_LLVIEWERPARCELMGR_H #include "v3dmath.h" -#include "lldarray.h" #include "llframetimer.h" #include "llsingleton.h" #include "llparcelselection.h" @@ -343,7 +342,7 @@ private: LLVector3d mHoverWestSouth; LLVector3d mHoverEastNorth; - LLDynamicArray mObservers; + std::vector mObservers; BOOL mTeleportInProgress; teleport_finished_signal_t mTeleportFinishedSignal; diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index cd89d9743..f2a5de015 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -444,9 +444,12 @@ void LLViewerParcelOverlay::updatePropertyLines() const LLColor4U auction_coloru = gColors.getColor4("PropertyColorAuction"); // Build into dynamic arrays, then copy into static arrays. - LLDynamicArray new_vertex_array; - LLDynamicArray new_color_array; - LLDynamicArray new_coord_array; + std::vector new_vertex_array; + new_vertex_array.reserve(256); + std::vector new_color_array; + new_color_array.reserve(256); + std::vector new_coord_array; + new_coord_array.reserve(256); U8 overlay = 0; BOOL add_edge = FALSE; @@ -611,7 +614,7 @@ void LLViewerParcelOverlay::updatePropertyLines() // Now copy into static arrays for faster rendering. // Attempt to recycle old arrays if possible to avoid memory // shuffling. - S32 new_vertex_count = new_vertex_array.count(); + S32 new_vertex_count = new_vertex_array.size(); if (!(mVertexArray && mColorArray && new_vertex_count == mVertexCount)) { @@ -635,7 +638,7 @@ void LLViewerParcelOverlay::updatePropertyLines() F32* vertex = mVertexArray; for (i = 0; i < mVertexCount; i++) { - const LLVector3& point = new_vertex_array.get(i); + const LLVector3& point = new_vertex_array.at(i); *vertex = point.mV[VX]; vertex++; *vertex = point.mV[VY]; @@ -647,7 +650,7 @@ void LLViewerParcelOverlay::updatePropertyLines() U8* colorp = mColorArray; for (i = 0; i < mVertexCount; i++) { - const LLColor4U& color = new_color_array.get(i); + const LLColor4U& color = new_color_array.at(i); *colorp = color.mV[VRED]; colorp++; *colorp = color.mV[VGREEN]; @@ -664,9 +667,9 @@ void LLViewerParcelOverlay::updatePropertyLines() void LLViewerParcelOverlay::addPropertyLine( - LLDynamicArray& vertex_array, - LLDynamicArray& color_array, - LLDynamicArray& coord_array, + std::vector& vertex_array, + std::vector& color_array, + std::vector& coord_array, const F32 start_x, const F32 start_y, const U32 edge, const LLColor4U& color) @@ -674,6 +677,10 @@ void LLViewerParcelOverlay::addPropertyLine( LLColor4U underwater( color ); underwater.mV[VALPHA] /= 2; + vertex_array.reserve(16); + color_array.reserve(16); + coord_array.reserve(16); + LLSurface& land = mRegion->getLand(); F32 dx; @@ -728,11 +735,11 @@ void LLViewerParcelOverlay::addPropertyLine( // First part, only one vertex outside_z = land.resolveHeightRegion( outside_x, outside_y ); - if (outside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (outside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - vertex_array.put( LLVector3(outside_x, outside_y, outside_z) ); - coord_array.put( LLVector2(outside_x - start_x, 0.f) ); + vertex_array.push_back(LLVector3(outside_x, outside_y, outside_z)); + coord_array.push_back(LLVector2(outside_x - start_x, 0.f)); inside_x += dx * LINE_WIDTH; inside_y += dy * LINE_WIDTH; @@ -744,17 +751,17 @@ void LLViewerParcelOverlay::addPropertyLine( inside_z = land.resolveHeightRegion( inside_x, inside_y ); outside_z = land.resolveHeightRegion( outside_x, outside_y ); - if (inside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (inside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - if (outside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (outside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - vertex_array.put( LLVector3(inside_x, inside_y, inside_z) ); - vertex_array.put( LLVector3(outside_x, outside_y, outside_z) ); + vertex_array.push_back(LLVector3(inside_x, inside_y, inside_z)); + vertex_array.push_back(LLVector3(outside_x, outside_y, outside_z)); - coord_array.put( LLVector2(outside_x - start_x, 1.f) ); - coord_array.put( LLVector2(outside_x - start_x, 0.f) ); + coord_array.push_back(LLVector2(outside_x - start_x, 1.f)); + coord_array.push_back(LLVector2(outside_x - start_x, 0.f)); inside_x += dx * (dx - LINE_WIDTH); inside_y += dy * (dy - LINE_WIDTH); @@ -770,17 +777,17 @@ void LLViewerParcelOverlay::addPropertyLine( inside_z = land.resolveHeightRegion( inside_x, inside_y ); outside_z = land.resolveHeightRegion( outside_x, outside_y ); - if (inside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (inside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - if (outside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (outside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - vertex_array.put( LLVector3(inside_x, inside_y, inside_z) ); - vertex_array.put( LLVector3(outside_x, outside_y, outside_z) ); + vertex_array.push_back(LLVector3(inside_x, inside_y, inside_z)); + vertex_array.push_back(LLVector3(outside_x, outside_y, outside_z)); - coord_array.put( LLVector2(outside_x - start_x, 1.f) ); - coord_array.put( LLVector2(outside_x - start_x, 0.f) ); + coord_array.push_back(LLVector2(outside_x - start_x, 1.f)); + coord_array.push_back(LLVector2(outside_x - start_x, 0.f)); inside_x += dx; inside_y += dy; @@ -799,17 +806,17 @@ void LLViewerParcelOverlay::addPropertyLine( inside_z = land.resolveHeightRegion( inside_x, inside_y ); outside_z = land.resolveHeightRegion( outside_x, outside_y ); - if (inside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (inside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - if (outside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (outside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - vertex_array.put( LLVector3(inside_x, inside_y, inside_z) ); - vertex_array.put( LLVector3(outside_x, outside_y, outside_z) ); + vertex_array.push_back(LLVector3(inside_x, inside_y, inside_z)); + vertex_array.push_back(LLVector3(outside_x, outside_y, outside_z)); - coord_array.put( LLVector2(outside_x - start_x, 1.f) ); - coord_array.put( LLVector2(outside_x - start_x, 0.f) ); + coord_array.push_back(LLVector2(outside_x - start_x, 1.f)); + coord_array.push_back(LLVector2(outside_x - start_x, 0.f)); inside_x += dx * LINE_WIDTH; inside_y += dy * LINE_WIDTH; @@ -820,11 +827,11 @@ void LLViewerParcelOverlay::addPropertyLine( // Last edge is not drawn to the edge outside_z = land.resolveHeightRegion( outside_x, outside_y ); - if (outside_z > 20.f) color_array.put( color ); - else color_array.put( underwater ); + if (outside_z > 20.f) color_array.push_back(color); + else color_array.push_back(underwater); - vertex_array.put( LLVector3(outside_x, outside_y, outside_z) ); - coord_array.put( LLVector2(outside_x - start_x, 0.f) ); + vertex_array.push_back(LLVector3(outside_x, outside_y, outside_z)); + coord_array.push_back(LLVector2(outside_x - start_x, 0.f)); } diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 3f629fda9..9680cd88e 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -31,7 +31,6 @@ // One of these structures per region. #include "llbbox.h" -#include "lldarray.h" #include "llframetimer.h" #include "lluuid.h" #include "llviewertexture.h" @@ -96,9 +95,9 @@ private: U8 ownership(S32 row, S32 col) const { return 0x7 & mOwnership[row * mParcelGridsPerEdge + col]; } - void addPropertyLine(LLDynamicArray& vertex_array, - LLDynamicArray& color_array, - LLDynamicArray& coord_array, + void addPropertyLine(std::vector& vertex_array, + std::vector& color_array, + std::vector& coord_array, const F32 start_x, const F32 start_y, const U32 edge, const LLColor4U& color); diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index 73d5096d7..08c736a0a 100644 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -33,7 +33,6 @@ #ifndef LL_LLVIEWERPARTSIM_H #define LL_LLVIEWERPARTSIM_H -#include "lldarrayptr.h" #include "llframetimer.h" #include "llpointer.h" #include "llpartdata.h" diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index ff3f0392e..187e71a72 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -75,11 +75,8 @@ #include "llapp.h" #include "llapr.h" #include "llcriticaldamp.h" -#include "lldarray.h" -#include "lldarrayptr.h" #include "lldefs.h" #include "lldepthstack.h" -#include "lldqueueptr.h" #include "llendianswizzle.h" #include "llerror.h" #include "llfasttimer.h" diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 257433332..27c0dc6cf 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1180,10 +1180,10 @@ public: S32 target_index = input["body"]["Index"][0]["Prey"].asInteger(); S32 you_index = input["body"]["Index"][0]["You" ].asInteger(); - LLDynamicArray* avatar_locs = ®ion->mMapAvatars; - LLDynamicArray* avatar_ids = ®ion->mMapAvatarIDs; - avatar_locs->reset(); - avatar_ids->reset(); + std::vector* avatar_locs = ®ion->mMapAvatars; + std::vector* avatar_ids = ®ion->mMapAvatarIDs; + avatar_locs->clear(); + avatar_ids->clear(); //LL_INFOS() << "coarse locations agent[0] " << input["body"]["AgentData"][0]["AgentID"].asUUID() << LL_ENDL; //LL_INFOS() << "my agent id = " << gAgent.getID() << LL_ENDL; @@ -1223,13 +1223,13 @@ public: pos |= y; pos <<= 8; pos |= z; - avatar_locs->put(pos); + avatar_locs->push_back(pos); //LL_INFOS() << "next pos: " << x << "," << y << "," << z << ": " << pos << LL_ENDL; if(has_agent_data) // for backwards compatibility with old message format { LLUUID agent_id(agents_it->get("AgentID").asUUID()); //LL_INFOS() << "next agent: " << agent_id.asString() << LL_ENDL; - avatar_ids->put(agent_id); + avatar_ids->push_back(agent_id); } } if (has_agent_data) @@ -1250,8 +1250,8 @@ LLHTTPRegistration void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) { //LL_INFOS() << "CoarseLocationUpdate" << LL_ENDL; - mMapAvatars.reset(); - mMapAvatarIDs.reset(); // only matters in a rare case but it's good to be safe. + mMapAvatars.clear(); + mMapAvatarIDs.clear(); // only matters in a rare case but it's good to be safe. U8 x_pos = 0; U8 y_pos = 0; @@ -1300,10 +1300,10 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) pos |= y_pos; pos <<= 8; pos |= z_pos; - mMapAvatars.put(pos); + mMapAvatars.push_back(pos); if(has_agent_data) { - mMapAvatarIDs.put(agent_id); + mMapAvatarIDs.push_back(agent_id); } } } @@ -1449,14 +1449,14 @@ LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc, U8 &cache_miss_type) { // LL_INFOS() << "CRC miss for " << local_id << LL_ENDL; cache_miss_type = CACHE_MISS_TYPE_CRC; - mCacheMissCRC.put(local_id); + mCacheMissCRC.push_back(local_id); } } else { // LL_INFOS() << "Cache miss for " << local_id << LL_ENDL; cache_miss_type = CACHE_MISS_TYPE_FULL; - mCacheMissFull.put(local_id); + mCacheMissFull.push_back(local_id); } return NULL; @@ -1464,13 +1464,13 @@ LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc, U8 &cache_miss_type) void LLViewerRegion::addCacheMissFull(const U32 local_id) { - mCacheMissFull.put(local_id); + mCacheMissFull.push_back(local_id); } void LLViewerRegion::requestCacheMisses() { - S32 full_count = mCacheMissFull.count(); - S32 crc_count = mCacheMissCRC.count(); + S32 full_count = mCacheMissFull.size(); + S32 crc_count = mCacheMissCRC.size(); if (full_count == 0 && crc_count == 0) return; LLMessageSystem* msg = gMessageSystem; @@ -1535,8 +1535,8 @@ void LLViewerRegion::requestCacheMisses() { sendReliableMessage(); } - mCacheMissFull.reset(); - mCacheMissCRC.reset(); + mCacheMissFull.clear(); + mCacheMissCRC.clear(); mCacheDirty = TRUE ; // LL_INFOS() << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << LL_ENDL; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index c74d9bc5a..044d60149 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -38,7 +38,6 @@ #include #include -#include "lldarray.h" #include "llwind.h" #include "llcloud.h" #include "llstat.h" @@ -422,8 +421,8 @@ public: // messaging system in which the previous message only sends and parses the // positions stored in the first array so they're maintained separately until // we stop supporting the old CoarseLocationUpdate message. - LLDynamicArray mMapAvatars; - LLDynamicArray mMapAvatarIDs; + std::vector mMapAvatars; + std::vector mMapAvatarIDs; private: LLViewerRegionImpl * mImpl; @@ -475,8 +474,8 @@ private: BOOL mCacheLoaded; BOOL mCacheDirty; - LLDynamicArray mCacheMissFull; - LLDynamicArray mCacheMissCRC; + std::vector mCacheMissFull; + std::vector mCacheMissCRC; // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3) mutable tex_matrix_t mWorldMapTiles; diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index f31391e2a..cccd389da 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -47,11 +47,11 @@ LLVLManager gVLManager; LLVLManager::~LLVLManager() { S32 i; - for (i = 0; i < mPacketData.count(); i++) + for (i = 0; i < mPacketData.size(); i++) { delete mPacketData[i]; } - mPacketData.reset(); + mPacketData.clear(); } void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) @@ -88,7 +88,7 @@ void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) LL_ERRS() << "Unknown layer type!" << (S32)vl_datap->mType << LL_ENDL; } - mPacketData.put(vl_datap); + mPacketData.push_back(vl_datap); } void LLVLManager::unpackData(const S32 num_packets) @@ -96,7 +96,7 @@ void LLVLManager::unpackData(const S32 num_packets) static LLFrameTimer decode_timer; S32 i; - for (i = 0; i < mPacketData.count(); i++) + for (i = 0; i < mPacketData.size(); i++) { LLVLData *datap = mPacketData[i]; @@ -128,11 +128,11 @@ void LLVLManager::unpackData(const S32 num_packets) } } - for (i = 0; i < mPacketData.count(); i++) + for (i = 0; i < mPacketData.size(); i++) { delete mPacketData[i]; } - mPacketData.reset(); + mPacketData.clear(); } @@ -164,12 +164,12 @@ S32 LLVLManager::getTotalBytes() const void LLVLManager::cleanupData(LLViewerRegion *regionp) { S32 cur = 0; - while (cur < mPacketData.count()) + while (cur < mPacketData.size()) { if (mPacketData[cur]->mRegionp == regionp) { delete mPacketData[cur]; - mPacketData.remove(cur); + mPacketData.erase(mPacketData.begin() + cur); } else { diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h index 6bf495e62..153abfa53 100644 --- a/indra/newview/llvlmanager.h +++ b/indra/newview/llvlmanager.h @@ -36,7 +36,6 @@ // This class manages the data coming in for viewer layers from the network. #include "stdtypes.h" -#include "lldarray.h" class LLVLData; class LLViewerRegion; @@ -61,7 +60,7 @@ public: void cleanupData(LLViewerRegion *regionp); protected: - LLDynamicArray mPacketData; + std::vector mPacketData; U32 mLandBits; U32 mWindBits; U32 mCloudBits; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index fc4eb0c8e..33ee35dfa 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2600,11 +2600,11 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const asset_id_matches); BOOL can_grab = FALSE; - LL_DEBUGS() << "item count for asset " << texture_id << ": " << items.count() << LL_ENDL; - if (items.count()) + LL_DEBUGS() << "item count for asset " << texture_id << ": " << items.size() << LL_ENDL; + if (items.size()) { // search for full permissions version - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { LLViewerInventoryItem* itemp = items[i]; if (itemp->getIsFullPerm()) diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 6f2fd4571..9fe14375a 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -35,7 +35,6 @@ #include "lluuid.h" #include "lldatapacker.h" -#include "lldlinked.h" #include "lldir.h" diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index 7f9b9bee8..10708c74b 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -34,7 +34,6 @@ #define LL_LLVOGRASS_H #include "llviewerobject.h" -#include "lldarray.h" #include class LLSurfacePatch; diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 482434a57..4751b81eb 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -34,7 +34,6 @@ #define LL_LLVOTREE_H #include "llviewerobject.h" -#include "lldarray.h" #include "xform.h" class LLFace; diff --git a/indra/newview/llvotreenew.h b/indra/newview/llvotreenew.h index 426470101..b4a2fe67c 100644 --- a/indra/newview/llvotreenew.h +++ b/indra/newview/llvotreenew.h @@ -34,7 +34,6 @@ #define LL_LLVOTREENEW_H #include "llviewerobject.h" -#include "lldarray.h" #include "xform.h" #include "lltreeparams.h" @@ -140,7 +139,7 @@ public: U32 mOffsets[MAX_VARS][MAX_RES]; // offsets for the partial branch pieces // local section frames for this branch LLMatrix4 mFrames[MAX_VARS][(MAX_RES*(MAX_RES + 1))/2]; // (0...n) + (1...n) + ... + (n-1..n) - LLDynamicArray mFaceNormals; + std::vector mFaceNormals; }; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 5d0d0757f..2dfd30a5e 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1585,13 +1585,13 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* positi { LLViewerRegion* regionp = *iter; const LLVector3d& origin_global = regionp->getOriginGlobal(); - S32 count = regionp->mMapAvatars.count(); + S32 count = regionp->mMapAvatars.size(); for (S32 i = 0; i < count; i++) { - LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global); + LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.at(i), origin_global); if(dist_vec_squared(pos_global, relative_to) <= radius_squared) { - LLUUID uuid = regionp->mMapAvatarIDs.get(i); + LLUUID uuid = regionp->mMapAvatarIDs.at(i); // if this avatar doesn't already exist in the list, add it if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end()) { @@ -1639,13 +1639,13 @@ void LLWorld::getAvatars(pos_map_t* umap, const LLVector3d& relative_to, F32 rad { LLViewerRegion* regionp = *iter; const LLVector3d& origin_global = regionp->getOriginGlobal(); - S32 count = regionp->mMapAvatars.count(); + S32 count = regionp->mMapAvatars.size(); for (S32 i = 0; i < count; i++) { - LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global); + LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.at(i), origin_global); if(dist_vec_squared(pos_global, relative_to) <= radius_squared) { - LLUUID uuid = regionp->mMapAvatarIDs.get(i); + LLUUID uuid = regionp->mMapAvatarIDs.at(i); // if this avatar doesn't already exist in the list, add it if(uuid.notNull()) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 1c2d13baf..1cf400446 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -35,8 +35,6 @@ #include "llcamera.h" #include "llerror.h" -#include "lldarrayptr.h" -#include "lldqueueptr.h" #include "lldrawpool.h" #include "llspatialpartition.h" #include "m4math.h" diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index b44fd340e..1439c92d1 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -946,9 +946,9 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const RlvWearableItemCollector functor(pFolder->getUUID(), true, false); gInventory.collectDescendentsIf(pFolder->getUUID(), folders, items, FALSE, functor); - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - const LLViewerInventoryItem* pItem = items.get(idxItem); + const LLViewerInventoryItem* pItem = items.at(idxItem); switch (pItem->getType()) { case LLAssetType::AT_BODYPART: @@ -991,9 +991,9 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const RlvWearableItemCollector functor(pFolder->getUUID(), true, false); gInventory.collectDescendentsIf(pFolder->getUUID(), folders, items, FALSE, functor); - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - LLViewerInventoryItem* pItem = items.get(idxItem); + LLViewerInventoryItem* pItem = items.at(idxItem); if (RlvForceWear::isWearingItem(pItem)) continue; // Don't examine any items we're already wearing @@ -1831,8 +1831,8 @@ void RlvHandler::onForceWearCallback(const uuid_vec_t& idItems, ERlvBehaviour eB LLInventoryModel::cat_array_t folders; if (RlvInventory::instance().getPath(idItems, folders)) { - for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) - onForceWear(folders.get(idxFolder), eBhvr); + for (S32 idxFolder = 0, cntFolder = folders.size(); idxFolder < cntFolder; idxFolder++) + onForceWear(folders.at(idxFolder), eBhvr); // If we're not executing a command then we're a delayed callback and need to manually call done() if ( (!getCurrentCommand()) && (RlvForceWear::instanceExists()) ) @@ -1985,9 +1985,9 @@ ERlvCmdRet RlvHandler::onFindFolder(const RlvCommand& rlvCmd, std::string& strRe // We need to return an "in depth" result so whoever has the most '/' is our lucky winner // (maxSlashes needs to be initialized to -1 since children of the #RLV folder won't have '/' in their shared path) int maxSlashes = -1, curSlashes; std::string strFolderName; - for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) + for (S32 idxFolder = 0, cntFolder = folders.size(); idxFolder < cntFolder; idxFolder++) { - strFolderName = RlvInventory::instance().getSharedPath(folders.get(idxFolder)); + strFolderName = RlvInventory::instance().getSharedPath(folders.at(idxFolder)); curSlashes = std::count(strFolderName.begin(), strFolderName.end(), '/'); if (curSlashes > maxSlashes) @@ -1999,11 +1999,11 @@ ERlvCmdRet RlvHandler::onFindFolder(const RlvCommand& rlvCmd, std::string& strRe } else if (RLV_BHVR_FINDFOLDERS == rlvCmd.getBehaviourType()) { - for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) + for (S32 idxFolder = 0, cntFolder = folders.size(); idxFolder < cntFolder; idxFolder++) { if (!strReply.empty()) strReply.push_back(','); - strReply += RlvInventory::instance().getSharedPath(folders.get(idxFolder)); + strReply += RlvInventory::instance().getSharedPath(folders.at(idxFolder)); } } } @@ -2101,15 +2101,15 @@ ERlvCmdRet RlvHandler::onGetInv(const RlvCommand& rlvCmd, std::string& strReply) if (!pFolders) return RLV_RET_FAILED; - for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++) + for (S32 idxFolder = 0, cntFolder = pFolders->size(); idxFolder < cntFolder; idxFolder++) { // Return all folders that: // - aren't hidden // - aren't a folded folder (only really matters when "Enable Legacy Naming" is enabled - see related blog post) // (we can skip checking for . folders since the ones we'll want to hide start with '.' anyway) - const std::string& strFolder = pFolders->get(idxFolder)->getName(); + const std::string& strFolder = pFolders->at(idxFolder)->getName(); if ( (!strFolder.empty()) && (RLV_FOLDER_PREFIX_HIDDEN != strFolder[0]) && - (!RlvInventory::isFoldedFolder(pFolders->get(idxFolder).get(), false)) ) + (!RlvInventory::isFoldedFolder(pFolders->at(idxFolder).get(), false)) ) { if (!strReply.empty()) strReply.push_back(','); @@ -2142,14 +2142,14 @@ ERlvCmdRet RlvHandler::onGetInvWorn(const RlvCommand& rlvCmd, std::string& strRe // Add all the folders to a lookup map std::map mapFolders; mapFolders.insert(std::pair(pFolder->getUUID(), wi)); - for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) - mapFolders.insert(std::pair(folders.get(idxFolder)->getUUID(), wi)); + for (S32 idxFolder = 0, cntFolder = folders.size(); idxFolder < cntFolder; idxFolder++) + mapFolders.insert(std::pair(folders.at(idxFolder)->getUUID(), wi)); // Iterate over all the found items LLViewerInventoryItem* pItem; std::map::iterator itFolder; - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - pItem = items.get(idxItem); + pItem = items.at(idxItem); if (!RlvForceWear::isWearableItem(pItem)) continue; @@ -2285,15 +2285,15 @@ ERlvCmdRet RlvHandler::onGetPath(const RlvCommand& rlvCmd, std::string& strReply { if (RLV_BHVR_GETPATH == rlvCmd.getBehaviourType()) { - strReply = RlvInventory::instance().getSharedPath(folders.get(0)); + strReply = RlvInventory::instance().getSharedPath(folders.at(0)); } else if (RLV_BHVR_GETPATHNEW == rlvCmd.getBehaviourType()) { - for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) + for (S32 idxFolder = 0, cntFolder = folders.size(); idxFolder < cntFolder; idxFolder++) { if (!strReply.empty()) strReply.push_back(','); - strReply += RlvInventory::instance().getSharedPath(folders.get(idxFolder)); + strReply += RlvInventory::instance().getSharedPath(folders.at(idxFolder)); } } } diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 4ab96fb07..84fd3e4b4 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -484,9 +484,9 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc bool fSeenWType[LLWearableType::WT_COUNT] = { false }; EWearAction eCurAction = eAction; - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - LLViewerInventoryItem* pRlvItem = items.get(idxItem); + LLViewerInventoryItem* pRlvItem = items.at(idxItem); LLViewerInventoryItem* pItem = (LLAssetType::AT_LINK == pRlvItem->getActualType()) ? pRlvItem->getLinkedItem() : pRlvItem; // If it's wearable it should be worn on detach @@ -915,8 +915,8 @@ void RlvForceWear::done() if (m_remGestures.size()) { // NOTE: LLGestureMgr::deactivateGesture() will call LLAppearanceMgr::removeCOFItemLinks() for us - for (S32 idxItem = 0, cntItem = m_remGestures.count(); idxItem < cntItem; idxItem++) - LLGestureMgr::instance().deactivateGesture(m_remGestures.get(idxItem)->getUUID()); + for (S32 idxItem = 0, cntItem = m_remGestures.size(); idxItem < cntItem; idxItem++) + LLGestureMgr::instance().deactivateGesture(m_remGestures.at(idxItem)->getUUID()); m_remGestures.clear(); } @@ -944,9 +944,9 @@ void RlvForceWear::done() for (addwearables_map_t::const_iterator itAddWearables = m_addWearables.begin(); itAddWearables != m_addWearables.end(); ++itAddWearables) { const LLInventoryModel::item_array_t& wearItems = itAddWearables->second; - for (S32 idxItem = 0, cntItem = wearItems.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = wearItems.size(); idxItem < cntItem; idxItem++) { - LLViewerInventoryItem* pItem = wearItems.get(idxItem); + LLViewerInventoryItem* pItem = wearItems.at(idxItem); if (!pAppearanceMgr->isLinkInCOF(pItem->getUUID())) // It's important to examine COF here and *not* gAgentWearables { if (LLAssetType::AT_BODYPART == pItem->getType()) @@ -963,9 +963,9 @@ void RlvForceWear::done() itAddAttachments != m_addAttachments.end(); ++itAddAttachments) { const LLInventoryModel::item_array_t& wearItems = itAddAttachments->second; - for (S32 idxItem = 0, cntItem = wearItems.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = wearItems.size(); idxItem < cntItem; idxItem++) { - const LLUUID& idItem = wearItems.get(idxItem)->getLinkedUUID(); + const LLUUID& idItem = wearItems.at(idxItem)->getLinkedUUID(); if (gAgentAvatarp->attachmentWasRequested(idItem)) continue; gAgentAvatarp->addAttachmentRequest(idItem); diff --git a/indra/newview/rlvinventory.cpp b/indra/newview/rlvinventory.cpp index b2c2c5bce..5c99c5ec9 100644 --- a/indra/newview/rlvinventory.cpp +++ b/indra/newview/rlvinventory.cpp @@ -107,8 +107,8 @@ void RlvInventory::fetchSharedInventory() // Add them to the "to fetch" list uuid_vec_t idFolders; idFolders.push_back(pRlvRoot->getUUID()); - for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) - idFolders.push_back(folders.get(idxFolder)->getUUID()); + for (S32 idxFolder = 0, cntFolder = folders.size(); idxFolder < cntFolder; idxFolder++) + idFolders.push_back(folders.at(idxFolder)->getUUID()); // Now fetch them all in one go RlvSharedInventoryFetcher* pFetcher = new RlvSharedInventoryFetcher(idFolders); @@ -137,9 +137,9 @@ void RlvInventory::fetchSharedLinks() // Add them to the "to fetch" list based on link type uuid_vec_t idFolders, idItems; - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - const LLViewerInventoryItem* pItem = items.get(idxItem); + const LLViewerInventoryItem* pItem = items.at(idxItem); switch (pItem->getActualType()) { case LLAssetType::AT_LINK: @@ -214,7 +214,7 @@ bool RlvInventory::findSharedFolders(const std::string& strCriteria, LLInventory RlvCriteriaCategoryCollector f(strCriteria); gInventory.collectDescendentsIf(pRlvRoot->getUUID(), folders, items, FALSE, f); - return (folders.count() != 0); + return (folders.size() != 0); } // Checked: 2010-08-30 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c @@ -239,7 +239,7 @@ bool RlvInventory::getPath(const uuid_vec_t& idItems, LLInventoryModel::cat_arra } } - return (folders.count() != 0); + return (folders.size() != 0); } // Checked: 2011-10-06 (RLVa-1.4.2a) | Modified: RLVa-1.4.2a @@ -253,9 +253,9 @@ const LLUUID& RlvInventory::getSharedRootID() const { // NOTE: we might have multiple #RLV folders (pick the first one with sub-folders; otherwise the last one with no sub-folders) const LLViewerInventoryCategory* pFolder; - for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++) + for (S32 idxFolder = 0, cntFolder = pFolders->size(); idxFolder < cntFolder; idxFolder++) { - if ( ((pFolder = pFolders->get(idxFolder)) != NULL) && (cstrSharedRoot == pFolder->getName()) ) + if ( ((pFolder = pFolders->at(idxFolder)) != NULL) && (cstrSharedRoot == pFolder->getName()) ) { m_idRlvRoot = pFolder->getUUID(); if (getDirectDescendentsFolderCount(pFolder) > 0) @@ -363,8 +363,8 @@ S32 RlvInventory::getDirectDescendentsItemCount(const LLInventoryCategory* pFold if (pItems) { - for (S32 idxItem = 0, cntItem = pItems->count(); idxItem < cntItem; idxItem++) - if (pItems->get(idxItem)->getType() == filterType) + for (S32 idxItem = 0, cntItem = pItems->size(); idxItem < cntItem; idxItem++) + if (pItems->at(idxItem)->getType() == filterType) cntType++; } } @@ -417,9 +417,9 @@ void RlvRenameOnWearObserver::doneIdle() continue; } - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - LLViewerInventoryItem* pItem = items.get(idxItem); + LLViewerInventoryItem* pItem = items.at(idxItem); if (!pItem) continue; diff --git a/indra/newview/rlvlocks.cpp b/indra/newview/rlvlocks.cpp index 6e496018b..9835a0b71 100644 --- a/indra/newview/rlvlocks.cpp +++ b/indra/newview/rlvlocks.cpp @@ -1063,7 +1063,7 @@ void RlvFolderLocks::addFolderLock(const folderlock_source_t& lockSource, ELockP // Checked: 2011-03-28 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g bool RlvFolderLocks::getLockedFolders(const folderlock_source_t& lockSource, LLInventoryModel::cat_array_t& lockFolders) const { - S32 cntFolders = lockFolders.count(); + S32 cntFolders = lockFolders.size(); switch (lockSource.first) { case ST_ATTACHMENT: @@ -1125,13 +1125,13 @@ bool RlvFolderLocks::getLockedFolders(const folderlock_source_t& lockSource, LLI default: return false; }; - return cntFolders != lockFolders.count(); + return cntFolders != lockFolders.size(); } // Checked: 2011-11-26 (RLVa-1.5.4a) | Modified: RLVa-1.5.4a bool RlvFolderLocks::getLockedItems(const LLUUID& idFolder, LLInventoryModel::item_array_t& lockItems) const { - S32 cntItems = lockItems.count(); + S32 cntItems = lockItems.size(); LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items; LLFindWearablesEx f(true, true); // Collect all worn items @@ -1141,9 +1141,9 @@ bool RlvFolderLocks::getLockedItems(const LLUUID& idFolder, LLInventoryModel::it std::map folderLookups; std::map::const_iterator itLookup; bool fItemLocked = false; - for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = items.size(); idxItem < cntItem; idxItem++) { - LLViewerInventoryItem* pItem = items.get(idxItem); + LLViewerInventoryItem* pItem = items.at(idxItem); if (LLAssetType::AT_LINK == pItem->getActualType()) pItem = pItem->getLinkedItem(); if (!pItem) @@ -1188,7 +1188,7 @@ bool RlvFolderLocks::getLockedItems(const LLUUID& idFolder, LLInventoryModel::it lockItems.push_back(pItem); } - return cntItems != lockItems.count(); + return cntItems != lockItems.size(); } // Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g @@ -1305,9 +1305,9 @@ void RlvFolderLocks::refreshLockedLookups() const LLInventoryModel::cat_array_t lockedFolders; const LLUUID& idFolderRoot = gInventory.getRootFolderID(); if (getLockedFolders(pLockDescr->lockSource, lockedFolders)) { - for (S32 idxFolder = 0, cntFolder = lockedFolders.count(); idxFolder < cntFolder; idxFolder++) + for (S32 idxFolder = 0, cntFolder = lockedFolders.size(); idxFolder < cntFolder; idxFolder++) { - const LLViewerInventoryCategory* pFolder = lockedFolders.get(idxFolder); + const LLViewerInventoryCategory* pFolder = lockedFolders.at(idxFolder); if (idFolderRoot != pFolder->getUUID()) m_LockedFolderMap.insert(std::pair(pFolder->getUUID(), pLockDescr)); else @@ -1326,9 +1326,9 @@ void RlvFolderLocks::refreshLockedLookups() const LLInventoryModel::item_array_t lockedItems; if (getLockedItems(LLAppearanceMgr::instance().getCOF(), lockedItems)) { - for (S32 idxItem = 0, cntItem = lockedItems.count(); idxItem < cntItem; idxItem++) + for (S32 idxItem = 0, cntItem = lockedItems.size(); idxItem < cntItem; idxItem++) { - const LLViewerInventoryItem* pItem = lockedItems.get(idxItem); + const LLViewerInventoryItem* pItem = lockedItems.at(idxItem); switch (pItem->getType()) { case LLAssetType::AT_BODYPART: diff --git a/indra/newview/statemachine/aifetchinventoryfolder.cpp b/indra/newview/statemachine/aifetchinventoryfolder.cpp index e0b38ddf2..a2d050375 100644 --- a/indra/newview/statemachine/aifetchinventoryfolder.cpp +++ b/indra/newview/statemachine/aifetchinventoryfolder.cpp @@ -135,9 +135,9 @@ void AIFetchInventoryFolder::multiplex_impl(state_type run_state) // Look up UUID by name. LLInventoryModel::cat_array_t* categories; gInventory.getDirectDescendentsOf(mParentFolder, categories); - for (S32 i = 0; i < categories->getLength(); ++i) + for (S32 i = 0; i < categories->size(); ++i) { - LLPointer const& category(categories->get(i)); + LLPointer const& category(categories->at(i)); if (category->getName() == mFolderName) { mFolderUUID = category->getUUID(); diff --git a/indra/test/lljoint_tut.cpp b/indra/test/lljoint_tut.cpp index 72071ebbf..34b15578a 100644 --- a/indra/test/lljoint_tut.cpp +++ b/indra/test/lljoint_tut.cpp @@ -240,7 +240,7 @@ namespace tut 3) void updateWorldPRSParent(); 4) void updateWorldMatrix(); 5) LLXformMatrix *getXform() { return &mXform; } - 6) void setConstraintSilhouette(LLDynamicArray& silhouette); + 6) void setConstraintSilhouette(std::vector& silhouette); 7) void clampRotation(LLQuaternion old_rot, LLQuaternion new_rot); // * diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index 7e2e1c7ac..de08f1029 100644 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -510,7 +510,7 @@ namespace tut template<> template<> void LLTemplateMessageBuilderTestObject::test<22>() - // repeated penultimate block (crashes when data in LLDynamicArrayIndexed) + // repeated penultimate block (crashes when data in LLIndexedVector) { U32 inTest00 = 0, inTest01 = 1, inTest1 = 2; U32 outTest00, outTest01, outTest1;