From 91e74d8f1dc3f1fe01cb65822913488f5cbc5657 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 8 Aug 2017 20:18:08 +0300 Subject: Use size_t type for index in itemshortcut. --- src/gui/shortcut/itemshortcut.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/gui/shortcut/itemshortcut.h') diff --git a/src/gui/shortcut/itemshortcut.h b/src/gui/shortcut/itemshortcut.h index 8aa7a9efc..5e77e9152 100644 --- a/src/gui/shortcut/itemshortcut.h +++ b/src/gui/shortcut/itemshortcut.h @@ -66,10 +66,10 @@ class ItemShortcut final * * @param index Index of the shortcut item. */ - int getItem(const int index) const A_WARN_UNUSED + int getItem(const size_t index) const A_WARN_UNUSED { return mItems[index]; } - ItemColor getItemColor(const int index) const A_WARN_UNUSED + ItemColor getItemColor(const size_t index) const A_WARN_UNUSED { return mItemColors[index]; } void setItemData(const size_t index, @@ -96,9 +96,9 @@ class ItemShortcut final * * @param index Index of the items. */ - void setItem(const int index); + void setItem(const size_t index); - void setItem(const int index, + void setItem(const size_t index, const int item, const ItemColor color); @@ -112,7 +112,7 @@ class ItemShortcut final * @param index Index of the item. * @param itemId ID of the item. */ - void setItems(const int index, + void setItems(const size_t index, const int itemId, const ItemColor color) { mItems[index] = itemId; mItemColors[index] = color; save(); } @@ -142,7 +142,7 @@ class ItemShortcut final /** * Remove a item from the shortcut. */ - void removeItem(const int index) + void removeItem(const size_t index) { mItems[index] = -1; save(); } /** @@ -150,19 +150,20 @@ class ItemShortcut final * * @param index Index of the item shortcut. */ - void useItem(const int index) const; + void useItem(const size_t index) const; /** * Equip a item from the shortcut. */ - void equipItem(const int index) const; + void equipItem(const size_t index) const; /** * UnEquip a item from the shortcut. */ - void unequipItem(const int index) const; + void unequipItem(const size_t index) const; - void swap(const int index1, const int index2); + void swap(const size_t index1, + const size_t index2); void clear(); -- cgit v1.2.3-70-g09d2