From c1179b0eed8cabf663d67fe69762e7b5af0a0580 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 17 Dec 2022 06:29:56 -0500 Subject: [PATCH] Remove more of the absl dep 2 of 3 --- indra/cmake/LLFileSystem.cmake | 2 +- indra/llcharacter/llcharacter.h | 8 ++--- indra/llcharacter/llkeyframemotion.h | 4 +-- indra/llcharacter/llmotioncontroller.h | 12 ++++---- indra/llcharacter/llpose.h | 4 +-- indra/llcommon/CMakeLists.txt | 10 +++--- indra/llcommon/llapr.cpp | 6 ++-- indra/llcommon/llapr.h | 4 +-- indra/llcommon/llassettype.cpp | 4 +-- indra/llcommon/llbase64.cpp | 12 ++++---- indra/llcommon/llbase64.h | 8 ++--- indra/llcommon/llerror.cpp | 7 ++--- indra/llcommon/llinitparam.h | 17 ++++++----- indra/llcommon/llmetricperformancetester.cpp | 2 -- indra/llcommon/llmutex.cpp | 32 ++++++++++++++++++++ indra/llcommon/llpounceable.h | 4 +-- indra/llcommon/llsdserialize.h | 2 -- indra/llcommon/llsingleton.h | 4 +-- indra/llcommon/llstaticstringtable.h | 7 ++--- indra/llcommon/llstring.cpp | 6 ++-- indra/llcommon/llstring.h | 16 ++++++++-- indra/llcommon/lluuid.cpp | 2 +- indra/llcommon/lluuid.h | 13 -------- indra/llcommon/tests/llsdserialize_test.cpp | 11 +++---- indra/llfilesystem/CMakeLists.txt | 3 +- indra/llfilesystem/lldiskcache.cpp | 4 +-- indra/llfilesystem/lldiskcache.h | 5 +-- indra/llinventory/llsettingsbase.h | 8 ++--- indra/llmessage/CMakeLists.txt | 6 ---- indra/llmessage/llavatarname.cpp | 13 ++++---- indra/llmessage/llavatarnamecache.cpp | 6 ++-- indra/llmessage/llavatarnamecache.h | 10 +++--- indra/llmessage/llcachename.cpp | 11 ++++--- indra/llmessage/llexperiencecache.cpp | 9 +++--- indra/llprimitive/llmaterialid.h | 18 ++--------- indra/llrender/CMakeLists.txt | 3 +- indra/llrender/llfontfreetype.h | 8 ++--- indra/llrender/llgl.cpp | 2 +- indra/llrender/llgl.h | 4 +-- indra/llrender/llvertexbuffer.cpp | 8 +++-- indra/llui/CMakeLists.txt | 9 +++--- indra/llui/llcommandmanager.h | 4 +-- indra/llui/llfloater.cpp | 2 +- indra/llui/llfloaterreg.cpp | 2 +- indra/llui/llfloaterreg.h | 14 ++++----- indra/llui/llkeywords.cpp | 2 +- indra/llui/llnotifications.cpp | 14 ++++++--- indra/llui/llpanel.cpp | 4 +-- indra/llui/llpanel.h | 3 +- indra/llui/lltrans.cpp | 13 +++----- indra/llui/lltrans.h | 4 +-- indra/llui/llui.cpp | 6 ++-- indra/llui/lluicolortable.h | 4 ++- indra/llwindow/llkeyboard.h | 5 +-- indra/llwindow/llkeyboardwin32.h | 4 +-- indra/llxml/llcontrol.h | 4 +-- indra/newview/alrenderutils.cpp | 2 -- indra/newview/llvoavatar.cpp | 20 +++++++----- indra/newview/llvoicevivox.cpp | 6 ++-- indra/newview/llvovolume.h | 2 -- indra/newview/llworldmap.h | 5 +-- indra/newview/llworldmipmap.h | 4 ++- indra/newview/rlvactions.h | 2 -- indra/newview/rlvdefines.h | 2 -- indra/newview/rlvhelper.h | 2 -- indra/newview/tests/llslurl_test.cpp | 8 +++-- indra/newview/tests/llviewernetwork_test.cpp | 5 ++- 67 files changed, 243 insertions(+), 224 deletions(-) diff --git a/indra/cmake/LLFileSystem.cmake b/indra/cmake/LLFileSystem.cmake index 72bd42ebfdc..73137bffa5a 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 37703d33fec..957c071cf2b 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 23a6cdff7ec..4ea938d6955 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 9ecfe28a85f..101ce86650a 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 5ca078ada6f..91175780d5b 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 77469578cba..12de18fba77 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 bf475da8c0d..6c11f2992eb 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 72896fb0529..e6997f74179 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 f73ad60cfe6..c344f1da710 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 6683ef7fc72..035ed6717b4 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 064da10a1f4..3be6159c7d4 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 8cdd8f94ecd..3855ab3df9c 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 24338b5cb6d..7cf05f52478 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 407473a5221..9ef12171971 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 638ff7e9285..4de4d9e58ec 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 e009694c577..7fb59d47366 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 5fd210f608e..980c4295a06 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 a48302cf00d..95ac4fdda0d 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 7053ae3f170..4fc86695edc 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 6a99937877e..1bc68089eb6 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 4f22f3d098c..c4316d8a4a2 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 b29592944c0..19db7f0c4d4 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 c11e31127c8..a7a8f6b47ae 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 7eefaf20546..810980c412b 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 af9042d5a9b..9ec643ff169 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 136a45cd3e6..48f8c39951c 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 315667ac2eb..a552d3e3847 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 bf3c6873648..ae2dacbbe41 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 f2743af6438..e91c3227471 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 77080b87d04..4a654fcc472 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 b3cfa82f80d..97ae65355bd 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 09b3147f3ae..190271f8942 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 066bcc42db7..536e66de242 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 9bda805d63f..9424d2637ab 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 9af85f5b684..dc790db8f61 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 f8fee2c7b29..ceb491b3c27 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 cea3f2c2e2d..5a33c285150 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 f8117db6a39..1d44cfcb5f1 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 b010a9a686c..8d9c7827c23 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 97ca94802b6..014b9c16c01 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 3e2be39d780..cfc87d3fa8d 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 a4e6f0f7cd7..7d23d246c76 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 9b49438a0eb..7a5c09ab865 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 860de774956..ef9b7aeace0 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 818c4643fdf..dc65a03d133 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 e3275762200..b4e4cac92e3 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 d0d40d28107..1b98a70c62a 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 475a27247bc..0f82170422f 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 71dd64db31c..3e026b7d752 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 93a2a4ca8a6..a3a42d36347 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 a8a82d79835..55cd6d95192 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 d58c0316092..d232de42f79 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 3fa167ac787..1a1581a0ffa 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 981b343a89d..3455d74314e 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 0a79a63b285..ad4667f410d 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 9735ef02d21..16a7abcf1f6 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 b93d5a7e92f..d9a307da577 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 9c0ca4a0e23..a5e24b80628 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 f644f4fbc16..2a25f6e8a18 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 fff8538e644..764d398df53 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 fb9a358d00f..e9ecafea35f 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 44a8455334d..0b8b132713a 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 be5f95ca1c5..48987e23812 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 8ecef5c354a..2a6285fc66d 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 2bb7bb038fc..3446ef55002 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 64013107279..e5de7e3d454 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 4b34e28af2f..9b371cfdb9e 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 } } -- GitLab