diff options
author | Peter Powell <petpow@saberuk.com> | 2019-12-08 19:12:56 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-12-08 19:12:56 +0000 |
commit | 914d8140d98dd0adc54f739dfe550765cc466bac (patch) | |
tree | 16d9189de1375682d149dd19ae7ad8acdd0c56b4 /include | |
parent | c9a06147e66170cd54f8eb28f61e9c2c5e1ad55f (diff) |
Use meaningful variable names in consolecolors.
Diffstat (limited to 'include')
-rw-r--r-- | include/consolecolors.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/include/consolecolors.h b/include/consolecolors.h index 8d154f7ee..70696fbf9 100644 --- a/include/consolecolors.h +++ b/include/consolecolors.h @@ -48,90 +48,90 @@ extern WORD g_wOriginalColors; extern WORD g_wBackgroundColor; extern HANDLE g_hStdout; -inline std::ostream& con_green(std::ostream &s) +inline std::ostream& con_green(std::ostream& stream) { if (CanUseColors()) SetConsoleTextAttribute(g_hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor); - return s; + return stream; } -inline std::ostream& con_red(std::ostream &s) +inline std::ostream& con_red(std::ostream& stream) { if (CanUseColors()) SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY|g_wBackgroundColor); - return s; + return stream; } -inline std::ostream& con_white(std::ostream &s) +inline std::ostream& con_white(std::ostream& stream) { if (CanUseColors()) SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|g_wBackgroundColor); - return s; + return stream; } -inline std::ostream& con_white_bright(std::ostream &s) +inline std::ostream& con_white_bright(std::ostream& stream) { if (CanUseColors()) SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor); - return s; + return stream; } -inline std::ostream& con_bright(std::ostream &s) +inline std::ostream& con_bright(std::ostream& stream) { if (CanUseColors()) SetConsoleTextAttribute(g_hStdout, FOREGROUND_INTENSITY|g_wBackgroundColor); - return s; + return stream; } -inline std::ostream& con_reset(std::ostream &s) +inline std::ostream& con_reset(std::ostream& stream) { if (CanUseColors()) SetConsoleTextAttribute(g_hStdout, g_wOriginalColors); - return s; + return stream; } #else -inline std::ostream& con_green(std::ostream &s) +inline std::ostream& con_green(std::ostream& stream) { if (!CanUseColors()) - return s; - return s << "\033[1;32m"; + return stream; + return stream << "\033[1;32m"; } -inline std::ostream& con_red(std::ostream &s) +inline std::ostream& con_red(std::ostream& stream) { if (!CanUseColors()) - return s; - return s << "\033[1;31m"; + return stream; + return stream << "\033[1;31m"; } -inline std::ostream& con_white(std::ostream &s) +inline std::ostream& con_white(std::ostream& stream) { if (!CanUseColors()) - return s; - return s << "\033[0m"; + return stream; + return stream << "\033[0m"; } -inline std::ostream& con_white_bright(std::ostream &s) +inline std::ostream& con_white_bright(std::ostream& stream) { if (!CanUseColors()) - return s; - return s << "\033[1m"; + return stream; + return stream << "\033[1m"; } -inline std::ostream& con_bright(std::ostream &s) +inline std::ostream& con_bright(std::ostream& stream) { if (!CanUseColors()) - return s; - return s << "\033[1m"; + return stream; + return stream << "\033[1m"; } -inline std::ostream& con_reset(std::ostream &s) +inline std::ostream& con_reset(std::ostream& stream) { if (!CanUseColors()) - return s; - return s << "\033[0m"; + return stream; + return stream << "\033[0m"; } #endif |