summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-10-28 09:28:55 -0400
committerRye <rye@alchemyviewer.org>2025-10-31 07:46:07 -0400
commit7429ee1f84161103affefa97a7d4f40803445364 (patch)
treecbb5d7a8b69df2aa0c486e7b7163beb411e595bd
parentefb62b8899848d0f048967fa29cf5837af95cdee (diff)
Fix multiple unicode file io handling issues with llofstream and llifstream
Signed-off-by: Rye <rye@alchemyviewer.org>
-rw-r--r--indra/integration_tests/llimage_libtest/llimage_libtest.cpp2
-rw-r--r--indra/llcommon/llprocessor.cpp2
-rw-r--r--indra/llcommon/tests/llprocess_test.cpp8
-rw-r--r--indra/llcommon/tests/llsdserialize_test.cpp2
-rw-r--r--indra/llfilesystem/lldir_win32.cpp4
-rw-r--r--indra/llui/llviewereventrecorder.h2
-rw-r--r--indra/newview/gltf/accessor.cpp2
-rw-r--r--indra/newview/gltf/asset.cpp4
-rw-r--r--indra/newview/gltf/llgltfloader.cpp2
-rw-r--r--indra/newview/llsettingsvo.cpp4
-rw-r--r--indra/newview/llviewerdisplay.cpp2
-rw-r--r--indra/newview/tests/llsechandler_basic_test.cpp4
-rw-r--r--indra/test/test.cpp2
13 files changed, 20 insertions, 20 deletions
diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
index c45bd6fd01..1bd1bb2d2b 100644
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
@@ -329,7 +329,7 @@ public:
void run()
{
- std::ofstream os(mFile.c_str());
+ llofstream os(mFile.c_str());
while (!sAllDone)
{
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 012b4ffb59..464578c2d9 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -841,7 +841,7 @@ private:
// Nicky: We just look into cpu0. In theory we could iterate over all cores
// "/sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq"
// But those should not fluctuate that much?
- std::ifstream fIn { "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" };
+ llifstream fIn{ "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" };
if( !fIn.is_open() )
return 0.0;
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 9eaf5bf3e3..4a88d69ded 100644
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -95,7 +95,7 @@ static std::string readfile(const std::string& pathname, const std::string& desc
{
use_desc = "in " + pathname;
}
- std::ifstream inf(pathname.c_str());
+ llifstream inf(pathname.c_str());
std::string output;
if (!std::getline(inf, output))
{
@@ -186,7 +186,7 @@ struct PythonProcessLauncher
const char* APR_LOG = getenv("APR_LOG");
if (APR_LOG && *APR_LOG)
{
- std::ifstream inf(APR_LOG);
+ llifstream inf(APR_LOG);
if (! inf.is_open())
{
LL_WARNS() << "Couldn't open '" << APR_LOG << "'" << LL_ENDL;
@@ -838,7 +838,7 @@ namespace tut
// How do we know it's not terminated? By making it respond to
// a specific stimulus in a specific way.
{
- std::ofstream outf(to.getName().c_str());
+ llofstream outf(to.getName().c_str());
outf << "go";
} // flush and close.
// now wait for the script to terminate... one way or another.
@@ -901,7 +901,7 @@ namespace tut
// How do we know it's not terminated? By making it respond to
// a specific stimulus in a specific way.
{
- std::ofstream outf(to.getName().c_str());
+ llofstream outf(to.getName().c_str());
outf << "go";
} // flush and close.
// now wait for the script to terminate... one way or another.
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index fae9f7023f..ee315051d8 100644
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -2117,7 +2117,7 @@ namespace tut
" f.write(lenformat.pack(len(serialized)))\n"
" f.write(serialized)\n";});
- std::ifstream inf(file.getName().c_str());
+ llifstream inf(file.getName().c_str());
LLSD item;
try
{
diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp
index 58c080c982..9624b1197f 100644
--- a/indra/llfilesystem/lldir_win32.cpp
+++ b/indra/llfilesystem/lldir_win32.cpp
@@ -52,7 +52,7 @@ namespace
// This is called so early that we can't count on static objects being
// properly constructed yet, so declare a pointer instead of an instance.
- std::ofstream* prelogf = nullptr;
+ llofstream* prelogf = nullptr;
void prelog(const std::string& message)
{
@@ -208,7 +208,7 @@ LLDir_Win32::LLDir_Win32()
{
// successfully created logdir, plunk a log file there
std::string logfilename(add(mOSUserDir, "lldir.log"));
- std::ofstream logfile(logfilename.c_str());
+ llofstream logfile(logfilename.c_str());
if (! logfile.is_open())
{
report(std::cerr);
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
index 5636c068d8..3bd8eb1f75 100644
--- a/indra/llui/llviewereventrecorder.h
+++ b/indra/llui/llviewereventrecorder.h
@@ -75,7 +75,7 @@ public:
bool logEvents;
std::string mLogFilename;
- llofstream mLog;
+ llofstream mLog;
private:
diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp
index f0ad3fa594..900c1da170 100644
--- a/indra/newview/gltf/accessor.cpp
+++ b/indra/newview/gltf/accessor.cpp
@@ -213,7 +213,7 @@ bool Buffer::save(Asset& asset, const std::string& folder)
bin_file += mUri;
- std::ofstream file(bin_file, std::ios::binary);
+ llofstream file(bin_file, std::ios::binary);
if (!file.is_open())
{
LL_WARNS("GLTF") << "Failed to open file: " << bin_file << LL_ENDL;
diff --git a/indra/newview/gltf/asset.cpp b/indra/newview/gltf/asset.cpp
index 28f30ae1c9..daa992b269 100644
--- a/indra/newview/gltf/asset.cpp
+++ b/indra/newview/gltf/asset.cpp
@@ -928,7 +928,7 @@ bool Asset::save(const std::string& filename)
object obj;
serialize(obj);
std::string buffer = boost::json::serialize(obj, {});
- std::ofstream file(filename, std::ios::binary);
+ llofstream file(filename, std::ios::binary);
file.write(buffer.c_str(), buffer.size());
return true;
@@ -1090,7 +1090,7 @@ bool Image::save(Asset& asset, const std::string& folder)
// set URI to non-j2c file for now, but later we'll want to reference the j2c hash
mUri = name + extension;
- std::ofstream file(filename, std::ios::binary);
+ llofstream file(filename, std::ios::binary);
file.write((const char*)buffer.mData.data() + bufferView.mByteOffset, bufferView.mByteLength);
}
else if (mTexture.notNull())
diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp
index 12bd5661d2..c7e598beb7 100644
--- a/indra/newview/gltf/llgltfloader.cpp
+++ b/indra/newview/gltf/llgltfloader.cpp
@@ -1762,7 +1762,7 @@ std::string LLGLTFLoader::extractTextureToTempFile(S32 textureIndex, const std::
"gltf_embedded_" + texture_type + "_" + std::to_string(sourceIndex) + extension;
// Write the image data to the temporary file
- std::ofstream temp_file(temp_filename, std::ios::binary);
+ llofstream temp_file(temp_filename, std::ios::binary);
if (temp_file.is_open())
{
temp_file.write(reinterpret_cast<const char*>(data_ptr), data_size);
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 6023f6885d..8329ed86da 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -364,7 +364,7 @@ bool LLSettingsVOBase::exportFile(const LLSettingsBase::ptr_t &settings, const s
{
try
{
- std::ofstream file(filename, std::ios::out | std::ios::trunc);
+ llofstream file(filename, std::ios::out | std::ios::trunc);
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
if (!file)
@@ -390,7 +390,7 @@ LLSettingsBase::ptr_t LLSettingsVOBase::importFile(const std::string &filename)
try
{
- std::ifstream file(filename, std::ios::in);
+ llifstream file(filename, std::ios::in);
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
if (!file)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index eaff660a78..61c5aa4da4 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1070,7 +1070,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
LLGLSLShader::finishProfile(stats);
auto report_name = getProfileStatsFilename();
- std::ofstream outf(report_name);
+ llofstream outf(report_name);
if (! outf)
{
LL_WARNS() << "Couldn't write to " << std::quoted(report_name) << LL_ENDL;
diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp
index f4ee15319e..acbadbc85a 100644
--- a/indra/newview/tests/llsechandler_basic_test.cpp
+++ b/indra/newview/tests/llsechandler_basic_test.cpp
@@ -773,7 +773,7 @@ namespace tut
LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
LLXORCipher cipher2(unique_id, sizeof(unique_id));
cipher2.encrypt(&binary_data[0], 16);
- std::ofstream temp_file("sechandler_settings.tmp", std::ofstream::binary);
+ llofstream temp_file("sechandler_settings.tmp", std::ofstream::binary);
temp_file.write((const char *)&binary_data[0], binary_data.size());
temp_file.close();
@@ -846,7 +846,7 @@ namespace tut
// rewrite the initial file to verify reloads
handler = NULL;
- std::ofstream temp_file2("sechandler_settings.tmp", std::ofstream::binary);
+ llofstream temp_file2("sechandler_settings.tmp", std::ofstream::binary);
temp_file2.write((const char *)&binary_data[0], binary_data.size());
temp_file2.close();
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 172b6e3542..b611e52835 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -108,7 +108,7 @@ public:
void replay(std::ostream& out)
{
mFile.close();
- std::ifstream inf(mTempFile.getName().c_str());
+ llifstream inf(mTempFile.getName().c_str());
std::string line;
while (std::getline(inf, line))
{