diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-10 15:19:50 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-10 15:19:50 +0100 |
commit | 1ac059d0b7ab18c3723336f6e2ac8012732a5570 (patch) | |
tree | a9c102b232c7719d89b2116fe0424195e0fb674a /src | |
parent | 39dd791921e94ffb55e3005e5c131c46c8929a78 (diff) | |
download | manaserv-1ac059d0b7ab18c3723336f6e2ac8012732a5570.tar.gz manaserv-1ac059d0b7ab18c3723336f6e2ac8012732a5570.tar.bz2 manaserv-1ac059d0b7ab18c3723336f6e2ac8012732a5570.tar.xz manaserv-1ac059d0b7ab18c3723336f6e2ac8012732a5570.zip |
Fixes for some compile warnings
Mostly comparisons between signed and unsigned integers
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/dalstorage.cpp | 2 | ||||
-rw-r--r-- | src/chat-server/post.cpp | 6 | ||||
-rw-r--r-- | src/common/transaction.hpp | 2 | ||||
-rw-r--r-- | src/utils/stringfilter.cpp | 8 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp index eac9f409..086487f3 100644 --- a/src/account-server/dalstorage.cpp +++ b/src/account-server/dalstorage.cpp @@ -1688,7 +1688,7 @@ std::vector<Transaction> DALStorage::getTransactions(time_t date) << date; dal::RecordSet const &rec = mDb->execSql(sql.str()); - for (int i = 0; i < rec.rows(); ++i) + for (unsigned int i = 0; i < rec.rows(); ++i) { Transaction trans; trans.mCharacterId = toUint(rec(i, 1)); diff --git a/src/chat-server/post.cpp b/src/chat-server/post.cpp index e3f4c4f0..ba829c02 100644 --- a/src/chat-server/post.cpp +++ b/src/chat-server/post.cpp @@ -62,7 +62,8 @@ std::string Letter::getContents() bool Letter::addAttachment(InventoryItem item) { - if (mAttachments.size() > Configuration::getValue("mail_maxAttachments", 3)) + unsigned int max = Configuration::getValue("mail_maxAttachments", 3); + if (mAttachments.size() > max) { return false; } @@ -102,7 +103,8 @@ Post::~Post() bool Post::addLetter(Letter *letter) { - if (mLetters.size() > Configuration::getValue("mail_maxLetters", 10)) + unsigned int max = Configuration::getValue("mail_maxLetters", 10); + if (mLetters.size() > max) { return false; } diff --git a/src/common/transaction.hpp b/src/common/transaction.hpp index 21a00de8..3cdb4d58 100644 --- a/src/common/transaction.hpp +++ b/src/common/transaction.hpp @@ -61,7 +61,7 @@ enum TRANS_TRADE_MONEY, TRANS_TRADE_ITEM, TRANS_ATTR_INCREASE, - TRANS_ATTR_DECREASE, + TRANS_ATTR_DECREASE }; #endif diff --git a/src/utils/stringfilter.cpp b/src/utils/stringfilter.cpp index 93be8b3e..1e2eaa54 100644 --- a/src/utils/stringfilter.cpp +++ b/src/utils/stringfilter.cpp @@ -103,9 +103,11 @@ bool StringFilter::filterContent(const std::string& text) bool StringFilter::isEmailValid(const std::string& email) { - // Testing Email validity - if ((email.length() < Configuration::getValue("account_minEmailLength", 7)) || - (email.length() > Configuration::getValue("account_maxEmailLength", 128))) + unsigned int min = Configuration::getValue("account_minEmailLength", 7); + unsigned int max = Configuration::getValue("account_maxEmailLength", 128); + + // Testing email validity + if (email.length() < min || email.length() > max) { return false; } |