summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-17 23:26:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-17 23:26:59 +0300
commit7e0a97d2521b9ce57003176e82a0b5564aa003c2 (patch)
tree5b2cfe1afe09bea1063f783050c1fb549daee76d /src/gui/widgets
parentf68cbf700a99f2f184715a5b8025bcb4b6525391 (diff)
downloadmanaplus-7e0a97d2521b9ce57003176e82a0b5564aa003c2.tar.gz
manaplus-7e0a97d2521b9ce57003176e82a0b5564aa003c2.tar.bz2
manaplus-7e0a97d2521b9ce57003176e82a0b5564aa003c2.tar.xz
manaplus-7e0a97d2521b9ce57003176e82a0b5564aa003c2.zip
Fix more code style and additional warnings.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/dropshortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp7
-rw-r--r--src/gui/widgets/setupitem.cpp2
-rw-r--r--src/gui/widgets/textfield.cpp2
4 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp
index d6d31871b..fca1af17f 100644
--- a/src/gui/widgets/dropshortcutcontainer.cpp
+++ b/src/gui/widgets/dropshortcutcontainer.cpp
@@ -185,7 +185,7 @@ void DropShortcutContainer::mouseDragged(gcn::MouseEvent &event)
return;
const int itemId = dropShortcut->getItem(index);
- const int itemColor = dropShortcut->getItemColor(index);
+ const unsigned char itemColor = dropShortcut->getItemColor(index);
if (itemId < 0)
return;
@@ -288,7 +288,7 @@ void DropShortcutContainer::mouseMoved(gcn::MouseEvent &event)
return;
const int itemId = dropShortcut->getItem(index);
- const int itemColor = dropShortcut->getItemColor(index);
+ const unsigned char itemColor = dropShortcut->getItemColor(index);
if (itemId < 0)
return;
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index 714435d21..735cea43d 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -140,7 +140,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics)
g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT);
const int itemId = itemShortcut[mNumber]->getItem(i);
- const int itemColor = itemShortcut[mNumber]->getItemColor(i);
+ const unsigned char itemColor = itemShortcut[mNumber]->getItemColor(i);
if (itemId < 0)
continue;
@@ -245,7 +245,8 @@ void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event)
return;
const int itemId = itemShortcut[mNumber]->getItem(index);
- const int itemColor = itemShortcut[mNumber]->getItemColor(index);
+ const unsigned char itemColor = itemShortcut[mNumber]->
+ getItemColor(index);
if (itemId < 0)
return;
@@ -365,7 +366,7 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event)
return;
const int itemId = itemShortcut[mNumber]->getItem(index);
- const int itemColor = itemShortcut[mNumber]->getItemColor(index);
+ const unsigned char itemColor = itemShortcut[mNumber]->getItemColor(index);
if (itemId < 0)
return;
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 7f539d79f..bbc809747 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -848,7 +848,7 @@ void SetupItemSlider2::action(const gcn::ActionEvent &event A_UNUSED)
void SetupItemSlider2::updateLabel()
{
- int val = mSlider->getValue() - mMin;
+ int val = static_cast<int>(mSlider->getValue()) - mMin;
if (val < 0)
val = 0;
else if (val >= static_cast<signed>(mValues->size()))
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 8f543e3bf..3d106f9a2 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -174,7 +174,7 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
if ((val >= '0' && val <= '9') || (val == '-' && !mCaretPosition))
{
char buf[2];
- buf[0] = val;
+ buf[0] = static_cast<char>(val);
buf[1] = 0;
mText.insert(mCaretPosition, std::string(buf));
mCaretPosition += 1;