summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llappearance/llpolymesh.cpp2
-rw-r--r--indra/llcommon/llcrc.cpp2
-rw-r--r--indra/llcommon/llcrc.h2
-rwxr-xr-xindra/llcommon/llfile.h10
-rw-r--r--indra/llcommon/llprocessor.cpp4
-rw-r--r--indra/llcommon/llsys.cpp6
-rwxr-xr-xindra/llfilesystem/lldir.cpp2
-rw-r--r--indra/llfilesystem/tests/lldir_test.cpp2
-rw-r--r--indra/llimage/llimagedimensionsinfo.cpp2
-rw-r--r--indra/llimage/llimagetga.cpp2
-rw-r--r--indra/llmessage/llassetstorage.cpp2
-rw-r--r--indra/llmessage/lltransfersourcefile.cpp2
-rw-r--r--indra/llmessage/lltransfertargetfile.cpp2
-rw-r--r--indra/llmessage/llxfer_file.cpp16
-rw-r--r--indra/llmessage/message.cpp4
-rw-r--r--indra/llmessage/tests/lldatapacker_test.cpp4
-rw-r--r--indra/llrender/llshadermgr.cpp4
-rw-r--r--indra/llui/lluicolortable.cpp2
-rw-r--r--indra/llui/llxuiparser.cpp4
-rw-r--r--indra/llxml/llcontrol.cpp2
-rw-r--r--indra/llxml/llxmlparser.cpp4
-rw-r--r--indra/newview/llconversationlog.cpp4
-rw-r--r--indra/newview/lldrawpoolbump.cpp2
-rwxr-xr-xindra/newview/llfloateruipreview.cpp2
-rw-r--r--indra/newview/llinventorymodel.cpp4
-rw-r--r--indra/newview/llkeyconflict.cpp2
-rw-r--r--indra/newview/lllogchat.cpp12
-rw-r--r--indra/newview/llmutelist.cpp8
-rw-r--r--indra/newview/llpreviewnotecard.cpp4
-rw-r--r--indra/newview/llpreviewscript.cpp4
-rw-r--r--indra/newview/llstartup.cpp6
-rw-r--r--indra/newview/lltoolbarview.cpp2
-rw-r--r--indra/newview/llviewerassetstorage.cpp2
-rw-r--r--indra/newview/llviewerinput.cpp2
-rw-r--r--indra/newview/llviewermenufile.cpp2
-rw-r--r--indra/newview/llviewerstatsrecorder.cpp2
36 files changed, 68 insertions, 70 deletions
diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp
index b579dc007b..45f51950ec 100644
--- a/indra/llappearance/llpolymesh.cpp
+++ b/indra/llappearance/llpolymesh.cpp
@@ -280,7 +280,7 @@ bool LLPolyMeshSharedData::loadMesh( const std::string& fileName )
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
return false;
}
- LLFILE* fp = LLFile::fopen(fileName, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* fp = LLFile::fopen(fileName, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!fp)
{
LLError::LLUserWarningMsg::showMissingFiles();
diff --git a/indra/llcommon/llcrc.cpp b/indra/llcommon/llcrc.cpp
index f836a12c35..33bf01a29b 100644
--- a/indra/llcommon/llcrc.cpp
+++ b/indra/llcommon/llcrc.cpp
@@ -166,7 +166,7 @@ void LLCRC::update(const std::string& filename)
return;
}
- FILE* fp = LLFile::fopen(filename, TEXT("rb")); /* Flawfinder: ignore */
+ FILE* fp = LLFile::fopen(filename, LLFILE_MODE("rb")); /* Flawfinder: ignore */
if (fp)
{
diff --git a/indra/llcommon/llcrc.h b/indra/llcommon/llcrc.h
index cbf4cf4e75..2ea5fbc3b0 100644
--- a/indra/llcommon/llcrc.h
+++ b/indra/llcommon/llcrc.h
@@ -36,7 +36,7 @@
// example (don't try this at work kids):
//
// LLCRC crc;
-// FILE* fp = LLFile::fopen(filename,TEXT("rb"));
+// FILE* fp = LLFile::fopen(filename,LLFILE_MODE("rb"));
// while(!feof(fp)) {
// crc.update(fgetc(fp));
// }
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index 7e8e114098..8de3f5c9b4 100755
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -56,12 +56,10 @@ typedef FILE LLFILE;
#include "fsyspath.h"
#include "llstring.h" // safe char* -> std::string conversion
-#ifndef TEXT
#if LL_WINDOWS
-#define TEXT(flags) L##flags
+#define LLFILE_MODE(flags) L##flags
#else
-#define TEXT(flags) flags
-#endif
+#define LLFILE_MODE(flags) flags
#endif
/// This class provides a selection of functions to operate on files through names and
@@ -415,7 +413,7 @@ public:
std::error_code ec;
return copy(source, target, std::filesystem::copy_options::overwrite_existing, ec);
}
- inline static bool copy(const std::string& source, char* target)
+ inline static bool copy(const std::string& source, const char* target)
{
std::error_code ec;
return copy(source, target, std::filesystem::copy_options::overwrite_existing, ec);
@@ -686,7 +684,7 @@ private:
#else
typedef int llfile_handle_t;
const llfile_handle_t InvalidHandle = -1;
- llfile_handle_t mHandle = -1;; // The file handle/descriptor
+ llfile_handle_t mHandle = -1; // The file handle/descriptor
#endif
std::ios_base::openmode mOpen{}; // Used to emulate std::ios_base::app under Windows
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 7656986fe2..9d0ef45bee 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -837,7 +837,7 @@ private:
void get_proc_cpuinfo()
{
std::map< std::string, std::string > cpuinfo;
- LLFILE* cpuinfo_fp = LLFile::fopen(CPUINFO_FILE, TEXT("rb"));
+ LLFILE* cpuinfo_fp = LLFile::fopen(CPUINFO_FILE, LLFILE_MODE("rb"));
if(cpuinfo_fp)
{
char line[MAX_STRING];
@@ -954,7 +954,7 @@ private:
std::ostringstream s;
// *NOTE:Mani - This is for linux only.
- LLFILE* cpuinfo = LLFile::fopen(CPUINFO_FILE, TEXT("rb"));
+ LLFILE* cpuinfo = LLFile::fopen(CPUINFO_FILE, LLFILE_MODE("rb"));
if(cpuinfo)
{
char line[MAX_STRING];
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 499de996e2..5ef042b5a7 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -514,7 +514,7 @@ namespace {
#if LL_LINUX
constexpr U32 STATUS_SIZE = 2048;
- LLFILE* status_filep = LLFile::fopen("/proc/self/status", TEXT("rb"));
+ LLFILE* status_filep = LLFile::fopen("/proc/self/status", LLFILE_MODE("rb"));
if (status_filep)
{
char buff[STATUS_SIZE]; /* Flawfinder: ignore */
@@ -1273,7 +1273,7 @@ bool gunzip_file(const std::string& srcfile, const std::string& dstfile)
src = gzopen(srcfile.c_str(), "rb");
#endif
if (! src) goto err;
- dst = LLFile::fopen(tmpfile, TEXT("wb")); /* Flawfinder: ignore */
+ dst = LLFile::fopen(tmpfile, LLFILE_MODE("wb")); /* Flawfinder: ignore */
if (! dst) goto err;
do
{
@@ -1314,7 +1314,7 @@ bool gzip_file(const std::string& srcfile, const std::string& dstfile)
#endif
if (! dst) goto err;
- src = LLFile::fopen(srcfile, TEXT("rb")); /* Flawfinder: ignore */
+ src = LLFile::fopen(srcfile, LLFILE_MODE("rb")); /* Flawfinder: ignore */
if (! src) goto err;
while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0)
diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index 3ec8983e8a..1a647362c5 100755
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -1010,7 +1010,7 @@ bool LLDir::setCacheDir(const std::string &path)
{
LLFile::mkdir(path);
std::string tempname = add(path, "temp");
- LLFILE* file = LLFile::fopen(tempname, TEXT("wt"));
+ LLFILE* file = LLFile::fopen(tempname, LLFILE_MODE("wt"));
if (file)
{
fclose(file);
diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp
index b879fef48a..412feb147b 100644
--- a/indra/llfilesystem/tests/lldir_test.cpp
+++ b/indra/llfilesystem/tests/lldir_test.cpp
@@ -405,7 +405,7 @@ namespace tut
std::string makeTestFile( const std::string& dir, const std::string& file )
{
std::string path = dir + file;
- LLFILE* handle = LLFile::fopen(path, TEXT("w"));
+ LLFILE* handle = LLFile::fopen(path, LLFILE_MODE("w"));
ensure("failed to open test file '"+path+"'", handle != NULL );
// Harbison & Steele, 4th ed., p. 366: "If an error occurs, fputs
// returns EOF; otherwise, it returns some other, nonnegative value."
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp
index 1d93014e1b..2ae7760d4c 100644
--- a/indra/llimage/llimagedimensionsinfo.cpp
+++ b/indra/llimage/llimagedimensionsinfo.cpp
@@ -166,7 +166,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
{
sJpegErrorEncountered = false;
clean();
- FILE* fp = LLFile::fopen(mSrcFilename, TEXT("rb"));
+ FILE* fp = LLFile::fopen(mSrcFilename, LLFILE_MODE("rb"));
if (!fp)
{
setLastError("Unable to open file for reading", mSrcFilename);
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 7c6686db95..7b09553974 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -1191,7 +1191,7 @@ bool LLImageTGA::loadFile( const std::string& path )
return false;
}
- LLFILE* file = LLFile::fopen(path, TEXT("rb")); /* Flawfinder: ignore */
+ LLFILE* file = LLFile::fopen(path, LLFILE_MODE("rb")); /* Flawfinder: ignore */
if( !file )
{
LL_WARNS() << "Couldn't open file " << path << LL_ENDL;
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 13be0161b4..a8f0554a71 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -1402,7 +1402,7 @@ void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
uuid.toString(uuid_str);
filename = llformat("%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type));
- LLFILE* fp = LLFile::fopen(filename, TEXT("wb")); /* Flawfinder: ignore */
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("wb")); /* Flawfinder: ignore */
if (fp)
{
const S32 buf_size = 65536;
diff --git a/indra/llmessage/lltransfersourcefile.cpp b/indra/llmessage/lltransfersourcefile.cpp
index c2bf5c2afa..d2d264c520 100644
--- a/indra/llmessage/lltransfersourcefile.cpp
+++ b/indra/llmessage/lltransfersourcefile.cpp
@@ -62,7 +62,7 @@ void LLTransferSourceFile::initTransfer()
return;
}
// Look for the file.
- mFP = LLFile::fopen(mParams.getFilename(), TEXT("rb")); /* Flawfinder: ignore */
+ mFP = LLFile::fopen(mParams.getFilename(), LLFILE_MODE("rb")); /* Flawfinder: ignore */
if (!mFP)
{
sendTransferStatus(LLTS_ERROR);
diff --git a/indra/llmessage/lltransfertargetfile.cpp b/indra/llmessage/lltransfertargetfile.cpp
index cc66befcae..05dba219ed 100644
--- a/indra/llmessage/lltransfertargetfile.cpp
+++ b/indra/llmessage/lltransfertargetfile.cpp
@@ -75,7 +75,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c
if (!mFP)
{
- mFP = LLFile::fopen(mParams.mFilename, TEXT("wb")); /* Flawfinder: ignore */
+ mFP = LLFile::fopen(mParams.mFilename, LLFILE_MODE("wb")); /* Flawfinder: ignore */
if (!mFP)
{
diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp
index f0310c6297..5f27cc4827 100644
--- a/indra/llmessage/llxfer_file.cpp
+++ b/indra/llmessage/llxfer_file.cpp
@@ -161,7 +161,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id,
S32 LLXfer_File::startDownload()
{
S32 retval = 0; // presume success
- mFp = LLFile::fopen(mTempFilename,TEXT("w+b")); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mTempFilename,LLFILE_MODE("w+b")); /* Flawfinder : ignore */
if (mFp)
{
fclose(mFp);
@@ -209,7 +209,7 @@ S32 LLXfer_File::startSend (U64 xfer_id, const LLHost &remote_host)
mBufferStartOffset = 0;
// We leave the file open, assuming we'll start reading and sending soon
- mFp = LLFile::fopen(mLocalFilename,TEXT("rb")); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mLocalFilename, LLFILE_MODE("rb")); /* Flawfinder : ignore */
if (mFp)
{
fseek(mFp,0,SEEK_END);
@@ -252,7 +252,7 @@ S32 LLXfer_File::reopenFileHandle()
if (mFp == NULL)
{
- mFp = LLFile::fopen(mLocalFilename,TEXT("rb")); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mLocalFilename, LLFILE_MODE("rb")); /* Flawfinder : ignore */
if (mFp == NULL)
{
LL_INFOS("Xfer") << "Warning: " << mLocalFilename << " not found when re-opening file" << LL_ENDL;
@@ -313,7 +313,7 @@ S32 LLXfer_File::flush()
{
LL_ERRS("Xfer") << "Overwriting open file pointer!" << LL_ENDL;
}
- mFp = LLFile::fopen(mTempFilename,TEXT("a+b")); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mTempFilename, LLFILE_MODE("a+b")); /* Flawfinder : ignore */
if (mFp)
{
@@ -381,11 +381,11 @@ S32 LLXfer_File::processEOF()
}
else
{
- //LLFILE* fp = LLFile::fopen(mTempFilename, TEXT("r"));
+ //LLFILE* fp = LLFile::fopen(mTempFilename, LLFILE_MODE("r"));
//LL_WARNS() << "File " << mTempFilename << " does "
// << (!fp ? "not" : "" ) << " exit." << LL_ENDL;
//if(fp) fclose(fp);
- //fp = LLFile::fopen(mLocalFilename, TEXT("r"));
+ //fp = LLFile::fopen(mLocalFilename, LLFILE_MODE("r"));
//LL_WARNS() << "File " << mLocalFilename << " does "
// << (!fp ? "not" : "" ) << " exit." << LL_ENDL;
//if(fp) fclose(fp);
@@ -452,8 +452,8 @@ U32 LLXfer_File::getXferTypeTag()
S32 copy_file(const std::string& from, const std::string& to)
{
S32 rv = 0;
- LLFILE* in = LLFile::fopen(from, TEXT("rb")); /*Flawfinder: ignore*/
- LLFILE* out = LLFile::fopen(to, TEXT("wb")); /*Flawfinder: ignore*/
+ LLFILE* in = LLFile::fopen(from, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
+ LLFILE* out = LLFile::fopen(to, LLFILE_MODE("wb")); /*Flawfinder: ignore*/
if(in && out)
{
S32 read = 0;
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 5b3b57f11e..df58c8a7f3 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2376,7 +2376,7 @@ void dump_prehash_files()
{
U32 i;
std::string filename("../../indra/llmessage/message_prehash.h");
- LLFILE* fp = LLFile::fopen(filename, TEXT("w")); /* Flawfinder: ignore */
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("w")); /* Flawfinder: ignore */
if (fp)
{
fprintf(
@@ -2407,7 +2407,7 @@ void dump_prehash_files()
fclose(fp);
}
filename = std::string("../../indra/llmessage/message_prehash.cpp");
- fp = LLFile::fopen(filename, TEXT("w")); /* Flawfinder: ignore */
+ fp = LLFile::fopen(filename, LLFILE_MODE("w")); /* Flawfinder: ignore */
if (fp)
{
fprintf(
diff --git a/indra/llmessage/tests/lldatapacker_test.cpp b/indra/llmessage/tests/lldatapacker_test.cpp
index 92a2c31ca8..5823980d43 100644
--- a/indra/llmessage/tests/lldatapacker_test.cpp
+++ b/indra/llmessage/tests/lldatapacker_test.cpp
@@ -348,7 +348,7 @@ namespace tut
{
F32 f_val = 44.44f, f_unpkval;
- LLFILE* fp = LLFile::fopen(TEST_FILE_NAME, TEXT("w+"));
+ LLFILE* fp = LLFile::fopen(TEST_FILE_NAME, LLFILE_MODE("w+"));
if(!fp)
{
LL_ERRS() << "File couldnt be open" << LL_ENDL;
@@ -403,7 +403,7 @@ namespace tut
LLVector4 unpkllvec4;
LLUUID unpkuuid;
- LLFILE* fp = LLFile::fopen(TEST_FILE_NAME,TEXT("w+"));
+ LLFILE* fp = LLFile::fopen(TEST_FILE_NAME, LLFILE_MODE("w+"));
if(!fp)
{
LL_ERRS() << "File couldnt be open" << LL_ENDL;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 0ed98f2e7e..f6738364a6 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -501,7 +501,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
open_file_name = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/errorF.glsl");
}
- file = LLFile::fopen(open_file_name, TEXT("r"));
+ file = LLFile::fopen(open_file_name, LLFILE_MODE("r"));
}
else
#endif
@@ -529,7 +529,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
*/
LL_DEBUGS("ShaderLoading") << "Looking in " << open_file_name << LL_ENDL;
- file = LLFile::fopen(open_file_name, TEXT("r")); /* Flawfinder: ignore */
+ file = LLFile::fopen(open_file_name, LLFILE_MODE("r")); /* Flawfinder: ignore */
if (file)
{
LL_DEBUGS("ShaderLoading") << "Loading file: " << open_file_name << " (Want class " << gpu_class << ")" << LL_ENDL;
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 206d02b366..cd062b23b8 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -298,7 +298,7 @@ void LLUIColorTable::saveUserSettings() const
if(!output_node->isNull())
{
const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml");
- LLFILE *fp = LLFile::fopen(filename, TEXT("w"));
+ LLFILE *fp = LLFile::fopen(filename, LLFILE_MODE("w"));
if(fp != NULL)
{
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index e3d806bdd0..9bf2f4220c 100644
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -637,7 +637,7 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p
}
}
- LLFILE* xsd_file = LLFile::fopen(file_name.c_str(), TEXT("w"));
+ LLFILE* xsd_file = LLFile::fopen(file_name.c_str(), LLFILE_MODE("w"));
LLXMLNode::writeHeaderToFile(xsd_file);
root_nodep->writeToFile(xsd_file);
fclose(xsd_file);
@@ -1397,7 +1397,7 @@ bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBl
mCurReadDepth = 0;
setParseSilently(silent);
- ScopedFile file(filename, TEXT("rb"));
+ ScopedFile file(filename, LLFILE_MODE("rb"));
if( !file.isOpen() )
{
LL_WARNS("ReadXUI") << "Unable to open file " << filename << LL_ENDL;
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index a8e44f7bdd..24d2facc4c 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -399,7 +399,7 @@ void LLControlGroup::cleanup()
if(mSettingsProfile && getCount.size() != 0)
{
std::string file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, SETTINGS_PROFILE);
- LLFILE* out = LLFile::fopen(file, TEXT("w")); /* Flawfinder: ignore */
+ LLFILE* out = LLFile::fopen(file, LLFILE_MODE("w")); /* Flawfinder: ignore */
if(!out)
{
LL_WARNS("SettingsProfile") << "Error opening " << SETTINGS_PROFILE << LL_ENDL;
diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp
index 5aac9100dd..8afd412cda 100644
--- a/indra/llxml/llxmlparser.cpp
+++ b/indra/llxml/llxmlparser.cpp
@@ -72,7 +72,7 @@ bool LLXmlParser::parseFile(const std::string &path)
bool success = true;
- LLFILE* file = LLFile::fopen(path, TEXT("rb")); /* Flawfinder: ignore */
+ LLFILE* file = LLFile::fopen(path, LLFILE_MODE("rb")); /* Flawfinder: ignore */
if( !file )
{
mAuxErrorString = llformat( "Couldn't open file %s", path.c_str());
@@ -388,7 +388,7 @@ int main()
{
char buf[1024];
- LLFILE* file = LLFile::fopen("test.xml", TEXT("rb"));
+ LLFILE* file = LLFile::fopen("test.xml", LLFILE_MODE("rb"));
if( !file )
{
return 1;
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 63a3743ef7..bfcc2e4182 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -512,7 +512,7 @@ bool LLConversationLog::saveToFile(const std::string& filename)
return false;
}
- LLFILE* fp = LLFile::fopen(filename, TEXT("wb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("wb"));
if (!fp)
{
LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL;
@@ -556,7 +556,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename)
return false;
}
- LLFILE* fp = LLFile::fopen(filename, TEXT("rb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("rb"));
if (!fp)
{
LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL;
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 200fce7b5b..a42972205a 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -114,7 +114,7 @@ void LLStandardBumpmap::addstandard()
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS
std::string file_name = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "std_bump.ini" );
- LLFILE* file = LLFile::fopen( file_name, TEXT("rt") ); /*Flawfinder: ignore*/
+ LLFILE* file = LLFile::fopen( file_name, LLFILE_MODE("rt") ); /*Flawfinder: ignore*/
if( !file )
{
LL_WARNS() << "Could not open std_bump <" << file_name << ">" << LL_ENDL;
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index cf710d45dd..637871da0d 100755
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -574,7 +574,7 @@ void LLFloaterUIPreview::onClickExportSchema()
// std::string file_name(template_path + gDirUtilp->getDirDelimiter() + widget_name + ".rng");
- // LLFILE* rng_file = LLFile::fopen(file_name.c_str(), TEXT("w"));
+ // LLFILE* rng_file = LLFile::fopen(file_name.c_str(), LLFILE_MODE("w"));
// {
// LLXMLNode::writeHeaderToFile(rng_file);
// const bool use_type_decorations = false;
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 9491c9d610..c34df48f7d 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -2745,7 +2745,7 @@ bool LLInventoryModel::loadSkeleton(
const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN;
std::string gzip_filename(inventory_filename);
gzip_filename.append(".gz");
- LLFILE* fp = LLFile::fopen(gzip_filename, TEXT("rb"));
+ LLFILE* fp = LLFile::fopen(gzip_filename, LLFILE_MODE("rb"));
bool remove_inventory_file = false;
if (LLAppViewer::instance()->isSecondInstance())
{
@@ -4908,7 +4908,7 @@ bool decompress_file(const char* src_filename, const char* dst_filename)
// open the files
src = gzopen(src_filename, "rb");
if(!src) goto err_decompress;
- dst = LLFile::fopen(dst_filename, TEXT("wb"));
+ dst = LLFile::fopen(dst_filename, LLFILE_MODE("wb"));
if(!dst) goto err_decompress;
// decompress.
diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp
index 458d5225e1..c082c632f1 100644
--- a/indra/newview/llkeyconflict.cpp
+++ b/indra/newview/llkeyconflict.cpp
@@ -575,7 +575,7 @@ void LLKeyConflictHandler::saveToSettings(bool temporary)
// Write the resulting XML to file
if (!output_node->isNull())
{
- LLFILE *fp = LLFile::fopen(filename, TEXT("w"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("w"));
if (fp != NULL)
{
LLXMLNode::writeHeaderToFile(fp);
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 405530f5bd..59f6993a0b 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -453,7 +453,7 @@ void LLLogChat::loadChatHistory(const std::string& file_name, std::list<LLSD>& m
// If we got here, we managed to stat the file.
// Open the file to read in binary mode to prevent interpreting other characters as EOF
- LLFILE* fptr = LLFile::fopen(log_file_name, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* fptr = LLFile::fopen(log_file_name, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!fptr)
{ // Ok, this is strange but not really tragic in the big picture of things
LL_WARNS("ChatHistory") << "Unable to read file " << log_file_name << " after stat was successful" << LL_ENDL;
@@ -890,7 +890,7 @@ bool LLLogChat::isAdHocTranscriptExist(std::string file_name)
bool LLLogChat::isTranscriptFileFound(std::string fullname)
{
bool result = false;
- LLFILE * filep = LLFile::fopen(fullname, TEXT("rb"));
+ LLFILE * filep = LLFile::fopen(fullname, LLFILE_MODE("rb"));
if (NULL != filep)
{
if (makeLogFileName("chat") == fullname)
@@ -1183,7 +1183,7 @@ void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LL
}
bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false;
- LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), TEXT("rb"));/*Flawfinder: ignore*/
+ LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), LLFILE_MODE("rb"));/*Flawfinder: ignore*/
if (!fptr)
{
@@ -1192,17 +1192,17 @@ void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LL
{
std::string old_name(file_name);
old_name.erase(old_name.size() - GROUP_CHAT_SUFFIX.size());
- fptr = LLFile::fopen(LLLogChat::makeLogFileName(old_name), TEXT("rb"));
+ fptr = LLFile::fopen(LLLogChat::makeLogFileName(old_name), LLFILE_MODE("rb"));
if (fptr)
{
fclose(fptr);
LLFile::copy(LLLogChat::makeLogFileName(old_name), LLLogChat::makeLogFileName(file_name));
}
- fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), TEXT("rb"));
+ fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), LLFILE_MODE("rb"));
}
if (!fptr)
{
- fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), TEXT("rb"));/*Flawfinder: ignore*/
+ fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!fptr)
{
mNewLoad = false;
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp
index 0e9fe5eb52..35d36affa2 100644
--- a/indra/newview/llmutelist.cpp
+++ b/indra/newview/llmutelist.cpp
@@ -589,7 +589,7 @@ bool LLMuteList::loadFromFile(const std::string& filename)
return false;
}
- LLFILE* fp = LLFile::fopen(filename, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!fp)
{
LL_WARNS() << "Couldn't open mute list " << filename << LL_ENDL;
@@ -653,7 +653,7 @@ bool LLMuteList::saveToFile(const std::string& filename)
return false;
}
- LLFILE* fp = LLFile::fopen(filename, TEXT("wb")); /*Flawfinder: ignore*/
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("wb")); /*Flawfinder: ignore*/
if (!fp)
{
LL_WARNS() << "Couldn't open mute list " << filename << LL_ENDL;
@@ -940,7 +940,7 @@ LLRenderMuteList::LLRenderMuteList()
bool LLRenderMuteList::saveToFile()
{
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "render_mute_settings.txt");
- LLFILE* fp = LLFile::fopen(filename, TEXT("wb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("wb"));
if (!fp)
{
LL_WARNS() << "Couldn't open render mute list file: " << filename << LL_ENDL;
@@ -963,7 +963,7 @@ bool LLRenderMuteList::saveToFile()
bool LLRenderMuteList::loadFromFile()
{
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "render_mute_settings.txt");
- LLFILE* fp = LLFile::fopen(filename, TEXT("rb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("rb"));
if (!fp)
{
LL_WARNS() << "Couldn't open render mute list file: " << filename << LL_ENDL;
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 6928d7e6c3..cecda23e7b 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -801,7 +801,7 @@ bool LLPreviewNotecard::loadNotecardText(const std::string& filename)
return false;
}
- LLFILE* file = LLFile::fopen(filename, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* file = LLFile::fopen(filename, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!file)
{
LL_WARNS() << "Error opening " << filename << LL_ENDL;
@@ -832,7 +832,7 @@ bool LLPreviewNotecard::loadNotecardText(const std::string& filename)
bool LLPreviewNotecard::writeToFile(const std::string& filename)
{
- LLFILE* fp = LLFile::fopen(filename, TEXT("wb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("wb"));
if (!fp)
{
LL_WARNS() << "Unable to write to " << filename << LL_ENDL;
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index c73976e540..53d0a712a8 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -632,7 +632,7 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
return false;
}
- LLFILE* file = LLFile::fopen(filename, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* file = LLFile::fopen(filename, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!file)
{
LL_WARNS() << "Error opening " << filename << LL_ENDL;
@@ -663,7 +663,7 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
bool LLScriptEdCore::writeToFile(const std::string& filename)
{
- LLFILE* fp = LLFile::fopen(filename, TEXT("wb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("wb"));
if (!fp)
{
LL_WARNS() << "Unable to write to " << filename << LL_ENDL;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 37609f74ed..2cb2a7f8d5 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -587,7 +587,7 @@ bool idle_startup()
std::string message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message_template.msg");
LLFILE* found_template = NULL;
- found_template = LLFile::fopen(message_template_path, TEXT("r")); /* Flawfinder: ignore */
+ found_template = LLFile::fopen(message_template_path, LLFILE_MODE("r")); /* Flawfinder: ignore */
#if LL_WINDOWS
// On the windows dev builds, unpackaged, the message_template.msg
@@ -596,7 +596,7 @@ bool idle_startup()
if (!found_template)
{
message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", "message_template.msg");
- found_template = LLFile::fopen(message_template_path.c_str(), TEXT("r")); /* Flawfinder: ignore */
+ found_template = LLFile::fopen(message_template_path.c_str(), LLFILE_MODE("r")); /* Flawfinder: ignore */
}
#elif LL_DARWIN
// On Mac dev builds, message_template.msg lives in:
@@ -606,7 +606,7 @@ bool idle_startup()
message_template_path =
gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,
"message_template.msg");
- found_template = LLFile::fopen(message_template_path.c_str(), TEXT("r")); /* Flawfinder: ignore */
+ found_template = LLFile::fopen(message_template_path.c_str(), LLFILE_MODE("r")); /* Flawfinder: ignore */
}
#endif
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index d1e36676af..c401a00fd7 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -420,7 +420,7 @@ void LLToolBarView::saveToolbars() const
if(!output_node->isNull())
{
const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "toolbars.xml");
- LLFILE *fp = LLFile::fopen(filename, TEXT("w"));
+ LLFILE *fp = LLFile::fopen(filename, LLFILE_MODE("w"));
if (fp != NULL)
{
LLXMLNode::writeHeaderToFile(fp);
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index c28f3dc73a..867d47c893 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -279,7 +279,7 @@ void LLViewerAssetStorage::storeAssetData(
LL_DEBUGS("AssetStorage") << "ASSET_ID: " << asset_id << LL_ENDL;
S32 size = 0;
- LLFILE* fp = LLFile::fopen(filename, TEXT("rb"));
+ LLFILE* fp = LLFile::fopen(filename, LLFILE_MODE("rb"));
if (fp)
{
fseek(fp, 0, SEEK_END);
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp
index 9b39f7b0e9..5741d7f5fb 100644
--- a/indra/newview/llviewerinput.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -1430,7 +1430,7 @@ S32 LLViewerInput::loadBindingsXML(const std::string& filename)
// file in app_settings is supposed to be up to date
// this is only for the file from user_settings
LL_INFOS("ViewerInput") << "Updating file " << filename << " to a newer version" << LL_ENDL;
- LLFILE *fp = LLFile::fopen(filename, TEXT("w"));
+ LLFILE *fp = LLFile::fopen(filename, LLFILE_MODE("w"));
if (fp != NULL)
{
LLXMLNode::writeHeaderToFile(fp);
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index a8ed2da9e0..423bb5f31d 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -1161,7 +1161,7 @@ void handle_compress_image()
// so doing dirty, but OS independent fopen and fseek
size_t get_file_size(std::string &filename)
{
- LLFILE* file = LLFile::fopen(filename, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* file = LLFile::fopen(filename, LLFILE_MODE("rb")); /*Flawfinder: ignore*/
if (!file)
{
LL_WARNS() << "Error opening " << filename << LL_ENDL;
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp
index a2141f4eed..a183d7c8de 100644
--- a/indra/newview/llviewerstatsrecorder.cpp
+++ b/indra/newview/llviewerstatsrecorder.cpp
@@ -194,7 +194,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
// Open the data file
makeStatsFileName();
- mStatsFile = LLFile::fopen(mStatsFileName, TEXT("wb"));
+ mStatsFile = LLFile::fopen(mStatsFileName, LLFILE_MODE("wb"));
if (mStatsFile)
{