summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-29 14:55:40 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-29 14:55:40 +0300
commit4c6264db7ad4f0ae8a6c001903b47741abb94d8c (patch)
treea4e95239130dc4b86d036acd10c95f5fe3b96999 /src/gui
parentf6e76f469a81ff2d9e3714d39d1a8f4012cda2b8 (diff)
downloadplus-4c6264db7ad4f0ae8a6c001903b47741abb94d8c.tar.gz
plus-4c6264db7ad4f0ae8a6c001903b47741abb94d8c.tar.bz2
plus-4c6264db7ad4f0ae8a6c001903b47741abb94d8c.tar.xz
plus-4c6264db7ad4f0ae8a6c001903b47741abb94d8c.zip
Fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/browserbox.cpp6
-rw-r--r--src/gui/widgets/icon.cpp2
-rw-r--r--src/gui/windows/charcreatedialog.cpp17
-rw-r--r--src/gui/windows/npcdialog.cpp5
4 files changed, 18 insertions, 12 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 97ad5ce85..007f2ce2c 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -211,7 +211,7 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
BrowserLink bLink;
// Check for links in format "@@link|Caption@@"
- const unsigned int sz = mTextRows.size();
+ const uint32_t sz = CAST_U32(mTextRows.size());
if (mEnableKeys)
{
@@ -386,7 +386,9 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
FOR_EACH (TextRowCIter, i, mTextRows)
{
std::string tempRow = *i;
- for (unsigned int j = 0, sz = tempRow.size(); j < sz; j++)
+ for (uint32_t j = 0, sz = CAST_U32(tempRow.size());
+ j < sz;
+ j++)
{
const std::string character = tempRow.substr(j, 1);
x += CAST_U32(font->getWidth(character));
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp
index 76d5d90b0..3b9bdeaf8 100644
--- a/src/gui/widgets/icon.cpp
+++ b/src/gui/widgets/icon.cpp
@@ -30,8 +30,6 @@
#include "resources/loaders/imageloader.h"
-#include "resources/resourcemanager/resourcemanager.h"
-
#include "debug.h"
Icon::Icon(const Widget2 *const widget,
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index a61008c6c..02ef2686f 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -664,19 +664,23 @@ void CharCreateDialog::setAttributes(const StringVect &labels,
{
mAttributeLabel[i] = new Label(this, labels[i]);
mAttributeLabel[i]->setWidth(70);
- mAttributeLabel[i]->setPosition(mPadding, y + i * 24);
+ mAttributeLabel[i]->setPosition(mPadding,
+ y + CAST_S32(i * 24));
mAttributeLabel[i]->adjustSize();
add(mAttributeLabel[i]);
mAttributeSlider[i] = new Slider(this, min, max, 1.0);
- mAttributeSlider[i]->setDimension(Rect(140 + mPadding, y + i * 24,
- 150, 12));
+ mAttributeSlider[i]->setDimension(Rect(140 + mPadding,
+ y + CAST_S32(i * 24),
+ 150,
+ 12));
mAttributeSlider[i]->setActionEventId("statslider");
mAttributeSlider[i]->addActionListener(this);
add(mAttributeSlider[i]);
mAttributeValue[i] = new Label(this, toString(min));
- mAttributeValue[i]->setPosition(295 + mPadding, y + i * 24);
+ mAttributeValue[i]->setPosition(295 + mPadding,
+ y + CAST_S32(i * 24));
add(mAttributeValue[i]);
}
@@ -688,7 +692,10 @@ void CharCreateDialog::setAttributes(const StringVect &labels,
}
else
{
- h = y + sz * 24 + mAttributesLeft->getHeight() + getPadding();
+ h = y +
+ CAST_S32(sz) * 24 +
+ mAttributesLeft->getHeight() +
+ getPadding();
}
if (serverFeatures->haveCreateCharGender() &&
features.getIntValue("forceCharGender") == -1 &&
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index b4323feb6..8b850d463 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -1365,8 +1365,7 @@ std::string NpcDialog::complexItemToStr(const ComplexItem *const item)
if (item)
{
const std::vector<Item*> &items = item->getChilds();
- const int sz = items.size();
- logger->log("complexItemToStr size=%d", sz);
+ const size_t sz = items.size();
if (!sz)
return str;
@@ -1375,7 +1374,7 @@ std::string NpcDialog::complexItemToStr(const ComplexItem *const item)
str = strprintf("%d,%d",
item2->getInvIndex(),
item2->getQuantity());
- for (int f = 1; f < sz; f ++)
+ for (size_t f = 1; f < sz; f ++)
{
str.append(";");
item2 = items[f];