diff --git a/indra/cmake/LLFileSystem.cmake b/indra/cmake/LLFileSystem.cmake index 72bd42ebfdc9222d26eeb75683c1d942a1be4397..73137bffa5ad996c5a5cf98b0e146b8561c1c1f4 100644 --- a/indra/cmake/LLFileSystem.cmake +++ b/indra/cmake/LLFileSystem.cmake @@ -6,4 +6,4 @@ set(LLFILESYSTEM_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llfilesystem ) -set(LLFILESYSTEM_LIBRARIES llfilesystem ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_SYSTEM_LIBRARY} absl::strings) +set(LLFILESYSTEM_LIBRARIES llfilesystem ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_SYSTEM_LIBRARY}) diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 37703d33fec40f01d8ff224bd89fd3d193125571..957c071cf2b699397252a344b8026bd4b12416b6 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -40,7 +40,7 @@ #include "llrefcount.h" #include "llsortedvector.h" -#include <absl/container/flat_hash_map.h> +#include "boost/unordered/unordered_flat_map.hpp" class LLPolyMesh; @@ -260,7 +260,7 @@ class LLCharacter protected: LLMotionController mMotionController; - typedef absl::flat_hash_map<std::string, void *> animation_data_map_t; + typedef boost::unordered_flat_map<std::string, void *, al::string_hash, std::equal_to<>> animation_data_map_t; animation_data_map_t mAnimationData; F32 mPreferredPelvisHeight; @@ -271,9 +271,9 @@ class LLCharacter private: // visual parameter stuff - typedef absl::flat_hash_map<S32, LLVisualParam *> visual_param_index_map_t; //Hash map for fast lookup. + typedef boost::unordered_flat_map<S32, LLVisualParam *> visual_param_index_map_t; //Hash map for fast lookup. typedef LLSortedVector<S32,LLVisualParam *> visual_param_sorted_vec_t; //Contiguous sorted array. - typedef absl::flat_hash_map<char *, LLVisualParam *> visual_param_name_map_t; + typedef boost::unordered_flat_map<char *, LLVisualParam *> visual_param_name_map_t; visual_param_sorted_vec_t::iterator mCurIterator; visual_param_sorted_vec_t mVisualParamSortedVector; diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index 23a6cdff7ec82ad39e1615fb22217672e2108de8..4ea938d6955c60664d1a339d352d98eeaa6ea139 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -43,7 +43,7 @@ #include "v3math.h" #include "llbvhconsts.h" -#include <absl/container/flat_hash_map.h> +#include "boost/unordered/unordered_flat_map.hpp" class LLKeyframeDataCache; class LLDataPacker; @@ -445,7 +445,7 @@ class LLKeyframeDataCache LLKeyframeDataCache() = default; ~LLKeyframeDataCache(); - typedef absl::flat_hash_map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t; + typedef boost::unordered_flat_map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t; static keyframe_data_map_t sKeyframeDataMap; static void addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList*); diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index 9ecfe28a85f083dc6259f140dfb42fc4b62a495c..101ce86650a42ee3fd14f22ac1edbb82d21c4cee 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -39,9 +39,9 @@ #include "llframetimer.h" #include "llstring.h" -#include "absl/container/node_hash_map.h" -#include "absl/container/flat_hash_map.h" -#include "absl/container/flat_hash_set.h" +#include "boost/unordered/unordered_map.hpp" +#include "boost/unordered/unordered_flat_map.hpp" +#include "boost/unordered/unordered_flat_set.hpp" //----------------------------------------------------------------------------- // Class predeclaration @@ -76,7 +76,7 @@ class LLMotionRegistry protected: - typedef absl::node_hash_map<LLUUID, LLMotionConstructor> motion_map_t; + typedef boost::unordered_map<LLUUID, LLMotionConstructor> motion_map_t; motion_map_t mMotionTable; }; @@ -87,7 +87,7 @@ class LLMotionController { public: typedef std::list<LLMotion*> motion_list_t; - typedef absl::flat_hash_set<LLMotion*> motion_set_t; + typedef boost::unordered_flat_set<LLMotion*> motion_set_t; BOOL mIsSelf; public: @@ -211,7 +211,7 @@ class LLMotionController // Once an animations is loaded, it will be initialized and put on the mLoadedMotions list. // Any animation that is currently playing also sits in the mActiveMotions list. - typedef absl::flat_hash_map<LLUUID, LLMotion*> motion_map_t; + typedef boost::unordered_flat_map<LLUUID, LLMotion*> motion_map_t; motion_map_t mAllMotions; motion_set_t mLoadingMotions; diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index 5ca078ada6f88ff833f67f684815cf937b329734..91175780d5b51ec59259c379834e825d7c909256 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -35,7 +35,7 @@ #include "lljoint.h" #include "llpointer.h" -#include <absl/container/flat_hash_map.h> +#include "boost/unordered/unordered_flat_map.hpp" #include <map> #include <string> @@ -109,7 +109,7 @@ class LLPoseBlender { protected: typedef std::list<LLJointStateBlender*> blender_list_t; - typedef absl::flat_hash_map<LLJoint*,LLJointStateBlender*> blender_map_t; + typedef boost::unordered_flat_map<LLJoint*,LLJointStateBlender*> blender_map_t; blender_map_t mJointStateBlenderPool; blender_list_t mActiveBlenders; diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 77469578cbab7c9d87e436db32b0f7a367c6267a..12de18fba77bb4da3228cc3ff0d91ea4e571f2ed 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -312,12 +312,8 @@ target_link_libraries( ${BOOST_SYSTEM_LIBRARY} ${GOOGLE_PERFTOOLS_LIBRARIES} ${URIPARSER_LIBRARIES} - absl::synchronization absl::flat_hash_map absl::node_hash_map - absl::random_random - absl::random_bit_gen_ref - absl::strings nlohmann_json::nlohmann_json fmt::fmt ${TRACY_LIBRARY} @@ -340,8 +336,10 @@ if(USE_PRECOMPILED_HEADERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15.0") <string> <string_view> <thread> - <absl/container/node_hash_map.h> - <absl/container/flat_hash_map.h> + <boost/unordered/unordered_flat_map.hpp> + <boost/unordered/unordered_flat_set.hpp> + <boost/unordered/unordered_map.hpp> + <boost/unordered/unordered_set.hpp> <fmt/format.h> <fmt/compile.h> ) diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index bf475da8c0d7adbe37fd9251e8a81e77d67fefc6..6c11f2992ebcf18b00414bc6b32247f8e72d438c 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -148,7 +148,7 @@ LLVolatileAPRPool::LLVolatileAPRPool(std::string name, BOOL is_local, apr_pool_t //create mutex if(!is_local) //not a local apr_pool, that is: shared by multiple threads. { - mMutexp = std::make_unique<absl::Mutex>(); + mMutexp = std::make_unique<std::mutex>(); } } @@ -169,7 +169,7 @@ apr_pool_t* LLVolatileAPRPool::getAPRPool() apr_pool_t* LLVolatileAPRPool::getVolatileAPRPool() { - absl::MutexLockMaybe lock(mMutexp.get()) ; + LLScopedLock lock(mMutexp.get()) ; mNumTotalRef++ ; mNumActiveRef++ ; @@ -184,7 +184,7 @@ apr_pool_t* LLVolatileAPRPool::getVolatileAPRPool() void LLVolatileAPRPool::clearVolatileAPRPool() { - absl::MutexLockMaybe lock(mMutexp.get()); + LLScopedLock lock(mMutexp.get()); if(mNumActiveRef > 0) { diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 72896fb0529dd420eb1d7a540c86f93e5e9cb768..e6997f741794ec43b639d4ab28871848aded3c5f 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -41,8 +41,6 @@ #include "llstring.h" -#include "absl/synchronization/mutex.h" - struct apr_dso_handle_t; /** * @brief Function which appropriately logs error or remains quiet on @@ -119,7 +117,7 @@ class LL_COMMON_API LLVolatileAPRPool final : public LLAPRPool S32 mNumActiveRef ; //number of active pointers pointing to the apr_pool. S32 mNumTotalRef ; //number of total pointers pointing to the apr_pool since last creating. - std::unique_ptr<absl::Mutex> mMutexp; + std::unique_ptr<std::mutex> mMutexp; } ; // File IO convenience functions. diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index f73ad60cfe63d9b041b347b1dea78f3f6d56e3ab..c344f1da71076f920280310055f595c15184c449 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -142,7 +142,7 @@ const char *LLAssetType::lookup(LLAssetType::EType asset_type) // static LLAssetType::EType LLAssetType::lookup(const char* name) { - return lookup(absl::NullSafeStringView(name)); + return lookup(ll_safe_string(name)); } // static @@ -180,7 +180,7 @@ const char *LLAssetType::lookupHumanReadable(LLAssetType::EType asset_type) // static LLAssetType::EType LLAssetType::lookupHumanReadable(const char* name) { - return lookupHumanReadable(absl::NullSafeStringView(name)); + return lookupHumanReadable(ll_safe_string(name)); } // static diff --git a/indra/llcommon/llbase64.cpp b/indra/llcommon/llbase64.cpp index 6683ef7fc72ff5132661d484c7bf8b7165da0036..035ed6717b4d42b51d44ca0e555290133cde3360 100644 --- a/indra/llcommon/llbase64.cpp +++ b/indra/llcommon/llbase64.cpp @@ -54,17 +54,17 @@ std::string LLBase64::encode(const U8* input, size_t input_size) } // static -std::string LLBase64::encode(const std::string& in_str) +std::string LLBase64::encode(std::string_view in_str) { size_t data_size = in_str.size(); std::vector<U8> data; data.resize(data_size); - memcpy(&data[0], in_str.c_str(), data_size); + memcpy(&data[0], in_str.data(), data_size); return encode(&data[0], data_size); } // static -size_t LLBase64::decode(const std::string& input, U8 * buffer, size_t buffer_size) +size_t LLBase64::decode(std::string_view input, U8 * buffer, size_t buffer_size) { if (input.empty()) return 0; @@ -72,7 +72,7 @@ size_t LLBase64::decode(const std::string& input, U8 * buffer, size_t buffer_siz BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); // BIO_new_mem_buf is not const aware, but it doesn't modify the buffer - BIO *bio = BIO_new_mem_buf(const_cast<char*>(input.c_str()), input.length()); + BIO *bio = BIO_new_mem_buf(const_cast<char*>(input.data()), input.length()); bio = BIO_push(b64, bio); size_t bytes_written = BIO_read(bio, buffer, buffer_size); BIO_free_all(bio); @@ -80,7 +80,7 @@ size_t LLBase64::decode(const std::string& input, U8 * buffer, size_t buffer_siz return bytes_written; } -std::string LLBase64::decode(const std::string& input) +std::string LLBase64::decode(std::string_view input) { U32 buffer_len = LLBase64::requiredDecryptionSpace(input); std::vector<U8> buffer(buffer_len); @@ -90,7 +90,7 @@ std::string LLBase64::decode(const std::string& input) } // static -size_t LLBase64::requiredDecryptionSpace(const std::string& str) +size_t LLBase64::requiredDecryptionSpace(std::string_view str) { size_t len = str.length(); U32 padding = 0; diff --git a/indra/llcommon/llbase64.h b/indra/llcommon/llbase64.h index 064da10a1f4d348fdd1873e383eaa4f9e45ee53f..3be6159c7d4b2f2a005fa6d47d261af7d400c174 100644 --- a/indra/llcommon/llbase64.h +++ b/indra/llcommon/llbase64.h @@ -31,11 +31,11 @@ class LL_COMMON_API LLBase64 { public: - static std::string encode(const std::string& in_str); + static std::string encode(std::string_view in_str); static std::string encode(const U8* input, size_t input_size); - static size_t decode(const std::string& input, U8 * buffer, size_t buffer_size); - static std::string decode(const std::string& input); - static size_t requiredDecryptionSpace(const std::string& str); + static size_t decode(std::string_view input, U8 * buffer, size_t buffer_size); + static std::string decode(std::string_view input); + static size_t requiredDecryptionSpace(std::string_view str); }; #endif diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 8cdd8f94ecd1440a643da5842bd98a234375f30a..3855ab3df9c629c5a35b20563e66779ab6ec5e49 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -47,8 +47,7 @@ #include <string_view> #include "string.h" -#include "absl/synchronization/mutex.h" -#include "absl/container/flat_hash_map.h" +#include "boost/unordered/unordered_flat_map.hpp" #include "llapp.h" #include "llapr.h" @@ -500,7 +499,7 @@ namespace } - typedef absl::flat_hash_map<std::string, LLError::ELevel> LevelMap; + typedef boost::unordered_flat_map<std::string, LLError::ELevel> LevelMap; typedef std::vector<LLError::RecorderPtr> Recorders; typedef std::vector<LLError::CallSite*> CallSiteVector; @@ -1388,7 +1387,7 @@ namespace LLError if (site.mClassInfo != typeid(NoClassInfo)) #endif // LL_LINUX { - function_name = absl::StrCat(class_name, "::", function_name); + function_name = fmt::format(FMT_COMPILE("{}::{}"), class_name, function_name); } ELevel compareLevel = s->mDefaultLevel; diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 24338b5cb6dede8b26c2f1c9391847141e38402d..7cf05f5247838357366352b9e75d7b7c94df0b44 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -34,7 +34,10 @@ #include <boost/shared_ptr.hpp> #include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_enum.hpp> -#include <absl/container/node_hash_map.h> +#include "boost/unordered/unordered_flat_map.hpp" +#include "boost/unordered/unordered_flat_set.hpp" +#include "boost/unordered/unordered_map.hpp" +#include "boost/unordered/unordered_set.hpp" #include "llerror.h" #include "llstl.h" @@ -262,7 +265,7 @@ namespace LLInitParam private: struct Inaccessable{}; public: - typedef absl::flat_hash_map<std::string, T> value_name_map_t; + typedef boost::unordered_flat_map<std::string, T> value_name_map_t; typedef Inaccessable name_t; typedef TypeValues<T> type_value_t; typedef ParamValue<typename LLTypeTags::Sorted<T>::value_t> param_value_t; @@ -324,7 +327,7 @@ namespace LLInitParam { typedef TypeValuesHelper<T, DERIVED_TYPE, IS_SPECIALIZED> self_t; public: - typedef typename absl::flat_hash_map<std::string, T> value_name_map_t; + typedef typename boost::unordered_flat_map<std::string, T, al::string_hash, std::equal_to<>> value_name_map_t; typedef std::string name_t; typedef self_t type_value_t; typedef ParamValue<typename LLTypeTags::Sorted<T>::value_t> param_value_t; @@ -558,9 +561,9 @@ namespace LLInitParam typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&); typedef boost::function<void (name_stack_t&, S32, S32, const possible_values_t*)> parser_inspect_func_t; - typedef absl::flat_hash_map<const std::type_info*, parser_read_func_t> parser_read_func_map_t; - typedef absl::flat_hash_map<const std::type_info*, parser_write_func_t> parser_write_func_map_t; - typedef absl::flat_hash_map<const std::type_info*, parser_inspect_func_t> parser_inspect_func_map_t; + typedef boost::unordered_flat_map<const std::type_info*, parser_read_func_t> parser_read_func_map_t; + typedef boost::unordered_flat_map<const std::type_info*, parser_write_func_t> parser_write_func_map_t; + typedef boost::unordered_flat_map<const std::type_info*, parser_inspect_func_t> parser_inspect_func_map_t; public: @@ -726,7 +729,7 @@ namespace LLInitParam void aggregateBlockData(BlockDescriptor& src_block_data); void addParam(ParamDescriptorPtr param, const char* name); - typedef absl::node_hash_map<std::string, ParamDescriptorPtr> param_map_t; + typedef boost::unordered_map<std::string, ParamDescriptorPtr> param_map_t; typedef std::vector<ParamDescriptorPtr> param_list_t; typedef std::list<ParamDescriptorPtr> all_params_list_t; typedef std::vector<std::pair<param_handle_t, ParamDescriptor::validation_func_t> > param_validation_list_t; diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 407473a5221aa44c8f37c36098cafc92aa6ed60c..9ef1217197169b6cc0d4dce0f07baff96c41930d 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -33,8 +33,6 @@ #include "llmetricperformancetester.h" #include "llfasttimer.h" -#include <absl/strings/str_format.h> - //---------------------------------------------------------------------------------------------- // LLMetricPerformanceTesterBasic : static methods and testers management //---------------------------------------------------------------------------------------------- diff --git a/indra/llcommon/llmutex.cpp b/indra/llcommon/llmutex.cpp index 638ff7e9285fc61f61ce56127f78496ec1730286..4de4d9e58ecf4916ca1112b0f763b541a6806e7f 100644 --- a/indra/llcommon/llmutex.cpp +++ b/indra/llcommon/llmutex.cpp @@ -151,4 +151,36 @@ void LLCondition::broadcast() mCond.notify_all(); } +//--------------------------------------------------------------------- +// +// LLScopedLock +// +LLScopedLock::LLScopedLock(std::mutex* mutex) : mMutex(mutex) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD + if(mutex) + { + mutex->lock(); + mLocked = true; + } + else + { + mLocked = false; + } +} + +LLScopedLock::~LLScopedLock() +{ + unlock(); +} + +void LLScopedLock::unlock() +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD + if(mLocked) + { + mLocked = false; + mMutex->unlock(); + } +} //============================================================================ diff --git a/indra/llcommon/llpounceable.h b/indra/llcommon/llpounceable.h index e009694c5774e513c5ab68d0b67e52faa39edf3f..7fb59d47366684f7de9a6dc76849c54022c28e82 100644 --- a/indra/llcommon/llpounceable.h +++ b/indra/llcommon/llpounceable.h @@ -40,8 +40,8 @@ #include <boost/call_traits.hpp> #include <boost/type_traits/remove_pointer.hpp> #include <boost/utility/value_init.hpp> +#include <boost/unordered_map.hpp> #include <boost/signals2/signal.hpp> -#include <absl/container/node_hash_map.h> // Forward declare the user template, since we want to be able to point to it // in some of its implementation classes. @@ -86,7 +86,7 @@ class LLPounceableQueueSingleton final : // instance will call on the SAME LLPounceableQueueSingleton instance -- // given how class statics work. We must keep a separate queue for each // LLPounceable instance. Use a hash map for that. - typedef absl::node_hash_map<owner_ptr, signal_t> map_t; + typedef boost::unordered_map<owner_ptr, signal_t> map_t; public: // Disambiguate queues belonging to different LLPounceables. diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index 5fd210f608e338d36a83d13cff83a9f0242a1151..980c4295a06a4a7c77b755f32ae75a1c60d80334 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -34,8 +34,6 @@ #include "llrefcount.h" #include "llsd.h" -#include "absl/strings/str_format.h" - /** * @class LLSDParser * @brief Abstract base class for LLSD parsers. diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index a48302cf00d8dcfae7058cc3d43e2922a6067b4f..95ac4fdda0d7a58783c0421643f5ab3ebc39c5b4 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -26,7 +26,7 @@ #define LLSINGLETON_H #include <boost/noncopyable.hpp> -#include "absl/container/node_hash_set.h" +#include <boost/unordered_set.hpp> #include <initializer_list> #include <list> #include <typeinfo> @@ -52,7 +52,7 @@ class LLSingletonBase: private boost::noncopyable static vec_t dep_sort(); // we directly depend on these other LLSingletons - typedef absl::node_hash_set<LLSingletonBase*> set_t; + typedef boost::unordered_set<LLSingletonBase*> set_t; set_t mDepends; protected: diff --git a/indra/llcommon/llstaticstringtable.h b/indra/llcommon/llstaticstringtable.h index 7053ae3f17002393882a4338e054db238dd44724..4fc86695edc461437b9e267292eb106032797192 100644 --- a/indra/llcommon/llstaticstringtable.h +++ b/indra/llcommon/llstaticstringtable.h @@ -29,8 +29,7 @@ #define LL_STATIC_STRING_TABLE_H #include "lldefs.h" -#include "absl/hash/hash.h" -#include "absl/container/flat_hash_map.h" +#include "boost/unordered/unordered_flat_map.hpp" #include "llstl.h" class LLStaticHashedString @@ -52,7 +51,7 @@ class LLStaticHashedString size_t makehash(const std::string& s) { - return absl::Hash<std::string>{}(s); + return boost::hash<std::string>{}(s); } std::string string; @@ -66,7 +65,7 @@ struct LLStaticStringHasher }; template< typename MappedObject > -using LLStaticStringTable = absl::flat_hash_map<LLStaticHashedString, MappedObject, LLStaticStringHasher>; +using LLStaticStringTable = boost::unordered_flat_map<LLStaticHashedString, MappedObject, LLStaticStringHasher>; #endif diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 6a99937877e13051e94a0c3ca084ec07a1d54ba5..1bc68089eb64917e5908c3f30d88ab7c21cdcc34 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -933,7 +933,7 @@ boost::optional<std::string> llstring_getoptenv(const std::string& key) long LLStringOps::sPacificTimeOffset = 0; long LLStringOps::sLocalTimeOffset = 0; bool LLStringOps::sPacificDaylightTime = 0; -absl::flat_hash_map<std::string, std::string> LLStringOps::datetimeToCodes; +boost::unordered_flat_map<std::string, std::string, al::string_hash, std::equal_to<>> LLStringOps::datetimeToCodes; std::vector<std::string> LLStringOps::sWeekDayList; std::vector<std::string> LLStringOps::sWeekDayShortList; @@ -1224,7 +1224,7 @@ bool LLStringUtil::simpleReplacement(std::string &replacement, std::string token return true; } // if not, see if there's one WITH brackets - iter = substitutions.find(absl::StrCat("[", token, "]")); + iter = substitutions.find(fmt::format(FMT_COMPILE("[{}]"), token)); if (iter != substitutions.end()) { replacement = iter->second; @@ -1249,7 +1249,7 @@ bool LLStringUtil::simpleReplacement(std::string &replacement, std::string token } // if not, see if there's one WITH brackets - std::string temp_token = absl::StrCat("[", token, "]"); + std::string temp_token = fmt::format(FMT_COMPILE("[{}]"), token); if (substitutions.has(temp_token)) { replacement = substitutions[temp_token].asString(); diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 4f22f3d098cda0a1efd1dcbc1cadd3d8bc300aba..c4316d8a4a23724512307961f4efea217cdf16f9 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -33,7 +33,7 @@ #endif #include <boost/call_traits.hpp> #include <boost/optional/optional.hpp> -#include <absl/container/flat_hash_map.h> +#include <boost/unordered/unordered_flat_map.hpp> #if LL_GNUC && GCC_VERSION >= 90000 #pragma GCC diagnostic pop #endif @@ -152,6 +152,18 @@ struct char_traits<U16> }; #endif +namespace al +{ + struct string_hash + { + using hash_type = boost::hash<std::string_view>; + using is_transparent = void; + [[nodiscard]] size_t operator()(const char* txt) const { return hash_type{}(txt); } + [[nodiscard]] size_t operator()(std::string_view txt) const { return hash_type{}(txt); } + [[nodiscard]] size_t operator()(const std::string& txt) const { return hash_type{}(txt); } + }; +} + class LL_COMMON_API LLStringOps { private: @@ -159,7 +171,7 @@ class LL_COMMON_API LLStringOps static long sLocalTimeOffset; static bool sPacificDaylightTime; - static absl::flat_hash_map<std::string, std::string> datetimeToCodes; + static boost::unordered_flat_map<std::string, std::string, al::string_hash, std::equal_to<>> datetimeToCodes; public: static std::vector<std::string> sWeekDayList; diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index b29592944c03966d9b43457fd5d9e4cf04c77960..19db7f0c4d41a745257d506069fb3320f84a921d 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -220,7 +220,7 @@ void LLUUID::toCompressedString(char *out) const BOOL LLUUID::set(const char* in_string, BOOL emit) { - return set(absl::NullSafeStringView(in_string),emit); + return set(ll_safe_string(in_string), emit); } BOOL LLUUID::parseInternalScalar(const char* in_string, bool broken_format, bool emit) diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index c11e31127c807b9d5ad88dbdd1e1ab2b40726ae9..a7a8f6b47ae1b1a63e2e094d831e344c8b2d2298 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -36,7 +36,6 @@ #include <immintrin.h> #include "absl/hash/hash.h" -#include "absl/strings/str_format.h" class LLMutex; @@ -203,18 +202,6 @@ class LL_COMMON_API LLUUID return H::combine_contiguous(std::move(h), id.mData, UUID_BYTES); } - friend absl::FormatConvertResult<absl::FormatConversionCharSet::kString> - AbslFormatConvert(const LLUUID& id, - const absl::FormatConversionSpec& spec, - absl::FormatSink* s) { - if (spec.conversion_char() == absl::FormatConversionChar::s) { - char uuid_str[UUID_STR_SIZE] = {}; // will be null-terminated - id.to_chars(uuid_str); - s->Append(uuid_str); - } - return { true }; - } - // xor functions. Useful since any two random uuids xored together // will yield a determinate third random unique id that can be // used as a key in a single uuid that represents 2. diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 7eefaf20546c4d9d867de002b9bbea2469e36d70..810980c412b4da3e3634c456eda7464d66117a40 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -59,7 +59,6 @@ using namespace boost::phoenix; #include "../test/lltut.h" #include "../test/namedtempfile.h" #include "stringize.h" -#include "llrand.h" std::vector<U8> string_to_vector(const std::string& str) { @@ -1661,7 +1660,7 @@ namespace tut for(int ii = 0; ii < 100; ++ii) { srand(ii); /* Flawfinder: ignore */ - S32 size = ll_rand() % 100 + 10; + S32 size = rand() % 100 + 10; std::generate_n( std::back_insert_iterator<buf_t>(val), size, @@ -1795,7 +1794,7 @@ namespace tut set_test_name("verify NamedTempFile"); python("platform", "import sys\n" - "print('Running on %s' % sys.platform)\n"); + "print('Running on', sys.platform)\n"); } // helper for test<3> @@ -1852,10 +1851,10 @@ namespace tut import_llsd << "def parse_each(iterable):\n" " for item in iterable:\n" - " yield llsd.parse(item.encode(\"utf-8\"))\n" << + " yield llsd.parse(item)\n" << pydata << // Don't forget raw-string syntax for Windows pathnames. - "verify(parse_each(open(r'" << file.getName() << "')))\n"); + "verify(parse_each(open(r'" << file.getName() << "', 'rb')))\n"); } template<> template<> @@ -1883,7 +1882,7 @@ namespace tut // N.B. Using 'print' implicitly adds newlines. "with open(r'" << file.getName() << "', 'w') as f:\n" " for item in DATA:\n" - " print(llsd.format_notation(item).decode(\"utf-8\"), file=f)\n"); + " print(llsd.format_notation(item).decode(), file=f)\n"); std::ifstream inf(file.getName().c_str()); LLSD item; diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index af9042d5a9bed768a9b0313d9bd1841193331cbe..9ec643ff169a4e7676b20c462c2c4664839d9bb3 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -73,7 +73,6 @@ target_link_libraries(llfilesystem PUBLIC ${LLCOMMON_LIBRARIES} ${cache_BOOST_LIBRARIES} - absl::strings ) if (WINDOWS) @@ -108,7 +107,7 @@ if (LL_TESTS) LL_ADD_PROJECT_UNIT_TESTS(llfilesystem "${llfilesystem_TEST_SOURCE_FILES}") # INTEGRATION TESTS - set(test_libs llmath llcommon llfilesystem ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES} absl::strings) + set(test_libs llmath llcommon llfilesystem ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. LL_ADD_INTEGRATION_TEST(lldir "" "${test_libs}") diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 136a45cd3e611c5c87730b36a2eb764331a683db..48f8c39951ce209b965f415fd284c21181524471 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -60,7 +60,7 @@ void LLDiskCache::createCache() std::vector<std::string> uuidprefix = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; for (auto& prefixchar : uuidprefix) { - LLFile::mkdir(absl::StrCat(sCacheDir, gDirUtilp->getDirDelimiter(), prefixchar)); + LLFile::mkdir(fmt::format("{}{}{}", sCacheDir, gDirUtilp->getDirDelimiter(), prefixchar)); } prepopulateCacheWithStatic(); } @@ -286,7 +286,7 @@ const std::string LLDiskCache::metaDataToFilepath(const LLUUID& id, { std::string uuidstr = id.asString(); const auto& dirdelim = gDirUtilp->getDirDelimiter(); - return absl::StrCat(sCacheDir, dirdelim, std::string_view(&uuidstr[0], 1), dirdelim, uuidstr, sCacheFilenameExt); + return fmt::format("{}{}{}{}{}{}", sCacheDir, dirdelim, std::string_view(&uuidstr[0], 1), dirdelim, uuidstr, sCacheFilenameExt); } void LLDiskCache::updateFileAccessTime(const boost::filesystem::path& file_path) diff --git a/indra/llfilesystem/lldiskcache.h b/indra/llfilesystem/lldiskcache.h index 315667ac2eb81bf5f3f3761920550c85ec46d4ac..a552d3e3847270ea696028950f843756a995b367 100644 --- a/indra/llfilesystem/lldiskcache.h +++ b/indra/llfilesystem/lldiskcache.h @@ -63,8 +63,9 @@ #define _LLDISKCACHE #include "llsingleton.h" +#include "lluuid.h" -#include "absl/container/flat_hash_set.h" +#include "boost/unordered/unordered_flat_set.hpp" class LLDiskCache final : public LLParamSingleton<LLDiskCache> @@ -198,7 +199,7 @@ class LLDiskCache final : */ bool mEnableCacheDebugInfo; - absl::flat_hash_set<LLUUID> mSkipList; + boost::unordered_flat_set<LLUUID> mSkipList; }; class LLPurgeDiskCacheThread : public LLThread diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index bf3c687364864dd940b3ada52a2afb9741fca389..ae2dacbbe418a0b76c2573cb22f4341e5cc1d6da 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -33,8 +33,8 @@ #include <vector> #include <boost/signals2.hpp> -#include "absl/container/flat_hash_set.h" -#include "absl/container/flat_hash_map.h" +#include "boost/unordered/unordered_flat_map.hpp" +#include "boost/unordered/unordered_flat_set.hpp" #include "llsd.h" #include "llsdutil.h" @@ -95,7 +95,7 @@ class LLSettingsBase : }; // Contains settings' names (map key), related shader id-key and default // value for revert in case we need to reset shader (no need to search each time) - typedef absl::flat_hash_map<std::string, DefaultParam> parammapping_t; + typedef boost::unordered_flat_map<std::string, DefaultParam> parammapping_t; typedef PTR_NAMESPACE::shared_ptr<LLSettingsBase> ptr_t; @@ -329,7 +329,7 @@ class LLSettingsBase : LLSettingsBase(); LLSettingsBase(const LLSD setting); - typedef absl::flat_hash_set<std::string> stringset_t; + typedef boost::unordered_flat_set<std::string> stringset_t; // combining settings objects. Customize for specific setting types virtual void lerpSettings(const LLSettingsBase &other, BlendFactor mix); diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index f2743af6438de512db21ce6314c959fca005b6db..e91c322747106bd97fa4cbf5f5b478d24b0bc680 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -218,9 +218,6 @@ target_link_libraries( ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} - absl::flat_hash_map - absl::node_hash_map - absl::strings rt ) else (LINUX) @@ -238,9 +235,6 @@ target_link_libraries( ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} - absl::flat_hash_map - absl::node_hash_map - absl::strings ) endif(LINUX) diff --git a/indra/llmessage/llavatarname.cpp b/indra/llmessage/llavatarname.cpp index 77080b87d046abb56a3eb2afc9bf1d376e6c6cac..4a654fcc47296c5bfe2855be0e7990ac4bd4f267 100644 --- a/indra/llmessage/llavatarname.cpp +++ b/indra/llmessage/llavatarname.cpp @@ -137,7 +137,7 @@ void LLAvatarName::fromString(const std::string& full_name) mLegacyLastName = full_name.substr(index+1); if (mLegacyLastName != "Resident") { - mUsername = absl::StrCat(mLegacyFirstName, ".", mLegacyLastName); + mUsername = fmt::format(FMT_COMPILE("{}.{}"), mLegacyFirstName, mLegacyLastName); mDisplayName = full_name; LLStringUtil::toLower(mUsername); } @@ -183,11 +183,11 @@ std::string LLAvatarName::getCompleteName(bool use_parentheses, bool force_use_c { if(use_parentheses) { - name = absl::StrCat(mDisplayName, " (", mUsername, ")"); + name = fmt::format(FMT_COMPILE("{} ({})"), mDisplayName, mUsername); } else { - name = absl::StrCat(mDisplayName, " [ ", mUsername, " ]"); + name = fmt::format(FMT_COMPILE("{} [ {} ]"), mDisplayName, mUsername); } } else @@ -210,8 +210,7 @@ std::string LLAvatarName::getLegacyName() const return mDisplayName; } - std::string name = absl::StrCat(mLegacyFirstName, " ", mLegacyLastName); - return name; + return fmt::format("{} {}", mLegacyFirstName, mLegacyLastName); } std::string LLAvatarName::getDisplayName(bool force_use_display_name) const @@ -246,12 +245,12 @@ std::string LLAvatarName::getUserName(bool lowercase) const { if(lowercase) { - name = absl::StrCat(mLegacyFirstName, ".", mLegacyLastName); + name = fmt::format("{}.{}", mLegacyFirstName, mLegacyLastName); LLStringUtil::toLower(name); } else { - name = absl::StrCat(mLegacyFirstName, " ", mLegacyLastName); + name = fmt::format("{} {}", mLegacyFirstName, mLegacyLastName); } } return name; diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index b3cfa82f80d3fedf09a6db663bb9d415e3efe1f0..97ae65355bd2d487e96dc3760bdede18fd0d7777 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -372,15 +372,17 @@ void LLAvatarNameCache::requestNamesViaCapability() if (url.empty()) { // ...starting new request - absl::StrAppend(&url, mNameLookupURL, "?ids=", agent_id.asString()); + url += mNameLookupURL; + url += "?ids="; ids = 1; } else { // ...continuing existing request - absl::StrAppend(&url, "&ids=", agent_id.asString()); + url += "&ids="; ids++; } + url += agent_id.asString(); agent_ids.push_back(agent_id); // mark request as pending diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 09b3147f3ae0c0e72b0f725045ef8ac7de877680..190271f894297f12fd12fe75b8efb4c084910479 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -32,8 +32,8 @@ #include "llavatarname.h" // for convenience #include "llsingleton.h" #include <boost/signals2.hpp> -#include <absl/container/flat_hash_map.h> -#include <absl/container/node_hash_map.h> +#include "boost/unordered/unordered_flat_map.hpp" +#include "boost/unordered/unordered_map.hpp" #include <set> @@ -180,18 +180,18 @@ class LLAvatarNameCache final : public LLSingleton<LLAvatarNameCache> // Agent IDs that have been requested, but with no reply. // Maps agent ID to frame time request was made. - typedef absl::flat_hash_map<LLUUID, F64> pending_queue_t; + typedef boost::unordered_flat_map<LLUUID, F64> pending_queue_t; pending_queue_t mPendingQueue; // Callbacks to fire when we received a name. // May have multiple callbacks for a single ID, which are // represented as multiple slots bound to the signal. // Avoid copying signals via pointers. - typedef absl::flat_hash_map<LLUUID, callback_signal_t* > signal_map_t; + typedef boost::unordered_flat_map<LLUUID, callback_signal_t* > signal_map_t; signal_map_t mSignalMap; // The cache at last, i.e. avatar names we know about. - typedef absl::node_hash_map<LLUUID, LLAvatarName> cache_t; + typedef boost::unordered_map<LLUUID, LLAvatarName> cache_t; cache_t mCache; // Time when unrefreshed cached names were checked last. diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 066bcc42db751cf22c4375ed216066d75e2ca8ed..536e66de24270f82e34bb2e06456c0d6f38317db 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -37,7 +37,7 @@ #include "lluuid.h" #include "message.h" -#include "absl/container/flat_hash_map.h" +#include "boost/unordered/unordered_flat_map.hpp" // llsd serialization constants static const std::string AGENTS("agents"); @@ -184,8 +184,8 @@ void ReplySender::flush() typedef std::set<LLUUID> AskQueue; typedef std::list<PendingReply*> ReplyQueue; typedef std::map<LLUUID,U32> PendingQueue; -typedef absl::flat_hash_map<LLUUID, LLCacheNameEntry*> Cache; -typedef absl::flat_hash_map<std::string, LLUUID> ReverseCache; +typedef boost::unordered_flat_map<LLUUID, LLCacheNameEntry*> Cache; +typedef boost::unordered_flat_map<std::string, LLUUID> ReverseCache; class LLCacheName::Impl { @@ -543,7 +543,8 @@ std::string LLCacheName::buildUsername(const std::string& full_name) if (lastname != "Resident") { - username = absl::StrCat(username, ".", lastname); + username += "."; + username += lastname; } LLStringUtil::toLower(username); @@ -586,7 +587,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name) { cap_letter = last_name.substr(0, 1); LLStringUtil::toUpper(cap_letter); - legacy_name = absl::StrCat(legacy_name, " ", cap_letter, last_name.substr(1)); + legacy_name = fmt::format("{} {}{}", legacy_name, cap_letter, last_name.substr(1)); } } diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 9bda805d63faf3eafd41252587a9fadb55cdc34d..9424d2637abc102eeb0148b95ad03c133d45f1ab 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -669,7 +669,7 @@ void LLExperienceCache::getGroupExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAda return; } - absl::StrAppend(&url, "?", groupId.asString()); + url += "?" + groupId.asString(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -741,7 +741,7 @@ void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, Expe return; } - std::string url = absl::StrCat(mCapability("ExperiencePreferences"), "?", experienceId.asString()); + std::string url = mCapability("ExperiencePreferences") + "?" + experienceId.asString(); permissionInvoker_fn invoker(boost::bind( // Humans ignore next line. It is just a cast to specify which LLCoreHttpUtil::HttpCoroutineAdapter routine overload. @@ -795,8 +795,7 @@ void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, E return; } - std::string url = absl::StrCat(mCapability("ExperiencePreferences"), "?", experienceId.asString()); - + std::string url = fmt::format("{}?{}", mCapability("ExperiencePreferences"), experienceId.asString()); permissionInvoker_fn invoker(boost::bind( // Humans ignore next line. It is just a cast to specify which LLCoreHttpUtil::HttpCoroutineAdapter routine overload. @@ -853,7 +852,7 @@ void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdap LL_WARNS("ExperienceCache") << "No Region Experiences capability" << LL_ENDL; return; } - absl::StrAppend(&url, "?experience_id=", experienceId.asString()); + url += "?experience_id=" + experienceId.asString(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); // LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 9af85f5b68459a4f5cab2e45c58e26d3de3ee900..dc790db8f618b2bb82daf03f2585a41617155529 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -33,8 +33,6 @@ #include <immintrin.h> #include "llsd.h" -#include "absl/hash/hash.h" - class LLMaterialID { public: @@ -140,9 +138,9 @@ class LLMaterialID #endif } - inline size_t hash() const + friend std::size_t hash_value(LLMaterialID const& id) { - return absl::Hash<LLMaterialID>{}(*this); + return boost::hash_range(id.mID, id.mID + MATERIAL_ID_SIZE); } // END BOOST @@ -173,17 +171,7 @@ namespace std { { size_t operator()(const LLMaterialID& id) const { - return id.hash(); - } - }; -} - -namespace boost { - template<> struct hash<LLMaterialID> - { - size_t operator()(const LLMaterialID& id) const - { - return id.hash(); + return hash_value(id); } }; } diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index f8fee2c7b2938f61e775fe782fd6035f5f593903..ceb491b3c2777c025d5274a2f2378d0a990c6db4 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -130,7 +130,6 @@ if(USE_PRECOMPILED_HEADERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15.0") <map> <list> <string> - <absl/container/flat_hash_set.h> - <absl/container/flat_hash_map.h> + <boost/unordered/unordered_flat_map.hpp> ) endif() diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index cea3f2c2e2d6dbf8b717db3aba96740111816a17..5a33c2851502cbeed36c68c2f811387dca0240df 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -27,7 +27,7 @@ #ifndef LL_LLFONTFREETYPE_H #define LL_LLFONTFREETYPE_H -#include <absl/container/flat_hash_map.h> +#include "boost/unordered/unordered_flat_map.hpp" #include "llpointer.h" #include "llstl.h" @@ -70,7 +70,7 @@ class LLFontManager }; void unloadAllFonts(); - absl::flat_hash_map< std::string, std::unique_ptr<LoadedFont> > mLoadedFonts; + boost::unordered_flat_map< std::string, std::unique_ptr<LoadedFont> > mLoadedFonts; }; struct LLFontGlyphInfo @@ -178,7 +178,7 @@ class LLFontFreetype final : public LLRefCount bool getKerningCache(U32 left_glyph, U32 right_glyph, F32& kerning) const; void setKerningCache(U32 left_glyph, U32 right_glyph, F32 kerning) const; - mutable absl::flat_hash_map<U64, F32> mKerningCache; + mutable boost::unordered_flat_map<U64, F32> mKerningCache; std::string mName; @@ -194,7 +194,7 @@ class LLFontFreetype final : public LLRefCount BOOL mIsFallback; font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars) - typedef absl::flat_hash_map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t; + typedef boost::unordered_flat_map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t; mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap mutable LLFontBitmapCache* mFontBitmapCachep; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index f8117db6a39bea6b3f60feb4d279146a1b3281fd..1d44cfcb5f1c48c2072dd7c1926aa6fd5f6eed54 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1716,7 +1716,7 @@ void clear_glerror() // // Static members -absl::flat_hash_map<LLGLenum, LLGLboolean> LLGLState::sStateMap; +boost::unordered_flat_map<LLGLenum, LLGLboolean> LLGLState::sStateMap; GLboolean LLGLDepthTest::sDepthEnabled = GL_FALSE; // OpenGL default GLenum LLGLDepthTest::sDepthFunc = GL_LESS; // OpenGL default diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index b010a9a686c5cb5fea8bd009cef8316ea0ee7d83..8d9c7827c23ed1833a2ad27ebeb1cf682ab7ce18 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -30,7 +30,7 @@ // This file contains various stuff for handling gl extensions and other gl related stuff. #include <string> -#include <absl/container/flat_hash_map.h> +#include <boost/unordered/unordered_flat_map.hpp> #include <list> #include "llerror.h" @@ -271,7 +271,7 @@ class LLGLState static void checkTextureChannels(const std::string& msg = ""); protected: - static absl::flat_hash_map<LLGLenum, LLGLboolean> sStateMap; + static boost::unordered_flat_map<LLGLenum, LLGLboolean> sStateMap; public: enum { CURRENT_STATE = -2 }; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 97ca94802b6dbe28c0d48c9ba1801c0e0467c228..014b9c16c01af87e58bbcfdbb373ae302c42ae01 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -37,7 +37,9 @@ #include "llglslshader.h" #include "llmemory.h" -#include "absl/container/flat_hash_set.h" +#if LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO || defined(RELEASE_SHOW_ASSERT) +#include "boost/unordered/unordered_flat_set.hpp" +#endif //Next Highest Power Of Two //helper function, returns first number > v that is a power of 2, or v if v is already a power of 2 @@ -124,8 +126,8 @@ bool LLVertexBuffer::sPreferStreamDraw = false; U32 LLVertexBuffer::sDummyVAO = 0; #if LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO || defined(RELEASE_SHOW_ASSERT) -static absl::flat_hash_set<U32> sActiveBufferNames; -static absl::flat_hash_set<U32> sDeletedBufferNames; +static boost::unordered_flat_set<U32> sActiveBufferNames; +static boost::unordered_flat_set<U32> sDeletedBufferNames; void validate_add_buffer(U32 name) { diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 3e2be39d780de3f1017e69eecec8383d5a6e1e14..cfc87d3fa8db5bd5e2edc222049748585e971822 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -291,9 +291,6 @@ target_link_libraries(llui ${HUNSPELL_LIBRARY} ${LLMESSAGE_LIBRARIES} ${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender - absl::flat_hash_map - absl::node_hash_map - absl::strings ) if(USE_PRECOMPILED_HEADERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15.0") @@ -324,8 +321,10 @@ if(USE_PRECOMPILED_HEADERS AND ${CMAKE_VERSION} VERSION_GREATER "3.15.0") <boost/function.hpp> <boost/noncopyable.hpp> <boost/signals2.hpp> - <absl/container/flat_hash_set.h> - <absl/container/flat_hash_map.h> + <boost/unordered/unordered_flat_map.hpp> + <boost/unordered/unordered_flat_set.hpp> + <boost/unordered/unordered_map.hpp> + <boost/unordered/unordered_set.hpp> ) endif() diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index a4e6f0f7cd71e99c04d4a747e1c2e0ec8c5099d5..7d23d246c76a1338e267b9ee0188374c4dd38f52 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -30,7 +30,7 @@ #include "llinitparam.h" #include "llsingleton.h" -#include <absl/container/flat_hash_map.h> +#include <boost/unordered/unordered_flat_map.hpp> class LLCommand; class LLCommandManager; @@ -199,7 +199,7 @@ class LLCommandManager final void addCommand(LLCommand * command); private: - typedef absl::flat_hash_map<LLUUID, U32> CommandIndexMap; + typedef boost::unordered_flat_map<LLUUID, U32> CommandIndexMap; typedef std::vector<LLCommand *> CommandVector; CommandVector mCommands; diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 9b49438a0ebd4f56344317f8c1104319394c0a95..7a5c09ab865ce01f619544a49d9b9d016f61d083 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -588,7 +588,7 @@ std::string LLFloater::getControlName(const std::string& name, const LLSD& key) // Add the key to the control name if appropriate. if (key.isString() && !key.asString().empty()) { - absl::StrAppend(&ctrl_name, "_", key.asString()); + ctrl_name += "_" + key.asString(); } return ctrl_name; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 860de774956f7525ef01701ca5f9da9ead7b42ad..ef9b7aeace08ee0cafd9072ee1ce4bb50aa12232 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -41,7 +41,7 @@ LLFloaterReg::instance_map_t LLFloaterReg::sInstanceMap; LLFloaterReg::build_map_t LLFloaterReg::sBuildMap; LLFloaterReg::group_map_t LLFloaterReg::sGroupMap; bool LLFloaterReg::sBlockShowFloaters = false; -absl::flat_hash_set<std::string> LLFloaterReg::sAlwaysShowableList; +boost::unordered_flat_set<std::string, al::string_hash, std::equal_to<>> LLFloaterReg::sAlwaysShowableList; static LLFloaterRegListener sFloaterRegListener; diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 818c4643fdf5fb5414969c96acfebbed8da4f908..dc65a03d133fa3daf7897cca035f1e367116801f 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -32,9 +32,9 @@ #include <list> #include <boost/function.hpp> -#include<absl/container/flat_hash_set.h> -#include<absl/container/flat_hash_map.h> -#include<absl/container/node_hash_map.h> +#include <boost/unordered/unordered_flat_map.hpp> +#include <boost/unordered/unordered_flat_set.hpp> +#include <boost/unordered/unordered_map.hpp> // [RLVa:KB] - Checked: 2011-05-25 (RLVa-1.4.0a) #include <boost/signals2.hpp> #include "llboost.h" @@ -58,15 +58,15 @@ class LLFloaterReg // 2) We can change the key of a floater without altering the list. typedef std::list<LLFloater*> instance_list_t; typedef const instance_list_t const_instance_list_t; - typedef absl::node_hash_map<std::string, instance_list_t> instance_map_t; + typedef boost::unordered_map<std::string, instance_list_t, al::string_hash, std::equal_to<>> instance_map_t; struct BuildData { LLFloaterBuildFunc mFunc; std::string mFile; }; - typedef absl::flat_hash_map<std::string, BuildData> build_map_t; - typedef absl::flat_hash_map<std::string, std::string> group_map_t; + typedef boost::unordered_flat_map<std::string, BuildData, al::string_hash, std::equal_to<>> build_map_t; + typedef boost::unordered_flat_map<std::string, std::string, al::string_hash, std::equal_to<>> group_map_t; private: friend class LLFloaterRegListener; @@ -78,7 +78,7 @@ class LLFloaterReg /** * Defines list of floater names that can be shown despite state of sBlockShowFloaters. */ - static absl::flat_hash_set<std::string> sAlwaysShowableList; + static boost::unordered_flat_set<std::string, al::string_hash, std::equal_to<>> sAlwaysShowableList; // [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a // Used to determine whether a floater can be shown diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index e3275762200832b44f8ae7a10aa16d774134aff4..b4e4cac92e3ab6edf32ad40d15cf92a281c0a780 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -351,7 +351,7 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group) case LLKeywordToken::TT_CONSTANT: if (getAttribute("type").length() > 0) { - color_group = getColorGroup(absl::StrCat(group, "-", getAttribute("type"))); + color_group = getColorGroup(fmt::format("{}-{}", group, getAttribute("type"))); } else { diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index d0d40d28107ee13b38ac50f232dd5a3854a85c27..1b98a70c62a61acaa254f20121e8103d18698786 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -694,7 +694,7 @@ void LLNotification::respond(const LLSD& response) mForm->setIgnored(mIgnored); if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) { - LLUI::getInstance()->mSettingGroups["ignores"]->setLLSD(absl::StrCat("Default", getName()), response); + LLUI::getInstance()->mSettingGroups["ignores"]->setLLSD("Default" + getName(), response); } } @@ -877,7 +877,10 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele std::string LLNotification::summarize() const { - std::string s = absl::StrCat("Notification(", getName(), ") : ", mTemplatep ? mTemplatep->mMessage : ""); + std::string s = "Notification("; + s += getName(); + s += ") : "; + s += mTemplatep ? mTemplatep->mMessage : ""; // should also include timestamp and expiration time (but probably not payload) return s; } @@ -1194,10 +1197,13 @@ size_t LLNotificationChannel::size() std::string LLNotificationChannel::summarize() { - std::string s = absl::StrCat("Channel '", mName, "'\n "); + std::string s("Channel '"); + s += mName; + s += "'\n "; for (LLNotificationChannel::Iterator it = begin(); it != end(); ++it) { - absl::StrAppend(&s, (*it)->summarize(), "\n "); + s += (*it)->summarize(); + s += "\n "; } return s; } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 475a27247bc27fbbb28bd54cf539edc8d31062b9..0f82170422f9105cefb7b32db66e9cd32403a602 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -608,7 +608,7 @@ std::string LLPanel::getString(std::string_view name, const LLStringUtil::format formatted_string.setArgList(args); return formatted_string.getString(); } - std::string err_str = absl::StrCat("Failed to find string ", name, " in panel ", getName()); //*TODO: Translate + std::string err_str = fmt::format("Failed to find string {} in panel {} loaded from file {}", name, getName(), mXMLFilename); //*TODO: Translate if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode")) { LL_ERRS() << err_str << LL_ENDL; @@ -627,7 +627,7 @@ std::string LLPanel::getString(std::string_view name) const { return found_it->second; } - std::string err_str = absl::StrCat("Failed to find string ", name, " in panel ", getName()); //*TODO: Translate + std::string err_str = fmt::format("Failed to find string {} in panel {} loaded from file {}", name, getName(), mXMLFilename); //*TODO: Translate if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode")) { LL_ERRS() << err_str << LL_ENDL; diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 71dd64db31c54d8d85af4180d6973627b13f0f9c..3e026b7d752bfb4d64185cadc917c865c7bce466 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -38,6 +38,7 @@ #include "llbadgeholder.h" #include <list> #include <queue> +#include <boost/unordered/unordered_map.hpp> const S32 LLPANEL_BORDER_WIDTH = 1; const BOOL BORDER_YES = TRUE; @@ -249,7 +250,7 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder LLButton* mDefaultBtn; LLUIString mLabel; - typedef absl::node_hash_map<std::string, std::string> ui_string_map_t; + typedef boost::unordered_map<std::string, std::string, al::string_hash, std::equal_to<>> ui_string_map_t; ui_string_map_t mUIStrings; diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index 93a2a4ca8a6650c6c3e7f3b1b2fc6ebc512fe601..a3a42d36347e596a2e4a0f21dcae41e5a1a11cf3 100644 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -35,9 +35,6 @@ #include <map> -#include <absl/strings/str_format.h> -#include <absl/strings/str_cat.h> - LLTrans::template_map_t LLTrans::sStringTemplates; LLTrans::template_map_t LLTrans::sDefaultStringTemplates; LLStringUtil::format_map_t LLTrans::sDefaultArgs; @@ -170,7 +167,7 @@ std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::fo else { LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL; - return absl::StrCat("MissingString(", xml_desc, ")"); + return fmt::format("MissingString({})", xml_desc); } } @@ -190,7 +187,7 @@ std::string LLTrans::getDefString(std::string_view xml_desc, const LLStringUtil: else { LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL; - return absl::StrCat("MissingString(", xml_desc, ")"); + return fmt::format("MissingString({})", xml_desc); } } @@ -216,7 +213,7 @@ std::string LLTrans::getString(std::string_view xml_desc, const LLSD& msg_args, else { LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL; - return absl::StrCat("MissingString(", xml_desc, ")"); + return fmt::format("MissingString({})", xml_desc); } } @@ -233,7 +230,7 @@ std::string LLTrans::getDefString(std::string_view xml_desc, const LLSD& msg_arg else { LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL; - return absl::StrCat("MissingString(", xml_desc, ")"); + return fmt::format("MissingString({})", xml_desc); } } @@ -340,7 +337,7 @@ std::string LLTrans::getCountString(const std::string_view language, const std:: args["[COUNT]"] = fmt::to_string(count); // Look up "AgeYearsB" or "AgeWeeksC" including the "form" - std::string key = absl::StrCat(xml_desc, form); + std::string key = fmt::format("{}{}", xml_desc, form); return getString(key, args); } diff --git a/indra/llui/lltrans.h b/indra/llui/lltrans.h index a8a82d79835d6562816cb83af6436767abce9752..55cd6d95192997ddd16a3edb5eb6500671694dea 100644 --- a/indra/llui/lltrans.h +++ b/indra/llui/lltrans.h @@ -30,7 +30,7 @@ #include "llpointer.h" #include "llstring.h" -#include <absl/container/node_hash_map.h> +#include <boost/unordered/unordered_map.hpp> class LLXMLNode; @@ -126,7 +126,7 @@ class LLTrans } private: - typedef absl::node_hash_map<std::string, LLTransTemplate> template_map_t; + typedef boost::unordered_map<std::string, LLTransTemplate, al::string_hash, std::equal_to<>> template_map_t; static template_map_t sStringTemplates; static template_map_t sDefaultStringTemplates; static LLStringUtil::format_map_t sDefaultArgs; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index d58c03160924a1627b494df02ce014230559e91c..d232de42f79ae9db4d5a84101aff3df0d4028772 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -132,12 +132,12 @@ LLUUID find_ui_sound(std::string_view name) LLUUID find_ui_sound(const char* namep) { - return find_ui_sound(absl::NullSafeStringView(namep)); + return find_ui_sound(ll_safe_string(namep)); } void make_ui_sound(const char* namep) { - LLUUID soundUUID = find_ui_sound(absl::NullSafeStringView(namep)); + LLUUID soundUUID = find_ui_sound(namep); if(soundUUID.notNull()) { LLUI::getInstance()->mAudioCallback(soundUUID); @@ -146,7 +146,7 @@ void make_ui_sound(const char* namep) void make_ui_sound_deferred(const char* namep) { - LLUUID soundUUID = find_ui_sound(absl::NullSafeStringView(namep)); + LLUUID soundUUID = find_ui_sound(namep); if(soundUUID.notNull()) { LLUI::getInstance()->mDeferredAudioCallback(soundUUID); diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h index 3fa167ac78750040725d855198d0d94ceb4d7c7c..1a1581a0ffaf6d90887d8283936a4793fde1da0c 100644 --- a/indra/llui/lluicolortable.h +++ b/indra/llui/lluicolortable.h @@ -34,6 +34,8 @@ #include "v4color.h" +#include <boost/unordered/unordered_flat_map.hpp> + class LLUIColor; class LLUIColorTable final : public LLSingleton<LLUIColorTable> @@ -42,7 +44,7 @@ class LLUIColorTable final : public LLSingleton<LLUIColorTable> LOG_CLASS(LLUIColorTable); // consider using sorted vector, can be much faster - typedef absl::node_hash_map<std::string, LLUIColor> string_color_map_t; + typedef boost::unordered_flat_map<std::string, LLUIColor, al::string_hash, std::equal_to<>> string_color_map_t; public: struct ColorParams : LLInitParam::ChoiceBlock<ColorParams> diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 981b343a89dddd101cb2c9c97316e416795d9ff2..3455d74314e2ce4a57eb1b45558abefd0ff82940 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -29,6 +29,7 @@ #include <map> #include <boost/function.hpp> +#include <boost/unordered/unordered_flat_map.hpp> #include "llstringtable.h" #include "lltimer.h" @@ -109,8 +110,8 @@ class LLKeyboard void addKeyName(KEY key, const std::string& name); protected: - absl::flat_hash_map<U32, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs - absl::flat_hash_map<KEY, U32> mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys + boost::unordered_flat_map<U32, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs + boost::unordered_flat_map<KEY, U32> mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys LLWindowCallbacks *mCallbacks; LLTimer mKeyLevelTimer[KEY_COUNT]; // Time since level was set diff --git a/indra/llwindow/llkeyboardwin32.h b/indra/llwindow/llkeyboardwin32.h index 0a79a63b2856cd4d7ab010747b851e208f78a5a1..ad4667f410dcb185a657fc06c34dfa05048c2408 100644 --- a/indra/llwindow/llkeyboardwin32.h +++ b/indra/llwindow/llkeyboardwin32.h @@ -51,8 +51,8 @@ class LLKeyboardWin32 : public LLKeyboard MASK updateModifiers(); //void setModifierKeyLevel( KEY key, BOOL new_state ); private: - absl::flat_hash_map<U32, KEY> mTranslateNumpadMap; - absl::flat_hash_map<KEY, U32> mInvTranslateNumpadMap; + boost::unordered_flat_map<U32, KEY> mTranslateNumpadMap; + boost::unordered_flat_map<KEY, U32> mInvTranslateNumpadMap; }; #endif diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 9735ef02d2177552fc61e9dbd9f558ee1b63e736..16a7abcf1f6c1c91ec2d565d1507341a494c99c1 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -34,7 +34,7 @@ #include "llrefcount.h" #include "llinstancetracker.h" -#include "absl/container/flat_hash_map.h" +#include <boost/unordered/unordered_flat_map.hpp> #include <vector> #include <string_view> @@ -171,7 +171,7 @@ class LLControlGroup final : public LLInstanceTracker<LLControlGroup, std::strin LOG_CLASS(LLControlGroup); protected: - typedef absl::flat_hash_map<std::string, LLControlVariablePtr> ctrl_name_table_t; + typedef boost::unordered_flat_map<std::string, LLControlVariablePtr, al::string_hash, std::equal_to<>> ctrl_name_table_t; ctrl_name_table_t mNameTable; static const std::string mTypeString[TYPE_COUNT]; diff --git a/indra/newview/alrenderutils.cpp b/indra/newview/alrenderutils.cpp index b93d5a7e92f5b1f35efb856d1976d1936f7fdcec..d9a307da5778683de031e0dc1924842c201cb4a0 100644 --- a/indra/newview/alrenderutils.cpp +++ b/indra/newview/alrenderutils.cpp @@ -41,8 +41,6 @@ #include "llviewershadermgr.h" #include "pipeline.h" -#include "absl/strings/numbers.h" - const U32 ALRENDER_BUFFER_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1; static LLStaticHashedString al_exposure("exposure"); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9c0ca4a0e23764980217ff701d2c38b0414c1eec..a5e24b806283c2e71ce2eb05887e5ce9d6e7dc06 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3437,27 +3437,33 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name) std::string line; if (is_away) { - absl::StrAppend(&line, avatar_away_str, ", "); + line += avatar_away_str; + line += ", "; } if (is_do_not_disturb) { - absl::StrAppend(&line, avatar_dnd_str, ", "); + line += avatar_dnd_str; + line += ", "; } if (is_muted) { - absl::StrAppend(&line, avatar_muted_str, ", "); + line += avatar_muted_str; + line += ", "; } if (is_appearance) { - absl::StrAppend(&line, avatar_edit_appr_str, ", "); + line += avatar_edit_appr_str; + line += ", "; } if (is_cloud) { - absl::StrAppend(&line, avatar_loading_data_str, ", "); + line += avatar_loading_data_str; + line += ", "; } if (is_typing) { - absl::StrAppend(&line, avatar_typing_str, ", "); + line += avatar_typing_str; + line += ", "; } // trim last ", " line.resize( line.length() - 2 ); @@ -10743,7 +10749,7 @@ void LLVOAvatar::updateRiggingInfo() } } rig_count = curr_rigging_info_key.size(); - rig_hash = absl::Hash<rigging_info_hash_vec_t>{}(curr_rigging_info_key); + rig_hash = boost::hash<rigging_info_hash_vec_t>()(curr_rigging_info_key); // Check for key change, which indicates some change in volume composition or LOD. if (rig_hash == mLastRiggingInfoKeyHash) { diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f644f4fbc1640e3354baf7caddf2ee85fc1fc539..2a25f6e8a184ffc26799de7b5aedf1dd01453f68 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5362,11 +5362,11 @@ bool LLVivoxVoiceClient::IDFromName(const std::string& inName, LLUUID &uuid) // Reverse the transforms done by nameFromID std::string_view temp = name; - std::string outstr; - if(absl::WebSafeBase64Unescape(temp.substr(1), &outstr) && outstr.size() == UUID_BYTES) + U8 id_buff[UUID_BYTES]; + if(LLBase64::decode(temp.substr(1), id_buff, UUID_BYTES)) { // The decode succeeded. Stuff the bits into the result's UUID - memcpy(uuid.mData, outstr.data(), UUID_BYTES); + memcpy(uuid.mData, id_buff, UUID_BYTES); result = true; } } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index fff8538e644cb30df21f3e4dfb6b9ac38858f395..764d398df53a9c636044d396aff7508697b8bd9d 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -37,8 +37,6 @@ #include <map> #include <set> -#include "absl/types/optional.h" - class LLViewerTextureAnim; class LLDrawPool; class LLMaterialID; diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index fb9a358d00f19c4c4202b093d7d73a045bc36b31..e9ecafea35fba9731338d20130c32173fbb43a50 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -29,6 +29,7 @@ #include "llworldmipmap.h" #include <boost/function.hpp> +#include <boost/unordered/unordered_flat_map.hpp> #include "v3dmath.h" #include "lluuid.h" @@ -216,7 +217,7 @@ class LLWorldMap final : public LLSingleton<LLWorldMap> void reloadItems(bool force = false); // Reload the items (people, hub, etc...) // Region Map access - typedef absl::flat_hash_map<U64, std::unique_ptr<LLSimInfo>> sim_info_map_t; + typedef boost::unordered_flat_map<U64, std::unique_ptr<LLSimInfo>> sim_info_map_t; const LLWorldMap::sim_info_map_t& getRegionMap() const { return mSimInfoMap; } void updateRegions(S32 x0, S32 y0, S32 x1, S32 y1); // Requests region info for a rectangle of regions (in grid coordinates) @@ -278,7 +279,7 @@ class LLWorldMap final : public LLSingleton<LLWorldMap> // cases where a block is never retrieved and, because of this boolean being set, never re-requested std::array<bool, MAP_BLOCK_RES*MAP_BLOCK_RES> mMapBlockLoaded; // Telling us if the block of regions has been requested or not - typedef absl::flat_hash_map<S32, F64> block_last_update_map_t; + typedef boost::unordered_flat_map<S32, F64> block_last_update_map_t; block_last_update_map_t mMapBlockLastUpdateOffsets; // Track location data : used while there's nothing tracked yet by LLTracker diff --git a/indra/newview/llworldmipmap.h b/indra/newview/llworldmipmap.h index 44a8455334da36bcc4b23daa7723735f21d41b4e..0b8b132713a0ad4ec4dd4cdc04123dcab995938e 100644 --- a/indra/newview/llworldmipmap.h +++ b/indra/newview/llworldmipmap.h @@ -33,6 +33,8 @@ #include "indra_constants.h" // REGION_WIDTH_UNITS #include "llregionhandle.h" // to_region_handle() +#include "boost/unordered/unordered_flat_map.hpp" + class LLViewerFetchedTexture; // LLWorldMipmap : Mipmap handling of all the tiles used to render the world at any resolution. @@ -84,7 +86,7 @@ class LLWorldMipmap // The mipmap is organized by resolution level (MAP_LEVELS of them). Each resolution level is an std::map // using a region_handle as a key and storing a smart pointer to the image as a value. - typedef absl::flat_hash_map<U64, LLPointer<LLViewerFetchedTexture> > sublevel_tiles_t; + typedef boost::unordered_flat_map<U64, LLPointer<LLViewerFetchedTexture> > sublevel_tiles_t; sublevel_tiles_t mWorldObjectsMipMap[MAP_LEVELS]; // sublevel_tiles_t mWorldTerrainMipMap[MAP_LEVELS]; diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index be5f95ca1c535c322b99fb69bd4fdad02daaa34c..48987e23812500d36a340e126c0c6f8e0b408038 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -20,8 +20,6 @@ #include "llchat.h" #include "rlvdefines.h" -#include <absl/strings/string_view.h> - // ============================================================================ // Forward declarations // diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 8ecef5c354a16822f6dfd9485875627e953582c8..2a6285fc66d6fccecb11c388463a2d58b02da8fb 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -16,8 +16,6 @@ #pragma once -#include <absl/strings/string_view.h> - // ============================================================================ // Defines // diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 2bb7bb038fcb722480aa3d7c6f6bf3fcaaa2bdce..3446ef55002d6775bd728fb4159d50f0baae97f6 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -25,8 +25,6 @@ #include "rlvdefines.h" #include "rlvcommon.h" -#include "absl/strings/str_cat.h" - // ============================================================================ // Forward declarations // diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 64013107279bcf0e44d32cd2dc62806bcad65824..e5de7e3d45406f09782abf9f1df1a88789ded3f3 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -274,6 +274,7 @@ namespace tut ensure_equals(" slurl, region + coords", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/my%20region/1/2/3"); +#ifndef HAVOK_BUILD LLGridManager::getInstance()->setGridChoice("my.grid.com"); slurl = LLSLURL("x-grid-info://my.grid.com/region/my%20region/1/2/3"); ensure_equals("grid slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION); @@ -338,7 +339,7 @@ namespace tut ensure_equals("apppath", slurl.getAppPath().size(), 1); ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar"); ensure_equals("appquery", slurl.getAppQuery(), "12345"); - +#endif } // construction from grid/region/vector combos @@ -367,14 +368,16 @@ namespace tut ensure_equals(" default grid/region/vector", slurl.getSLURLString(), "http://maps.secondlife.com/secondlife/my%20region/1/2/3"); +#ifndef HAVOK_BUILD LLGridManager::getInstance()->setGridChoice("MyGrid"); slurl = LLSLURL("my region", LLVector3(1,2,3)); ensure_equals("default grid/region/vector - type", slurl.getType(), LLSLURL::LOCATION); ensure_equals(" default grid/region/vector", slurl.getSLURLString(), "x-grid-info://my.grid.com/region/my%20region/1/2/3"); - +#endif } +#ifndef HAVOK_BUILD // x-grid-location-info template<> template<> void slurlTestObject::test<3>() @@ -417,4 +420,5 @@ namespace tut ensure_equals("position", slurl.getPosition(), LLVector3(1, 2, 3)); } +#endif } diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 4b34e28af2fc7c801d20d4e173340003dcc1084d..9b371cfdb9e1cf4bfad813f1aae031650cff8764 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -280,6 +280,7 @@ namespace tut LLGridManager::getInstance()->isSystemGrid("util.aditi.lindenlab.com")); } +#ifndef HAVOK_BUILD // initialization with a grid file template<> template<> void viewerNetworkTestObject::test<2>() @@ -408,7 +409,7 @@ namespace tut std::string("http://minimal.long.name/app/login/")); } - +#endif // validate grid selection template<> template<> @@ -449,6 +450,7 @@ namespace tut uris[0], std::string("https://login.agni.lindenlab.com/cgi-bin/login.cgi")); +#ifndef HAVOK_BUILD LLGridManager::getInstance()->setGridChoice(std::string("altgrid.long.name")); ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), @@ -462,6 +464,7 @@ namespace tut LLGridManager::getInstance()->isInOpenSim()); ensure("alternative grid is not Second Life", !LLGridManager::getInstance()->isInSecondlife()); +#endif } }