From fd7d9cc4d13d52c3e76df12e32e3742d804be857 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 2 Mar 2021 20:39:36 -0500
Subject: [PATCH] Fix build after merge

---
 indra/llfilesystem/CMakeLists.txt  |  2 +-
 indra/llfilesystem/lldiskcache.cpp | 12 +++++++-----
 indra/newview/alaoengine.cpp       | 15 ++++++++-------
 indra/newview/alaoengine.h         |  5 +++--
 indra/newview/llvoavatar.cpp       |  3 ++-
 5 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt
index e5efcf6dfd6..62463b0c5f2 100644
--- a/indra/llfilesystem/CMakeLists.txt
+++ b/indra/llfilesystem/CMakeLists.txt
@@ -71,7 +71,7 @@ target_link_libraries(llfilesystem
     )
 
 if (WINDOWS)
-  target_link_libraries(llvfs Shlwapi)
+  target_link_libraries(llfilesystem Shlwapi)
 endif (WINDOWS)
 
 if (DARWIN)
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp
index c9f7684b5a6..1708b233ffd 100644
--- a/indra/llfilesystem/lldiskcache.cpp
+++ b/indra/llfilesystem/lldiskcache.cpp
@@ -64,7 +64,7 @@ void LLDiskCache::purge()
     std::vector<file_info_t> file_info;
 
 #if LL_WINDOWS
-    std::wstring cache_path(utf8str_to_utf16str(mCacheDir));
+    std::wstring cache_path(ll_convert_string_to_wide(mCacheDir));
 #else
     std::string cache_path(mCacheDir);
 #endif
@@ -220,8 +220,10 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
     const std::time_t cur_time = std::time(nullptr);
 
 #if LL_WINDOWS
+    std::wstring wpath = ll_convert_string_to_wide(file_path);
+
     // file last write time
-    const std::time_t last_write_time = boost::filesystem::last_write_time(utf8str_to_utf16str(file_path));
+    const std::time_t last_write_time = boost::filesystem::last_write_time(wpath);
 
     // delta between cur time and last time the file was written
     const std::time_t delta_time = cur_time - last_write_time;
@@ -230,7 +232,7 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
     // before the last one
     if (delta_time > time_threshold)
     {
-        boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), cur_time);
+        boost::filesystem::last_write_time(wpath, cur_time);
     }
 #else
     // file last write time
@@ -272,7 +274,7 @@ void LLDiskCache::clearCache()
      * likely just fine
      */
 #if LL_WINDOWS
-    std::wstring cache_path(utf8str_to_utf16str(mCacheDir));
+    std::wstring cache_path(ll_convert_string_to_wide(mCacheDir));
 #else
     std::string cache_path(mCacheDir);
 #endif
@@ -305,7 +307,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
      * is an easy win.
      */
 #if LL_WINDOWS
-    std::wstring dir_path(utf8str_to_utf16str(dir));
+    std::wstring dir_path(ll_convert_string_to_wide(dir));
 #else
     std::string dir_path(dir);
 #endif
diff --git a/indra/newview/alaoengine.cpp b/indra/newview/alaoengine.cpp
index ad35646a651..1b48047b7d1 100644
--- a/indra/newview/alaoengine.cpp
+++ b/indra/newview/alaoengine.cpp
@@ -25,7 +25,6 @@
 
 #include "llviewerprecompiledheaders.h"
 
-
 #include "roles_constants.h"
 
 #include "alaoengine.h"
@@ -35,11 +34,11 @@
 #include "llagentcamera.h"
 #include "llanimationstates.h"
 #include "llassetstorage.h"
+#include "llfilesystem.h"
 #include "llinventorydefines.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
 #include "llnotificationsutil.h"
-#include "llvfs.h"
 #include "llviewercontrol.h"
 #include "llviewerinventory.h"
 #include "llviewerobjectlist.h"
@@ -1667,7 +1666,7 @@ bool ALAOEngine::importNotecard(const LLInventoryItem* item)
 }
 
 // static
-void ALAOEngine::onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLAssetType::EType type,
+void ALAOEngine::onNotecardLoadComplete(const LLUUID& assetUUID, LLAssetType::EType type,
 											void* userdata, S32 status, LLExtStat extStatus)
 {
 	if (status != LL_ERR_NOERR)
@@ -1680,11 +1679,13 @@ void ALAOEngine::onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLA
 	}
 	LL_DEBUGS("AOEngine") << "Downloading import notecard complete." << LL_ENDL;
 
-	S32 notecardSize = vfs->getSize(assetUUID, type);
+	LLFileSystem file(assetUUID, type, LLFileSystem::READ);
+
+	S32 notecardSize = file.getSize();
 	auto buffer = std::make_unique<char[]>(notecardSize + 1);
 	buffer[notecardSize] = '\0';
-	S32 ret = vfs->getData(assetUUID, type, reinterpret_cast<U8*>(buffer.get()), 0, notecardSize);
-	if (ret > 0)
+
+	if (file.read((U8*)buffer.get(), notecardSize) != FALSE)
 	{
 		ALAOEngine::instance().parseNotecard(std::move(buffer));
 	}
@@ -1694,7 +1695,7 @@ void ALAOEngine::onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLA
 	}
 }
 
-void ALAOEngine::parseNotecard(std::unique_ptr<char[]>&& buffer)
+void ALAOEngine::parseNotecard(std::unique_ptr<char[]> buffer)
 {
 	LL_DEBUGS("AOEngine") << "parsing import notecard" << LL_ENDL;
 
diff --git a/indra/newview/alaoengine.h b/indra/newview/alaoengine.h
index 0307b762cee..71ac93363be 100644
--- a/indra/newview/alaoengine.h
+++ b/indra/newview/alaoengine.h
@@ -186,9 +186,10 @@ class ALAOEngine final : public LLSingleton<ALAOEngine>
 	void onRegionChange();
 
 	void onToggleAOControl();
-	static void onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLAssetType::EType type,
+	static void onNotecardLoadComplete(const LLUUID& assetUUID, LLAssetType::EType type,
 												void* userdata, S32 status, LLExtStat extStatus);
-	void parseNotecard(std::unique_ptr<char[]>&& buffer);
+
+	void parseNotecard(std::unique_ptr<char[]> buffer);
 
 	updated_signal_t mUpdatedSignal;
 	animation_changed_signal_t mAnimationChangedSignal;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 3785b99ef11..5975e369c1f 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1325,7 +1325,8 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
 {
     LL_RECORD_BLOCK_TIME(FTM_AVATAR_EXTENT_UPDATE);
 
-    static const LLCachedControl<S32> box_detail(gSavedSettings, "AvatarBoundingBoxComplexity");
+    static const LLCachedControl<S32> box_detail_cc(gSavedSettings, "AvatarBoundingBoxComplexity");
+	S32 box_detail = box_detail_cc;
     if (getOverallAppearance() != AOA_NORMAL)
     {
         if (isControlAvatar())
-- 
GitLab