diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2016-07-15 17:33:49 -0300 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2016-07-15 22:33:49 +0200 |
| commit | fbbb03212e93591a77a1169a30fb01867cd3c0e9 (patch) | |
| tree | b149e12bdead2d300215142e6e4bc1a8a33ec86e /src/server/game/Chat/ChatLink.cpp | |
| parent | 11558b3bdc10ad429e8dbb9ab4489e39eb2d6fcc (diff) | |
Core/Chat: general cleanup and revamping: (#17576)
- Remove duplicate ObjectGuid in Channel (both as key and value member)
- Add const-ness to Channel methods
- NULL->nullptr
- const type* -> type const*
- Removed all instances of std::map::operator[] except where it is actually INTENDED to insert an element
- Use Trinity::StringFormat instead of snprintf
Diffstat (limited to 'src/server/game/Chat/ChatLink.cpp')
| -rw-r--r-- | src/server/game/Chat/ChatLink.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 3602b54bc44..92d69edb5e8 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -71,7 +71,7 @@ inline std::string ReadSkip(std::istringstream& iss, char term) return res; } -inline bool CheckDelimiter(std::istringstream& iss, char delimiter, const char* context) +inline bool CheckDelimiter(std::istringstream& iss, char delimiter, char const* context) { char c = iss.peek(); if (c != delimiter) @@ -96,7 +96,7 @@ inline bool ReadHex(std::istringstream& iss, uint32& res, uint32 length) #define DELIMITER ':' #define PIPE_CHAR '|' -bool ChatLink::ValidateName(char* buffer, const char* /*context*/) +bool ChatLink::ValidateName(char* buffer, char const* /*context*/) { _name = buffer; return true; @@ -170,7 +170,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const { std::stringstream ss; - if (locale == NULL || index >= locale->Name.size()) + if (locale == nullptr || index >= locale->Name.size()) ss << _item->Name1; else ss << locale->Name[index]; @@ -179,13 +179,13 @@ inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* local return ss.str(); } -bool ItemChatLink::ValidateName(char* buffer, const char* context) +bool ItemChatLink::ValidateName(char* buffer, char const* context) { ChatLink::ValidateName(buffer, context); - char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); + char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : nullptr); - bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer); + bool res = (FormatName(LOCALE_enUS, nullptr, suffixStrings) == buffer); if (!res) { ItemLocale const* il = sObjectMgr->GetItemLocale(_item->ItemId); @@ -239,7 +239,7 @@ bool QuestChatLink::Initialize(std::istringstream& iss) return true; } -bool QuestChatLink::ValidateName(char* buffer, const char* context) +bool QuestChatLink::ValidateName(char* buffer, char const* context) { ChatLink::ValidateName(buffer, context); @@ -280,7 +280,7 @@ bool SpellChatLink::Initialize(std::istringstream& iss) return true; } -bool SpellChatLink::ValidateName(char* buffer, const char* context) +bool SpellChatLink::ValidateName(char* buffer, char const* context) { ChatLink::ValidateName(buffer, context); @@ -373,7 +373,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) return true; } -bool AchievementChatLink::ValidateName(char* buffer, const char* context) +bool AchievementChatLink::ValidateName(char* buffer, char const* context) { ChatLink::ValidateName(buffer, context); @@ -537,7 +537,7 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) return true; } -LinkExtractor::LinkExtractor(const char* msg) : _iss(msg) { } +LinkExtractor::LinkExtractor(char const* msg) : _iss(msg) { } LinkExtractor::~LinkExtractor() { @@ -549,19 +549,19 @@ LinkExtractor::~LinkExtractor() bool LinkExtractor::IsValidMessage() { const char validSequence[6] = "cHhhr"; - const char* validSequenceIterator = validSequence; + char const* validSequenceIterator = validSequence; char buffer[256]; std::istringstream::pos_type startPos = 0; uint32 color = 0; - ChatLink* link = NULL; + ChatLink* link = nullptr; while (!_iss.eof()) { if (validSequence == validSequenceIterator) { - link = NULL; + link = nullptr; _iss.ignore(255, PIPE_CHAR); startPos = _iss.tellg() - std::istringstream::pos_type(1); } |
