summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-18 01:51:36 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-18 01:51:36 +0300
commitf0e95132f27ceb901fbd779fafc798a1f67a06a6 (patch)
tree52ee9ab21f4e01c2c8ae70b86841b0138349645d /src/gui
parent7e0a97d2521b9ce57003176e82a0b5564aa003c2 (diff)
downloadmanaverse-f0e95132f27ceb901fbd779fafc798a1f67a06a6.tar.gz
manaverse-f0e95132f27ceb901fbd779fafc798a1f67a06a6.tar.bz2
manaverse-f0e95132f27ceb901fbd779fafc798a1f67a06a6.tar.xz
manaverse-f0e95132f27ceb901fbd779fafc798a1f67a06a6.zip
Another warning fixes.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charcreatedialog.cpp2
-rw-r--r--src/gui/chatwindow.cpp4
-rw-r--r--src/gui/logindialog.cpp5
-rw-r--r--src/gui/sdlfont.cpp2
-rw-r--r--src/gui/updaterwindow.cpp2
-rw-r--r--src/gui/whoisonline.cpp4
-rw-r--r--src/gui/whoisonline.h2
-rw-r--r--src/gui/widgets/layout.cpp4
-rw-r--r--src/gui/widgets/textbox.cpp15
-rw-r--r--src/gui/widgets/textfield.cpp2
10 files changed, 20 insertions, 22 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index b71b812d2..ad766091c 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -283,7 +283,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
Net::getCharHandler()->newCharacter(getName(), characterSlot,
mFemale->isSelected(), mHairStyle, mHairColor,
- static_cast<uint16_t>(mRace), atts);
+ static_cast<unsigned char>(mRace), atts);
}
else
{
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index fc30fbc04..f3255af97 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -1058,8 +1058,8 @@ void ChatWindow::addWhisper(const std::string &nick,
{
std::string msg = mes;
std::string nick2;
- int idx = mes.find(":");
- if (idx > 0)
+ size_t idx = mes.find(":");
+ if (idx != std::string::npos && idx > 0)
{
nick2 = msg.substr(0, idx);
msg = msg.substr(idx + 1);
diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp
index 95b6fc666..d8ba0232e 100644
--- a/src/gui/logindialog.cpp
+++ b/src/gui/logindialog.cpp
@@ -48,11 +48,6 @@
#include "debug.h"
-static const int MAX_SERVER_LIST_SIZE = 15;
-static const int LOGIN_DIALOG_WIDTH = 300;
-static const int LOGIN_DIALOG_HEIGHT = 140;
-static const int FIELD_WIDTH = LOGIN_DIALOG_WIDTH - 70;
-
std::string LoginDialog::savedPassword("");
std::string LoginDialog::savedPasswordKey("");
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index e1310ef2e..19a912173 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -339,7 +339,7 @@ void SDLFont::doClean()
for (int f = 0; f < CACHES_NUMBER; f ++)
{
std::list<SDLTextChunk> *cache = &mCache[f];
- const unsigned size = cache->size();
+ const size_t size = cache->size();
#ifdef DEBUG_FONT_COUNTERS
logger->log("ptr: %d, size: %d", f, size);
#endif
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index 154594e60..be68518e3 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -313,7 +313,7 @@ void UpdaterWindow::loadNews()
{
firstLine = false;
std::string str = line;
- unsigned i = str.find("##9 Latest client version: ##6");
+ size_t i = str.find("##9 Latest client version: ##6");
if (!i)
{
line = strtok(nullptr, "\n");
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index 438318fdc..8e130d887 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -191,7 +191,7 @@ void WhoIsOnline::updateWindow(std::vector<OnlinePlayer*> &friends,
std::vector<OnlinePlayer*> &neutral,
std::vector<OnlinePlayer*> &disregard,
std::vector<OnlinePlayer*> enemy,
- int numOnline)
+ size_t numOnline)
{
//Set window caption
setCaption(_("Who Is Online - ") + toString(numOnline));
@@ -245,7 +245,7 @@ void WhoIsOnline::updateWindow(std::vector<OnlinePlayer*> &friends,
void WhoIsOnline::loadList(std::vector<OnlinePlayer*> &list)
{
mBrowserBox->clearRows();
- int numOnline = list.size();
+ size_t numOnline = list.size();
std::vector<OnlinePlayer*> friends;
std::vector<OnlinePlayer*> neutral;
std::vector<OnlinePlayer*> disregard;
diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h
index 94b30bfc2..4f70b24f9 100644
--- a/src/gui/whoisonline.h
+++ b/src/gui/whoisonline.h
@@ -170,7 +170,7 @@ private:
std::vector<OnlinePlayer*> &neutral,
std::vector<OnlinePlayer*> &disregard,
std::vector<OnlinePlayer*> enemy,
- int numOnline);
+ size_t numOnline);
enum DownloadStatus
{
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index 453e62a50..990937e06 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -349,9 +349,9 @@ void LayoutArray::reflow(int nx, int ny, int nw, int nh)
{
int dx = x, dy = y, dw = 0, dh = 0;
align(dx, dw, 0, *cell, &widths[gridX],
- widths.size() - gridX);
+ static_cast<int>(widths.size() - gridX));
align(dy, dh, 1, *cell, &heights[gridY],
- heights.size() - gridY);
+ static_cast<int>(heights.size() - gridY));
cell->reflow(dx, dy, dw, dh);
}
x += widths[gridX] + mSpacing;
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index b40a7dcb1..cd5b4bf99 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -177,7 +177,8 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
}
else
{
- mCaretColumn = mTextRows[mCaretRow].size();
+ mCaretColumn = static_cast<int>(
+ mTextRows[mCaretRow].size());
}
}
break;
@@ -192,11 +193,12 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
if (mCaretRow >= static_cast<int>(mTextRows.size()))
{
- mCaretRow = mTextRows.size() - 1;
+ mCaretRow = static_cast<int>(mTextRows.size()) - 1;
if (mCaretRow < 0)
mCaretRow = 0;
- mCaretColumn = mTextRows[mCaretRow].size();
+ mCaretColumn = static_cast<int>(
+ mTextRows[mCaretRow].size());
}
else
{
@@ -223,7 +225,7 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
}
case Input::KEY_GUI_END:
{
- mCaretColumn = mTextRows[mCaretRow].size();
+ mCaretColumn = static_cast<int>(mTextRows[mCaretRow].size());
break;
}
@@ -250,7 +252,8 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
}
else if (mCaretColumn == 0 && mCaretRow != 0 && mEditable)
{
- mCaretColumn = mTextRows[mCaretRow - 1].size();
+ mCaretColumn = static_cast<int>(
+ mTextRows[mCaretRow - 1].size());
mTextRows[mCaretRow - 1] += mTextRows[mCaretRow];
mTextRows.erase(mTextRows.begin() + mCaretRow);
--mCaretRow;
@@ -303,7 +306,7 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
mCaretRow += rowsPerPage;
if (mCaretRow >= static_cast<int>(mTextRows.size()))
- mCaretRow = mTextRows.size() - 1;
+ mCaretRow = static_cast<int>(mTextRows.size()) - 1;
}
break;
}
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 3d106f9a2..f0df5eb57 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -279,7 +279,7 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
break;
case 5: // Ctrl+e
- mCaretPosition = mText.size();
+ mCaretPosition = static_cast<int>(mText.size());
consumed = true;
break;