From 6e3f404a1cb55aa8ae43f39567a8ff16cc33b156 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 14 Feb 2016 17:37:10 -0500 Subject: [PATCH] Rip out old workarounds, hacks and macros for newer C++ features not being supported back in the day. Adds LL_COMPILE_TIME_MESSAGE support to Linux. llfinite -> std::isfinite llisnan -> std::isnan vector_shrink_to_fit -> vector.shrink_to_fit --- indra/llcharacter/llkeyframemotion.cpp | 22 ++++----- indra/llcommon/aithreadsafe.h | 42 ---------------- indra/llcommon/llatomic.h | 2 +- indra/llcommon/lldate.cpp | 4 -- indra/llcommon/llpreprocessor.h | 16 +++--- indra/llcommon/llsd.cpp | 5 +- indra/llcommon/llsdserialize.cpp | 8 +-- indra/llcommon/llstl.h | 47 ++---------------- indra/llcommon/llthread.h | 2 +- indra/llcommon/lluuid.h | 3 -- indra/llcommon/stdtypes.h | 4 -- indra/llmath/llcalcparser.h | 2 +- indra/llmath/llmath.h | 55 +-------------------- indra/llmath/lloctree.h | 2 +- indra/llmath/llquaternion.h | 2 +- indra/llmath/llvolume.cpp | 20 ++++---- indra/llmath/v2math.h | 2 +- indra/llmath/v3dmath.h | 2 +- indra/llmath/v3math.cpp | 4 +- indra/llmath/v3math.h | 2 +- indra/llmath/v4math.h | 2 +- indra/llmath/xform.h | 14 +++--- indra/llmessage/llbufferstream.cpp | 11 ----- indra/llmessage/llbufferstream.h | 9 ---- indra/llmessage/llnamevalue.cpp | 2 +- indra/llmessage/lltemplatemessagereader.cpp | 4 +- indra/llprimitive/llprimitive.h | 14 +++--- indra/llprimitive/lltextureentry.cpp | 2 +- indra/llrender/llshadermgr.cpp | 14 ------ indra/llui/ailist.h | 8 +-- indra/lscript/lscript_byteconvert.h | 30 +++++------ indra/newview/llfloaterfriends.cpp | 16 +++--- indra/newview/llfloaterinspect.h | 7 ++- indra/newview/llhudeffectpointat.cpp | 2 +- indra/newview/llpanelprofile.cpp | 8 +-- indra/newview/llviewerobject.cpp | 2 +- indra/newview/llvoicevivox.cpp | 4 +- indra/newview/llvopartgroup.cpp | 2 +- 38 files changed, 98 insertions(+), 299 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index f1cea2f6d..35b9ab8a1 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1382,7 +1382,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) } if (mJointMotionList->mDuration > MAX_ANIM_DURATION || - !llfinite(mJointMotionList->mDuration)) + !std::isfinite(mJointMotionList->mDuration)) { LL_WARNS() << "invalid animation duration" << LL_ENDL; return FALSE; @@ -1407,14 +1407,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) // get loop //------------------------------------------------------------------------- if (!dp.unpackF32(mJointMotionList->mLoopInPoint, "loop_in_point") || - !llfinite(mJointMotionList->mLoopInPoint)) + !std::isfinite(mJointMotionList->mLoopInPoint)) { LL_WARNS() << "can't read loop point" << LL_ENDL; return FALSE; } if (!dp.unpackF32(mJointMotionList->mLoopOutPoint, "loop_out_point") || - !llfinite(mJointMotionList->mLoopOutPoint)) + !std::isfinite(mJointMotionList->mLoopOutPoint)) { LL_WARNS() << "can't read loop point" << LL_ENDL; return FALSE; @@ -1430,14 +1430,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) // get easeIn and easeOut //------------------------------------------------------------------------- if (!dp.unpackF32(mJointMotionList->mEaseInDuration, "ease_in_duration") || - !llfinite(mJointMotionList->mEaseInDuration)) + !std::isfinite(mJointMotionList->mEaseInDuration)) { LL_WARNS() << "can't read easeIn" << LL_ENDL; return FALSE; } if (!dp.unpackF32(mJointMotionList->mEaseOutDuration, "ease_out_duration") || - !llfinite(mJointMotionList->mEaseOutDuration)) + !std::isfinite(mJointMotionList->mEaseOutDuration)) { LL_WARNS() << "can't read easeOut" << LL_ENDL; return FALSE; @@ -1608,7 +1608,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (old_version) { if (!dp.unpackF32(time, "time") || - !llfinite(time)) + !std::isfinite(time)) { LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL; return FALSE; @@ -1702,7 +1702,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (old_version) { if (!dp.unpackF32(pos_key.mTime, "time") || - !llfinite(pos_key.mTime)) + !std::isfinite(pos_key.mTime)) { LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL; return FALSE; @@ -1907,28 +1907,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) // constraintp->mTargetConstraintDir *= constraintp->mSourceConstraintOffset.magVec(); } - if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start") || !llfinite(constraintp->mEaseInStartTime)) + if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start") || !std::isfinite(constraintp->mEaseInStartTime)) { LL_WARNS() << "can't read constraint ease in start time" << LL_ENDL; delete constraintp; return FALSE; } - if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop") || !llfinite(constraintp->mEaseInStopTime)) + if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop") || !std::isfinite(constraintp->mEaseInStopTime)) { LL_WARNS() << "can't read constraint ease in stop time" << LL_ENDL; delete constraintp; return FALSE; } - if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start") || !llfinite(constraintp->mEaseOutStartTime)) + if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start") || !std::isfinite(constraintp->mEaseOutStartTime)) { LL_WARNS() << "can't read constraint ease out start time" << LL_ENDL; delete constraintp; return FALSE; } - if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop") || !llfinite(constraintp->mEaseOutStopTime)) + if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop") || !std::isfinite(constraintp->mEaseOutStopTime)) { LL_WARNS() << "can't read constraint ease out stop time" << LL_ENDL; delete constraintp; diff --git a/indra/llcommon/aithreadsafe.h b/indra/llcommon/aithreadsafe.h index 93b38246f..ac1531596 100644 --- a/indra/llcommon/aithreadsafe.h +++ b/indra/llcommon/aithreadsafe.h @@ -96,16 +96,6 @@ #include "llthread.h" #include "llerror.h" -// g++ 4.2.x (and before?) have the bug that when you try to pass a temporary -// to a function taking a const reference, it still calls the copy constructor. -// Define this to hack around that. -// Note that the chosen solution ONLY works for copying an AI*Access object that -// is passed to a function: the lifetime of the copied object must not be longer -// than the original (or at least, it shouldn't be used anymore after the -// original is destructed). This will be guaranteed if the code also compiles -// on a compiler that doesn't need this hack. -#define AI_NEED_ACCESS_CC (defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ < 3)) || (__GNUC__ < 4))) - template struct AIReadAccessConst; template struct AIReadAccess; template struct AIWriteAccess; @@ -339,9 +329,6 @@ struct AIReadAccessConst AIReadAccessConst(AIThreadSafe const& wrapper, bool high_priority = false) : mWrapper(const_cast&>(wrapper)), mState(readlocked) -#if AI_NEED_ACCESS_CC - , mIsCopyConstructed(false) -#endif { mWrapper.mRWLock.rdlock(high_priority); } @@ -350,9 +337,6 @@ struct AIReadAccessConst // These should never be dynamically allocated, so there is no need to make this virtual. ~AIReadAccessConst() { -#if AI_NEED_ACCESS_CC - if (mIsCopyConstructed) return; -#endif if (mState == readlocked) mWrapper.mRWLock.rdunlock(); else if (mState == writelocked) @@ -371,23 +355,14 @@ protected: //! Constructor used by AIReadAccess. AIReadAccessConst(AIThreadSafe& wrapper, state_type state) : mWrapper(wrapper), mState(state) -#if AI_NEED_ACCESS_CC - , mIsCopyConstructed(false) -#endif { } AIThreadSafe& mWrapper; //!< Reference to the object that we provide access to. state_type const mState; //!< The lock state that mWrapper is in. -#if AI_NEED_ACCESS_CC - bool mIsCopyConstructed; -public: - AIReadAccessConst(AIReadAccessConst const& orig) : mWrapper(orig.mWrapper), mState(orig.mState), mIsCopyConstructed(true) { } -#else private: // Disallow copy constructing directly. AIReadAccessConst(AIReadAccessConst const&); -#endif }; /** @@ -596,9 +571,6 @@ struct AIAccessConst { //! Construct a AIAccessConst from a constant AIThreadSafeSimple. AIAccessConst(AIThreadSafeSimple const& wrapper) : mWrapper(const_cast&>(wrapper)) -#if AI_NEED_ACCESS_CC - , mIsCopyConstructed(false) -#endif { this->mWrapper.mMutex.lock(); } @@ -611,9 +583,6 @@ struct AIAccessConst ~AIAccessConst() { -#if AI_NEED_ACCESS_CC - if (mIsCopyConstructed) return; -#endif this->mWrapper.mMutex.unlock(); } @@ -625,15 +594,9 @@ struct AIAccessConst protected: AIThreadSafeSimple& mWrapper; //!< Reference to the object that we provide access to. -#if AI_NEED_ACCESS_CC - bool mIsCopyConstructed; -public: - AIAccessConst(AIAccessConst const& orig) : mWrapper(orig.mWrapper), mIsCopyConstructed(true) { } -#else private: // Disallow copy constructing directly. AIAccessConst(AIAccessConst const&); -#endif }; /** @@ -817,14 +780,9 @@ struct AISTAccessConst protected: AIThreadSafeSingleThread& mWrapper; //!< Reference to the object that we provide access to. -#if AI_NEED_ACCESS_CC -public: - AISTAccessConst(AISTAccessConst const& orig) : mWrapper(orig.mWrapper) { } -#else private: // Disallow copy constructing directly. AISTAccessConst(AISTAccessConst const&); -#endif }; /** diff --git a/indra/llcommon/llatomic.h b/indra/llcommon/llatomic.h index 3ffd7e125..e9a88a7b6 100644 --- a/indra/llcommon/llatomic.h +++ b/indra/llcommon/llatomic.h @@ -50,7 +50,7 @@ #include "boost/atomic.hpp" template struct impl_atomic_type { typedef boost::atomic type; }; -#elif defined(USE_STD_ATOMIC) && defined(LL_CPP11) +#elif defined(USE_STD_ATOMIC) #include template struct impl_atomic_type { typedef std::atomic type; }; diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index b24e70fad..823075eba 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -142,11 +142,7 @@ void LLDate::toStream(std::ostream& s) const } s << std::dec << std::setfill('0'); -#if( LL_WINDOWS || __GNUC__ > 2) s << std::right; -#else - s.setf(ios::right); -#endif s << std::setw(4) << (exp_time.tm_year + 1900) << '-' << std::setw(2) << (exp_time.tm_mon + 1) << '-' << std::setw(2) << (exp_time.tm_mday) diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 84087cee3..b299fd829 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -109,9 +109,9 @@ #endif -// Check for C++11 support -#if __cplusplus >= 201100L || _MSC_VER >= 1800 -# define LL_CPP11 +// Require C++11 support +#if __cplusplus < 201100L && _MSC_VER < 1800 +#error C++11 support is required to build this project. #endif #if LL_WINDOWS @@ -211,11 +211,7 @@ #endif #endif -#if defined(LL_WINDOWS) || __cplusplus >= 201103L -# define LL_TYPEOF(exp) decltype(exp) -#else -# define LL_TYPEOF(exp) typeof(exp) -#endif +#define LL_TYPEOF(exp) decltype(exp) #define LL_TO_STRING_HELPER(x) #x #define LL_TO_STRING(x) LL_TO_STRING_HELPER(x) @@ -226,8 +222,8 @@ #if LL_WINDOWS #define LL_COMPILE_TIME_MESSAGE(msg) __pragma(message(LL_FILE_LINENO_MSG(msg))) #else -// no way to get gcc 4.2 to print a user-defined diagnostic message only when a macro is used -#define LL_COMPILE_TIME_MESSAGE(msg) +#define PRAGMA_MSG(x) _Pragma(#x) +#define LL_COMPILE_TIME_MESSAGE(msg) PRAGMA_MSG(message msg) #endif #endif // not LL_LINDEN_PREPROCESSOR_H diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index d8bbb3a74..ec061c9d0 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -31,7 +31,6 @@ #include "llsd.h" #include "llerror.h" -#include "../llmath/llmath.h" #include "llformat.h" #include "llsdserialize.h" #include "stringize.h" @@ -249,10 +248,10 @@ namespace }; LLSD::Boolean ImplReal::asBoolean() const - { return !llisnan(mValue) && mValue != 0.0; } + { return !std::isnan(mValue) && mValue != 0.0; } LLSD::Integer ImplReal::asInteger() const - { return !llisnan(mValue) ? (LLSD::Integer)mValue : 0; } + { return !std::isnan(mValue) ? (LLSD::Integer)mValue : 0; } LLSD::String ImplReal::asString() const { return llformat("%lg", mValue); } diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index a61c4ba97..bb4dea06d 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -1330,13 +1330,7 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 break; case LLSD::TypeBoolean: - if(mBoolAlpha || -#if( LL_WINDOWS || __GNUC__ > 2) - (ostr.flags() & std::ios::boolalpha) -#else - (ostr.flags() & 0x0100) -#endif - ) + if(mBoolAlpha || (ostr.flags() & std::ios::boolalpha)) { ostr << (data.asBoolean() ? NOTATION_TRUE_SERIAL : NOTATION_FALSE_SERIAL); diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index c0b02e0cc..9c66bc886 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -221,14 +221,7 @@ template //Singu note: This has been generalized to support a broader range of map-esque containers inline bool is_in_map(const T& inmap, typename T::key_type const& key) { - if(inmap.find(key) == inmap.end()) - { - return false; - } - else - { - return true; - } + return inmap.find(key) != inmap.end(); } // Similar to get_ptr_in_map, but for any type with a valid T(0) constructor. @@ -328,19 +321,6 @@ inline T* vector_append(std::vector& invec, S32 N) return &(invec[sz]); } -template -inline void vector_shrink_to_fit(std::vector& invec) -{ - //For Windows: We always assume vs2010 or later, which support this c++11 feature with no configuration needed. - //For GCC: __cplusplus >= 201103L indicates C++11 support. __GXX_EXPERIMENTAL_CXX0X being set indicates experimental c++0x support. C++11 support replaces C++0x support. - // std::vector::shrink_to_fit was added to GCCs C++0x implementation in version 4.5.0. -#if defined(LL_WINDOWS) || __cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X) && __GNUC_MINOR__ >= 5) - invec.shrink_to_fit(); -#else - std::vector(invec).swap(invec); -#endif -} - // call function f to n members starting at first. similar to std::for_each template Function ll_for_n(InputIter first, Size n, Function f) @@ -528,27 +508,6 @@ llbind2nd(const _Operation& __oper, const _Tp& __x) return llbinder2nd<_Operation>(__oper, _Arg2_type(__x)); } -/** - * Compare std::type_info* pointers a la std::less. We break this out as a - * separate function for use in two different std::less specializations. - */ -inline -bool before(const std::type_info* lhs, const std::type_info* rhs) -{ -#if LL_LINUX && defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) - // If we're building on Linux with gcc, and it's either gcc 3.x or - // 4.{0,1,2,3}, then we have to use a workaround. Note that we use gcc on - // Mac too, and some people build with gcc on Windows (cygwin or mingw). - // On Linux, different load modules may produce different type_info* - // pointers for the same type. Have to compare name strings to get good - // results. - return strcmp(lhs->name(), rhs->name()) < 0; -#else // not Linux, or gcc 4.4+ - // Just use before(), as we normally would - return lhs->before(*rhs); -#endif -} - /** * Specialize std::less to use std::type_info::before(). * See MAINT-1175. It is NEVER a good idea to directly compare std::type_info* @@ -563,7 +522,7 @@ namespace std { bool operator()(const std::type_info* lhs, const std::type_info* rhs) const { - return before(lhs, rhs); + return lhs->before(*rhs); } }; @@ -573,7 +532,7 @@ namespace std { bool operator()(std::type_info* lhs, std::type_info* rhs) const { - return before(lhs, rhs); + return lhs->before(*rhs); } }; } // std diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 255f115c9..9ac6496c4 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -201,7 +201,7 @@ protected: #include typedef boost::recursive_mutex LLMutexImpl; typedef boost::condition_variable_any LLConditionVariableImpl; -#elif defined(USE_STD_MUTEX) && defined(LL_CPP11) +#elif defined(USE_STD_MUTEX) #include typedef std::recursive_mutex LLMutexImpl; typedef std::condition_variable_any LLConditionVariableImpl; diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 1eb8a0bab..31bbd9036 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -307,8 +307,6 @@ struct lluuid_less typedef std::set uuid_list_t; - -#ifdef LL_CPP11 namespace std { template <> struct hash { @@ -319,7 +317,6 @@ namespace std { } }; } -#endif namespace boost { template<> class hash diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index af0b4dd4e..b5079f849 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -108,8 +108,4 @@ typedef U8 LLPCode; #define LL_ARRAY_SIZE( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) ) -#if LL_LINUX && __GNUC__ <= 2 -typedef int intptr_t; -#endif - #endif diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index faa699ff7..05e7491fc 100644 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h @@ -161,7 +161,7 @@ private: F32 _min(const F32& a, const F32& b) const { return llmin(a, b); } F32 _max(const F32& a, const F32& b) const { return llmax(a, b); } - bool checkNaN(const F32& a) const { return !llisnan(a); } + bool checkNaN(const F32& a) const { return !std::isnan(a); } //FIX* non ambiguous function fix making SIN() work for calc -Cryogenic Blitz F32 _sin(const F32& a) const { return sin(DEG_TO_RAD * a); } diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 7b3586cf3..ae4197331 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -41,23 +41,6 @@ // llcommon depend on llmath. #include "is_approx_equal_fraction.h" - -// work around for Windows & older gcc non-standard function names. -#if LL_WINDOWS -#include -#define llisnan(val) _isnan(val) -#define llfinite(val) _finite(val) -#elif (LL_LINUX && __GNUC__ <= 2) -#define llisnan(val) isnan(val) -#define llfinite(val) isfinite(val) -#elif LL_SOLARIS -#define llisnan(val) isnan(val) -#define llfinite(val) (val <= std::numeric_limits::max()) -#else -#define llisnan(val) std::isnan(val) -#define llfinite(val) std::isfinite(val) -#endif - // Single Precision Floating Point Routines // (There used to be more defined here, but they appeared to be redundant and // were breaking some other includes. Removed by Falcon, reviewed by Andrew, 11/25/09) @@ -156,36 +139,12 @@ inline F64 llabs(const F64 a) inline S32 lltrunc( F32 f ) { -#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined(_WIN64) && !(_MSC_VER >= 1800) - // Avoids changing the floating point control word. - // Add or subtract 0.5 - epsilon and then round - const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF }; - S32 result; - __asm { - fld f - mov eax, f - shr eax, 29 - and eax, 4 - fadd dword ptr [zpfp + eax] - fistp result - } - return result; -#else -#ifdef LL_CPP11 - return (S32)trunc(f); -#else - return (S32)f; -#endif -#endif + return (S32)trunc(f); } inline S32 lltrunc( F64 f ) { -#ifdef LL_CPP11 return (S32)trunc(f); -#else - return (S32)f; -#endif } inline S32 llfloor( F32 f ) @@ -217,29 +176,17 @@ inline S32 llceil( F32 f ) // Use this round. Does an arithmetic round (0.5 always rounds up) inline S32 ll_round(const F32 val) { -#ifdef LL_CPP11 return (S32)round(val); -#else - return llfloor(val + 0.5f); -#endif } inline F32 ll_round(F32 val, F32 nearest) { -#ifdef LL_CPP11 return F32(round(val * (1.0f / nearest))) * nearest; -#else - return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest; -#endif } inline F64 ll_round(F64 val, F64 nearest) { -#ifdef LL_CPP11 return F64(round(val * (1.0 / nearest))) * nearest; -#else - return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest; -#endif } // these provide minimum peak error diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 3d6310310..de831a4e6 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -696,7 +696,7 @@ public: (mData.size() > gOctreeReserveCapacity && mData.capacity() > gOctreeReserveCapacity + mData.size() - 1 - (mData.size() - gOctreeReserveCapacity - 1) % 4)) { //Shrink to lowest possible (reserve)+4*i size.. Say reserve is 5, here are [size,capacity] pairs. [10,13],[9,9],[8,9],[7,9],[6,9],[5,5],[4,5],[3,5],[2,5],[1,5],[0,5] - vector_shrink_to_fit(mData); + mData.shrink_to_fit(); } #ifdef LL_OCTREE_STATS if(old_cap != mData.capacity()) diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index 349af0552..236ce442b 100644 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -166,7 +166,7 @@ public: // checker inline BOOL LLQuaternion::isFinite() const { - return (llfinite(mQ[VX]) && llfinite(mQ[VY]) && llfinite(mQ[VZ]) && llfinite(mQ[VS])); + return (std::isfinite(mQ[VX]) && std::isfinite(mQ[VY]) && std::isfinite(mQ[VZ]) && std::isfinite(mQ[VS])); } inline BOOL LLQuaternion::isIdentity() const diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c38075610..3de6dab3c 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -167,8 +167,8 @@ void calc_tangent_from_triangle( float r = ((rd*rd) > FLT_EPSILON) ? (1.0f / rd) : ((rd > 0.0f) ? 1024.f : -1024.f); //some made up large ratio for division by zero - llassert(llfinite(r)); - llassert(!llisnan(r)); + llassert(std::isfinite(r)); + llassert(!std::isnan(r)); LLVector4a sdir( (t2 * x1 - t1 * x2) * r, @@ -5989,13 +5989,13 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) normal.set(0,0,1); } - llassert(llfinite(normal.getF32ptr()[0])); - llassert(llfinite(normal.getF32ptr()[1])); - llassert(llfinite(normal.getF32ptr()[2])); + llassert(std::isfinite(normal.getF32ptr()[0])); + llassert(std::isfinite(normal.getF32ptr()[1])); + llassert(std::isfinite(normal.getF32ptr()[2])); - llassert(!llisnan(normal.getF32ptr()[0])); - llassert(!llisnan(normal.getF32ptr()[1])); - llassert(!llisnan(normal.getF32ptr()[2])); + llassert(!std::isnan(normal.getF32ptr()[0])); + llassert(!std::isnan(normal.getF32ptr()[1])); + llassert(!std::isnan(normal.getF32ptr()[2])); for (S32 i = 0; i < num_vertices; i++) { @@ -6810,8 +6810,8 @@ void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVe float r = ((rd*rd) > FLT_EPSILON) ? (1.0f / rd) : ((rd > 0.0f) ? 1024.f : -1024.f); //some made up large ratio for division by zero - llassert(llfinite(r)); - llassert(!llisnan(r)); + llassert(std::isfinite(r)); + llassert(!std::isnan(r)); LLVector4a sdir((t2 * x1 - t1 * x2) * r, (t2 * y1 - t1 * y2) * r, (t2 * z1 - t1 * z2) * r); diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index 194bcfcfb..c1ec3f516 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -250,7 +250,7 @@ inline F32 LLVector2::normalize(void) // checker inline bool LLVector2::isFinite() const { - return (llfinite(mV[VX]) && llfinite(mV[VY])); + return (std::isfinite(mV[VX]) && std::isfinite(mV[VY])); } // deprecated diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index f92c3984e..dae0b3077 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -191,7 +191,7 @@ inline LLVector3d::LLVector3d(const LLVector3d ©) // checker inline BOOL LLVector3d::isFinite() const { - return (llfinite(mdV[VX]) && llfinite(mdV[VY]) && llfinite(mdV[VZ])); + return (std::isfinite(mdV[VX]) && std::isfinite(mdV[VY]) && std::isfinite(mdV[VZ])); } diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index 898296707..43c94a5e5 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -76,7 +76,7 @@ BOOL LLVector3::clampLength( F32 length_limit ) BOOL changed = FALSE; F32 len = length(); - if (llfinite(len)) + if (std::isfinite(len)) { if ( len > length_limit) { @@ -97,7 +97,7 @@ BOOL LLVector3::clampLength( F32 length_limit ) for (S32 i = 0; i < 3; ++i) { F32 abs_component = fabs(mV[i]); - if (llfinite(abs_component)) + if (std::isfinite(abs_component)) { if (abs_component > max_abs_component) { diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 193533678..9403135a5 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -199,7 +199,7 @@ inline LLVector3::LLVector3(const LLVector3 ©) // checker inline BOOL LLVector3::isFinite() const { - return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ])); + return (std::isfinite(mV[VX]) && std::isfinite(mV[VY]) && std::isfinite(mV[VZ])); } diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index 4288916e4..b4a59f01c 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -194,7 +194,7 @@ inline LLVector4::LLVector4(const LLVector3 &vec, F32 w) inline BOOL LLVector4::isFinite() const { - return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]) && llfinite(mV[VW])); + return (std::isfinite(mV[VX]) && std::isfinite(mV[VY]) && std::isfinite(mV[VZ]) && std::isfinite(mV[VW])); } // Clear and Assignment Functions diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h index 06c408fa5..b07988e1b 100644 --- a/indra/llmath/xform.h +++ b/indra/llmath/xform.h @@ -200,7 +200,7 @@ void LLXform::setPosition(const LLVector3& pos) void LLXform::setPosition(const F32 x, const F32 y, const F32 z) { setChanged(TRANSLATED); - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) mPosition.setVec(x,y,z); else { @@ -212,7 +212,7 @@ void LLXform::setPosition(const F32 x, const F32 y, const F32 z) void LLXform::setPositionX(const F32 x) { setChanged(TRANSLATED); - if (llfinite(x)) + if (std::isfinite(x)) mPosition.mV[VX] = x; else { @@ -224,7 +224,7 @@ void LLXform::setPositionX(const F32 x) void LLXform::setPositionY(const F32 y) { setChanged(TRANSLATED); - if (llfinite(y)) + if (std::isfinite(y)) mPosition.mV[VY] = y; else { @@ -236,7 +236,7 @@ void LLXform::setPositionY(const F32 y) void LLXform::setPositionZ(const F32 z) { setChanged(TRANSLATED); - if (llfinite(z)) + if (std::isfinite(z)) mPosition.mV[VZ] = z; else { @@ -268,7 +268,7 @@ void LLXform::setScale(const LLVector3& scale) void LLXform::setScale(const F32 x, const F32 y, const F32 z) { setChanged(SCALED); - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) mScale.setVec(x,y,z); else { @@ -290,7 +290,7 @@ void LLXform::setRotation(const LLQuaternion& rot) void LLXform::setRotation(const F32 x, const F32 y, const F32 z) { setChanged(ROTATED); - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) { mRotation.setQuat(x,y,z); } @@ -303,7 +303,7 @@ void LLXform::setRotation(const F32 x, const F32 y, const F32 z) void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) { setChanged(ROTATED); - if (llfinite(x) && llfinite(y) && llfinite(z) && llfinite(s)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z) && std::isfinite(s)) { mRotation.mQ[VX] = x; mRotation.mQ[VY] = y; mRotation.mQ[VZ] = z; mRotation.mQ[VS] = s; } diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index ff1c9993c..15e90872a 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -233,17 +233,10 @@ int LLBufferStreamBuf::sync() } // virtual -#if( LL_WINDOWS || __GNUC__ > 2) LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff( LLBufferStreamBuf::off_type off, std::ios::seekdir way, std::ios::openmode which) -#else -streampos LLBufferStreamBuf::seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which) -#endif { if(!mBuffer || ((way == std::ios::beg) && (off < 0)) @@ -318,12 +311,8 @@ streampos LLBufferStreamBuf::seekoff( } } -#if( LL_WINDOWS || __GNUC__ > 2 ) S32 rv = (S32)(intptr_t)address; return (pos_type)rv; -#else - return (streampos)address; -#endif } diff --git a/indra/llmessage/llbufferstream.h b/indra/llmessage/llbufferstream.h index 723269307..33ce6a68d 100644 --- a/indra/llmessage/llbufferstream.h +++ b/indra/llmessage/llbufferstream.h @@ -48,10 +48,8 @@ public: virtual ~LLBufferStreamBuf(); protected: -#if( LL_WINDOWS || __GNUC__ > 2 ) typedef std::streambuf::pos_type pos_type; typedef std::streambuf::off_type off_type; -#endif /* @name streambuf vrtual implementations */ @@ -87,17 +85,10 @@ protected: * or both masked together. * @return Returns the new position or an invalid position on failure. */ -#if( LL_WINDOWS || __GNUC__ > 2) virtual pos_type seekoff( off_type off, std::ios::seekdir way, std::ios::openmode which); -#else - virtual streampos seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which); -#endif /* * @brief Get s sequence of characters from the input diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index c51883ee3..8eb844fb7 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -168,7 +168,7 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con } // finite checks - if (!llfinite(t1) || !llfinite(t2) || !llfinite(t3)) + if (!std::isfinite(t1) || !std::isfinite(t2) || !std::isfinite(t3)) { t1 = 0.f; t2 = 0.f; diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 6f728ff35..b0044de0b 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -326,7 +326,7 @@ void LLTemplateMessageReader::getF32(const char *block, const char *var, { getData(block, var, &d, sizeof(F32), blocknum); - if( !llfinite( d ) ) + if( !std::isfinite( d ) ) { LL_WARNS() << "non-finite in getF32Fast " << block << " " << var << LL_ENDL; @@ -339,7 +339,7 @@ void LLTemplateMessageReader::getF64(const char *block, const char *var, { getData(block, var, &d, sizeof(F64), blocknum); - if( !llfinite( d ) ) + if( !std::isfinite( d ) ) { LL_WARNS() << "non-finite in getF64Fast " << block << " " << var << LL_ENDL; diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 82481feaa..36680ba9b 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -528,7 +528,7 @@ inline BOOL LLPrimitive::isApp(const LLPCode pcode) // Special case for setPosition. If not check-for-finite, fall through to LLXform method. void LLPrimitive::setPosition(const F32 x, const F32 y, const F32 z) { - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) { LLXform::setPosition(x, y, z); } @@ -565,7 +565,7 @@ void LLPrimitive::setAngularVelocity(const LLVector3& avel) void LLPrimitive::setAngularVelocity(const F32 x, const F32 y, const F32 z) { - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) { mAngularVelocity.setVec(x,y,z); } @@ -589,7 +589,7 @@ void LLPrimitive::setVelocity(const LLVector3& vel) void LLPrimitive::setVelocity(const F32 x, const F32 y, const F32 z) { - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) { mVelocity.setVec(x,y,z); } @@ -601,7 +601,7 @@ void LLPrimitive::setVelocity(const F32 x, const F32 y, const F32 z) void LLPrimitive::setVelocityX(const F32 x) { - if (llfinite(x)) + if (std::isfinite(x)) { mVelocity.mV[VX] = x; } @@ -613,7 +613,7 @@ void LLPrimitive::setVelocityX(const F32 x) void LLPrimitive::setVelocityY(const F32 y) { - if (llfinite(y)) + if (std::isfinite(y)) { mVelocity.mV[VY] = y; } @@ -625,7 +625,7 @@ void LLPrimitive::setVelocityY(const F32 y) void LLPrimitive::setVelocityZ(const F32 z) { - if (llfinite(z)) + if (std::isfinite(z)) { mVelocity.mV[VZ] = z; } @@ -661,7 +661,7 @@ void LLPrimitive::setAcceleration(const LLVector3& accel) void LLPrimitive::setAcceleration(const F32 x, const F32 y, const F32 z) { - if (llfinite(x) && llfinite(y) && llfinite(z)) + if (std::isfinite(x) && std::isfinite(y) && std::isfinite(z)) { mAcceleration.setVec(x,y,z); } diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 284dfc15f..91d5c7ca7 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -417,7 +417,7 @@ S32 LLTextureEntry::setOffsetT(F32 t) S32 LLTextureEntry::setRotation(F32 theta) { - if (mRotation != theta && llfinite(theta)) + if (mRotation != theta && std::isfinite(theta)) { mRotation = theta; return TEM_CHANGE_TEXTURE; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index f7496140c..6e63b7bc5 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -865,7 +865,6 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade dumpObjectLog(ret); error_str = get_object_log(ret); -#if LL_WINDOWS std::stringstream ostr; //dump shader source for debugging for (GLuint i = 0; i < count; i++) @@ -882,19 +881,6 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade } LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL; -#else - std::string str; - - for (GLuint i = 0; i < count; i++) { - str.append(text[i]); - - if (i % 128 == 0) - { - LL_WARNS("ShaderLoading") << str << LL_ENDL; - str = ""; - } - } -#endif glDeleteObjectARB(ret); //no longer need handle ret = 0; } diff --git a/indra/llui/ailist.h b/indra/llui/ailist.h index 14ef05f0c..c528227ba 100644 --- a/indra/llui/ailist.h +++ b/indra/llui/ailist.h @@ -257,7 +257,7 @@ class AIConstListIterator { typedef AIListIterator iterator; _Container const* mContainer; - _Iterator mConstIterator; // This has to be an _Iterator instead of _ConstIterator, because the compiler doesn't accept a const_iterator for erase yet (C++11 does). + _ConstIterator mConstIterator; void ref(void) { @@ -289,7 +289,7 @@ class AIConstListIterator { typedef T const& reference; AIConstListIterator(void) : mContainer(NULL) { } - AIConstListIterator(_Container const* __c, _Iterator const& __i) : mContainer(__c), mConstIterator(__i) + AIConstListIterator(_Container const* __c, _ConstIterator const& __i) : mContainer(__c), mConstIterator(__i) { llassert(mContainer); ref(); @@ -343,7 +343,7 @@ class AIConstListIterator { _Self& operator++() { - _Iterator cur = mConstIterator; + _ConstIterator cur = mConstIterator; ++cur; unref(); while(cur != mContainer->end() && cur->dead) @@ -364,7 +364,7 @@ class AIConstListIterator { _Self& operator--() { - _Iterator cur = mConstIterator; + _ConstIterator cur = mConstIterator; --cur; unref(); while(cur->dead) diff --git a/indra/lscript/lscript_byteconvert.h b/indra/lscript/lscript_byteconvert.h index aa8c7ffb4..4cc118fab 100644 --- a/indra/lscript/lscript_byteconvert.h +++ b/indra/lscript/lscript_byteconvert.h @@ -136,7 +136,7 @@ inline F32 bytestream2float(const U8 *stream, S32 &offset) { S32 value = bytestream2integer(stream, offset); F32 fpvalue = *(F32 *)&value; - if (!llfinite(fpvalue)) + if (!std::isfinite(fpvalue)) { fpvalue = 0; set_fault(stream, LSRF_MATH); @@ -155,7 +155,7 @@ inline void bytestream_int2float(U8 *stream, S32 &offset) S32 value = bytestream2integer(stream, offset); offset -= 4; F32 fpvalue = (F32)value; - if (!llfinite(fpvalue)) + if (!std::isfinite(fpvalue)) { fpvalue = 0; set_fault(stream, LSRF_MATH); @@ -230,21 +230,21 @@ inline void bytestream2vector(LLVector3 &vector, const U8 *stream, S32 &offset) { S32 value = bytestream2integer(stream, offset); vector.mV[VZ] = *(F32 *)&value; - if (!llfinite(vector.mV[VZ])) + if (!std::isfinite(vector.mV[VZ])) { vector.mV[VZ] = 0; set_fault(stream, LSRF_MATH); } value = bytestream2integer(stream, offset); vector.mV[VY] = *(F32 *)&value; - if (!llfinite(vector.mV[VY])) + if (!std::isfinite(vector.mV[VY])) { vector.mV[VY] = 0; set_fault(stream, LSRF_MATH); } value = bytestream2integer(stream, offset); vector.mV[VX] = *(F32 *)&value; - if (!llfinite(vector.mV[VX])) + if (!std::isfinite(vector.mV[VX])) { vector.mV[VX] = 0; set_fault(stream, LSRF_MATH); @@ -265,28 +265,28 @@ inline void bytestream2quaternion(LLQuaternion &quat, const U8 *stream, S32 &off { S32 value = bytestream2integer(stream, offset); quat.mQ[VS] = *(F32 *)&value; - if (!llfinite(quat.mQ[VS])) + if (!std::isfinite(quat.mQ[VS])) { quat.mQ[VS] = 0; set_fault(stream, LSRF_MATH); } value = bytestream2integer(stream, offset); quat.mQ[VZ] = *(F32 *)&value; - if (!llfinite(quat.mQ[VZ])) + if (!std::isfinite(quat.mQ[VZ])) { quat.mQ[VZ] = 0; set_fault(stream, LSRF_MATH); } value = bytestream2integer(stream, offset); quat.mQ[VY] = *(F32 *)&value; - if (!llfinite(quat.mQ[VY])) + if (!std::isfinite(quat.mQ[VY])) { quat.mQ[VY] = 0; set_fault(stream, LSRF_MATH); } value = bytestream2integer(stream, offset); quat.mQ[VX] = *(F32 *)&value; - if (!llfinite(quat.mQ[VX])) + if (!std::isfinite(quat.mQ[VX])) { quat.mQ[VX] = 0; set_fault(stream, LSRF_MATH); @@ -315,7 +315,7 @@ inline F32 get_register_fp(U8 *stream, LSCRIPTRegisters reg) { S32 offset = gLSCRIPTRegisterAddresses[reg]; F32 value = bytestream2float(stream, offset); - if (!llfinite(value)) + if (!std::isfinite(value)) { value = 0; set_fault(stream, LSRF_MATH); @@ -390,7 +390,7 @@ inline F32 add_register_fp(U8 *stream, LSCRIPTRegisters reg, F32 value) S32 offset = gLSCRIPTRegisterAddresses[reg]; F32 newvalue = bytestream2float(stream, offset); newvalue += value; - if (!llfinite(newvalue)) + if (!std::isfinite(newvalue)) { newvalue = 0; set_fault(stream, LSRF_MATH); @@ -587,7 +587,7 @@ inline F32 lscript_pop_float(U8 *stream) { S32 sp = get_register(stream, LREG_SP); F32 value = bytestream2float(stream, sp); - if (!llfinite(value)) + if (!std::isfinite(value)) { value = 0; set_fault(stream, LSRF_MATH); @@ -727,7 +727,7 @@ inline void lscript_local_get(U8 *stream, S32 address, F32 &value) { if (lscript_check_local(stream, address, LSCRIPTDataSize[LST_FLOATINGPOINT])) value = bytestream2float(stream, address); - if (!llfinite(value)) + if (!std::isfinite(value)) { value = 0; set_fault(stream, LSRF_MATH); @@ -757,7 +757,7 @@ inline void lscript_global_get(U8 *stream, S32 address, F32 &value) { if (lscript_check_global(stream, address, LSCRIPTDataSize[LST_FLOATINGPOINT])) value = bytestream2float(stream, address); - if (!llfinite(value)) + if (!std::isfinite(value)) { value = 0; set_fault(stream, LSRF_MATH); @@ -1058,7 +1058,7 @@ inline F32 safe_instruction_bytestream2float(U8 *stream, S32 &offset) if (safe_instruction_check_address(stream, offset, LSCRIPTDataSize[LST_INTEGER])) { F32 value = bytestream2float(stream, offset); - if (!llfinite(value)) + if (!std::isfinite(value)) { value = 0; set_fault(stream, LSRF_MATH); diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 5a75a4771..da43f9696 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -272,13 +272,11 @@ BOOL LLPanelFriends::postBuild() { mFriendsList = getChild("friend_list"); mFriendsList->setCommitOnSelectionChange(true); - /* Singu TODO: Update to C++11 and make everything cleaner here auto single_selection(boost::bind(&LLScrollListCtrl::getCurrentID, mFriendsList)); auto selection(boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList)); - */ mFriendsList->setCommitCallback(boost::bind(&LLPanelFriends::onSelectName, this)); //getChild("buddy_group_combobox")->setCommitCallback(boost::bind(&LLPanelFriends::setContactGroup, this, _2)); - mFriendsList->setDoubleClickCallback(boost::bind(LLAvatarActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, mFriendsList))); + mFriendsList->setDoubleClickCallback(boost::bind(LLAvatarActions::startIM, single_selection)); // // Contact search and group system. @@ -294,13 +292,13 @@ BOOL LLPanelFriends::postBuild() U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE; refreshNames(changed_mask); - getChild("im_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickIM, this, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); - //getChild("assign_btn")->setCommitCallback(boost::bind(ASFloaterContactGroups::show, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); - getChild("profile_btn")->setCommitCallback(boost::bind(LLAvatarActions::showProfiles, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList), false)); - getChild("offer_teleport_btn")->setCommitCallback(boost::bind(static_cast(LLAvatarActions::offerTeleport), boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); - getChild("pay_btn")->setCommitCallback(boost::bind(LLAvatarActions::pay, boost::bind(&LLScrollListCtrl::getCurrentID, mFriendsList))); + getChild("im_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickIM, this, selection)); + //getChild("assign_btn")->setCommitCallback(boost::bind(ASFloaterContactGroups::show, selection)); + getChild("profile_btn")->setCommitCallback(boost::bind(LLAvatarActions::showProfiles, selection, false)); + getChild("offer_teleport_btn")->setCommitCallback(boost::bind(static_cast(LLAvatarActions::offerTeleport), selection)); + getChild("pay_btn")->setCommitCallback(boost::bind(LLAvatarActions::pay, single_selection)); getChild("add_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickAddFriend, this)); - getChild("remove_btn")->setCommitCallback(boost::bind(LLAvatarActions::removeFriendsDialog, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList))); + getChild("remove_btn")->setCommitCallback(boost::bind(LLAvatarActions::removeFriendsDialog, selection)); //getChild("export_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickExport, this)); Making Dummy View -HgB //getChild("import_btn")->setCommitCallback(boost::bind(&LLPanelFriends::onClickImport, this)); Making Dummy View -HgB diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index c60b116d7..633507b5c 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -38,7 +38,6 @@ #include "llavatarname.h" #include "llfloater.h" #include "llvoinventorylistener.h" -#include //class LLTool; class LLObjectSelection; @@ -85,9 +84,9 @@ private: std::map > mInventoryNums; // std::vector mQueue; // - boost::container::map mOwnerNameCacheConnection; - boost::container::map mLastOwnerNameCacheConnection; // - boost::container::map mCreatorNameCacheConnection; + std::map mOwnerNameCacheConnection; + std::map mLastOwnerNameCacheConnection; // + std::map mCreatorNameCacheConnection; }; #endif //LL_LLFLOATERINSPECT_H diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 5cbbbb577..90546e5b9 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -441,7 +441,7 @@ bool LLHUDEffectPointAt::calcTargetPosition() mTargetPos -= mSourceObject->getRenderPosition(); - if (!llfinite(mTargetPos.lengthSquared())) + if (!std::isfinite(mTargetPos.lengthSquared())) { return false; } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 910e43e9e..d35d481ab 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -97,13 +97,7 @@ public: } std::string verb = params[1].asString(); -#if LL_WINDOWS // C++11 - while (!verb.empty() && std::ispunct(verb.back())) - verb.pop_back(); -#else - for (size_t i = verb.size()-1; i >= 0 && std::ispunct(verb[i]); --i) - verb.erase(i); -#endif + for (; !verb.empty() && std::ispunct(verb.back()); verb.pop_back()); if (verb == "about") { LLAvatarActions::showProfile(avatar_id); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 0f4f433d5..331fe0c51 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1822,7 +1822,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LLVector3 diff = new_pos_parent - test_pos_parent ; F32 mag_sqr = diff.magVecSquared() ; - if(llfinite(mag_sqr)) + if(std::isfinite(mag_sqr)) { setPositionParent(new_pos_parent); } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 1563c3f16..63735252d 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -3912,7 +3912,7 @@ void LLVivoxVoiceClient::sessionState::removeParticipant(const std::string& uri) vector_replace_with_last(mParticipantList, iter); if (mParticipantList.empty() || mParticipantList.capacity() - mParticipantList.size() > 16) { - vector_shrink_to_fit(mParticipantList); + mParticipantList.shrink_to_fit(); } mParticipantsChanged = true; LL_DEBUGS("Voice") << "participant \"" << uri << "\" (" << iter->mAvatarID << ") removed." << LL_ENDL; @@ -3929,7 +3929,7 @@ void LLVivoxVoiceClient::sessionState::removeAllParticipants() // Singu Note: mParticipantList has replaced both mParticipantsByURI and mParticipantsByUUID, meaning we don't have two maps to maintain any longer. mParticipantList.clear(); - vector_shrink_to_fit(mParticipantList); + mParticipantList.shrink_to_fit(); } void LLVivoxVoiceClient::getParticipantList(std::set &participants) diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 92296ceb4..981d05727 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -408,7 +408,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) else inv_camera_dist_squared = 1.f; - llassert(llfinite(inv_camera_dist_squared)); + llassert(std::isfinite(inv_camera_dist_squared)); llassert(!llisnan(inv_camera_dist_squared)); F32 area = part->mScale.mV[0] * part->mScale.mV[1] * inv_camera_dist_squared;