Improved: Switched to stricter code formatter (Uncrustify) for better consistency across all source files.
This commit is contained in:
1 parent
a1be4cc70f
commit
57e8158efd
202 files changed
+4595
-4284
No files matched your search
+27
-27
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
This file is part of EqualizerAPO, a system-wide equalizer.
|
||||
Copyright (C) 2012 Jonas Thedering
|
||||
This file is part of EqualizerAPO, a system-wide equalizer.
|
||||
Copyright (C) 2012 Jonas Thedering
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
@@ -36,36 +36,36 @@ bool LogHelper::useConsoleColors = false;
|
||||
|
||||
void LogHelper::log(const char* file, int line, const void* caller, bool trace, const wchar_t* format, ...)
|
||||
{
|
||||
if(!initialized)
|
||||
if (!initialized)
|
||||
{
|
||||
//Do not try to initialize again, even in case of error
|
||||
// Do not try to initialize again, even in case of error
|
||||
initialized = true;
|
||||
|
||||
wchar_t temp[255];
|
||||
GetTempPathW(sizeof(temp)/sizeof(wchar_t), temp);
|
||||
GetTempPathW(sizeof(temp) / sizeof(wchar_t), temp);
|
||||
|
||||
logPath = temp;
|
||||
logPath += L"EqualizerAPO.log";
|
||||
|
||||
try
|
||||
{
|
||||
if(RegistryHelper::readValue(APP_REGPATH, L"EnableTrace") != L"false")
|
||||
if (RegistryHelper::readValue(APP_REGPATH, L"EnableTrace") != L"false")
|
||||
enableTrace = true;
|
||||
}
|
||||
catch(RegistryException e)
|
||||
catch (RegistryException e)
|
||||
{
|
||||
LogFStatic(L"%s", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if(trace && !enableTrace)
|
||||
if (trace && !enableTrace)
|
||||
return;
|
||||
|
||||
FILE* fp;
|
||||
if(presetFP == NULL)
|
||||
if (presetFP == NULL)
|
||||
{
|
||||
errno_t err = _wfopen_s(&fp, logPath.c_str(), L"at");
|
||||
if(err != 0)
|
||||
if (err != 0)
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -73,16 +73,16 @@ void LogHelper::log(const char* file, int line, const void* caller, bool trace,
|
||||
fp = presetFP;
|
||||
}
|
||||
|
||||
if(useConsoleColors)
|
||||
if (useConsoleColors)
|
||||
{
|
||||
HANDLE con = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if(trace)
|
||||
if (trace)
|
||||
SetConsoleTextAttribute(con, 2); // Set console color to green
|
||||
else
|
||||
SetConsoleTextAttribute(con, 12); // Set console color to red
|
||||
}
|
||||
|
||||
if(!compact)
|
||||
if (!compact)
|
||||
{
|
||||
SYSTEMTIME ___st;
|
||||
GetLocalTime(&___st);
|
||||
@@ -91,7 +91,7 @@ void LogHelper::log(const char* file, int line, const void* caller, bool trace,
|
||||
___st.wYear, ___st.wMonth, ___st.wDay, ___st.wHour, ___st.wMinute, ___st.wSecond, ___st.wMilliseconds, threadId, (DWORD)(unsigned long long)caller, file, line);
|
||||
}
|
||||
|
||||
if(trace)
|
||||
if (trace)
|
||||
fwprintf(fp, L"(TRACE) ");
|
||||
|
||||
va_list varArgs;
|
||||
@@ -101,13 +101,13 @@ void LogHelper::log(const char* file, int line, const void* caller, bool trace,
|
||||
|
||||
fwprintf(fp, L"\n");
|
||||
|
||||
if(useConsoleColors)
|
||||
if (useConsoleColors)
|
||||
{
|
||||
HANDLE con = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(con, 7); // Set console color to light grey (default)
|
||||
}
|
||||
|
||||
if(presetFP == NULL)
|
||||
if (presetFP == NULL)
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user