summaryrefslogtreecommitdiff
path: root/src/gui/models
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-20 21:19:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-20 21:19:35 +0300
commit3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9 (patch)
tree2053748aba4fd1e01020effe9322757426354d28 /src/gui/models
parent2577a25f8a4acf587526809fda2ded95875e1222 (diff)
downloadmv-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.gz
mv-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.bz2
mv-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.xz
mv-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.zip
Add missing const in gui directory.
Diffstat (limited to 'src/gui/models')
-rw-r--r--src/gui/models/namesmodel.cpp3
-rw-r--r--src/gui/models/namesmodel.h3
-rw-r--r--src/gui/models/playertablemodel.cpp4
-rw-r--r--src/gui/models/shopitems.cpp4
-rw-r--r--src/gui/models/shopitems.h2
-rw-r--r--src/gui/models/touchactionmodel.cpp2
6 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/models/namesmodel.cpp b/src/gui/models/namesmodel.cpp
index 2e7606274..8d0d77251 100644
--- a/src/gui/models/namesmodel.cpp
+++ b/src/gui/models/namesmodel.cpp
@@ -45,7 +45,8 @@ std::string NamesModel::getElementAt(int i)
return mNames[CAST_SIZE(i)];
}
-void NamesModel::fillFromArray(const char *const *const arr, std::size_t sz)
+void NamesModel::fillFromArray(const char *const *const arr,
+ const std::size_t sz)
{
if (!arr)
return;
diff --git a/src/gui/models/namesmodel.h b/src/gui/models/namesmodel.h
index 0f75b0bc8..63af17db6 100644
--- a/src/gui/models/namesmodel.h
+++ b/src/gui/models/namesmodel.h
@@ -52,7 +52,8 @@ class NamesModel notfinal : public ListModel
void add(const std::string &str)
{ mNames.push_back(str); }
- void fillFromArray(const char *const *const arr, std::size_t size);
+ void fillFromArray(const char *const *const arr,
+ const std::size_t size);
protected:
StringVect mNames;
diff --git a/src/gui/models/playertablemodel.cpp b/src/gui/models/playertablemodel.cpp
index 80eab3694..e3458abc3 100644
--- a/src/gui/models/playertablemodel.cpp
+++ b/src/gui/models/playertablemodel.cpp
@@ -100,8 +100,8 @@ void PlayerTableModel::playerRelationsUpdated()
mPlayers = player_names;
// set up widgets
- for (unsigned int r = 0, sz = CAST_U32(
- player_names->size()); r < sz; ++r)
+ for (unsigned int r = 0, fsz = CAST_U32(
+ player_names->size()); r < fsz; ++r)
{
const std::string name = (*player_names)[r];
Widget *const widget = new Label(this, name);
diff --git a/src/gui/models/shopitems.cpp b/src/gui/models/shopitems.cpp
index 952e5fe19..2a2b75ae8 100644
--- a/src/gui/models/shopitems.cpp
+++ b/src/gui/models/shopitems.cpp
@@ -103,9 +103,9 @@ ShopItem *ShopItems::addItem2(const int inventoryIndex,
return item;
}
-ShopItem *ShopItems::at(unsigned int i) const
+ShopItem *ShopItems::at(const size_t i) const
{
- if (i >= CAST_U32(mShopItems.size()))
+ if (i >= mShopItems.size())
return nullptr;
return mShopItems.at(i);
diff --git a/src/gui/models/shopitems.h b/src/gui/models/shopitems.h
index c75fee7e1..d346c38b7 100644
--- a/src/gui/models/shopitems.h
+++ b/src/gui/models/shopitems.h
@@ -107,7 +107,7 @@ class ShopItems final : public ListModel
/**
* Returns the item number i in the shop.
*/
- ShopItem *at(unsigned int i) const A_WARN_UNUSED;
+ ShopItem *at(const size_t i) const A_WARN_UNUSED;
/**
* Removes an element from the shop.
diff --git a/src/gui/models/touchactionmodel.cpp b/src/gui/models/touchactionmodel.cpp
index c75c5985e..12059cb08 100644
--- a/src/gui/models/touchactionmodel.cpp
+++ b/src/gui/models/touchactionmodel.cpp
@@ -48,7 +48,7 @@ TouchActionsModel::TouchActionsModel() :
{
std::vector<SetupActionData*> data;
- for (int f = 0, sz = touchActionDataSize; f < sz; f ++)
+ for (int f = 0, fsz = touchActionDataSize; f < fsz; f ++)
{
int k = 0;
while (!touchActionData[f][k].name.empty())