Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
This commit is contained in:
committed by
Martin Natano
parent
f0680a29fc
commit
0cba3579de
+6
-6
@@ -51,7 +51,7 @@ RageLog* LOG; // global and accessible from anywhere in the program
|
||||
*
|
||||
* The identifier is never displayed, so we can use a simple local object to
|
||||
* map/unmap, using any mechanism to generate unique IDs. */
|
||||
static map<RString, RString> LogMaps;
|
||||
static std::map<RString, RString> LogMaps;
|
||||
|
||||
#define LOG_PATH "/Logs/log.txt"
|
||||
#define INFO_PATH "/Logs/info.txt"
|
||||
@@ -97,7 +97,7 @@ RageLog::~RageLog()
|
||||
{
|
||||
/* Add the mapped log data to info.txt. */
|
||||
const RString AdditionalLog = GetAdditionalLog();
|
||||
vector<RString> AdditionalLogLines;
|
||||
std::vector<RString> AdditionalLogLines;
|
||||
split( AdditionalLog, "\n", AdditionalLogLines );
|
||||
for( unsigned i = 0; i < AdditionalLogLines.size(); ++i )
|
||||
{
|
||||
@@ -256,7 +256,7 @@ void RageLog::Write( int where, const RString &sLine )
|
||||
LockMut( *g_Mutex );
|
||||
|
||||
const char *const sWarningSeparator = "/////////////////////////////////////////";
|
||||
vector<RString> asLines;
|
||||
std::vector<RString> asLines;
|
||||
split( sLine, "\n", asLines, false );
|
||||
if( where & WRITE_LOUD )
|
||||
{
|
||||
@@ -334,7 +334,7 @@ void RageLog::AddToInfo( const RString &str )
|
||||
{
|
||||
const RString txt( NEWLINE "Staticlog limit reached" NEWLINE );
|
||||
|
||||
const unsigned pos = min( staticlog_size, sizeof(staticlog) - txt.size() );
|
||||
const unsigned int pos = std::min<unsigned int>(staticlog_size, sizeof(staticlog) - txt.size());
|
||||
memcpy( staticlog+pos, txt.data(), txt.size() );
|
||||
limit_reached = true;
|
||||
return;
|
||||
@@ -396,14 +396,14 @@ void RageLog::UpdateMappedLog()
|
||||
for (auto const &i : LogMaps)
|
||||
str += ssprintf( "%s" NEWLINE, i.second.c_str() );
|
||||
|
||||
g_AdditionalLogSize = min( sizeof(g_AdditionalLogStr), str.size()+1 );
|
||||
g_AdditionalLogSize = std::min( sizeof(g_AdditionalLogStr), str.size()+1 );
|
||||
memcpy( g_AdditionalLogStr, str.c_str(), g_AdditionalLogSize );
|
||||
g_AdditionalLogStr[ sizeof(g_AdditionalLogStr)-1 ] = 0;
|
||||
}
|
||||
|
||||
const char *RageLog::GetAdditionalLog()
|
||||
{
|
||||
int size = min( g_AdditionalLogSize, (int) sizeof(g_AdditionalLogStr)-1 );
|
||||
int size = std::min( g_AdditionalLogSize, (int) sizeof(g_AdditionalLogStr)-1 );
|
||||
g_AdditionalLogStr[size] = 0;
|
||||
return g_AdditionalLogStr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user