Merge pull request #481 from KiNgMaR/squash-some-warnings

squash some compiler warnings
This commit is contained in:
Alexey Sokolov
2014-02-07 20:23:18 +00:00
6 changed files with 22 additions and 20 deletions
+1 -1
View File
@@ -312,7 +312,7 @@ public:
* @return true if item existed and was removed, false if it never existed
*/
bool RemItem(const K& Item) {
return m_mItems.erase(Item);
return (m_mItems.erase(Item) != 0);
}
/**
+3 -3
View File
@@ -137,7 +137,7 @@ public:
* @return An integer less than, equal to, or greater than zero if this
* string smaller, equal.... to the given string.
*/
int CaseCmp(const CString& s, unsigned long uLen = CString::npos) const;
int CaseCmp(const CString& s, CString::size_type uLen = CString::npos) const;
/**
* Compare this string case sensitively to some other string.
* @param s The string to compare to.
@@ -145,7 +145,7 @@ public:
* @return An integer less than, equal to, or greater than zero if this
* string smaller, equal.... to the given string.
*/
int StrCmp(const CString& s, unsigned long uLen = CString::npos) const;
int StrCmp(const CString& s, CString::size_type uLen = CString::npos) const;
/**
* Check if this string is equal to some other string.
* @param s The string to compare to.
@@ -154,7 +154,7 @@ public:
* @param uLen Number of characters to consider.
* @return True if the strings are equal.
*/
bool Equals(const CString& s, bool bCaseSensitive = false, unsigned long uLen = CString::npos) const;
bool Equals(const CString& s, bool bCaseSensitive = false, CString::size_type uLen = CString::npos) const;
/**
* Do a wildcard comparision between two strings.
* For example, the following returns true:
+2 -2
View File
@@ -163,8 +163,8 @@ public:
const VCString& GetMotd() const { return m_vsMotd; }
// !MOTD
void AddServerThrottle(CString sName) { m_sConnectThrottle.AddItem(sName); }
bool GetServerThrottle(CString sName) { return m_sConnectThrottle.GetItem(sName); }
void AddServerThrottle(CString sName) { m_sConnectThrottle.AddItem(sName, true); }
bool GetServerThrottle(CString sName) { bool *b = m_sConnectThrottle.GetItem(sName); return (b && *b); }
void AddNetworkToQueue(CIRCNetwork *pNetwork);
std::list<CIRCNetwork*>& GetConnectionQueue() { return m_lpConnectQueue; }
+12 -10
View File
@@ -321,19 +321,21 @@ public:
bool CheckAutoOp(const CNick& Nick, CChan& Channel) {
CAutoOpUser *pUser = FindUserByHost(Nick.GetHostMask(), Channel.GetName());
if (pUser) {
if (pUser->GetUserKey().Equals("__NOKEY__")) {
PutIRC("MODE " + Channel.GetName() + " +o " + Nick.GetNick());
} else {
// then insert this nick into the queue, the timer does the rest
CString sNick = Nick.GetNick().AsLower();
if (m_msQueue.find(sNick) == m_msQueue.end()) {
m_msQueue[sNick] = "";
}
if (!pUser) {
return false;
}
if (pUser->GetUserKey().Equals("__NOKEY__")) {
PutIRC("MODE " + Channel.GetName() + " +o " + Nick.GetNick());
} else {
// then insert this nick into the queue, the timer does the rest
CString sNick = Nick.GetNick().AsLower();
if (m_msQueue.find(sNick) == m_msQueue.end()) {
m_msQueue[sNick] = "";
}
}
return pUser;
return true;
}
void DelUser(const CString& sUser) {
+1 -1
View File
@@ -478,7 +478,7 @@ public:
return sCap.Equals("sasl");
}
virtual void OnServerCapResult(const CString& sCap, const bool bSuccess) {
virtual void OnServerCapResult(const CString& sCap, bool bSuccess) {
if (sCap.Equals("sasl")) {
if (bSuccess) {
GetMechanismsString().Split(" ", m_Mechanisms);
+3 -3
View File
@@ -65,21 +65,21 @@ unsigned char* CString::strnchr(const unsigned char* src, unsigned char c, unsig
return NULL;
}
int CString::CaseCmp(const CString& s, unsigned long uLen) const {
int CString::CaseCmp(const CString& s, CString::size_type uLen) const {
if (uLen != CString::npos) {
return strncasecmp(c_str(), s.c_str(), uLen);
}
return strcasecmp(c_str(), s.c_str());
}
int CString::StrCmp(const CString& s, unsigned long uLen) const {
int CString::StrCmp(const CString& s, CString::size_type uLen) const {
if (uLen != CString::npos) {
return strncmp(c_str(), s.c_str(), uLen);
}
return strcmp(c_str(), s.c_str());
}
bool CString::Equals(const CString& s, bool bCaseSensitive, unsigned long uLen) const {
bool CString::Equals(const CString& s, bool bCaseSensitive, CString::size_type uLen) const {
if (bCaseSensitive) {
return (StrCmp(s, uLen) == 0);
} else {