From 41eb6872431ebaa79c98550d26c797415d79bb67 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Tue, 22 Jul 2014 03:39:01 -0400 Subject: [PATCH] Fix compile errors and warnings on linux after merging Shyotl. --- indra/llmath/llmatrix4a.h | 28 ++++++++++++++++----------- indra/llmath/lloctree.h | 4 ++-- indra/newview/lldrawpool.cpp | 3 ++- indra/newview/llflexibleobject.cpp | 6 ++++-- indra/newview/llviewercamera.h | 4 ++-- indra/newview/llviewerobjectlist.cpp | 3 ++- indra/newview/llviewerpartsim.cpp | 16 +++++++++------ indra/newview/llviewertextureanim.cpp | 3 ++- 8 files changed, 41 insertions(+), 26 deletions(-) diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index f322c087a..0af8105ec 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -663,22 +663,28 @@ public: } //======================Logic==================== +private: + template inline void init_foos(LLMatrix4a& foos) const + { + static bool done(false); + if (done) return; + const LLVector4a delta(0.0001f); + foos.setIdentity(); + foos.getRow<0>().sub(delta); + foos.getRow<1>().sub(delta); + foos.getRow<2>().sub(delta); + foos.getRow<3>().sub(delta); + done = true; + } + +public: inline bool isIdentity() const { static LLMatrix4a mins; static LLMatrix4a maxs; - static LLVector4a delta(0.0001f); - static bool init_mins = ( mins.setIdentity(), - mins.getRow<0>().sub(delta), - mins.getRow<1>().sub(delta), - mins.getRow<2>().sub(delta), - mins.getRow<3>().sub(delta), true ); - static bool init_maxs = ( maxs.setIdentity(), - maxs.getRow<0>().add(delta), - maxs.getRow<1>().add(delta), - maxs.getRow<2>().add(delta), - maxs.getRow<3>().add(delta), true ); + init_foos(mins); + init_foos(maxs); LLVector4a mask1 = _mm_and_ps(_mm_cmpgt_ps(mMatrix[0],mins.getRow<0>()), _mm_cmplt_ps(mMatrix[0],maxs.getRow<0>())); LLVector4a mask2 = _mm_and_ps(_mm_cmpgt_ps(mMatrix[1],mins.getRow<1>()), _mm_cmplt_ps(mMatrix[1],maxs.getRow<1>())); diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 5189d852b..0be162f5c 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -968,11 +968,11 @@ public: #ifdef LL_OCTREE_POOLS void* operator new(size_t size) { - return getPool(size).malloc(); + return LLOctreeNode::getPool(size).malloc(); } void operator delete(void* ptr) { - getPool(sizeof(LLOctreeNode)).free(ptr); + LLOctreeNode::getPool(sizeof(LLOctreeNode)).free(ptr); } #else void* operator new(size_t size) diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 7a6ca0e24..3a936eaf8 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -301,7 +301,8 @@ void LLFacePool::removeFaceReference(LLFace *facep) if (idx != -1) { facep->setReferenceIndex(-1); - std::vector::iterator iter = vector_replace_with_last(mReferences, mReferences.begin() + idx); + std::vector::iterator face_it(mReferences.begin() + idx); + std::vector::iterator iter = vector_replace_with_last(mReferences, face_it); if(iter != mReferences.end()) (*iter)->setReferenceIndex(idx); } diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index e378c4458..cf97d4e82 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -80,10 +80,12 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD LLVolumeImplFlexible::~LLVolumeImplFlexible() { - std::vector::iterator iter = vector_replace_with_last(sInstanceList, sInstanceList.begin() + mInstanceIndex); + std::vector::iterator flex_it(sInstanceList.begin() + mInstanceIndex); + std::vector::iterator iter = vector_replace_with_last(sInstanceList, flex_it); if(iter != sInstanceList.end()) (*iter)->mInstanceIndex = mInstanceIndex; - vector_replace_with_last(sUpdateDelay,sUpdateDelay.begin() + mInstanceIndex); + std::vector::iterator update_it(sUpdateDelay.begin() + mInstanceIndex); + vector_replace_with_last(sUpdateDelay, update_it); } //static diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 8d4e9ce97..0c465592b 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -39,10 +39,10 @@ class LLViewerObject; // This rotation matrix moves the default OpenGL reference frame // (-Z at, Y up) to Cory's favorite reference frame (X at, Z up) -static LL_ALIGN_16(const LLMatrix4a OGL_TO_CFR_ROTATION(LLVector4a( 0.f, 0.f, -1.f, 0.f), // -Z becomes X +static LL_ALIGN_16(const LLMatrix4a) OGL_TO_CFR_ROTATION(LLVector4a( 0.f, 0.f, -1.f, 0.f), // -Z becomes X LLVector4a(-1.f, 0.f, 0.f, 0.f), // -X becomes Y LLVector4a( 0.f, 1.f, 0.f, 0.f), // Y becomes Z - LLVector4a( 0.f, 0.f, 0.f, 1.f) )); + LLVector4a( 0.f, 0.f, 0.f, 1.f) ); const BOOL FOR_SELECTION = TRUE; const BOOL NOT_FOR_SELECTION = FALSE; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 4bb792f8b..b04c53af5 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1459,7 +1459,8 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp) objectp->setListIndex(-1); - std::vector >::iterator iter = vector_replace_with_last(mActiveObjects,mActiveObjects.begin() + idx); + std::vector >::iterator it(mActiveObjects.begin() + idx); + std::vector >::iterator iter = vector_replace_with_last(mActiveObjects, it); if(iter != mActiveObjects.end()) (*iter)->setListIndex(idx); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index a27e1ec4e..c3f49f69f 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -406,7 +406,8 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) // Kill dead particles (either flagged dead, or too old) if ((part->mLastUpdateTime > part->mMaxAge) || (LLViewerPart::LL_PART_DEAD_MASK == part->mFlags)) { - vector_replace_with_last(mParticles,mParticles.begin() + i); + part_list_t::iterator it(mParticles.begin() + i); + vector_replace_with_last(mParticles, it); delete part ; } else @@ -416,7 +417,8 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) { // Transfer particles between groups LLViewerPartSim::getInstance()->put(part) ; - vector_replace_with_last(mParticles,mParticles.begin() + i); + part_list_t::iterator it(mParticles.begin() + i); + vector_replace_with_last(mParticles, it); } else { @@ -721,8 +723,9 @@ void LLViewerPartSim::updateSimulation() if (mViewerPartSources[i]->isDead()) { - vector_replace_with_last(mViewerPartSources,mViewerPartSources.begin() + i); - //mViewerPartSources.erase(mViewerPartSources.begin() + i); + source_list_t::iterator it(mViewerPartSources.begin() + i); + vector_replace_with_last(mViewerPartSources, it); + //mViewerPartSources.erase(it); count--; } else @@ -758,8 +761,9 @@ void LLViewerPartSim::updateSimulation() if (!mViewerPartGroups[i]->getCount()) { delete mViewerPartGroups[i]; - vector_replace_with_last(mViewerPartGroups,mViewerPartGroups.begin() + i); - //mViewerPartGroups.erase(mViewerPartGroups.begin() + i); + group_list_t::iterator it(mViewerPartGroups.begin() + i); + vector_replace_with_last(mViewerPartGroups, it); + //mViewerPartGroups.erase(it); i--; count--; } diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 525de0ed2..1e6b7a343 100644 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -49,7 +49,8 @@ LLViewerTextureAnim::LLViewerTextureAnim(LLVOVolume* vobj) : LLTextureAnim() LLViewerTextureAnim::~LLViewerTextureAnim() { - std::vector::iterator iter = vector_replace_with_last(sInstanceList, sInstanceList.begin() + mInstanceIndex); + std::vector::iterator it(sInstanceList.begin() + mInstanceIndex); + std::vector::iterator iter = vector_replace_with_last(sInstanceList, it); if(iter != sInstanceList.end()) (*iter)->mInstanceIndex = mInstanceIndex; }