diff options
144 files changed, 525 insertions, 416 deletions
| diff --git a/doc/contributions.txt b/doc/contributions.txt index 14d85b5e23..160e6386e6 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -64,6 +64,8 @@ Aimee Trescothick  	VWR-14711  	VWR-14712  	VWR-15454 +AiraYumi +	SL-20781 (github PR #613)  Alejandro Rosenthal  	VWR-1184  Aleric Inglewood diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 18b03c1f89..b430c4c6aa 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -24,12 +24,6 @@   * $/LicenseInfo$   */ -#if LL_MSVC -// disable warning about boost::lexical_cast returning uninitialized data -// when it fails to parse the string -#pragma warning (disable:4701) -#endif -  #include "linden_common.h"  #include "llavatarappearance.h" @@ -46,14 +40,6 @@  #include "boost/bind.hpp"  #include "boost/tokenizer.hpp" - -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - -#include <boost/lexical_cast.hpp> -  using namespace LLAvatarAppearanceDefines;  //----------------------------------------------------------------------------- @@ -230,7 +216,7 @@ void LLAvatarAppearance::initInstance()  		for (U32 lod = 0; lod < mesh_dict->mLOD; lod++)  		{  			LLAvatarJointMesh* mesh = createAvatarJointMesh(); -			std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod); +			std::string mesh_name = "m" + mesh_dict->mName + std::to_string(lod);  			// We pre-pended an m - need to capitalize first character for camelCase  			mesh_name[1] = toupper(mesh_name[1]);  			mesh->setName(mesh_name); diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h index 8ed295b6f1..ce6731e864 100644 --- a/indra/llcommon/lldoubledispatch.h +++ b/indra/llcommon/lldoubledispatch.h @@ -255,7 +255,7 @@ private:      };      /// shared_ptr manages Entry lifespan for us -    typedef boost::shared_ptr<EntryBase> EntryPtr; +    typedef std::shared_ptr<EntryBase> EntryPtr;      /// use a @c list to make it easy to insert      typedef std::list<EntryPtr> DispatchTable;      DispatchTable mDispatch; diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 414515854a..4268f107e9 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1070,7 +1070,7 @@ namespace LLError      //      // NOTE!!! Requires external mutex lock!!!      template <typename RECORDER> -    std::pair<boost::shared_ptr<RECORDER>, Recorders::iterator> +    std::pair<std::shared_ptr<RECORDER>, Recorders::iterator>      findRecorderPos(SettingsConfigPtr &s)      {          // Since we promise to return an iterator, use a classic iterator @@ -1081,7 +1081,7 @@ namespace LLError              // *it is a RecorderPtr, a shared_ptr<Recorder>. Use a              // dynamic_pointer_cast to try to downcast to test if it's also a              // shared_ptr<RECORDER>. -            auto ptr = boost::dynamic_pointer_cast<RECORDER>(*it); +            auto ptr = std::dynamic_pointer_cast<RECORDER>(*it);              if (ptr)              {                  // found the entry we want @@ -1101,7 +1101,7 @@ namespace LLError      // shared_ptr might be empty (operator!() returns true) if there was no      // such RECORDER subclass instance in mRecorders.      template <typename RECORDER> -    boost::shared_ptr<RECORDER> findRecorder() +    std::shared_ptr<RECORDER> findRecorder()      {          SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig();          LLMutexLock lock(&s->mRecorderMutex); @@ -1134,7 +1134,7 @@ namespace LLError  		if (!file_name.empty())  		{ -			boost::shared_ptr<RecordToFile> recordToFile(new RecordToFile(file_name)); +			std::shared_ptr<RecordToFile> recordToFile(new RecordToFile(file_name));  			if (recordToFile->okay())  			{  				addRecorder(recordToFile); diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index 57f10b7895..77b187a80f 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -174,7 +174,7 @@ namespace LLError  		bool mWantsMultiline;  	}; -	typedef boost::shared_ptr<Recorder> RecorderPtr; +	typedef std::shared_ptr<Recorder> RecorderPtr;      /**       * Instantiate GenericRecorder with a callable(level, message) to get diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 9edc7e40f3..e0d0ab9ac7 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -627,7 +627,7 @@ namespace LLInitParam  		UserData*			mUserData;  	}; -	typedef boost::shared_ptr<ParamDescriptor> ParamDescriptorPtr; +	typedef std::shared_ptr<ParamDescriptor> ParamDescriptorPtr;  	// each derived Block class keeps a static data structure maintaining offsets to various params  	class LL_COMMON_API BlockDescriptor diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index 8f88e728ce..b2b1162f63 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -462,10 +462,10 @@ private:      LLProcessPtr mChild;      LLTempBoundListener          mStdinConnection, mStdoutConnection, mStdoutDataConnection, mStderrConnection; -    boost::scoped_ptr<LLEventPump::Blocker> mBlocker; +    std::unique_ptr<LLEventPump::Blocker> mBlocker;      LLProcess::ReadPipe::size_type mExpect;      LLError::RecorderPtr mRecorder; -    boost::scoped_ptr<LLLeapListener> mListener; +    std::unique_ptr<LLLeapListener> mListener;  };  // These must follow the declaration of LLLeapImpl, so they may as well be last. diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 0d65762284..0d6a147da3 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -36,7 +36,6 @@  #include "llevents.h"  #include "llexception.h" -#include <boost/foreach.hpp>  #include <boost/bind.hpp>  #include <boost/asio/streambuf.hpp>  #include <boost/asio/buffers_iterator.hpp> @@ -587,7 +586,7 @@ LLProcess::LLProcess(const LLSDOrParams& params):  	// apr_procattr_child_err_set()), or accepting a filename, opening it and  	// passing that apr_file_t (simple <, >, 2> redirect emulation).  	std::vector<apr_int32_t> select; -	BOOST_FOREACH(const FileParam& fparam, params.files) +	for (const FileParam& fparam : params.files)  	{  		// Every iteration, we're going to append an item to 'select'. At the  		// top of the loop, its size() is, in effect, an index. Use that to @@ -684,7 +683,7 @@ LLProcess::LLProcess(const LLSDOrParams& params):  	argv.push_back(params.executable().c_str());  	// Add arguments. See above remarks about c_str(). -	BOOST_FOREACH(const std::string& arg, params.args) +	for (const std::string& arg : params.args)  	{  		argv.push_back(arg.c_str());  	} @@ -961,7 +960,7 @@ void LLProcess::handle_status(int reason, int status)  		// only be performed if in fact we're going to produce the log message.  		LL_DEBUGS("LLProcess") << empty;  		std::string reason_str; -		BOOST_FOREACH(const ReasonCode& rcp, reasons) +		for (const ReasonCode& rcp : reasons)  		{  			if (reason == rcp.code)  			{ @@ -1151,7 +1150,7 @@ std::ostream& operator<<(std::ostream& out, const LLProcess::Params& params)  		out << "cd " << LLStringUtil::quote(params.cwd) << ": ";  	}  	out << LLStringUtil::quote(params.executable); -	BOOST_FOREACH(const std::string& arg, params.args) +	for (const std::string& arg : params.args)  	{  		out << ' ' << LLStringUtil::quote(arg);  	} diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index 0842f2eb07..c57821bf52 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -51,7 +51,7 @@ class LLEventPump;  class LLProcess;  /// LLProcess instances are created on the heap by static factory methods and  /// managed by ref-counted pointers. -typedef boost::shared_ptr<LLProcess> LLProcessPtr; +typedef std::shared_ptr<LLProcess> LLProcessPtr;  /**   * LLProcess handles launching an external process with specified command line diff --git a/indra/llcommon/llrun.h b/indra/llcommon/llrun.h index d610f86234..42e3d9b47a 100644 --- a/indra/llcommon/llrun.h +++ b/indra/llcommon/llrun.h @@ -48,7 +48,7 @@ public:  	/**  	 * @brief The pointer to a runnable.  	 */ -	typedef boost::shared_ptr<LLRunnable> run_ptr_t; +	typedef std::shared_ptr<LLRunnable> run_ptr_t;  	/**  	 * @brief The handle for use in the API. diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index ad54d1b0be..fdcc052bd0 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -478,9 +478,9 @@ namespace llsd  {  /***************************************************************************** -*   BOOST_FOREACH() helpers for LLSD +*   range-based for-loop helpers for LLSD  *****************************************************************************/ -/// Usage: BOOST_FOREACH(LLSD item, inArray(someLLSDarray)) { ... } +/// Usage: for (LLSD item : inArray(someLLSDarray)) { ... }  class inArray  {  public: @@ -503,7 +503,7 @@ private:  /// MapEntry is what you get from dereferencing an LLSD::map_[const_]iterator.  typedef std::map<LLSD::String, LLSD>::value_type MapEntry; -/// Usage: BOOST_FOREACH([const] MapEntry& e, inMap(someLLSDmap)) { ... } +/// Usage: for([const] MapEntry& e : inMap(someLLSDmap)) { ... }  class inMap  {  public: diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index 6b1986d0e9..5f1a89670e 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -32,7 +32,6 @@  #include "lldependencies.h"  #include "llexception.h"  #include "llcoros.h" -#include <boost/foreach.hpp>  #include <algorithm>  #include <iostream>                 // std::cerr in dire emergency  #include <sstream> @@ -411,7 +410,7 @@ void LLSingletonBase::cleanup_()  void LLSingletonBase::deleteAll()  {      // It's essential to traverse these in dependency order. -    BOOST_FOREACH(LLSingletonBase* sp, dep_sort()) +    for (LLSingletonBase* sp : dep_sort())      {          // Capture the class name first: in case of exception, don't count on          // being able to extract it later. diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 1fd6cac14a..61fc47e4d0 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1199,7 +1199,7 @@ void LLStringUtilBase<T>::getTokens(const string_type& string, std::vector<strin  {  	// This overload must deal with escapes. Delegate that to InEscString  	// (unless there ARE no escapes). -	boost::scoped_ptr< LLStringUtilBaseImpl::InString<T> > instrp; +	std::unique_ptr< LLStringUtilBaseImpl::InString<T> > instrp;  	if (escapes.empty())  		instrp.reset(new LLStringUtilBaseImpl::InString<T>(string.begin(), string.end()));  	else diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 938685bae6..f6b99b7d85 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -49,7 +49,6 @@  #include "llsdutil.h"  #include <boost/bind.hpp>  #include <boost/circular_buffer.hpp> -#include <boost/foreach.hpp>  #include <boost/lexical_cast.hpp>  #include <boost/range.hpp>  #include <boost/utility/enable_if.hpp> @@ -905,9 +904,9 @@ void LLMemoryInfo::stream(std::ostream& s) const  	// Max key length  	size_t key_width(0); -	BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap)) +	for (const auto& [key, value] : inMap(mStatsMap))  	{ -		size_t len(pair.first.length()); +		size_t len(key.length());  		if (len > key_width)  		{  			key_width = len; @@ -915,10 +914,9 @@ void LLMemoryInfo::stream(std::ostream& s) const  	}  	// Now stream stats -	BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap)) +	for (const auto& [key, value] : inMap(mStatsMap))  	{ -		s << pfx << std::setw(narrow(key_width+1)) << (pair.first + ':') << ' '; -		LLSD value(pair.second); +		s << pfx << std::setw(narrow(key_width+1)) << (key + ':') << ' ';  		if (value.isInteger())  			s << std::setw(12) << value.asInteger();  		else if (value.isReal()) diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 148c18aabe..b4cdbdc6bf 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -153,27 +153,27 @@ namespace tut  		int countMessages()  		{ -			return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages(); +			return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages();  		}  		void clearMessages()  		{ -			boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages(); +			std::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages();  		}  		void setWantsTime(bool t)              { -                boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t); +                std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t);              }  		void setWantsMultiline(bool t)              { -                boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t); +                std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t);              }  		std::string message(int n)  		{ -			return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n); +			return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n);  		}  		void ensure_message_count(int expectedCount) @@ -497,12 +497,12 @@ namespace  	void testLogName(LLError::RecorderPtr recorder, LogFromFunction f,  		const std::string& class_name = "")  	{ -		boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages(); +		std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages();  		std::string name = f(false);  		f(true); -		std::string messageWithoutName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0); -		std::string messageWithName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1); +		std::string messageWithoutName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0); +		std::string messageWithName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1);  		ensure_has(name + " logged without name",  			messageWithoutName, name); @@ -691,13 +691,13 @@ namespace tut  		LL_INFOS() << "boo" << LL_ENDL;  		ensure_message_field_equals(0, MSG_FIELD, "boo"); -		ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1); -		ensure_contains("alt recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo"); +		ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1); +		ensure_contains("alt recorder message 0", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo");  		LLError::setTimeFunction(roswell);  		LLError::RecorderPtr anotherRecorder(new TestRecorder()); -		boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true); +		std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true);  		LLError::addRecorder(anotherRecorder);  		LL_INFOS() << "baz" << LL_ENDL; @@ -705,10 +705,10 @@ namespace tut  		std::string when = roswell();  		ensure_message_does_not_contain(1, when); -		ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2); -		ensure_does_not_contain("alt recorder message 1", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when); -		ensure_equals("another recorder count", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1); -		ensure_contains("another recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when); +		ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2); +		ensure_does_not_contain("alt recorder message 1", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when); +		ensure_equals("another recorder count", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1); +		ensure_contains("another recorder message 0", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when);  		LLError::removeRecorder(altRecorder);  		LLError::removeRecorder(anotherRecorder); diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index 032923a108..01104545c6 100644 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -101,7 +101,7 @@ namespace tut          int which;          LLTestApp testApp; -        void explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp); +        void explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp);          void waitForEventOn1();          void coroPump();          void postAndWait1(); @@ -111,7 +111,7 @@ namespace tut      typedef coroutine_group::object object;      coroutine_group coroutinegrp("coroutine"); -    void test_data::explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp) +    void test_data::explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp)      {          BEGIN          { @@ -127,7 +127,7 @@ namespace tut              // For test purposes, instead of handing 'callback' (or an              // adapter) off to some I/O subsystem, we'll just pass it back to              // our caller. -            cbp = boost::make_shared<LLCoros::Promise<std::string>>(); +            cbp = std::make_shared<LLCoros::Promise<std::string>>();              LLCoros::Future<std::string> future = LLCoros::getFuture(*cbp);              // calling get() on the future causes us to suspend @@ -146,7 +146,7 @@ namespace tut          DEBUG;          // Construct the coroutine instance that will run explicit_wait. -        boost::shared_ptr<LLCoros::Promise<std::string>> respond; +        std::shared_ptr<LLCoros::Promise<std::string>> respond;          LLCoros::instance().launch("test<1>",                                     [this, &respond](){ explicit_wait(respond); });          mSync.bump(); diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index 5daa29adf4..95af9c2a50 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -94,7 +94,7 @@ namespace tut              ensure("couldn't find stack Keyed", bool(found));              ensure_equals("found wrong Keyed instance", found.get(), &one);              { -                boost::scoped_ptr<Keyed> two(new Keyed("two")); +                std::unique_ptr<Keyed> two(new Keyed("two"));                  ensure_equals(Keyed::instanceCount(), 2);                  auto found = Keyed::getInstance("two");                  ensure("couldn't find heap Keyed", bool(found)); @@ -118,7 +118,7 @@ namespace tut              std::weak_ptr<Unkeyed> found = one.getWeak();              ensure(! found.expired());              { -                boost::scoped_ptr<Unkeyed> two(new Unkeyed); +                std::unique_ptr<Unkeyed> two(new Unkeyed);                  ensure_equals(Unkeyed::instanceCount(), 2);              }              ensure_equals(Unkeyed::instanceCount(), 1); diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index b6b297b8d7..628f046f55 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -21,7 +21,6 @@  // external library headers  #include "llapr.h"  #include "apr_thread_proc.h" -#include <boost/foreach.hpp>  #include <boost/function.hpp>  #include <boost/algorithm/string/find_iterator.hpp>  #include <boost/algorithm/string/finder.hpp> @@ -323,7 +322,7 @@ namespace tut      {  /*==========================================================================*|          std::string reason_str; -        BOOST_FOREACH(const ReasonCode& rcp, reasons) +        for (const ReasonCode& rcp : reasons)          {              if (reason == rcp.code)              { @@ -554,7 +553,7 @@ namespace tut          catch (const failure&)          {              std::cout << "History:\n"; -            BOOST_FOREACH(const Item& item, history) +            for (const Item& item : history)              {                  std::string what(item.what);                  if ((! what.empty()) && what[what.length() - 1] == '\n') diff --git a/indra/llcommon/tests/llstreamqueue_test.cpp b/indra/llcommon/tests/llstreamqueue_test.cpp index 050ad5c5bf..8af057328b 100644 --- a/indra/llcommon/tests/llstreamqueue_test.cpp +++ b/indra/llcommon/tests/llstreamqueue_test.cpp @@ -15,9 +15,6 @@  #include "llstreamqueue.h"  // STL headers  #include <vector> -// std headers -// external library headers -#include <boost/foreach.hpp>  // other Linden headers  #include "../test/lltut.h"  #include "stringize.h" @@ -133,7 +130,7 @@ namespace tut          std::streamsize leave(5);   // len("craft") above          std::streamsize skip(total - leave);          std::streamsize written(0); -        BOOST_FOREACH(const std::string& block, blocks) +        for (const std::string& block : blocks)          {              written += strq.write(&block[0], block.length());              ensure_equals("size() after write()", strq.size(), written); @@ -152,7 +149,7 @@ namespace tut      {          set_test_name("concatenate blocks");          std::string blocks[] = { "abcd", "efghij", "klmnopqrs" }; -        BOOST_FOREACH(const std::string& block, blocks) +        for (const std::string& block : blocks)          {              strq.write(&block[0], block.length());          } @@ -170,7 +167,7 @@ namespace tut      {          set_test_name("split blocks");          std::string blocks[] = { "abcdefghijklm", "nopqrstuvwxyz" }; -        BOOST_FOREACH(const std::string& block, blocks) +        for (const std::string& block : blocks)          {              strq.write(&block[0], block.length());          } diff --git a/indra/llcommon/tests/lltreeiterators_test.cpp b/indra/llcommon/tests/lltreeiterators_test.cpp index 1d619867d4..b9c7a70c07 100644 --- a/indra/llcommon/tests/lltreeiterators_test.cpp +++ b/indra/llcommon/tests/lltreeiterators_test.cpp @@ -38,7 +38,6 @@  // external library headers  #include <boost/bind.hpp>  #include <boost/range/iterator_range.hpp> -#include <boost/foreach.hpp>  // associated header  #include "../lltreeiterators.h" @@ -402,7 +401,7 @@ private:   *   * Example:   * @code - * BOOST_FOREACH(TreeNodePtr node, getRootRange<LLTreeIter::UP>(somenode)) + * for (TreeNodePtr node : getRootRange<LLTreeIter::UP>(somenode))   * {   *     std::cout << node->name() << '\n';   * } @@ -424,7 +423,7 @@ getRootRange(const TreeNodePtr& node)   *   * Example:   * @code - * BOOST_FOREACH(TreeNodePtr node, getWalkRange<LLTreeIter::DFS_PRE>(root)) + * for (TreeNodePtr node : getWalkRange<LLTreeIter::DFS_PRE>(root))   * {   *     std::cout << node->name() << '\n';   * } @@ -520,7 +519,7 @@ public:       *       * Example usage:       * @code -     * BOOST_FOREACH(EnhancedTreeNodePtr node, somenode->getRootRange<LLTreeIter::UP>()) +     * for (EnhancedTreeNodePtr node : somenode->getRootRange<LLTreeIter::UP>())       * {       *     std::cout << node->name() << '\n';       * } @@ -564,7 +563,7 @@ public:       *       * Example usage:       * @code -     * BOOST_FOREACH(EnhancedTreeNodePtr node, somenode->getWalkRange<LLTreeIter::DFS_PRE>()) +     * for (EnhancedTreeNodePtr node : somenode->getWalkRange<LLTreeIter::DFS_PRE>())       * {       *     std::cout << node->name() << '\n';       * } @@ -644,7 +643,7 @@ LLLinkedIter<PlainTree> PlainTree_child_end(PlainTree* node)   *   * Example:   * @code - * BOOST_FOREACH(PlainTree* node, getRootRange<LLTreeIter::UP>(somenode)) + * for (PlainTree* node : getRootRange<LLTreeIter::UP>(somenode))   * {   *     std::cout << node->name() << '\n';   * } @@ -668,7 +667,7 @@ getRootRange(PlainTree* node)   *   * Example:   * @code - * BOOST_FOREACH(PlainTree* node, getWalkRange<LLTreeIter::DFS_PRE>(root)) + * for (PlainTree* node : getWalkRange<LLTreeIter::DFS_PRE>(root))   * {   *     std::cout << node->name() << '\n';   * } @@ -1103,18 +1102,18 @@ namespace tut          // This test function illustrates the looping techniques described in the          // comments for the getRootRange() free function, the          // EnhancedTreeNode::root_range template and the -        // EnhancedTreeNode::getRootRange() method. Obviously the BOOST_FOREACH() +        // EnhancedTreeNode::getRootRange() method. Obviously the for()          // forms are more succinct.          TreeNodePtr tnroot(example_tree<TreeNode>());          TreeNodePtr tnB2b(get_B2b<TreeNode, TreeNode::child_iterator>                            (tnroot, boost::bind(&TreeNode::child_begin, _1))); -        std::string desc1("BOOST_FOREACH(TreeNodePr, getRootRange<LLTreeIter::UP>(tnB2b))"); +        std::string desc1("for (TreeNodePr : getRootRange<LLTreeIter::UP>(tnB2b))");  //      std::cout << desc1 << "\n";          // Although we've commented out the output statement, ensure that the          // loop construct is still valid, as promised by the getRootRange()          // documentation. -        BOOST_FOREACH(TreeNodePtr node, getRootRange<LLTreeIter::UP>(tnB2b)) +        for (TreeNodePtr node : getRootRange<LLTreeIter::UP>(tnB2b))          {  //          std::cout << node->name() << '\n';          } @@ -1137,9 +1136,9 @@ namespace tut  //          std::cout << (*ri)->name() << '\n';          } -        std::string desc2("BOOST_FOREACH(EnhancedTreeNodePtr node, etnB2b->getRootRange<LLTreeIter::UP>())"); +        std::string desc2("for (EnhancedTreeNodePtr node : etnB2b->getRootRange<LLTreeIter::UP>())");  //      std::cout << desc2 << '\n'; -        BOOST_FOREACH(EnhancedTreeNodePtr node, etnB2b->getRootRange<LLTreeIter::UP>()) +        for (EnhancedTreeNodePtr node : etnB2b->getRootRange<LLTreeIter::UP>())          {  //          std::cout << node->name() << '\n';          } diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h index d657b329bb..6978c296b3 100644 --- a/indra/llcommon/tests/wrapllerrs.h +++ b/indra/llcommon/tests/wrapllerrs.h @@ -218,12 +218,12 @@ public:      /// for the sought string.      std::string messageWith(const std::string& search, bool required=true)      { -        return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required); +        return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required);      }      std::ostream& streamto(std::ostream& out) const      { -        return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out); +        return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out);      }      friend inline std::ostream& operator<<(std::ostream& out, const CaptureLog& self) diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h index a71eae59c0..61ecc492af 100644 --- a/indra/llcorehttp/_httplibcurl.h +++ b/indra/llcorehttp/_httplibcurl.h @@ -65,7 +65,7 @@ private:  	void operator=(const HttpLibcurl &);		// Not defined  public: -    typedef boost::shared_ptr<HttpOpRequest> opReqPtr_t; +    typedef std::shared_ptr<HttpOpRequest> opReqPtr_t;  	/// Give cycles to libcurl to run active requests.  Completed  	/// operations (successful or failed) will be retried or handed diff --git a/indra/llcorehttp/_httpoperation.cpp b/indra/llcorehttp/_httpoperation.cpp index 3b64018132..c3a9bcaf54 100644 --- a/indra/llcorehttp/_httpoperation.cpp +++ b/indra/llcorehttp/_httpoperation.cpp @@ -58,7 +58,7 @@ HttpOperation::handleMap_t  HttpOperation::mHandleMap;  LLCoreInt::HttpMutex	    HttpOperation::mOpMutex;  HttpOperation::HttpOperation(): -    boost::enable_shared_from_this<HttpOperation>(), +    std::enable_shared_from_this<HttpOperation>(),      mReplyQueue(),      mUserHandler(),      mReqPolicy(HttpRequest::DEFAULT_POLICY_ID), diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h index 8c1364bab4..b07ef76d49 100644 --- a/indra/llcorehttp/_httpoperation.h +++ b/indra/llcorehttp/_httpoperation.h @@ -69,12 +69,12 @@ class HttpService;  /// and those interfaces establish the access rules.  class HttpOperation : private boost::noncopyable, -    public boost::enable_shared_from_this<HttpOperation> +    public std::enable_shared_from_this<HttpOperation>  {  public: -    typedef boost::shared_ptr<HttpOperation> ptr_t; -    typedef boost::weak_ptr<HttpOperation> wptr_t; -    typedef boost::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t; +    typedef std::shared_ptr<HttpOperation> ptr_t; +    typedef std::weak_ptr<HttpOperation> wptr_t; +    typedef std::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t;  	/// Threading:  called by consumer thread.  	HttpOperation(); @@ -157,12 +157,12 @@ public:      HttpHandle getHandle();      template< class OPT > -    static boost::shared_ptr< OPT > fromHandle(HttpHandle handle) +    static std::shared_ptr< OPT > fromHandle(HttpHandle handle)      {          ptr_t ptr = findByHandle(handle);          if (!ptr) -            return boost::shared_ptr< OPT >(); -        return boost::dynamic_pointer_cast< OPT >(ptr); +            return std::shared_ptr< OPT >(); +        return std::dynamic_pointer_cast< OPT >(ptr);      }  protected: diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index d60eb6c95f..3247146212 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -201,7 +201,7 @@ HttpOpRequest::~HttpOpRequest()  void HttpOpRequest::stageFromRequest(HttpService * service)  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; -    HttpOpRequest::ptr_t self(boost::dynamic_pointer_cast<HttpOpRequest>(shared_from_this())); +    HttpOpRequest::ptr_t self(std::dynamic_pointer_cast<HttpOpRequest>(shared_from_this()));      service->getPolicy().addOp(self);			// transfers refcount  } @@ -209,7 +209,7 @@ void HttpOpRequest::stageFromRequest(HttpService * service)  void HttpOpRequest::stageFromReady(HttpService * service)  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; -    HttpOpRequest::ptr_t self(boost::dynamic_pointer_cast<HttpOpRequest>(shared_from_this())); +    HttpOpRequest::ptr_t self(std::dynamic_pointer_cast<HttpOpRequest>(shared_from_this()));      service->getTransport().addOp(self);		// transfers refcount  } @@ -290,7 +290,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request)  // HttpOpRequest::ptr_t HttpOpRequest::fromHandle(HttpHandle handle)  // {  //  -//     return boost::dynamic_pointer_cast<HttpOpRequest>((static_cast<HttpOpRequest *>(handle))->shared_from_this()); +//     return std::dynamic_pointer_cast<HttpOpRequest>((static_cast<HttpOpRequest *>(handle))->shared_from_this());  // } diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index ec84822cf4..626064329d 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -66,7 +66,7 @@ class BufferArray;  class HttpOpRequest : public HttpOperation  {  public: -    typedef boost::shared_ptr<HttpOpRequest> ptr_t; +    typedef std::shared_ptr<HttpOpRequest> ptr_t;  	HttpOpRequest(); diff --git a/indra/llcorehttp/_httpopsetget.h b/indra/llcorehttp/_httpopsetget.h index eabd41e79f..04ab2446ef 100644 --- a/indra/llcorehttp/_httpopsetget.h +++ b/indra/llcorehttp/_httpopsetget.h @@ -53,7 +53,7 @@ namespace LLCore  class HttpOpSetGet : public HttpOperation  {  public: -    typedef boost::shared_ptr<HttpOpSetGet> ptr_t; +    typedef std::shared_ptr<HttpOpSetGet> ptr_t;  	HttpOpSetGet(); diff --git a/indra/llcorehttp/_httppolicy.h b/indra/llcorehttp/_httppolicy.h index 0b8806a3e2..955f757c93 100644 --- a/indra/llcorehttp/_httppolicy.h +++ b/indra/llcorehttp/_httppolicy.h @@ -60,7 +60,7 @@ private:  	void operator=(const HttpPolicy &);			// Not defined  public: -    typedef boost::shared_ptr<HttpOpRequest> opReqPtr_t; +    typedef std::shared_ptr<HttpOpRequest> opReqPtr_t;  	/// Threading:  called by init thread.  	HttpRequest::policy_t createPolicyClass(); diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h index 33e205c1c9..2de26249ef 100644 --- a/indra/llcorehttp/_httpreplyqueue.h +++ b/indra/llcorehttp/_httpreplyqueue.h @@ -63,8 +63,8 @@ class HttpReplyQueue : private boost::noncopyable  {  public: -    typedef boost::shared_ptr<HttpOperation>    opPtr_t; -    typedef boost::shared_ptr<HttpReplyQueue>   ptr_t; +    typedef std::shared_ptr<HttpOperation>    opPtr_t; +    typedef std::shared_ptr<HttpReplyQueue>   ptr_t;  	HttpReplyQueue();      virtual ~HttpReplyQueue();		 diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h index f0296f30e3..52369df174 100644 --- a/indra/llcorehttp/_httprequestqueue.h +++ b/indra/llcorehttp/_httprequestqueue.h @@ -61,7 +61,7 @@ private:  	void operator=(const HttpRequestQueue &);			// Not defined  public: -    typedef boost::shared_ptr<HttpOperation> opPtr_t; +    typedef std::shared_ptr<HttpOperation> opPtr_t;  	static void init();  	static void term(); diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 18505e0aad..7fe5c48edf 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -301,24 +301,24 @@ struct HttpStatus  	HttpStatus()  	{ -		mDetails = boost::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS)); +		mDetails = std::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS));      }  	HttpStatus(type_enum_t type, short status)  	{ -        mDetails = boost::shared_ptr<Details>(new Details(type, status)); +        mDetails = std::shared_ptr<Details>(new Details(type, status));  	}  	HttpStatus(int http_status)  	{ -        mDetails = boost::shared_ptr<Details>(new Details(http_status,  +        mDetails = std::shared_ptr<Details>(new Details(http_status,   			(http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR));  		llassert(http_status >= 100 && http_status <= 999);  	}  	HttpStatus(int http_status, const std::string &message)  	{ -        mDetails = boost::shared_ptr<Details>(new Details(http_status, +        mDetails = std::shared_ptr<Details>(new Details(http_status,  			(http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR));  		llassert(http_status >= 100 && http_status <= 999);  		mDetails->mMessage = message; @@ -341,7 +341,7 @@ struct HttpStatus      HttpStatus & clone(const HttpStatus &rhs)      { -        mDetails = boost::shared_ptr<Details>(new Details(*rhs.mDetails)); +        mDetails = std::shared_ptr<Details>(new Details(*rhs.mDetails));          return *this;      } @@ -490,14 +490,14 @@ private:  		LLSD		mErrorData;  	}; -    boost::shared_ptr<Details> mDetails; +    std::shared_ptr<Details> mDetails;  }; // end struct HttpStatus  ///  A namespace for several free methods and low level utilities.   namespace LLHttp  { -    typedef boost::shared_ptr<CURL> CURL_ptr; +    typedef std::shared_ptr<CURL> CURL_ptr;      void initialize();      void cleanup(); diff --git a/indra/llcorehttp/httphandler.h b/indra/llcorehttp/httphandler.h index 65e043f5d3..4cfb2598c7 100644 --- a/indra/llcorehttp/httphandler.h +++ b/indra/llcorehttp/httphandler.h @@ -58,8 +58,8 @@ class HttpResponse;  class HttpHandler   {  public: -    typedef boost::shared_ptr<HttpHandler>  ptr_t; -    typedef boost::weak_ptr<HttpHandler>    wptr_t; +    typedef std::shared_ptr<HttpHandler>  ptr_t; +    typedef std::weak_ptr<HttpHandler>    wptr_t;  	virtual ~HttpHandler()  	{ } diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h index b9168cb6ec..e7cf4037bf 100644 --- a/indra/llcorehttp/httpheaders.h +++ b/indra/llcorehttp/httpheaders.h @@ -85,7 +85,7 @@ public:  	typedef container_t::const_reverse_iterator const_reverse_iterator;  	typedef container_t::value_type value_type;  	typedef container_t::size_type size_type; -    typedef boost::shared_ptr<HttpHeaders> ptr_t; +    typedef std::shared_ptr<HttpHeaders> ptr_t;  public:  	/// @post In addition to the instance, caller has a refcount diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index 41f71896b0..fa993c857b 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -60,7 +60,7 @@ class HttpOptions : private boost::noncopyable  public:  	HttpOptions(); -	typedef boost::shared_ptr<HttpOptions> ptr_t; +	typedef std::shared_ptr<HttpOptions> ptr_t;      virtual ~HttpOptions();						// Use release() diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h index ca4b9e92bc..857a034a7b 100644 --- a/indra/llcorehttp/httprequest.h +++ b/indra/llcorehttp/httprequest.h @@ -96,8 +96,8 @@ private:  public:  	typedef unsigned int policy_t; -	typedef boost::shared_ptr<HttpRequest> ptr_t; -    typedef boost::weak_ptr<HttpRequest>   wptr_t; +	typedef std::shared_ptr<HttpRequest> ptr_t; +    typedef std::weak_ptr<HttpRequest>   wptr_t;  public:  	/// @name PolicyMethods  	/// @{ @@ -627,7 +627,7 @@ public:  protected:  private: -    typedef boost::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t; +    typedef std::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t;  	/// @name InstanceData  	/// diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index b834085e5c..ef98fbef2b 100644 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -72,7 +72,7 @@ public:  	/// Statistics for the HTTP   	struct TransferStats  	{ -		typedef boost::shared_ptr<TransferStats> ptr_t; +		typedef std::shared_ptr<TransferStats> ptr_t;  		TransferStats() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {}  		F64 mSizeDownload; diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 69b23f9cf8..41fbb97175 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -44,7 +44,6 @@  #include "stringize.h"  #include "llstring.h"  #include <boost/filesystem.hpp> -#include <boost/foreach.hpp>  #include <boost/range/begin.hpp>  #include <boost/range/end.hpp>  #include <boost/assign/list_of.hpp> @@ -691,10 +690,10 @@ void LLDir::walkSearchSkinDirs(const std::string& subdir,  							   const std::string& filename,  							   const FUNCTION& function) const  { -	BOOST_FOREACH(std::string skindir, mSearchSkinDirs) +	for (const std::string& skindir : mSearchSkinDirs)  	{  		std::string subdir_path(add(skindir, subdir)); -		BOOST_FOREACH(std::string subsubdir, subsubdirs) +		for (const std::string& subsubdir : subsubdirs)  		{  			std::string full_path(add(subdir_path, subsubdir, filename));  			if (fileExists(full_path)) @@ -843,7 +842,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir,  		// current language, copy them -- in proper order -- into results.  		// Don't drive this by walking the map itself: it matters that we  		// generate results in the same order as subsubdirs. -		BOOST_FOREACH(std::string subsubdir, subsubdirs) +		for (const std::string& subsubdir : subsubdirs)  		{  			StringMap::const_iterator found(path_for.find(subsubdir));  			if (found != path_for.end()) @@ -855,7 +854,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir,  	LL_DEBUGS("LLDir") << empty;  	const char* comma = ""; -	BOOST_FOREACH(std::string path, results) +	for (const std::string& path : results)  	{  		LL_CONT << comma << "'" << path << "'";  		comma = ", "; diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp index 3cff622a4b..60265cade6 100644 --- a/indra/llfilesystem/tests/lldir_test.cpp +++ b/indra/llfilesystem/tests/lldir_test.cpp @@ -34,7 +34,6 @@  #include "../test/lltut.h"  #include "stringize.h" -#include <boost/foreach.hpp>  #include <boost/assign/list_of.hpp>  using boost::assign::list_of; @@ -109,7 +108,7 @@ struct LLDir_Dummy: public LLDir              "install/skins/default/future/somefile.txt"          }; -        BOOST_FOREACH(const char* path, preload) +        for (const char* path : preload)          {              buildFilesystem(path);          } @@ -166,7 +165,7 @@ struct LLDir_Dummy: public LLDir          LLStringUtil::getTokens(path, components, "/");          // Ensure we have an entry representing every level of this path          std::string partial; -        BOOST_FOREACH(std::string component, components) +        for (std::string component : components)          {              append(partial, component);              mFilesystem.insert(partial); diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 031471d1fe..f9393dea54 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -2259,9 +2259,9 @@ bool LLImageFormatted::save(const std::string &filename)  		return false;  	} -	outfile.write(getData(), 	getDataSize()); +	S32 result = outfile.write(getData(), getDataSize());  	outfile.close() ; -	return true; +    return (result != 0);  }  S8 LLImageFormatted::getCodec() const diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 8dba1641a6..68598589b8 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -48,7 +48,7 @@ std::string LLImageJ2C::getEngineInfo()  {  	// All known LLImageJ2CImpl implementation subclasses are cheap to  	// construct. -	boost::scoped_ptr<LLImageJ2CImpl> impl(fallbackCreateLLImageJ2CImpl()); +	std::unique_ptr<LLImageJ2CImpl> impl(fallbackCreateLLImageJ2CImpl());  	return impl->getEngineInfo();  } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index e196f7479e..b30df6f776 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -95,7 +95,7 @@ protected:  	S8  mRawDiscardLevel;  	F32 mRate;  	bool mReversible; -	boost::scoped_ptr<LLImageJ2CImpl> mImpl; +	std::unique_ptr<LLImageJ2CImpl> mImpl;  	std::string mLastError;      // Image compression/decompression tester diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 55bcc7c5b2..6334a35fd0 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -32,6 +32,7 @@  #include "llinventorydefines.h"  #include "llxorcipher.h"  #include "llsd.h" +#include "llsdserialize.h"  #include "message.h"  #include <boost/tokenizer.hpp> @@ -217,7 +218,19 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)  		}          else if (0 == strcmp("metadata", keyword))          { -            LLSD metadata(valuestr); +            LLSD metadata; +            if (strncmp("<llsd>", valuestr, 6) == 0) +            { +                std::istringstream stream(valuestr); +                LLSDSerialize::fromXML(metadata, stream); +            } +            else +            { +                // next line likely contains metadata, but at the moment is not supported +                // can do something like: +                // LLSDSerialize::fromNotation(metadata, input_stream, -1); +            } +              if (metadata.has("thumbnail"))              {                  const LLSD& thumbnail = metadata["thumbnail"]; @@ -693,7 +706,19 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)  		}          else if (0 == strcmp("metadata", keyword))          { -            LLSD metadata(valuestr); +            LLSD metadata; +            if (strncmp("<llsd>", valuestr, 6) == 0) +            { +                std::istringstream stream(valuestr); +                LLSDSerialize::fromXML(metadata, stream); +            } +            else +            { +                // next line likely contains metadata, but at the moment is not supported +                // can do something like: +                // LLSDSerialize::fromNotation(metadata, input_stream, -1); +            } +              if (metadata.has("thumbnail"))              {                  const LLSD& thumbnail = metadata["thumbnail"]; @@ -802,9 +827,14 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu      if (mThumbnailUUID.notNull())      { +        // Max length is 255 chars, will have to export differently if it gets more data +        // Ex: use newline and toNotation (uses {}) for unlimited size          LLSD metadata;          metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); -        output_stream << "\t\tmetadata\t" << metadata << "|\n"; + +        output_stream << "\t\tmetadata\t"; +        LLSDSerialize::toXML(metadata, output_stream); +        output_stream << "|\n";      }  	// Check for permissions to see the asset id, and if so write it @@ -1303,7 +1333,19 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)  		}          else if (0 == strcmp("metadata", keyword))          { -            LLSD metadata(valuestr); +            LLSD metadata; +            if (strncmp("<llsd>", valuestr, 6) == 0) +            { +                std::istringstream stream(valuestr); +                LLSDSerialize::fromXML(metadata, stream); +            } +            else +            { +                // next line likely contains metadata, but at the moment is not supported +                // can do something like: +                // LLSDSerialize::fromNotation(metadata, input_stream, -1); +            } +              if (metadata.has("thumbnail"))              {                  const LLSD& thumbnail = metadata["thumbnail"]; @@ -1343,9 +1385,12 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL)  	output_stream << "\t\tname\t" << mName.c_str() << "|\n";      if (mThumbnailUUID.notNull())      { +        // Only up to 255 chars          LLSD metadata;          metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); -        output_stream << "\t\tmetadata\t" << metadata << "|\n"; +        output_stream << "\t\tmetadata\t"; +        LLSDSerialize::toXML(metadata, output_stream); +        output_stream << "|\n";      }  	output_stream << "\t}\n";  	return TRUE; diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index b57e4cc40e..fe3902380c 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -113,10 +113,10 @@ private:  	};  	// Encode variable -	boost::scoped_ptr<LLKDUMemSource> mInputp; +	std::unique_ptr<LLKDUMemSource> mInputp;  	CodeStreamHolder mCodeStreamp; -	boost::scoped_ptr<kdu_core::kdu_coords> mTPosp; // tile position -	boost::scoped_ptr<kdu_core::kdu_dims> mTileIndicesp; +	std::unique_ptr<kdu_core::kdu_coords> mTPosp; // tile position +	std::unique_ptr<kdu_core::kdu_dims> mTileIndicesp;  	int mBlocksSize;  	int mPrecinctsSize;  	int mLevels; @@ -125,7 +125,7 @@ private:  	// We don't own this LLImageRaw. We're simply pointing to an instance  	// passed into initDecode().  	LLImageRaw *mRawImagep; -	boost::scoped_ptr<LLKDUDecodeState> mDecodeState; +	std::unique_ptr<LLKDUDecodeState> mDecodeState;  };  #endif diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index afed98ff36..71878b8cb6 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1000,7 +1000,7 @@ class LLVolume : public LLRefCount  	friend class LLVolumeLODGroup;  protected: -	~LLVolume(); // use unref +	virtual ~LLVolume(); // use unref  public:  	typedef std::vector<LLVolumeFace> face_list_t; diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index ebbaea9b12..c0a5e361b1 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -95,7 +95,7 @@ public:  private:      struct QueuedCoproc      { -        typedef boost::shared_ptr<QueuedCoproc> ptr_t; +        typedef std::shared_ptr<QueuedCoproc> ptr_t;          QueuedCoproc(const std::string &name, const LLUUID &id, CoProcedure_t proc) :              mName(name), @@ -115,7 +115,7 @@ private:      // Use shared_ptr to control the lifespan of our CoprocQueue_t instance      // because the consuming coroutine might outlive this LLCoprocedurePool      // instance. -    typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr; +    typedef std::shared_ptr<CoprocQueue_t> CoprocQueuePtr;      std::string     mPoolName;      size_t          mPoolSize, mActiveCoprocsCount, mPending; @@ -301,7 +301,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size):      mPoolSize(size),      mActiveCoprocsCount(0),      mPending(0), -    mPendingCoprocs(boost::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)), +    mPendingCoprocs(std::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)),      mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID),      mCoroMapping()  { @@ -384,7 +384,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced          LL_INFOS("CoProcMgr") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName << "\" at "                                << mPending << LL_ENDL;      } -    auto pushed = mPendingCoprocs->try_push(boost::make_shared<QueuedCoproc>(name, id, proc)); +    auto pushed = mPendingCoprocs->try_push(std::make_shared<QueuedCoproc>(name, id, proc));      if (pushed == boost::fibers::channel_op_status::success)      {          ++mPending; diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 6d0d68cf24..fc561c6b0f 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -263,8 +263,8 @@ class HttpCoroHandler : public LLCore::HttpHandler  {  public: -    typedef boost::shared_ptr<HttpCoroHandler>  ptr_t; -    typedef boost::weak_ptr<HttpCoroHandler>    wptr_t; +    typedef std::shared_ptr<HttpCoroHandler>  ptr_t; +    typedef std::weak_ptr<HttpCoroHandler>    wptr_t;      HttpCoroHandler(LLEventStream &reply); @@ -317,8 +317,8 @@ public:      static const std::string HTTP_RESULTS_CONTENT;      static const std::string HTTP_RESULTS_RAW; -    typedef boost::shared_ptr<HttpCoroutineAdapter> ptr_t; -    typedef boost::weak_ptr<HttpCoroutineAdapter>   wptr_t; +    typedef std::shared_ptr<HttpCoroutineAdapter> ptr_t; +    typedef std::weak_ptr<HttpCoroutineAdapter>   wptr_t;      HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId);      ~HttpCoroutineAdapter(); diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 1c97133723..f0dc4624ef 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -112,7 +112,7 @@ private:      // Callback types for get()       typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t; -	typedef boost::shared_ptr<callback_signal_t> signal_ptr; +	typedef std::shared_ptr<callback_signal_t> signal_ptr;  	// May have multiple callbacks for a single ID, which are  	// represented as multiple slots bound to the signal.  	// Avoid copying signals via pointers. diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index c707c7ad09..e302dd2b5e 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -982,7 +982,7 @@ LLHTTPNode& LLIOHTTPServer::create(      }      LLHTTPResponseFactory* factory = new LLHTTPResponseFactory; -	boost::shared_ptr<LLChainIOFactory> factory_ptr(factory); +	std::shared_ptr<LLChainIOFactory> factory_ptr(factory);      LLIOServerSocket* server = new LLIOServerSocket(pool, socket, factory_ptr); diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index 7fd4cee8ba..e6ac8ebfc2 100644 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -89,7 +89,7 @@ public:  	/**   	 * @brief Scattered memory container.  	 */ -	typedef boost::shared_ptr<LLBufferArray> buffer_ptr_t; +	typedef std::shared_ptr<LLBufferArray> buffer_ptr_t;  	/**   	 * @brief Enumeration for IO return codes diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index 303d80eb14..a62b3c0204 100644 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -65,7 +65,7 @@ public:  	/**   	 * @brief Reference counted shared pointers to sockets.  	 */ -	typedef boost::shared_ptr<LLSocket> ptr_t; +	typedef std::shared_ptr<LLSocket> ptr_t;  	/**   	 * @brief Type of socket to create. @@ -305,7 +305,7 @@ class LLIOServerSocket : public LLIOPipe  {  public:  	typedef LLSocket::ptr_t socket_t; -	typedef boost::shared_ptr<LLChainIOFactory> factory_t; +	typedef std::shared_ptr<LLChainIOFactory> factory_t;  	LLIOServerSocket(apr_pool_t* pool, socket_t listener, factory_t reactor);  	virtual ~LLIOServerSocket(); diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h index 9c09aeb44c..f215acab56 100644 --- a/indra/llmessage/llservice.h +++ b/indra/llmessage/llservice.h @@ -116,7 +116,7 @@ class LLService : public LLIOPipe  public:  	//typedef boost::intrusive_ptr<LLServiceCreator> creator_t;  	//typedef boost::intrusive_ptr<LLService> service_t; -	typedef boost::shared_ptr<LLChainIOFactory> creator_t; +	typedef std::shared_ptr<LLChainIOFactory> creator_t;  	/**   	 * @brief This method is used to register a protocol name with a diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h index 9c98e2c558..6ea150fda3 100644 --- a/indra/llmessage/llstoredmessage.h +++ b/indra/llmessage/llstoredmessage.h @@ -46,7 +46,7 @@ private:  	std::string mName;  }; -typedef boost::shared_ptr<LLStoredMessage> LLStoredMessagePtr; +typedef std::shared_ptr<LLStoredMessage> LLStoredMessagePtr;  #endif // LL_STOREDMESSAGE_H diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp index b7fdf4f437..1c571a74da 100644 --- a/indra/llmessage/tests/llcurl_stub.cpp +++ b/indra/llmessage/tests/llcurl_stub.cpp @@ -49,7 +49,7 @@ void LLCurl::Responder::httpCompleted()  }  void LLCurl::Responder::completedRaw(LLChannelDescriptors const&, -									 boost::shared_ptr<LLBufferArray> const&) +									 std::shared_ptr<LLBufferArray> const&)  {  } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index ba76ae4e37..d56712257b 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -335,7 +335,7 @@ public:  	// "init_history" message   	void initializeUrlHistory(const LLSD& url_history); -	boost::shared_ptr<LLPluginClassMedia> getSharedPtr() { return boost::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this +	std::shared_ptr<LLPluginClassMedia> getSharedPtr() { return std::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this  protected: diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 1893c9e657..01627925d7 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -43,7 +43,7 @@  #include "llsd.h"  #include "llevents.h" -class LLPluginProcessParentOwner : public boost::enable_shared_from_this < LLPluginProcessParentOwner >  +class LLPluginProcessParentOwner : public std::enable_shared_from_this < LLPluginProcessParentOwner >   {  public:  	virtual ~LLPluginProcessParentOwner(); @@ -60,7 +60,7 @@ class LLPluginProcessParent : public LLPluginMessagePipeOwner      LLPluginProcessParent(LLPluginProcessParentOwner *owner);  public: -    typedef boost::shared_ptr<LLPluginProcessParent> ptr_t; +    typedef std::shared_ptr<LLPluginProcessParent> ptr_t;  	~LLPluginProcessParent(); diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 2e4b013b77..2c357e1ac5 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -53,8 +53,6 @@  #pragma warning (default : 4264)  #endif -#include <boost/lexical_cast.hpp> -  #include "lldaeloader.h"  #include "llsdserialize.h"  #include "lljoint.h" @@ -2385,7 +2383,7 @@ std::string LLDAELoader::getElementLabel(daeElement *element)  		if (ind > 0)  		{ -			index_string = "_" + boost::lexical_cast<std::string>(ind); +			index_string = "_" + std::to_string(ind);  		}  		// if parent has a name or ID, use it diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp index 7394f99794..8e498158d6 100644 --- a/indra/llprimitive/llgltfloader.cpp +++ b/indra/llprimitive/llgltfloader.cpp @@ -48,8 +48,6 @@  // TODO: includes inherited from dae loader.  Validate / prune -#include <boost/lexical_cast.hpp> -  #include "llsdserialize.h"  #include "lljoint.h" diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 99a5697a84..ae81f06e84 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -68,6 +68,7 @@ LLModel::~LLModel()  	{  		LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID);  	} +    mPhysics.mMesh.clear();  }  //static diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 4505d6b3b9..040257e00e 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -106,6 +106,8 @@ public:  		std::vector<LLVector3> mPositions;  		std::vector<LLVector3> mNormals; +        ~PhysicsMesh() {} +  		void clear()  		{  			mPositions.clear(); @@ -131,6 +133,7 @@ public:  	public:  		Decomposition() { }  		Decomposition(LLSD& data); +		~Decomposition() { }  		void fromLLSD(LLSD& data);  		LLSD asLLSD() const;  		bool hasHullList() const; @@ -365,7 +368,7 @@ class LLModelInstanceBase  {  public:  	LLPointer<LLModel> mModel; -	LLPointer<LLModel> mLOD[5]; +	LLPointer<LLModel> mLOD[LLModel::NUM_LODS];  	LLUUID mMeshID;  	LLMatrix4 mTransform; @@ -380,6 +383,15 @@ public:  		: mModel(NULL)  	{  	} + +    virtual ~LLModelInstanceBase() +    { +        mModel = NULL; +        for (int j = 0; j < LLModel::NUM_LODS; ++j) +        { +            mLOD[j] = NULL; +        } +    };  };  typedef std::vector<LLModelInstanceBase> model_instance_list; @@ -399,6 +411,8 @@ public:  	LLModelInstance(LLSD& data); +    ~LLModelInstance() {} +  	LLSD asLLSD();  }; diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp index b072ce3964..c3e17d1267 100644 --- a/indra/llprimitive/tests/llmediaentry_test.cpp +++ b/indra/llprimitive/tests/llmediaentry_test.cpp @@ -211,7 +211,7 @@ namespace tut      void whitelist_test(int num, bool enable, const char *whitelist, const char *candidate_url, bool expected_pass)      { -        std::string message = "Whitelist test " + boost::lexical_cast<std::string>(num); +        std::string message = "Whitelist test " + std::to_string(num);          LLMediaEntry entry;          entry.setWhiteListEnable(enable);          set_whitelist(entry, whitelist); diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 3e159365e5..8ef7bd837f 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -34,8 +34,6 @@  #include "llerror.h"  #include "llxuiparser.h" -#include <boost/foreach.hpp> -  //  // LLCommandId class @@ -182,7 +180,7 @@ bool LLCommandManager::load()  		return false;  	} -	BOOST_FOREACH(LLCommand::Params& commandParams, commandsParams.commands) +	for (const LLCommand::Params& commandParams : commandsParams.commands)  	{  		LLCommand * command = new LLCommand(commandParams); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c67db54ea6..216f4a4ea5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -59,7 +59,6 @@  #include "llmultifloater.h"  #include "llsdutil.h"  #include "lluiusage.h" -#include <boost/foreach.hpp>  // use this to control "jumping" behavior when Ctrl-Tabbing @@ -2387,7 +2386,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)  			//{  			//	floaterp->translate(translate_x, translate_y);  			//} -			BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents) +			for (LLHandle<LLFloater> dependent_floater : floaterp->mDependents)  			{  				if (dependent_floater.get())  				{ @@ -2402,10 +2401,9 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)  void LLFloaterView::restoreAll()  {  	// make sure all subwindows aren't minimized -	child_list_t child_list = *(getChildList()); -	for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it) +	for (auto child : *getChildList())  	{ -		LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it); +		LLFloater* floaterp = dynamic_cast<LLFloater*>(child);  		if (floaterp)  		{  			floaterp->setMinimized(FALSE); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 7e4e828a88..2769a96875 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -395,8 +395,7 @@ void LLLayoutStack::updateLayout()  							: getRect().getHeight();  	// first, assign minimum dimensions -	LLLayoutPanel* panelp = NULL; -	BOOST_FOREACH(panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (panelp->mAutoResize)  		{ @@ -409,12 +408,15 @@ void LLLayoutStack::updateLayout()  	llassert(total_visible_fraction < 1.05f);  	// don't need spacing after last panel -	space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; +	if (!mPanels.empty()) +	{ +		space_to_distribute += ll_round(F32(mPanelSpacing) * mPanels.back()->getVisibleAmount()); +	}  	S32 remaining_space = space_to_distribute;  	if (space_to_distribute > 0 && total_visible_fraction > 0.f)  	{	// give space proportionally to visible auto resize panels -		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +		for (LLLayoutPanel* panelp : mPanels)  		{  			if (panelp->mAutoResize)  			{ @@ -427,7 +429,7 @@ void LLLayoutStack::updateLayout()  	}  	// distribute any left over pixels to non-collapsed, visible panels -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (remaining_space == 0) break; @@ -443,7 +445,7 @@ void LLLayoutStack::updateLayout()  	F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight(); -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim); @@ -538,7 +540,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const  {  	if (!panelp) return NULL; -	BOOST_FOREACH(LLLayoutPanel* p, mPanels) +	for (LLLayoutPanel* p : mPanels)  	{  		if (p == panelp)  		{ @@ -552,7 +554,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c  {  	LLLayoutPanel* result = NULL; -	BOOST_FOREACH(LLLayoutPanel* p, mPanels) +	for (LLLayoutPanel* p : mPanels)  	{  		if (p->getName() == name)  		{ @@ -566,7 +568,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c  void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)  { -	BOOST_FOREACH(LLLayoutPanel* lp, mPanels) +	for (LLLayoutPanel* lp : mPanels)  	{  		if (lp->mResizeBar == NULL)  		{ @@ -669,7 +671,7 @@ void LLLayoutStack::updateFractionalSizes()  {  	F32 total_resizable_dim = 0.f; -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (panelp->mAutoResize)  		{ @@ -677,7 +679,7 @@ void LLLayoutStack::updateFractionalSizes()  		}  	} -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (panelp->mAutoResize)  		{ @@ -698,7 +700,7 @@ void LLLayoutStack::normalizeFractionalSizes()  	S32 num_auto_resize_panels = 0;  	F32 total_fractional_size = 0.f; -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (panelp->mAutoResize)  		{ @@ -709,7 +711,7 @@ void LLLayoutStack::normalizeFractionalSizes()  	if (total_fractional_size == 0.f)  	{ // equal distribution -		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +		for (LLLayoutPanel* panelp : mPanels)  		{  			if (panelp->mAutoResize)  			{ @@ -719,7 +721,7 @@ void LLLayoutStack::normalizeFractionalSizes()  	}  	else  	{ // renormalize -		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +		for (LLLayoutPanel* panelp : mPanels)  		{  			if (panelp->mAutoResize)  			{ @@ -736,7 +738,7 @@ bool LLLayoutStack::animatePanels()  	//  	// animate visibility  	// -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (panelp->getVisible())  		{ @@ -834,7 +836,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&  	LLLayoutPanel* other_resize_panel = NULL;  	LLLayoutPanel* following_panel = NULL; -	BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels) +	BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available...  	{  		if (panelp->mAutoResize)  		{ @@ -883,7 +885,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&  		AFTER_RESIZED_PANEL  	} which_panel = BEFORE_RESIZED_PANEL; -	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) +	for (LLLayoutPanel* panelp : mPanels)  	{  		if (!panelp->getVisible() || panelp->mCollapsed)   		{ @@ -974,6 +976,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&  												MIN_FRACTIONAL_SIZE,  												MAX_FRACTIONAL_SIZE);  			} +			break;  		default:  			break;  		} @@ -990,8 +993,8 @@ void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)  void LLLayoutStack::updateResizeBarLimits()  { -	LLLayoutPanel* previous_visible_panelp = NULL; -	BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels) +	LLLayoutPanel* previous_visible_panelp{ nullptr }; +	BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available...  	{  		if (!visible_panelp->getVisible() || visible_panelp->mCollapsed)  		{ diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index 1ede5b706f..e8b6b7e43b 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -34,7 +34,6 @@  // Project includes  #include "lluictrlfactory.h"  #include "lluiimage.h" -#include "boost/foreach.hpp"  // registered in llui.cpp to avoid being left out by MS linker  //static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator"); @@ -52,7 +51,7 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p)  void LLLoadingIndicator::initFromParams(const Params& p)  { -	BOOST_FOREACH(LLUIImage* image, p.images().image) +	for (LLUIImage* image : p.images().image)  	{  		mImages.push_back(image);  	} diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index cebca70b59..76b50e0cdd 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -60,7 +60,6 @@  #include "v2math.h"  #include <set>  #include <boost/tokenizer.hpp> -#include <boost/foreach.hpp>  // static  LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL; @@ -2156,7 +2155,7 @@ void LLMenuGL::arrange( void )  		}  		else  		{ -			BOOST_FOREACH(LLMenuItemGL* itemp, mItems) +			for (LLMenuItemGL* itemp : mItems)  			{  				// do first so LLMenuGLItemCall can call on_visible to determine if visible  				itemp->buildDrawLabel(); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index d87241a9bf..28fc8bf79f 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -45,7 +45,6 @@  #include <algorithm>  #include <boost/regex.hpp> -#include <boost/foreach.hpp>  const std::string NOTIFICATION_PERSIST_VERSION = "0.93"; @@ -444,14 +443,14 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par  		mSoundName = p.sound;  	} -	BOOST_FOREACH(const LLNotificationTemplate::UniquenessContext& context, p.unique.contexts) +	for (const LLNotificationTemplate::UniquenessContext& context : p.unique.contexts)  	{  		mUniqueContext.push_back(context.value);  	}  	LL_DEBUGS("Notifications") << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL; -	BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags) +	for (const LLNotificationTemplate::Tag& tag : p.tags)  	{  		LL_DEBUGS("Notifications") << "    tag \"" << std::string(tag.value) << "\"" << LL_ENDL;  		mTags.push_back(tag.value); @@ -1154,7 +1153,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p)  	LLInstanceTracker<LLNotificationChannel, std::string>(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()),  	mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString())  { -	BOOST_FOREACH(const std::string& source, p.sources) +	for (const std::string& source : p.sources)      {  		connectToChannel(source);  	} @@ -1527,7 +1526,7 @@ void replaceFormText(LLNotificationForm::Params& form, const std::string& patter  		form.ignore.text = replace;  	} -	BOOST_FOREACH(LLNotificationForm::FormElement& element, form.form_elements.elements) +	for (LLNotificationForm::FormElement& element : form.form_elements.elements)  	{  		if (element.button.isChosen() && element.button.text() == pattern)  		{ @@ -1575,19 +1574,19 @@ bool LLNotifications::loadTemplates()  	mTemplates.clear(); -	BOOST_FOREACH(LLNotificationTemplate::GlobalString& string, params.strings) +	for (const LLNotificationTemplate::GlobalString& string : params.strings)  	{  		mGlobalStrings[string.name] = string.value;  	}  	std::map<std::string, LLNotificationForm::Params> form_templates; -	BOOST_FOREACH(LLNotificationTemplate::Template& notification_template, params.templates) +	for (const LLNotificationTemplate::Template& notification_template : params.templates)  	{  		form_templates[notification_template.name] = notification_template.form;  	} -	BOOST_FOREACH(LLNotificationTemplate::Params& notification, params.notifications) +	for (LLNotificationTemplate::Params& notification : params.notifications)  	{  		if (notification.form_ref.form_template.isChosen())  		{ @@ -1641,7 +1640,7 @@ bool LLNotifications::loadVisibilityRules()  	mVisibilityRules.clear(); -	BOOST_FOREACH(LLNotificationVisibilityRule::Rule& rule, params.rules) +	for (const LLNotificationVisibilityRule::Rule& rule : params.rules)  	{  		mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule)));  	} diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 4d71d189f2..98b4c9df85 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -992,7 +992,7 @@ private:  	bool mIgnoreAllNotifications; -	boost::scoped_ptr<LLNotificationsListener> mListener; +	std::unique_ptr<LLNotificationsListener> mListener;  	std::vector<LLNotificationChannelPtr> mDefaultChannels;  }; diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index 83b5bf03ac..859222f907 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -32,7 +32,6 @@  #include "llnotificationtemplate.h"  #include "llsd.h"  #include "llui.h" -#include <boost/foreach.hpp>  LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :      LLEventAPI("LLNotifications", diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 2707f7a15c..204b8b9984 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -27,7 +27,6 @@  #include "linden_common.h" -#include <boost/foreach.hpp>  #include "lltoolbar.h"  #include "llcommandmanager.h" @@ -219,7 +218,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)  	mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p)); -	BOOST_FOREACH(LLCommandId id, p.commands) +	for (const auto& id : p.commands)  	{  		addCommand(id);  	} @@ -417,7 +416,7 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)  		// Determine which button the mouse was over during the click in case the context menu action  		// is intended to affect the button.  		mRightMouseTargetButton = NULL; -		BOOST_FOREACH(LLToolBarButton* button, mButtons) +		for (LLToolBarButton* button : mButtons)  		{  			LLRect button_rect;  			button->localRectToOtherView(button->getLocalRect(), &button_rect, this); @@ -505,7 +504,7 @@ void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type)  void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth)  {  	// make buttons in current row all same girth -	BOOST_FOREACH(LLToolBarButton* button, buttons_in_row) +	for (LLToolBarButton* button : buttons_in_row)  	{  		if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL)  		{ @@ -693,7 +692,7 @@ void LLToolBar::updateLayoutAsNeeded()  	std::vector<LLToolBarButton*> buttons_in_row; -	BOOST_FOREACH(LLToolBarButton* button, mButtons) +	for (LLToolBarButton* button : mButtons)  	{  		button->reshape(button->mWidthRange.getMin(), button->mDesiredHeight);  		button->autoResize(); @@ -878,7 +877,7 @@ void LLToolBar::createButtons()  {  	std::set<LLUUID> set_flashing; -	BOOST_FOREACH(LLToolBarButton* button, mButtons) +	for (LLToolBarButton* button : mButtons)  	{          if (button->getFlashTimer() && button->getFlashTimer()->isFlashingInProgress())          { @@ -896,7 +895,7 @@ void LLToolBar::createButtons()  	mButtonMap.clear();  	mRightMouseTargetButton = NULL; -	BOOST_FOREACH(LLCommandId& command_id, mButtonCommands) +	for (const LLCommandId& command_id : mButtonCommands)  	{  		LLToolBarButton* button = createButton(command_id);  		mButtons.push_back(button); diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index 096336045c..f43bdf1fdc 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -32,7 +32,6 @@  #include "llui.h"  #include "lluicolortable.h"  #include "lluictrlfactory.h" -#include <boost/foreach.hpp>  LLUIColorTable::ColorParams::ColorParams()  :	value("value"), @@ -208,7 +207,7 @@ bool LLUIColorTable::loadFromSettings()  	// pass constraint=LLDir::ALL_SKINS because we want colors.xml from every  	// skin dir -	BOOST_FOREACH(std::string colors_path, +	for (const std::string& colors_path :  				  gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS))  	{  		result |= loadFromFilename(colors_path, mLoadedColors); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index da7868d804..070cd4b107 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -32,7 +32,6 @@  #include <sstream>  #include <boost/tokenizer.hpp> -#include <boost/foreach.hpp>  #include <boost/bind.hpp>  #include "llrender.h" @@ -592,7 +591,7 @@ void LLView::deleteAllChildren()  void LLView::setAllChildrenEnabled(BOOL b)  { -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		viewp->setEnabled(b);  	} @@ -621,7 +620,7 @@ void LLView::onVisibilityChange ( BOOL new_visibility )  {  	BOOL old_visibility;  	BOOL log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus(); -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		if (!viewp)  		{ @@ -725,7 +724,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m  {  	if ( getVisible() && getEnabled() )  	{ -		BOOST_FOREACH(LLView* viewp, mChildList) +		for (LLView* viewp : mChildList)  		{  			if ((viewp->*method)(c, mask, TRUE))  			{ @@ -744,7 +743,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m  template <typename METHOD, typename XDATA>  LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block)  { -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		S32 local_x = x - viewp->getRect().mLeft;  		S32 local_y = y - viewp->getRect().mBottom; @@ -773,7 +772,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA  LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask)  { -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		S32 local_x = x - viewp->getRect().mLeft;  		S32 local_y = y - viewp->getRect().mBottom; @@ -805,7 +804,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,  	// default to not accepting drag and drop, will be overridden by handler  	*accept = ACCEPT_NO; -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		S32 local_x = x - viewp->getRect().mLeft;  		S32 local_y = y - viewp->getRect().mBottom; @@ -831,7 +830,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,  LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)  { -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		S32 local_x = x - viewp->getRect().mLeft;  		S32 local_y = y - viewp->getRect().mBottom; @@ -859,7 +858,7 @@ LLView*	LLView::childFromPoint(S32 x, S32 y, bool recur)  	if (!getVisible())  		return NULL; -	BOOST_FOREACH(LLView* viewp, mChildList) +	for (LLView* viewp : mChildList)  	{  		S32 local_x = x - viewp->getRect().mLeft;  		S32 local_y = y - viewp->getRect().mBottom; @@ -1379,7 +1378,7 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)  		mRect.mTop = getRect().mBottom + height;  		// move child views according to reshape flags -		BOOST_FOREACH(LLView* viewp, mChildList) +		for (LLView* viewp : mChildList)  		{  			if (viewp != NULL)  			{ @@ -1451,7 +1450,7 @@ LLRect LLView::calcBoundingRect()  {  	LLRect local_bounding_rect = LLRect::null; -	BOOST_FOREACH(LLView* childp, mChildList) +	for (LLView* childp : mChildList)  	{  		// ignore invisible and "top" children when calculating bounding rect  		// such as combobox popups @@ -1614,7 +1613,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const      LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;      // Look for direct children *first* -	BOOST_FOREACH(LLView* childp, mChildList) +	for (LLView* childp : mChildList)  	{  		llassert(childp);  		if (childp->getName() == name) @@ -1625,7 +1624,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const  	if (recurse)  	{  		// Look inside each child as well. -		BOOST_FOREACH(LLView* childp, mChildList) +		for (LLView* childp : mChildList)  		{  			llassert(childp);  			LLView* viewp = childp->findChildView(name, recurse); @@ -2800,7 +2799,7 @@ S32	LLView::notifyParent(const LLSD& info)  bool	LLView::notifyChildren(const LLSD& info)  {  	bool ret = false; -	BOOST_FOREACH(LLView* childp, mChildList) +	for (LLView* childp : mChildList)  	{  		ret = ret || childp->notifyChildren(info);  	} diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fc83c16e5d..d59a467e51 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1575,34 +1575,15 @@ endif (WINDOWS)  # Add the xui files. This is handy for searching for xui elements  # from within the IDE. -set(viewer_XUI_FILES -    skins/default/colors.xml -    skins/default/default_languages.xml -    skins/default/textures/textures.xml -    ) -file(GLOB DEFAULT_XUI_FILE_GLOB_LIST -     ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/*.xml) -list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST}) - -file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST -     ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/widgets/*.xml) -list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST}) - -# Cannot append empty lists in CMake, wait until we have files here. -#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST -#     ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml) -#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST}) - -list(SORT viewer_XUI_FILES) - -source_group("XUI Files" FILES ${viewer_XUI_FILES}) - -set_source_files_properties(${viewer_XUI_FILES} +file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE +    ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) +set_source_files_properties(${viewer_XUI_FILES}                               PROPERTIES HEADER_FILE_ONLY TRUE) -  list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) -file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES TRUE +# Add the shader sources +file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE      ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl)  source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES})  set_source_files_properties(${viewer_SHADER_FILES}  @@ -1612,6 +1593,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES})  set(viewer_APPSETTINGS_FILES      app_settings/anim.ini +    app_settings/autoreplace.xml      app_settings/cmd_line.xml      app_settings/commands.xml      app_settings/grass.xml diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index b7f452904a..d1e1815a79 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -95,7 +95,6 @@  #include "llworld.h"  #include "llworldmap.h"  #include "stringize.h" -#include "boost/foreach.hpp"  #include "llcorehttputil.h"  #include "lluiusage.h" @@ -2329,7 +2328,7 @@ void LLAgent::endAnimationUpdateUI()  			LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");  			LLFloaterIMContainer::floater_list_t conversations;  			im_box->getDetachedConversationFloaters(conversations); -			BOOST_FOREACH(LLFloater* conversation, conversations) +			for (LLFloater* conversation : conversations)  			{  				LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL;  				skip_list.insert(conversation); diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index fd3a9b1d7b..43b4457bf5 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -61,7 +61,7 @@ class LLTeleportRequest; -typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr; +typedef std::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;  //--------------------------------------------------------------------  // Types @@ -131,7 +131,7 @@ public:  private:  	bool			mInitialized;  	bool			mFirstLogin; -	boost::shared_ptr<LLAgentListener> mListener; +	std::shared_ptr<LLAgentListener> mListener;  	//--------------------------------------------------------------------  	// Session diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 8977b145d1..0d0d6e7e46 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1779,7 +1779,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)  		head_offset.clearVec();  		F32 fixup; -		if (gAgentAvatarp->hasPelvisFixup(fixup)) +        if (gAgentAvatarp->hasPelvisFixup(fixup) && !gAgentAvatarp->isSitting())  		{  			head_offset[VZ] -= fixup;  		} diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4c3a9229d2..c84657cf7a 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -27,7 +27,6 @@  #include "llviewerprecompiledheaders.h"  #include <boost/lexical_cast.hpp> -#include <boost/foreach.hpp>  #include "llaccordionctrltab.h"  #include "llagent.h"  #include "llagentcamera.h" @@ -1647,7 +1646,7 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id)          sub_cat_array,          outfit_item_array,          LLInventoryModel::EXCLUDE_TRASH); -    BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) +    for (LLViewerInventoryItem* outfit_item : outfit_item_array)      {          LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();          if (linked_item != NULL) @@ -3438,7 +3437,7 @@ void update_base_outfit_after_ordering()  								sub_cat_array,  								outfit_item_array,  								LLInventoryModel::EXCLUDE_TRASH); -	BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) +	for (LLViewerInventoryItem* outfit_item : outfit_item_array)  	{  		LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();  		if (linked_item != NULL) @@ -3742,7 +3741,7 @@ LLSD LLAppearanceMgr::dumpCOF() const  			LLUUID linked_asset_id(linked_item->getAssetUUID());  			md5.update((unsigned char*)linked_asset_id.mData, 16);  			U32 flags = linked_item->getFlags(); -			md5.update(boost::lexical_cast<std::string>(flags)); +			md5.update(std::to_string(flags));  		}  		else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType())  		{ diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ec411a680f..96986ae046 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -143,7 +143,6 @@  // Third party library includes  #include <boost/bind.hpp> -#include <boost/foreach.hpp>  #include <boost/algorithm/string.hpp>  #include <boost/regex.hpp>  #include <boost/throw_exception.hpp> @@ -1207,7 +1206,7 @@ bool LLAppViewer::init()              LLSD item(LeapCommand);              LeapCommand.append(item);          } -        BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) +        for (const auto& leap : llsd::inArray(LeapCommand))          {              LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;              // We don't have any better description of this plugin than the @@ -2357,7 +2356,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,  		LL_ERRS() << "Invalid settings location list" << LL_ENDL;  	} -	BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) +	for (const SettingsGroup& group : mSettingsLocationList->groups)  	{  		// skip settings groups that aren't the one we requested  		if (group.name() != location_key) continue; @@ -2369,7 +2368,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,  			return false;  		} -		BOOST_FOREACH(const SettingsFile& file, group.files) +		for (const SettingsFile& file : group.files)  		{  			LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name()  			    << " - from location " << location_key << LL_ENDL; @@ -2433,11 +2432,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,  std::string LLAppViewer::getSettingsFilename(const std::string& location_key,  											 const std::string& file)  { -	BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) +	for (const SettingsGroup& group : mSettingsLocationList->groups)  	{  		if (group.name() == location_key)  		{ -			BOOST_FOREACH(const SettingsFile& settings_file, group.files) +			for (const SettingsFile& settings_file : group.files)  			{  				if (settings_file.name() == file)  				{ @@ -3017,7 +3016,7 @@ void LLAppViewer::initStrings()  	// Now that we've set "[sourceid]", have to go back through  	// default_trans_args and reinitialize all those other keys because some  	// of them, in turn, reference "[sourceid]". -	BOOST_FOREACH(std::string key, default_trans_args) +	for (const std::string& key : default_trans_args)  	{  		std::string brackets(key), nobrackets(key);  		// Invalid to inspect key[0] if key is empty(). But then, the entire @@ -4682,16 +4681,23 @@ void LLAppViewer::idle()  		// When appropriate, update agent location to the simulator.  		F32 agent_update_time = agent_update_timer.getElapsedTimeF32();  		F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time; -		BOOL force_update = gAgent.controlFlagsDirty() -							|| (mLastAgentControlFlags != gAgent.getControlFlags()) -							|| (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); -		if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) +        bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND); +        BOOL force_send = +            // if there is something to send +            (gAgent.controlFlagsDirty() && timed_out) +            // if something changed +            || (mLastAgentControlFlags != gAgent.getControlFlags()) +            // keep alive +            || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); +        // timing out doesn't warranty that an update will be sent, +        // just that it will be checked. +		if (force_send || timed_out)  		{  			LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;  			// Send avatar and camera info  			mLastAgentControlFlags = gAgent.getControlFlags(); -			mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time; -			send_agent_update(force_update); +			mLastAgentForceUpdate = force_send ? 0 : agent_force_update_time; +			send_agent_update(force_send);  			agent_update_timer.reset();  		}  	} diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index eb2c156ca5..b11786a451 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -73,7 +73,7 @@ namespace      class ObjectInventoryFetcher: public LLVOInventoryListener      {      public: -        typedef boost::shared_ptr<ObjectInventoryFetcher> ptr_t; +        typedef std::shared_ptr<ObjectInventoryFetcher> ptr_t;          ObjectInventoryFetcher(LLEventPump &pump, LLViewerObject* object, void* user_data) :              mPump(pump), diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index a696c99a82..3c59ca046d 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -32,7 +32,6 @@  #include "llnotificationsutil.h"  #include "lltrans.h" -#include <boost/foreach.hpp>  #include "boost/lexical_cast.hpp"  const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec @@ -392,7 +391,7 @@ void LLConversationLog::deleteBackupLogs()  	std::vector<std::string> backup_logs;  	getListOfBackupLogs(backup_logs); -	BOOST_FOREACH(const std::string& fullpath, backup_logs) +	for (const std::string& fullpath : backup_logs)  	{  		LLFile::remove(fullpath);  	} @@ -434,7 +433,7 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s  			while(LLFile::isfile(backupFileName))  			{  				++backupFileCount; -				backupFileName = targetDirectory + ".backup" + boost::lexical_cast<std::string>(backupFileCount); +				backupFileName = targetDirectory + ".backup" + std::to_string(backupFileCount);  			}  			//Rename the file to its backup name so it is not overwritten diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 9ec4fb085b..fa5248920d 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -37,8 +37,6 @@  #include "llimview.h" //For LLIMModel  #include "lltrans.h" -#include <boost/foreach.hpp> -  //  // Conversation items : common behaviors  // @@ -293,8 +291,7 @@ void LLConversationItemSession::updateName(LLConversationItemParticipant* partic  		// In the case of a P2P conversation, we need to grab the name of the other participant in the session instance itself  		// as we do not create participants for such a session. -		LLFolderViewModelItem * itemp; -		BOOST_FOREACH(itemp, mChildren) +		for (auto itemp : mChildren)  		{  			LLConversationItem* current_participant = dynamic_cast<LLConversationItem*>(itemp);  			// Add the avatar uuid to the list (except if it's the own agent uuid) diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index b66eb754a4..b0d88159c1 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -32,7 +32,6 @@  #include "llprocess.h"  #include "llsdutil.h"  #include "llstring.h" -#include <boost/foreach.hpp>  // static  const std::string LLExternalEditor::sFilenameMarker = "%s"; @@ -93,7 +92,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::run(const std::string& file_path)  	params.executable = mProcessParams.executable;  	// Substitute the filename marker in the command with the actual passed file name. -	BOOST_FOREACH(const std::string& arg, mProcessParams.args) +	for (const std::string& arg : mProcessParams.args)  	{  		std::string fixed(arg);  		LLStringUtil::replaceString(fixed, sFilenameMarker, file_path); diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index 2d5e86869d..fa51143f3a 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -84,7 +84,7 @@ BOOL LLFloaterEditSky::postBuild()  	mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo");  	mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");  	mSaveButton = getChild<LLButton>("save"); -    mSkyAdapter = boost::make_shared<LLSkySettingsAdapter>(); +    mSkyAdapter = std::make_shared<LLSkySettingsAdapter>();      LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp index c44ae7faca..4a6268435b 100644 --- a/indra/newview/llfloatereditwater.cpp +++ b/indra/newview/llfloatereditwater.cpp @@ -71,7 +71,7 @@ BOOL LLFloaterEditWater::postBuild()  	mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");  	mSaveButton = getChild<LLButton>("save"); -    mWaterAdapter = boost::make_shared<LLWatterSettingsAdapter>(); +    mWaterAdapter = std::make_shared<LLWatterSettingsAdapter>();      LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEditWater::onWaterPresetListChange, this)); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index f997dc9910..8f12abe7a5 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -57,7 +57,6 @@  #include "llsdserialize.h"  #include "llviewermenu.h" // is_agent_mappable  #include "llviewerobjectlist.h" -#include "boost/foreach.hpp"  const S32 EVENTS_PER_IDLE_LOOP_CURRENT_SESSION = 80; @@ -805,12 +804,11 @@ void LLFloaterIMContainer::setVisible(BOOL visible)  void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters)  { -	typedef conversations_widgets_map::value_type conv_pair;  	LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); -	BOOST_FOREACH(conv_pair item, mConversationsWidgets) +	for (const auto& [key, fvi] : mConversationsWidgets)  	{ -		LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(item.second); +		LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(fvi);  		if (widget)  		{  			LLFloater* session_floater = widget->getSessionFloater(); diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 4cd91c53d8..ef4b71b3af 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -453,7 +453,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts()  //-----------------------------------------------------------------------------------------------  //LLFloaterIMNearbyChatHandler  //----------------------------------------------------------------------------------------------- -boost::scoped_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat")); +std::unique_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat"));  LLFloaterIMNearbyChatHandler::LLFloaterIMNearbyChatHandler()  { diff --git a/indra/newview/llfloaterimnearbychathandler.h b/indra/newview/llfloaterimnearbychathandler.h index 5e6f8cde30..1849604470 100644 --- a/indra/newview/llfloaterimnearbychathandler.h +++ b/indra/newview/llfloaterimnearbychathandler.h @@ -46,7 +46,7 @@ public:  protected:  	virtual void initChannel(); -	static boost::scoped_ptr<LLEventPump> sChatWatcher; +	static std::unique_ptr<LLEventPump> sChatWatcher;  };  } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index aa723eb3a8..6b8e2898a0 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1016,7 +1016,6 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata)  	if (userdata.asString() == "closeadvanced")  	{  		LLFloaterReg::hideInstance("prefs_graphics_advanced"); -		updateMaxComplexity();  	}  	else  	{ diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 67a205417e..b0183f072e 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -158,7 +158,7 @@ public:  	// typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise  	typedef std::list<std::string> StringList; -	typedef boost::shared_ptr<StringList> StringListPtr; +	typedef std::shared_ptr<StringList> StringListPtr;  	typedef std::map<std::string, std::pair<StringListPtr,StringListPtr> > DiffMap;  	DiffMap mDiffsMap;							// map, of filename to pair of list of changed element paths and list of errors diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 61a01d7418..ce4a032b27 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3162,9 +3162,11 @@ void LLIMMgr::addMessage(              // Fetch group chat history, enabled by default.              if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))              { -                std::string chat_url = gAgent.getRegion()->getCapability("ChatSessionRequest"); -                LLCoros::instance().launch("chatterBoxHistoryCoro", -                    boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp)); +                std::string chat_url = gAgent.getRegionCapability("ChatSessionRequest"); +                if (!chat_url.empty()) +                { +                    LLCoros::instance().launch("chatterBoxHistoryCoro", boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp)); +                }              }  			//Play sound for new conversations diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f806614e29..9c741daef6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3030,7 +3030,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,  	return accept;  } -void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv) +void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv)  {  	const char* dialog = NULL;  	if (object->flagScripted()) @@ -3043,7 +3043,7 @@ void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> mo  	}      static LLNotificationPtr notification_ptr; -    static boost::shared_ptr<LLMoveInv> inv_ptr; +    static std::shared_ptr<LLMoveInv> inv_ptr;      // Notification blocks user from interacting with inventories so everything that comes after first message      // is part of this message - don'r show it again @@ -3156,7 +3156,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,  	if(drop && accept)  	{  		it = inventory_objects.begin(); -        boost::shared_ptr<LLMoveInv> move_inv(new LLMoveInv); +        std::shared_ptr<LLMoveInv> move_inv(new LLMoveInv);  		move_inv->mObjectID = object_id;  		move_inv->mCategoryID = category_id;  		move_inv->mCallback = callback; @@ -5015,7 +5015,7 @@ LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const  // helper stuff -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv> move_inv) +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv> move_inv)  {  	LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData;  	LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID); @@ -5489,7 +5489,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,  		if (accept && drop)  		{              LLUUID item_id = inv_item->getUUID(); -            boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); +            std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv());  			move_inv->mObjectID = inv_item->getParentUUID();  			two_uuids_t item_pair(mUUID, item_id);  			move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3cbbd68e51..6f06f3b36d 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -794,7 +794,7 @@ struct LLMoveInv      void* mUserData;  }; -void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv); -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv>); +void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv); +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv>);  #endif // LL_LLINVENTORYBRIDGE_H diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 6662f14b12..5df9b71fc3 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -91,8 +91,6 @@  #include "llvoavatarself.h"  #include "llwearablelist.h" -#include <boost/foreach.hpp> -  BOOL LLInventoryState::sWearNewClothing = FALSE;  LLUUID LLInventoryState::sWearNewClothingTransactionID;  std::list<LLUUID> LLInventoryAction::sMarketplaceFolders; @@ -2968,6 +2966,23 @@ bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids)  void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm)  {  	std::set<LLFolderViewItem*> selected_items = root->getSelectionList(); +    if (selected_items.empty() +        && action != "wear" +        && action != "wear_add" +        && !isRemoveAction(action)) +    { +        // Was item removed while user was checking menu? +        // "wear" and removal exlusions are due to use of +        // getInventorySelectedUUIDs() below +        LL_WARNS("Inventory") << "Menu tried to operate on empty selection" << LL_ENDL; + +        if (("copy" == action) || ("cut" == action)) +        { +            LLClipboard::instance().reset(); +        } + +        return; +    }      // Prompt the user and check for authorization for some marketplace active listing edits  	if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action))) diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index d2056fb44d..230ee86fb7 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -3339,7 +3339,7 @@ BOOL dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, BOOL drop,          if (accept && drop)          { -            boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); +            std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv());              move_inv->mObjectID = inv_item->getParentUUID();              std::pair<LLUUID, LLUUID> item_pair(folder_id, inv_item->getUUID());              move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 052ac50185..55a947a09d 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -42,7 +42,6 @@  #include <boost/algorithm/string/trim.hpp>  #include <boost/algorithm/string/replace.hpp>  #include <boost/regex.hpp> -#include <boost/foreach.hpp>  #if LL_MSVC  #pragma warning(push)   @@ -709,7 +708,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,  	std::string backupFileName;  	unsigned backupFileCount; -	BOOST_FOREACH(const std::string& fullpath, listOfFilesToMove) +	for (const std::string& fullpath : listOfFilesToMove)  	{  		backupFileCount = 0;  		newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos); @@ -723,7 +722,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,  			while(LLFile::isfile(backupFileName))  			{  				++backupFileCount; -				backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount); +				backupFileName = newFullPath + ".backup" + std::to_string(backupFileCount);  			}  			//Rename the file to its backup name so it is not overwritten @@ -780,7 +779,7 @@ void LLLogChat::deleteTranscripts()  	getListOfTranscriptFiles(list_of_transcriptions);  	getListOfTranscriptBackupFiles(list_of_transcriptions); -	BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions) +	for (const std::string& fullpath : list_of_transcriptions)  	{  		S32 retry_count = 0;  		while (retry_count < 5) diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 2e9aab7c00..74d6890d1d 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -90,7 +90,7 @@ private:  	void attemptComplete() { mAttemptComplete = true; } // In the future an event? -	boost::scoped_ptr<LLLogin> mLoginModule; +	std::unique_ptr<LLLogin> mLoginModule;  	LLNotificationsInterface* mNotifications;  	std::string mLoginState; diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp index 0886f9a990..02bd9e1f34 100644 --- a/indra/newview/llmarketplacenotifications.cpp +++ b/indra/newview/llmarketplacenotifications.cpp @@ -33,7 +33,6 @@  #include "llerror.h" -#include <boost/foreach.hpp>  #include <boost/signals2.hpp> @@ -54,7 +53,7 @@ namespace LLMarketplaceInventoryNotifications  			llassert(!no_copy_payloads.empty());  			llassert(no_copy_cb_action != NULL); -			BOOST_FOREACH(const LLSD& payload, no_copy_payloads) +			for (const LLSD& payload : no_copy_payloads)  			{  				(*no_copy_cb_action)(payload);  			} diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 3b59b2f05e..577ab0048f 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -68,7 +68,7 @@ class LLMaterialHttpHandler : public LLHttpSDHandler  {  public:   	typedef boost::function<void(bool, const LLSD&)> CallbackFunction; -	typedef boost::shared_ptr<LLMaterialHttpHandler> ptr_t; +	typedef std::shared_ptr<LLMaterialHttpHandler> ptr_t;  	LLMaterialHttpHandler(const std::string& method, CallbackFunction cback); diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 58f8bad3e4..8cd4793106 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -116,10 +116,10 @@ protected:  	// Request (pure virtual base class for requests in the queue)      class Request:  -        public boost::enable_shared_from_this<Request> +        public std::enable_shared_from_this<Request>      {      public: -        typedef boost::shared_ptr<Request> ptr_t; +        typedef std::shared_ptr<Request> ptr_t;          // Subclasses must implement this to build a payload for their request type.          virtual LLSD getPayload() const = 0; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 01d6469010..1f909b98dc 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -411,7 +411,7 @@ namespace {  static S32 dump_num = 0;  std::string make_dump_name(std::string prefix, S32 num)  { -	return prefix + boost::lexical_cast<std::string>(num) + std::string(".xml"); +	return prefix + std::to_string(num) + std::string(".xml");  }  void dump_llsd_to_file(const LLSD& content, std::string filename);  LLSD llsd_from_file(std::string filename); @@ -572,10 +572,10 @@ S32 LLMeshRepoThread::sRequestWaterLevel = 0;  //   LLMeshUploadThread  class LLMeshHandlerBase : public LLCore::HttpHandler, -    public boost::enable_shared_from_this<LLMeshHandlerBase> +    public std::enable_shared_from_this<LLMeshHandlerBase>  {  public: -    typedef boost::shared_ptr<LLMeshHandlerBase> ptr_t; +    typedef std::shared_ptr<LLMeshHandlerBase> ptr_t;  	LOG_CLASS(LLMeshHandlerBase);  	LLMeshHandlerBase(U32 offset, U32 requested_bytes) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index ccae1030f1..ad22e84c6e 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -220,6 +220,16 @@ LLModelPreview::~LLModelPreview()          mPreviewAvatar->markDead();          mPreviewAvatar = NULL;      } + +    mUploadData.clear(); +    mTextureSet.clear(); + +    for (U32 i = 0; i < LLModel::NUM_LODS; i++) +    { +        clearModel(i); +    } +    mBaseModel.clear(); +    mBaseScene.clear();  }  void LLModelPreview::updateDimentionsAndOffsets() diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index df7320768c..d4d5d087bd 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -310,7 +310,6 @@ protected:      vv_LLVolumeFace_t mBaseModelFacesCopy;      U32 mGroup; -    std::map<LLPointer<LLModel>, U32> mObject;      // Amount of triangles in original(base) model      U32 mMaxTriangleLimit; diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index b06131cf38..3f6a86106a 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -34,9 +34,6 @@  #include "llfloaterimnearbychathandler.h"  #include "llnotifications.h" -#include <boost/bind.hpp> -#include <boost/foreach.hpp> -  using namespace LLNotificationsUI;  //-------------------------------------------------------------------------- @@ -53,15 +50,15 @@ LLNotificationManager::~LLNotificationManager()  //--------------------------------------------------------------------------  void LLNotificationManager::init()  { -	mChannels.push_back(new LLScriptHandler()); -	mChannels.push_back(new LLTipHandler()); -	mChannels.push_back(new LLGroupHandler()); -	mChannels.push_back(new LLAlertHandler("Alerts", "alert", false)); -	mChannels.push_back(new LLAlertHandler("AlertModal", "alertmodal", true)); -	mChannels.push_back(new LLOfferHandler()); -	mChannels.push_back(new LLHintHandler()); -	mChannels.push_back(new LLBrowserNotification()); -	mChannels.push_back(new LLIMHandler()); +	mChannels.emplace_back(new LLScriptHandler()); +	mChannels.emplace_back(new LLTipHandler()); +	mChannels.emplace_back(new LLGroupHandler()); +	mChannels.emplace_back(new LLAlertHandler("Alerts", "alert", false)); +	mChannels.emplace_back(new LLAlertHandler("AlertModal", "alertmodal", true)); +	mChannels.emplace_back(new LLOfferHandler()); +	mChannels.emplace_back(new LLHintHandler()); +	mChannels.emplace_back(new LLBrowserNotification()); +	mChannels.emplace_back(new LLIMHandler());  	mChatHandler = std::shared_ptr<LLFloaterIMNearbyChatHandler>(new LLFloaterIMNearbyChatHandler());  } diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index b26aabca4f..9bf0fde302 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -28,8 +28,6 @@  #include "llviewerprecompiledheaders.h" // must be first include  #include "lloutfitgallery.h" -#include <boost/foreach.hpp> -  // llcommon  #include "llcommonutils.h"  #include "llfilesystem.h" @@ -1243,7 +1241,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)                  sub_cat_array,                  outfit_item_array,                  LLInventoryModel::EXCLUDE_TRASH); -            BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) +            for (LLViewerInventoryItem* outfit_item : outfit_item_array)              {                  LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();                  LLUUID asset_id, inv_id; diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 0fdb9a57f3..854a32621a 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -40,7 +40,6 @@  #include "lltextbox.h"  #include "lltrans.h"  #include "llsdutil.h" -#include <boost/foreach.hpp>  static LLPanelInjector<LLPanelExperienceListEditor> t_panel_experience_list_editor("panel_experience_list_editor"); @@ -96,7 +95,7 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience  void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids )  {  	mExperienceIds.clear(); -	BOOST_FOREACH(LLSD uuid, llsd::inArray(experience_ids)) +	for (LLSD uuid : llsd::inArray(experience_ids))  	{  		// Using insert(range) doesn't work here because the conversion from  		// LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry. diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index cf1f0bc32f..2b6bf1bcd6 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -49,8 +49,6 @@  #include "lluictrlfactory.h"  #include "llviewerwindow.h" -#include <boost/foreach.hpp> -  LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id)  {  	// Pass on construction of this panel to the control factory. @@ -163,8 +161,8 @@ void LLPanelGroupBulkBan::submit()  	// remove already banned users and yourself from request.  	std::vector<LLAvatarName> banned_avatar_names;  	std::vector<LLAvatarName> out_of_limit_names; -	bool banning_self = FALSE; -	std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgent.getID()); +	bool banning_self{ false }; +	std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgentID);  	if (conflict != banned_agent_list.end())  	{  		banned_agent_list.erase(conflict); @@ -172,18 +170,17 @@ void LLPanelGroupBulkBan::submit()  	}  	if (group_datap)  	{ -		BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList) +		for (const auto& [group_ban_agent_id, group_ban_data] : group_datap->mBanList)  		{ -			const LLUUID& group_ban_agent_id = group_ban_pair.first;  			std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id);  			if (conflict != banned_agent_list.end())  			{  				LLAvatarName av_name;  				LLAvatarNameCache::get(group_ban_agent_id, &av_name); -				banned_avatar_names.push_back(av_name); +				banned_avatar_names.emplace_back(av_name);  				banned_agent_list.erase(conflict); -				if (banned_agent_list.size() == 0) +				if (banned_agent_list.empty())  				{  					break;  				} diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index c6254f72cf..5c4f8e9135 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -112,7 +112,7 @@ private:  	static void updateServerCombo();  private: -	boost::scoped_ptr<LLPanelLoginListener> mListener; +	std::unique_ptr<LLPanelLoginListener> mListener;  	void updateLoginButtons();  	void populateUserList(LLPointer<LLCredential> credential); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 50d7074d4b..f9e29c0a92 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -61,6 +61,8 @@ public:  	void openApearanceTab(const std::string& tab_name); +    bool isCOFPanelActive() const; +  protected:  	void updateVerbs(); @@ -73,7 +75,6 @@ private:  protected:  	void 					initTabPanels();  	void 					onTabChange(); -	bool 					isCOFPanelActive() const;  	bool 					isOutfitsListPanelActive() const;  	bool 					isOutfitsGalleryPanelActive() const; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 3fbaad4dee..307935f45f 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -650,6 +650,8 @@ BOOL LLPanelProfileClassified::postBuild()      mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelProfileClassified::onTextureSelected, this));      mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseEnter, this));      mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseLeave, this)); +    mSnapshotCtrl->setAllowLocalTexture(FALSE); +    mSnapshotCtrl->setBakeTextureEnabled(FALSE);      mEditIcon->setVisible(false);      mMapButton->setCommitCallback(boost::bind(&LLPanelProfileClassified::onMapClick, this)); @@ -667,7 +669,7 @@ BOOL LLPanelProfileClassified::postBuild()          mCategoryCombo->add(LLTrans::getString(iter->second));      } -    mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this), NULL); +    mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onTitleChange, this), NULL);      mClassifiedDescEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this));      mCategoryCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this));      mContentTypeCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); @@ -935,6 +937,8 @@ void LLPanelProfileClassified::onCancelClick()      }      else      { +        updateTabLabel(mClassifiedNameText->getValue()); +          // Reload data to undo changes to forms          LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());      } @@ -955,7 +959,7 @@ void LLPanelProfileClassified::onSaveClick()      }      if(isNew() || isNewWithErrors())      { -        if(gStatusBar->getBalance() < getPriceForListing()) +        if(gStatusBar->getBalance() < MINIMUM_PRICE_FOR_LISTING)          {              LLNotificationsUtil::add("ClassifiedInsufficientFunds");              return; @@ -1403,6 +1407,12 @@ void LLPanelProfileClassified::onChange()      enableSave(isDirty());  } +void LLPanelProfileClassified::onTitleChange() +{ +    updateTabLabel(getClassifiedName()); +    onChange(); +} +  void LLPanelProfileClassified::doSave()  {      //*TODO: Fix all of this @@ -1428,6 +1438,14 @@ void LLPanelProfileClassified::doSave()  void LLPanelProfileClassified::onPublishFloaterPublishClicked()  { +    if (mPublishFloater->getPrice() < MINIMUM_PRICE_FOR_LISTING) +    { +        LLSD args; +        args["MIN_PRICE"] = MINIMUM_PRICE_FOR_LISTING; +        LLNotificationsUtil::add("MinClassifiedPrice", args); +        return; +    } +      setPriceForListing(mPublishFloater->getPrice());      doSave(); diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 912819e86b..d1aa5f55e3 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -257,6 +257,7 @@ protected:      void onSetLocationClick();      void onChange(); +    void onTitleChange();      void onPublishFloaterPublishClicked(); diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index ff3f654d0e..5826621645 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -252,6 +252,8 @@ void LLPanelProfilePicks::onClickNewBtn()          select_tab(true).          label(pick_panel->getPickName()));      updateButtons(); + +    pick_panel->addLocationChangedCallbacks();  }  void LLPanelProfilePicks::onClickDelete() @@ -488,6 +490,8 @@ LLPanelProfilePick::LLPanelProfilePick()   , mLocationChanged(false)   , mNewPick(false)   , mIsEditing(false) + , mRegionCallbackConnection() + , mParcelCallbackConnection()  {  } @@ -505,6 +509,15 @@ LLPanelProfilePick::~LLPanelProfilePick()      {          LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);      } + +    if (mRegionCallbackConnection.connected()) +    { +        mRegionCallbackConnection.disconnect(); +    } +    if (mParcelCallbackConnection.connected()) +    { +        mParcelCallbackConnection.disconnect(); +    }  }  void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id) @@ -581,6 +594,8 @@ BOOL LLPanelProfilePick::postBuild()      mSnapshotCtrl = getChild<LLTextureCtrl>("pick_snapshot");      mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this)); +    mSnapshotCtrl->setAllowLocalTexture(FALSE); +    mSnapshotCtrl->setBakeTextureEnabled(FALSE);      childSetAction("teleport_btn", boost::bind(&LLPanelProfilePick::onClickTeleport, this));      childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this)); @@ -670,6 +685,7 @@ void LLPanelProfilePick::setSnapshotId(const LLUUID& id)  void LLPanelProfilePick::setPickName(const std::string& name)  {      mPickName->setValue(name); +    mPickNameStr = name;  }  const std::string LLPanelProfilePick::getPickName() @@ -778,6 +794,18 @@ void LLPanelProfilePick::onClickSetLocation()  void LLPanelProfilePick::onClickSave()  { +    if (mRegionCallbackConnection.connected()) +    { +        mRegionCallbackConnection.disconnect(); +    } +    if (mParcelCallbackConnection.connected()) +    { +        mParcelCallbackConnection.disconnect(); +    } +    if (mLocationChanged)  +    { +        onClickSetLocation(); +    }      sendUpdate();      mLocationChanged = false; @@ -785,6 +813,7 @@ void LLPanelProfilePick::onClickSave()  void LLPanelProfilePick::onClickCancel()  { +    updateTabLabel(mPickNameStr);      LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId());      mLocationChanged = false;      enableSaveButton(FALSE); @@ -824,6 +853,13 @@ void LLPanelProfilePick::processParcelInfo(const LLParcelData& parcel_data)      }  } +void LLPanelProfilePick::addLocationChangedCallbacks() +{ +    mRegionCallbackConnection = gAgent.addRegionChangedCallback([this]() { onClickSetLocation(); }); +    mParcelCallbackConnection = gAgent.addParcelChangedCallback([this]() { onClickSetLocation(); }); +} + +  void LLPanelProfilePick::sendUpdate()  {      LLPickData pick_data; diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index f84463cc9b..d56f786ff1 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -140,7 +140,9 @@ public:      void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; }      void setErrorStatus(S32 status, const std::string& reason) override {}; -protected: +    void addLocationChangedCallbacks(); + +  protected:      /**       * Sends remote parcel info request to resolve parcel name from its ID. @@ -237,6 +239,10 @@ protected:      LLUUID mParcelId;      LLUUID mPickId;      LLUUID mRequestedId; +    std::string mPickNameStr; + +    boost::signals2::connection mRegionCallbackConnection; +    boost::signals2::connection mParcelCallbackConnection;      bool mLocationChanged;      bool mNewPick; diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 17b8ec0683..664e240484 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -114,7 +114,7 @@ public:  	void handleTerrainLinksetsResult(const LLSD &pContent);  	void handleTerrainLinksetsError(); -    typedef boost::shared_ptr<LinksetsResponder> ptr_t; +    typedef std::shared_ptr<LinksetsResponder> ptr_t;  protected: @@ -139,7 +139,7 @@ private:  	LLPathfindingObjectPtr                          mTerrainLinksetPtr;  }; -typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr; +typedef std::shared_ptr<LinksetsResponder> LinksetsResponderPtr;  //---------------------------------------------------------------------------  // LLPathfindingManager diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index bb44f780c8..258d0fdef7 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -107,8 +107,8 @@ private:      void navMeshStatusRequestCoro(std::string url, U64 regionHandle, bool isGetStatusOnly);      void navAgentStateRequestCoro(std::string url);      void navMeshRebakeCoro(std::string url, rebake_navmesh_callback_t rebakeNavMeshCallback); -    void linksetObjectsCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; -    void linksetTerrainCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; +    void linksetObjectsCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; +    void linksetTerrainCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const;      void charactersCoro(std::string url, request_id_t requestId, object_request_callback_t callback) const;  	//void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 87f32b8d56..ddc886f01c 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -39,7 +39,7 @@  class LLPathfindingNavMesh;  class LLUUID; -typedef boost::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr; +typedef std::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr;  class LLPathfindingNavMesh  { diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index baa1cc5979..b76f4421a6 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -114,7 +114,7 @@ private:  		LLPathfindingNavMesh::navmesh_slot_t        mNavMeshSlot;  	}; -	typedef boost::shared_ptr<NavMeshLocation> NavMeshLocationPtr; +	typedef std::shared_ptr<NavMeshLocation> NavMeshLocationPtr;  	typedef std::vector<NavMeshLocationPtr> NavMeshLocationPtrs;  	void handleNavMeshLocation(); diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index b8d3ca2364..0114cce3f1 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -41,7 +41,7 @@  class LLPathfindingObject;  class LLSD; -typedef boost::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr; +typedef std::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr;  class LLPathfindingObject  { diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 61580582d3..e2e0dce4da 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -36,7 +36,7 @@  class LLPathfindingObjectList; -typedef boost::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr; +typedef std::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr;  typedef std::map<std::string, LLPathfindingObjectPtr> LLPathfindingObjectMap;  class LLPathfindingObjectList diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 975e2bb910..ea7d4800e0 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -653,7 +653,7 @@ void LLPreviewTexture::adjustAspectRatio()  			{  				// No existing ratio found, create an element that will show image at original ratio  				populateRatioList(); // makes sure previous custom ratio is cleared -				std::string ratio = boost::lexical_cast<std::string>(num)+":" + boost::lexical_cast<std::string>(denom); +				std::string ratio = std::to_string(num)+":" + std::to_string(denom);  				mRatiosList.push_back(ratio);  				combo->add(ratio);  				combo->setCurrentByIndex(mRatiosList.size()- 1); diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp index 5d051d0ebf..bedee32213 100644 --- a/indra/newview/llsculptidsize.cpp +++ b/indra/newview/llsculptidsize.cpp @@ -66,7 +66,7 @@ void LLSculptIDSize::inc(const LLDrawable *pdrawable, int sz)  	if (itLU.first == itLU.second)  	{ //register  		//llassert(mSizeInfo.get<tag_BY_DRAWABLE>().end() == mSizeInfo.get<tag_BY_DRAWABLE>().find(pdrawable)); -		mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, boost::make_shared<SizeSum>(sz), sculptId)); +		mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, std::make_shared<SizeSum>(sz), sculptId));  		total_size = sz;  	}  	else diff --git a/indra/newview/llsculptidsize.h b/indra/newview/llsculptidsize.h index 87ee417b86..679fcbd44c 100644 --- a/indra/newview/llsculptidsize.h +++ b/indra/newview/llsculptidsize.h @@ -52,7 +52,7 @@ public:  	struct Info  	{ -		typedef boost::shared_ptr<SizeSum> PtrSizeSum; +		typedef std::shared_ptr<SizeSum> PtrSizeSum;  		Info(const LLDrawable *drawable, int size, PtrSizeSum sizeInfo, LLUUID sculptId)  			: mDrawable(drawable) diff --git a/indra/newview/llsearchableui.h b/indra/newview/llsearchableui.h index 31f11eb8ef..84fcefb835 100644 --- a/indra/newview/llsearchableui.h +++ b/indra/newview/llsearchableui.h @@ -93,7 +93,7 @@ namespace ll  	{  		struct SearchableItem; -		typedef boost::shared_ptr< SearchableItem > SearchableItemPtr; +		typedef std::shared_ptr< SearchableItem > SearchableItemPtr;  		typedef std::vector< SearchableItemPtr > tSearchableItemList; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index aed9dba7ef..7571d361a4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -361,6 +361,15 @@ void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string      }  } +bool LLSidepanelAppearance::isCOFPanelVisible() +{ +    if (mPanelOutfitsInventory && mPanelOutfitsInventory->getVisible()) +    { +        return mPanelOutfitsInventory->isCOFPanelActive(); +    } +    return false; +} +  void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch)  {  	if (!mOutfitEdit || mOutfitEdit->getVisible() == visible) diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index bb9709a2b8..e67652d6f7 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -66,6 +66,8 @@ public:  	void updateToVisibility( const LLSD& new_visibility );  	LLPanelEditWearable* getWearable(){ return mEditWearable; } +    bool isCOFPanelVisible(); +  private:  	void onFilterEdit(const std::string& search_string);  	void onVisibilityChanged ( const LLSD& new_visibility ); diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index f6628293ee..9157d20f98 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -46,8 +46,6 @@  #include "llviewercontrol.h"  // HACK for destinations guide on startup  #include "llinventorymodel.h" // HACK to disable starter avatars button for NUX -#include <boost/foreach.hpp> -  LLToolBarView* gToolBarView = NULL;  static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); @@ -282,7 +280,7 @@ bool LLToolBarView::loadToolbars(bool force_default)  			LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode;  			mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setButtonType(button_type);  		} -		BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands) +		for (const LLCommandId::Params& command_params : toolbar_set.left_toolbar.commands)  		{  			if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT]))  			{ @@ -297,7 +295,7 @@ bool LLToolBarView::loadToolbars(bool force_default)  			LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode;  			mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setButtonType(button_type);  		} -		BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands) +		for (const LLCommandId::Params& command_params : toolbar_set.right_toolbar.commands)  		{  			if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]))  			{ @@ -312,7 +310,7 @@ bool LLToolBarView::loadToolbars(bool force_default)  			LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode;  			mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setButtonType(button_type);  		} -		BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands) +		for (const LLCommandId::Params& command_params : toolbar_set.bottom_toolbar.commands)  		{  			if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]))  			{ diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index f1f42afd81..5041c9f76f 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -431,7 +431,7 @@ private:  private:  	// a single media url with some data and an impl. -	boost::shared_ptr<LLPluginClassMedia> mMediaSource; +	std::shared_ptr<LLPluginClassMedia> mMediaSource;      LLMutex mLock;  	F64		mZoomFactor;  	LLUUID mTextureId; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9db9d97ddc..89784f4124 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -102,6 +102,7 @@  #include "llsceneview.h"  #include "llscenemonitor.h"  #include "llselectmgr.h" +#include "llsidepanelappearance.h"  #include "llspellcheckmenuhandler.h"  #include "llstatusbar.h"  #include "lltextureview.h" @@ -6655,6 +6656,13 @@ void handle_edit_outfit()  void handle_now_wearing()  { +    LLSidepanelAppearance *panel_appearance = dynamic_cast<LLSidepanelAppearance *>(LLFloaterSidePanelContainer::getPanel("appearance")); +    if (panel_appearance && panel_appearance->isInVisibleChain() && panel_appearance->isCOFPanelVisible()) +    { +        LLFloaterReg::findInstance("appearance")->closeFloater(); +        return; +    } +      LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing"));  } diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index ff2ee693fd..6b9df6df28 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -145,7 +145,7 @@ public:      virtual void notify(const std::vector<std::string>& filenames);  private: -    boost::shared_ptr<LLPluginClassMedia> mPlugin; +    std::shared_ptr<LLPluginClassMedia> mPlugin;  }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 55e43352bc..221ead7667 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -119,8 +119,6 @@  #include "llviewerregion.h"  #include "llfloaterregionrestarting.h" -#include <boost/foreach.hpp> -  #include "llnotificationmanager.h" //  #include "llexperiencecache.h" @@ -5626,7 +5624,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp  		BOOL caution = FALSE;  		S32 count = 0;  		std::string perms; -		BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS) +		for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS)  		{  			if ((orig_questions & script_perm.permbit)  				&& script_perm.caution) @@ -5870,7 +5868,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)  		S32 known_questions = 0;  		bool has_not_only_debit = questions ^ SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit;  		// check the received permission flags against each permission -		BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS) +		for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS)  		{  			if (questions & script_perm.permbit)  			{ diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp index afbe2c94de..aea06834b2 100644 --- a/indra/newview/llviewerparcelaskplay.cpp +++ b/indra/newview/llviewerparcelaskplay.cpp @@ -287,7 +287,7 @@ void LLViewerParcelAskPlay::saveSettings()              if ((iter_parcel->second.mDate.secondsSinceEpoch() + (F64SecondsImplicit)U32Days(30)) > LLTimer::getTotalSeconds())              {                  // write unexpired parcels -                std::string parcel_id = boost::lexical_cast<std::string>(iter_parcel->first); +                std::string parcel_id = std::to_string(iter_parcel->first);                  write_llsd[key][parcel_id] = LLSD();                  write_llsd[key][parcel_id]["mode"] = (LLSD::Integer)iter_parcel->second.mMode;                  write_llsd[key][parcel_id]["date"] = iter_parcel->second.mDate; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 3225299493..2bab50300b 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -592,7 +592,7 @@ std::string LLViewerShaderMgr::loadBasicShaders()  	std::map<std::string, std::string> attribs;  	attribs["MAX_JOINTS_PER_MESH_OBJECT"] =  -		boost::lexical_cast<std::string>(LLSkinningUtil::getMaxJointCount()); +		std::to_string(LLSkinningUtil::getMaxJointCount());      BOOL ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections"); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ccef006a07..346073b8a1 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -538,8 +538,8 @@ private:  	bool			mStatesDirty;  	U32			mCurrResolutionIndex; -	boost::scoped_ptr<LLWindowListener> mWindowListener; -	boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener; +	std::unique_ptr<LLWindowListener> mWindowListener; +	std::unique_ptr<LLViewerWindowListener> mViewerWindowListener;  	// Object temporarily hovered over while dragging  	LLPointer<LLViewerObject>	mDragHoveredObject; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fee00eb6f4..550be30919 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4283,6 +4283,15 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time)  				if (mTurning)  				{  					pelvis_rot_threshold *= 0.4f; +                    // account for fps, assume that above value is for ~60fps +                    constexpr F32 default_frame_sec = 0.016f; +                    F32 prev_frame_sec = LLFrameTimer::getFrameDeltaTimeF32(); +                    if (default_frame_sec > prev_frame_sec) +                    { +                        // reduce threshold since turn rate per second is constant, +                        // shorter frame means shorter turn. +                        pelvis_rot_threshold *= prev_frame_sec/default_frame_sec; +                    }  				}  				// am I done turning? diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 3725510b6a..c8d77a6e0b 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5952,7 +5952,7 @@ void LLVivoxVoiceClient::filePlaybackSetMode(bool vox, float speed)  }  //------------------------------------------------------------------------ -std::set<LLVivoxVoiceClient::sessionState::wptr_t> LLVivoxVoiceClient::sessionState::mSession; +std::set<LLVivoxVoiceClient::sessionState::wptr_t, std::owner_less<LLVivoxVoiceClient::sessionState::wptr_t>> LLVivoxVoiceClient::sessionState::mSession;  LLVivoxVoiceClient::sessionState::sessionState() : diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index e3ab99c675..d75d1b4b5d 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -294,8 +294,8 @@ protected:  		bool mAvatarIDValid;  		bool mIsSelf;  	}; -    typedef boost::shared_ptr<participantState> participantStatePtr_t; -    typedef boost::weak_ptr<participantState> participantStateWptr_t; +    typedef std::shared_ptr<participantState> participantStatePtr_t; +    typedef std::weak_ptr<participantState> participantStateWptr_t;      typedef std::map<const std::string, participantStatePtr_t> participantMap;      typedef std::map<const LLUUID, participantStatePtr_t> participantUUIDMap; @@ -303,10 +303,10 @@ protected:  	struct sessionState  	{      public: -        typedef boost::shared_ptr<sessionState> ptr_t; -        typedef boost::weak_ptr<sessionState> wptr_t; +        typedef std::shared_ptr<sessionState> ptr_t; +        typedef std::weak_ptr<sessionState> wptr_t; -        typedef boost::function<void(const ptr_t &)> sessionFunc_t; +        typedef std::function<void(const ptr_t &)> sessionFunc_t;          static ptr_t createSession();  		~sessionState(); @@ -370,7 +370,7 @@ protected:      private:          sessionState(); -        static std::set<wptr_t> mSession;   // canonical list of outstanding sessions. +        static std::set<wptr_t, std::owner_less<wptr_t>> mSession;   // canonical list of outstanding sessions.          std::set<wptr_t>::iterator  mMyIterator;    // used for delete          static void for_eachPredicate(const wptr_t &a, sessionFunc_t func); @@ -381,7 +381,7 @@ protected:          static bool testByCallerId(const LLVivoxVoiceClient::sessionState::wptr_t &a, LLUUID participantId);  	}; -    typedef boost::shared_ptr<sessionState> sessionStatePtr_t; +    typedef std::shared_ptr<sessionState> sessionStatePtr_t;      typedef std::map<std::string, sessionStatePtr_t> sessionMap; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ec2f490742..c5b6eca5ae 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4575,6 +4575,11 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&          }      } +    if (getClickAction() == CLICK_ACTION_IGNORE && !LLFloater::isVisible(gFloaterTools)) +    { +        return FALSE; +    } +  	BOOL ret = FALSE;  	LLVolume* volume = getVolume(); diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index aa8c79b0d2..0edabf358f 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -388,7 +388,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request)  	LLCoordGL pos(request["x"].asInteger(), request["y"].asInteger());  	bool has_pos(request.has("x") && request.has("y")); -	boost::scoped_ptr<LLView::TemporaryDrilldownFunc> tempfunc; +	std::unique_ptr<LLView::TemporaryDrilldownFunc> tempfunc;  	// Documentation for mouseDown(), mouseUp() and mouseMove() claims you  	// must either specify ["path"], or both of ["x"] and ["y"]. You MAY diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index b816f9a3b5..3c2c6d15c4 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -544,7 +544,7 @@ private:      const std::string mMethod;      const std::string mReplyPump;      LLTempBoundListener mBoundListener; -    boost::scoped_ptr<LLXMLRPCTransaction> mTransaction; +    std::unique_ptr<LLXMLRPCTransaction> mTransaction;  	LLXMLRPCTransaction::EStatus mPreviousStatus; // To detect state changes.  }; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index ba7e8d7298..a77c31eee3 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -188,7 +188,7 @@ public:  	virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); -	typedef boost::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; +	typedef std::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t;  private: diff --git a/indra/newview/skins/default/xui/en/floater_publish_classified.xml b/indra/newview/skins/default/xui/en/floater_publish_classified.xml index 84e0b489d0..3e68011b6c 100644 --- a/indra/newview/skins/default/xui/en/floater_publish_classified.xml +++ b/indra/newview/skins/default/xui/en/floater_publish_classified.xml @@ -25,6 +25,7 @@ Remember, Classified fees are non-refundable.      </text>      <spinner       decimal_digits="0" +     allow_digits_only="true"       follows="left|top"       font="SansSerif"       halign="left" @@ -36,7 +37,6 @@ Remember, Classified fees are non-refundable.       layout="topleft"       left="15"       value="50" -     min_val="50"       max_val="999999"       name="price_for_listing"       top_pad="10" diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index 4f7f87b6b0..4eddfb46e1 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -49,7 +49,7 @@ void LLCurl::Responder::failureResult(S32 status, const std::string& reason, con  void LLCurl::Responder::successResult(const LLSD& content) { }  void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { }  std::string LLCurl::Responder::dumpResponse() const { return "(failure)"; } -void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } +void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,std::shared_ptr<LLBufferArray> const &) { }  void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { }  void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { }  void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { } @@ -110,7 +110,7 @@ namespace tut  	{  		set_test_name("observer pointer"); -		boost::scoped_ptr<TestObserver> observer(new TestObserver()); +		std::unique_ptr<TestObserver> observer(new TestObserver());  		LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance();  		processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get()); diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 40243a8ad6..99b49c8b29 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -946,7 +946,7 @@ namespace tut  		typedef LLCloneIOFactory<LLPipeStringInjector> emitter_t;  		emitter_t* emitter = new emitter_t(  			new LLPipeStringInjector("suckers never play me")); -		boost::shared_ptr<LLChainIOFactory> factory(emitter); +		std::shared_ptr<LLChainIOFactory> factory(emitter);  		LLIOServerSocket* server = new LLIOServerSocket(  			mPool,  			mSocket, @@ -993,7 +993,7 @@ namespace tut  		LLPumpIO::chain_t chain;  		typedef LLCloneIOFactory<LLIOFuzz> emitter_t;  		emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); -		boost::shared_ptr<LLChainIOFactory> factory(emitter); +		std::shared_ptr<LLChainIOFactory> factory(emitter);  		LLIOServerSocket* server = new LLIOServerSocket(  			mPool,  			mSocket, @@ -1036,7 +1036,7 @@ namespace tut  		LLPumpIO::chain_t chain;  		typedef LLCloneIOFactory<LLIOFuzz> emitter_t;  		emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); -		boost::shared_ptr<LLChainIOFactory> factory(emitter); +		std::shared_ptr<LLChainIOFactory> factory(emitter);  		LLIOServerSocket* server = new LLIOServerSocket(  			mPool,  			mSocket, @@ -1079,7 +1079,7 @@ namespace tut  		LLPumpIO::chain_t chain;  		typedef LLCloneIOFactory<LLIOFuzz> emitter_t;  		emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); -		boost::shared_ptr<LLChainIOFactory> factory(emitter); +		std::shared_ptr<LLChainIOFactory> factory(emitter);  		LLIOServerSocket* server = new LLIOServerSocket(  			mPool,  			mSocket, @@ -1120,7 +1120,7 @@ namespace tut  		LLPumpIO::chain_t chain;  		typedef LLCloneIOFactory<LLIOSleeper> sleeper_t;  		sleeper_t* sleeper = new sleeper_t(new LLIOSleeper); -		boost::shared_ptr<LLChainIOFactory> factory(sleeper); +		std::shared_ptr<LLChainIOFactory> factory(sleeper);  		LLIOServerSocket* server = new LLIOServerSocket(  			mPool,  			mSocket, diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index 17f64a4953..a38de71e48 100644 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -368,10 +368,10 @@ void events_object::test<7>()  	LLEventStream bob("bob"); 		// should work, previous one unregistered  	LLEventStream bob1("bob", true);// allowed to tweak name  	ensure_equals("tweaked LLEventStream name", bob1.getName(), "bob1"); -	std::vector<boost::shared_ptr<LLEventStream> > streams; +	std::vector<std::shared_ptr<LLEventStream> > streams;  	for (int i = 2; i <= 10; ++i)  	{ -		streams.push_back(boost::shared_ptr<LLEventStream>(new LLEventStream("bob", true))); +		streams.push_back(std::shared_ptr<LLEventStream>(new LLEventStream("bob", true)));  	}  	ensure_equals("last tweaked LLEventStream name", streams.back()->getName(), "bob10");  } diff --git a/indra/test/test.cpp b/indra/test/test.cpp index a265e1273b..fba7a48bb4 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -160,12 +160,12 @@ public:  	virtual void reset()  	{ -		boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset(); +		std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset();  	}  	virtual void replay(std::ostream& out)  	{ -		boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out); +		std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out);  	}  private: @@ -179,7 +179,7 @@ class LLTestCallback : public chained_callback  public:  	LLTestCallback(bool verbose_mode, std::ostream *stream, -				   boost::shared_ptr<LLReplayLog> replayer) : +				   std::shared_ptr<LLReplayLog> replayer) :  		mVerboseMode(verbose_mode),  		mTotalTests(0),  		mPassedTests(0), @@ -187,7 +187,7 @@ public:  		mSkippedTests(0),  		// By default, capture a shared_ptr to std::cout, with a no-op "deleter"  		// so that destroying the shared_ptr makes no attempt to delete std::cout. -		mStream(boost::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})), +		mStream(std::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})),  		mReplayer(replayer)  	{  		if (stream) @@ -201,7 +201,7 @@ public:  			// Allocate and assign in two separate steps, per Herb Sutter.  			// (Until we turn on C++11 support, have to wrap *stream with  			// boost::ref() due to lack of perfect forwarding.) -			boost::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream))); +			std::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream)));  			mStream = pstream;  		}  	} @@ -325,8 +325,8 @@ protected:  	int mPassedTests;  	int mFailedTests;  	int mSkippedTests; -	boost::shared_ptr<std::ostream> mStream; -	boost::shared_ptr<LLReplayLog> mReplayer; +	std::shared_ptr<std::ostream> mStream; +	std::shared_ptr<LLReplayLog> mReplayer;  };  // TeamCity specific class which emits service messages @@ -336,7 +336,7 @@ class LLTCTestCallback : public LLTestCallback  {  public:  	LLTCTestCallback(bool verbose_mode, std::ostream *stream, -					 boost::shared_ptr<LLReplayLog> replayer) : +					 std::shared_ptr<LLReplayLog> replayer) :  		LLTestCallback(verbose_mode, stream, replayer)  	{  	} @@ -549,7 +549,7 @@ int main(int argc, char **argv)  	apr_status_t apr_err;  	const char* opt_arg = NULL;  	int opt_id = 0; -	boost::scoped_ptr<llofstream> output; +	std::unique_ptr<llofstream> output;  	const char *touch = NULL;  	while(true) @@ -608,7 +608,7 @@ int main(int argc, char **argv)  	// set up logging  	const char* LOGFAIL = getenv("LOGFAIL"); -	boost::shared_ptr<LLReplayLog> replayer{boost::make_shared<LLReplayLog>()}; +	std::shared_ptr<LLReplayLog> replayer{std::make_shared<LLReplayLog>()};  	// Testing environment variables for both 'set' and 'not empty' allows a  	// user to suppress a pre-existing environment variable by forcing empty. diff --git a/indra/viewer_components/login/lllogin.h b/indra/viewer_components/login/lllogin.h index 051641ff59..de58ca0c29 100644 --- a/indra/viewer_components/login/lllogin.h +++ b/indra/viewer_components/login/lllogin.h @@ -121,7 +121,7 @@ public:  private:  	class Impl; -	boost::scoped_ptr<Impl> mImpl; +	std::unique_ptr<Impl> mImpl;  };  #endif // LL_LLLOGIN_H | 
