summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2026-01-05 15:01:23 -0500
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-01-07 02:15:43 +0200
commit9873abfb94f0d9cbc6df60fef9df622ef51355ec (patch)
treefc01bc328a5231189c630169daa337326832ed33 /indra/llcommon
parent615b1bcec74f4d6d759d69ecf9965b7d2b423c52 (diff)
Address feedback from copilot
Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra/llcommon')
-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
5 files changed, 11 insertions, 13 deletions
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)