Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces
Note: Only affects files with extension "cpp" and "h" under /src/server
This commit is contained in:
1 parent
8b820baa73
commit
b16d2245bb
390 files changed
+1545
-1545
No files matched your search
@@ -38,11 +38,11 @@ Log::Log() :
|
||||
|
||||
Log::~Log()
|
||||
{
|
||||
if( logfile != NULL )
|
||||
if ( logfile != NULL )
|
||||
fclose(logfile);
|
||||
logfile = NULL;
|
||||
|
||||
if( gmLogfile != NULL )
|
||||
if ( gmLogfile != NULL )
|
||||
fclose(gmLogfile);
|
||||
gmLogfile = NULL;
|
||||
|
||||
@@ -50,7 +50,7 @@ Log::~Log()
|
||||
fclose(charLogfile);
|
||||
charLogfile = NULL;
|
||||
|
||||
if( dberLogfile != NULL )
|
||||
if ( dberLogfile != NULL )
|
||||
fclose(dberLogfile);
|
||||
dberLogfile = NULL;
|
||||
|
||||
@@ -129,20 +129,20 @@ void Log::Initialize()
|
||||
InitColors(ConfigMgr::GetStringDefault("LogColors", ""));
|
||||
|
||||
m_gmlog_per_account = ConfigMgr::GetBoolDefault("GmLogPerAccount", false);
|
||||
if(!m_gmlog_per_account)
|
||||
if (!m_gmlog_per_account)
|
||||
gmLogfile = openLogFile("GMLogFile", "GmLogTimestamp", "a");
|
||||
else
|
||||
{
|
||||
// GM log settings for per account case
|
||||
m_gmlog_filename_format = ConfigMgr::GetStringDefault("GMLogFile", "");
|
||||
if(!m_gmlog_filename_format.empty())
|
||||
if (!m_gmlog_filename_format.empty())
|
||||
{
|
||||
bool m_gmlog_timestamp = ConfigMgr::GetBoolDefault("GmLogTimestamp", false);
|
||||
|
||||
size_t dot_pos = m_gmlog_filename_format.find_last_of(".");
|
||||
if(dot_pos!=m_gmlog_filename_format.npos)
|
||||
if (dot_pos!=m_gmlog_filename_format.npos)
|
||||
{
|
||||
if(m_gmlog_timestamp)
|
||||
if (m_gmlog_timestamp)
|
||||
m_gmlog_filename_format.insert(dot_pos, m_logsTimestamp);
|
||||
|
||||
m_gmlog_filename_format.insert(dot_pos, "_#%u");
|
||||
@@ -151,7 +151,7 @@ void Log::Initialize()
|
||||
{
|
||||
m_gmlog_filename_format += "_#%u";
|
||||
|
||||
if(m_gmlog_timestamp)
|
||||
if (m_gmlog_timestamp)
|
||||
m_gmlog_filename_format += m_logsTimestamp;
|
||||
}
|
||||
|
||||
@@ -199,13 +199,13 @@ void Log::ReloadConfig()
|
||||
FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFlag, char const* mode)
|
||||
{
|
||||
std::string logfn=ConfigMgr::GetStringDefault(configFileName, "");
|
||||
if(logfn.empty())
|
||||
if (logfn.empty())
|
||||
return NULL;
|
||||
|
||||
if(configTimeStampFlag && ConfigMgr::GetBoolDefault(configTimeStampFlag, false))
|
||||
if (configTimeStampFlag && ConfigMgr::GetBoolDefault(configTimeStampFlag, false))
|
||||
{
|
||||
size_t dot_pos = logfn.find_last_of(".");
|
||||
if(dot_pos!=logfn.npos)
|
||||
if (dot_pos!=logfn.npos)
|
||||
logfn.insert(dot_pos, m_logsTimestamp);
|
||||
else
|
||||
logfn += m_logsTimestamp;
|
||||
@@ -216,7 +216,7 @@ FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFl
|
||||
|
||||
FILE* Log::openGmlogPerAccount(uint32 account)
|
||||
{
|
||||
if(m_gmlog_filename_format.empty())
|
||||
if (m_gmlog_filename_format.empty())
|
||||
return NULL;
|
||||
|
||||
char namebuf[TRINITY_PATH_MAX];
|
||||
@@ -239,7 +239,7 @@ void Log::outTimestamp(FILE* file)
|
||||
|
||||
void Log::InitColors(const std::string& str)
|
||||
{
|
||||
if(str.empty())
|
||||
if (str.empty())
|
||||
{
|
||||
m_colored = false;
|
||||
return;
|
||||
@@ -253,10 +253,10 @@ void Log::InitColors(const std::string& str)
|
||||
{
|
||||
ss >> color[i];
|
||||
|
||||
if(!ss)
|
||||
if (!ss)
|
||||
return;
|
||||
|
||||
if(color[i] < 0 || color[i] >= Colors)
|
||||
if (color[i] < 0 || color[i] >= Colors)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ void Log::outString(const char * str, ...)
|
||||
ResetColor(true);
|
||||
|
||||
printf("\n");
|
||||
if(logfile)
|
||||
if (logfile)
|
||||
{
|
||||
outTimestamp(logfile);
|
||||
va_start(ap, str);
|
||||
@@ -715,7 +715,7 @@ void Log::outDebugInLine(const char * str, ...)
|
||||
vutf8printf(stdout, str, &ap);
|
||||
va_end(ap);
|
||||
|
||||
//if(m_colored)
|
||||
//if (m_colored)
|
||||
// ResetColor(true);
|
||||
|
||||
if (logfile)
|
||||
@@ -772,7 +772,7 @@ void Log::outDebug(DebugLogFilters f, const char * str, ...)
|
||||
va_end(ap2);
|
||||
}
|
||||
|
||||
if( m_logLevel > LOGL_DETAIL )
|
||||
if ( m_logLevel > LOGL_DETAIL )
|
||||
{
|
||||
if (m_colored)
|
||||
SetColor(true, m_colors[LOGL_DEBUG]);
|
||||
@@ -782,7 +782,7 @@ void Log::outDebug(DebugLogFilters f, const char * str, ...)
|
||||
vutf8printf(stdout, str, &ap);
|
||||
va_end(ap);
|
||||
|
||||
if(m_colored)
|
||||
if (m_colored)
|
||||
ResetColor(true);
|
||||
|
||||
printf( "\n" );
|
||||
@@ -817,7 +817,7 @@ void Log::outStaticDebug(const char * str, ...)
|
||||
va_end(ap2);
|
||||
}
|
||||
|
||||
if( m_logLevel > LOGL_DETAIL )
|
||||
if ( m_logLevel > LOGL_DETAIL )
|
||||
{
|
||||
if (m_colored)
|
||||
SetColor(true, m_colors[LOGL_DEBUG]);
|
||||
@@ -827,7 +827,7 @@ void Log::outStaticDebug(const char * str, ...)
|
||||
vutf8printf(stdout, str, &ap);
|
||||
va_end(ap);
|
||||
|
||||
if(m_colored)
|
||||
if (m_colored)
|
||||
ResetColor(true);
|
||||
|
||||
printf( "\n" );
|
||||
|
||||
Reference in new issue
Block a user