Intermiediary commit.

This commit is contained in:
Shyotl
2019-03-16 17:51:00 -05:00
parent 7cf55fa993
commit 2d8fbb89c9
58 changed files with 1857 additions and 1057 deletions

View File

@@ -32,15 +32,6 @@
class LLUUID;
// At 45 Hz collisions seem stable and objects seem
// to settle down at a reasonable rate.
// JC 3/18/2003
// const F32 PHYSICS_TIMESTEP = 1.f / 45.f;
// This must be a #define due to anal retentive restrictions on const expressions
// CG 2008-06-05
#define PHYSICS_TIMESTEP (1.f / 45.f)
const F32 COLLISION_TOLERANCE = 0.1f;
const F32 HALF_COLLISION_TOLERANCE = 0.05f;
@@ -265,7 +256,7 @@ const U8 SIM_ACCESS_DOWN = 254;
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// attachment constants
const S32 MAX_AGENT_ATTACHMENTS = 38;
const U32 MAX_AGENT_ATTACHMENTS = 38;
const U8 ATTACHMENT_ADD = 0x80;
// god levels

View File

@@ -265,10 +265,10 @@ int LLFile::remove_nowarn(const std::string& filename)
return rc;
}
int LLFile::remove(const std::string& filename)
int LLFile::remove(const std::string& filename, int supress_error)
{
int rc = LLFile::remove_nowarn(filename);
return warnif("remove", filename, rc);
return warnif("remove", filename, rc, supress_error);
}
int LLFile::rename_nowarn(const std::string& filename, const std::string& newname)
@@ -285,10 +285,10 @@ int LLFile::rename_nowarn(const std::string& filename, const std::string& newnam
return rc;
}
int LLFile::rename(const std::string& filename, const std::string& newname)
int LLFile::rename(const std::string& filename, const std::string& newname, int supress_error)
{
int rc = LLFile::rename_nowarn(filename, newname);
return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc);
return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, supress_error);
}
int LLFile::stat(const std::string& filename, llstat* filestatus)

View File

@@ -45,6 +45,7 @@ typedef FILE LLFILE;
typedef struct _stat llstat;
#else
typedef struct stat llstat;
#include <sys/types.h>
#endif
#ifndef S_ISREG
@@ -77,8 +78,8 @@ public:
static int mkdir(const std::string& filename, int perms = 0700);
static int rmdir(const std::string& filename);
static int remove(const std::string& filename);
static int rename(const std::string& filename,const std::string& newname);
static int remove(const std::string& filename, int supress_error = 0);
static int rename(const std::string& filename,const std::string& newname, int supress_error = 0);
static int stat(const std::string& filename,llstat* file_status);
static bool isdir(const std::string& filename);
static bool isfile(const std::string& filename);

View File

@@ -815,6 +815,26 @@ std::string LLStringOps::getDatetimeCode (std::string key)
}
std::string LLStringOps::getReadableNumber(F64 num)
{
if (fabs(num)>=1e9)
{
return llformat("%.2lfB", num / 1e9);
}
else if (fabs(num)>=1e6)
{
return llformat("%.2lfM", num / 1e6);
}
else if (fabs(num)>=1e3)
{
return llformat("%.2lfK", num / 1e3);
}
else
{
return llformat("%.2lf", num);
}
}
namespace LLStringFn
{
// NOTE - this restricts output to ascii

View File

@@ -210,6 +210,9 @@ public:
static bool getPacificDaylightTime(void) { return sPacificDaylightTime;}
static std::string getDatetimeCode (std::string key);
// Express a value like 1234567 as "1.23M"
static std::string getReadableNumber(F64 num);
};
/**