From dd7df288448230fa6becee18e4259ce19976e367 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 17 Jul 2014 20:11:33 -0700 Subject: Refactored cChatColor - Changed std::string fields to const char-pointers in order to wipe out potential issues with static initialization and global destructors - Deprecated cChatColor::Color() because the name does not match the value --- src/ChatColor.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/ChatColor.cpp') diff --git a/src/ChatColor.cpp b/src/ChatColor.cpp index 72a0a6928..e1317c287 100644 --- a/src/ChatColor.cpp +++ b/src/ChatColor.cpp @@ -2,31 +2,31 @@ #include "ChatColor.h" -const std::string cChatColor::Color = "\xc2\xa7"; // or in other words: "§" in UTF-8 -const std::string cChatColor::Delimiter = "\xc2\xa7"; // or in other words: "§" in UTF-8 -const std::string cChatColor::Black = cChatColor::Color + "0"; -const std::string cChatColor::Navy = cChatColor::Color + "1"; -const std::string cChatColor::Green = cChatColor::Color + "2"; -const std::string cChatColor::Blue = cChatColor::Color + "3"; -const std::string cChatColor::Red = cChatColor::Color + "4"; -const std::string cChatColor::Purple = cChatColor::Color + "5"; -const std::string cChatColor::Gold = cChatColor::Color + "6"; -const std::string cChatColor::LightGray = cChatColor::Color + "7"; -const std::string cChatColor::Gray = cChatColor::Color + "8"; -const std::string cChatColor::DarkPurple = cChatColor::Color + "9"; -const std::string cChatColor::LightGreen = cChatColor::Color + "a"; -const std::string cChatColor::LightBlue = cChatColor::Color + "b"; -const std::string cChatColor::Rose = cChatColor::Color + "c"; -const std::string cChatColor::LightPurple = cChatColor::Color + "d"; -const std::string cChatColor::Yellow = cChatColor::Color + "e"; -const std::string cChatColor::White = cChatColor::Color + "f"; +const char * cChatColor::Color = "\xc2\xa7"; // or in other words: "§" in UTF-8 +const char * cChatColor::Delimiter = "\xc2\xa7"; // or in other words: "§" in UTF-8 +const char * cChatColor::Black = "\xc2\xa7""0"; +const char * cChatColor::Navy = "\xc2\xa7""1"; +const char * cChatColor::Green = "\xc2\xa7""2"; +const char * cChatColor::Blue = "\xc2\xa7""3"; +const char * cChatColor::Red = "\xc2\xa7""4"; +const char * cChatColor::Purple = "\xc2\xa7""5"; +const char * cChatColor::Gold = "\xc2\xa7""6"; +const char * cChatColor::LightGray = "\xc2\xa7""7"; +const char * cChatColor::Gray = "\xc2\xa7""8"; +const char * cChatColor::DarkPurple = "\xc2\xa7""9"; +const char * cChatColor::LightGreen = "\xc2\xa7""a"; +const char * cChatColor::LightBlue = "\xc2\xa7""b"; +const char * cChatColor::Rose = "\xc2\xa7""c"; +const char * cChatColor::LightPurple = "\xc2\xa7""d"; +const char * cChatColor::Yellow = "\xc2\xa7""e"; +const char * cChatColor::White = "\xc2\xa7""f"; -const std::string cChatColor::Random = cChatColor::Color + "k"; -const std::string cChatColor::Bold = cChatColor::Color + "l"; -const std::string cChatColor::Strikethrough = cChatColor::Color + "m"; -const std::string cChatColor::Underlined = cChatColor::Color + "n"; -const std::string cChatColor::Italic = cChatColor::Color + "o"; -const std::string cChatColor::Plain = cChatColor::Color + "r"; +const char * cChatColor::Random = "\xc2\xa7""k"; +const char * cChatColor::Bold = "\xc2\xa7""l"; +const char * cChatColor::Strikethrough = "\xc2\xa7""m"; +const char * cChatColor::Underlined = "\xc2\xa7""n"; +const char * cChatColor::Italic = "\xc2\xa7""o"; +const char * cChatColor::Plain = "\xc2\xa7""r"; -- cgit v1.2.3