[7296] Fixed some GCC warnings.

This commit is contained in:
VladimirMangos 2009-02-18 19:15:53 +03:00
parent 0be9e35b7b
commit 6793f9256f
4 changed files with 8 additions and 10 deletions

View file

@ -32,7 +32,7 @@ namespace MaNGOS
} }
namespace XP namespace XP
{ {
typedef enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY }; enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
inline uint32 GetGrayLevel(uint32 pl_level) inline uint32 GetGrayLevel(uint32 pl_level)
{ {

View file

@ -1882,18 +1882,14 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
return false; return false;
} }
char* FactionName;
for(FactionStateList::const_iterator itr = target->m_factions.begin(); itr != target->m_factions.end(); ++itr) for(FactionStateList::const_iterator itr = target->m_factions.begin(); itr != target->m_factions.end(); ++itr)
{ {
FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID); FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID);
if (factionEntry) char const* factionName = factionEntry ? factionEntry->name[m_session->GetSessionDbcLocale()] : "#Not found#";
FactionName = factionEntry->name[m_session->GetSessionDbcLocale()];
else
FactionName = "#Not found#";
ReputationRank rank = target->GetReputationRank(factionEntry); ReputationRank rank = target->GetReputationRank(factionEntry);
std::string rankName = GetMangosString(ReputationRankStrIndex[rank]); std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
std::ostringstream ss; std::ostringstream ss;
ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << FactionName << "]|h|r " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")"; ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << factionName << "]|h|r " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
if(itr->second.Flags & FACTION_FLAG_VISIBLE) if(itr->second.Flags & FACTION_FLAG_VISIBLE)
ss << GetMangosString(LANG_FACTION_VISIBLE); ss << GetMangosString(LANG_FACTION_VISIBLE);

View file

@ -252,8 +252,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
size_t len = utf8::distance(utf8str,utf8str+csize); size_t len = utf8::distance(utf8str,utf8str+csize);
if(len > wsize) if(len > wsize)
{ {
if(wsize > 0)
wstr[0] = L'\0';
wsize = 0; wsize = 0;
wstr = L"";
return false; return false;
} }
@ -263,8 +264,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
} }
catch(std::exception) catch(std::exception)
{ {
if(wsize > 0)
wstr[0] = L'\0';
wsize = 0; wsize = 0;
wstr = L"";
return false; return false;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7295" #define REVISION_NR "7296"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__