Inconsistent code formatting in print_error (Newlines and spaces)

This commit is contained in:
ZuBsPaCe 2015-11-19 14:23:05 +01:00
parent b7a1599845
commit e23734363e
2 changed files with 47 additions and 46 deletions

View file

@ -1790,6 +1790,7 @@ void OS_Windows::print_error(const char* p_function,const char* p_file,int p_lin
print("\E[0;35m At: %s:%i.\E[0m\n", p_file, p_line);
break;
}
} else {
CONSOLE_SCREEN_BUFFER_INFO sbi; //original
@ -1797,8 +1798,6 @@ void OS_Windows::print_error(const char* p_function,const char* p_file,int p_lin
SetConsoleTextAttribute(hCon, sbi.wAttributes);
uint32_t basecol = 0;
switch(p_type) {
case ERR_ERROR: basecol = FOREGROUND_RED; break;
@ -1809,8 +1808,6 @@ void OS_Windows::print_error(const char* p_function,const char* p_file,int p_lin
if (p_rationale && p_rationale[0]) {
SetConsoleTextAttribute(hCon, basecol | FOREGROUND_INTENSITY);
switch(p_type) {
case ERR_ERROR: print("ERROR: "); break;
case ERR_WARNING: print("WARNING: "); break;
@ -1819,30 +1816,34 @@ void OS_Windows::print_error(const char* p_function,const char* p_file,int p_lin
SetConsoleTextAttribute(hCon, FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
print(" %s\n", p_rationale);
SetConsoleTextAttribute(hCon, basecol);
print("At: ");
SetConsoleTextAttribute(hCon, FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN);
print(" %s:%i\n", p_file, p_line);
} else {
SetConsoleTextAttribute(hCon, basecol | FOREGROUND_INTENSITY);
switch(p_type) {
case ERR_ERROR: print("ERROR: %s: ", p_function); break;
case ERR_WARNING: print("WARNING: %s: ", p_function); break;
case ERR_SCRIPT: print("SCRIPT ERROR: %s: ", p_function); break;
}
SetConsoleTextAttribute(hCon, FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY);
print(" %s\n", p_code);
SetConsoleTextAttribute(hCon, basecol);
print("At: ");
SetConsoleTextAttribute(hCon, FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN);
print(" %s:%i\n", p_file, p_line);
}
SetConsoleTextAttribute(hCon, sbi.wAttributes);
}
}