From 6a4bf944ace9215924b3f37f634a2fac35febd13 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Wed, 9 Aug 2017 01:30:21 +0300
Subject: Fix warning with old compilers.

---
 src/gui/shortcut/emoteshortcut.cpp | 4 ++--
 src/gui/shortcut/emoteshortcut.h   | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gui/shortcut/emoteshortcut.cpp b/src/gui/shortcut/emoteshortcut.cpp
index 81b0e2b19..fb59da96b 100644
--- a/src/gui/shortcut/emoteshortcut.cpp
+++ b/src/gui/shortcut/emoteshortcut.cpp
@@ -80,7 +80,7 @@ void EmoteShortcut::useEmotePlayer(const size_t index) const
     if (localPlayer == nullptr)
         return;
 
-    if (index <= SHORTCUT_EMOTES)
+    if (index <= CAST_SIZE(SHORTCUT_EMOTES))
     {
         if (mEmotes[index - 1] > 0)
             localPlayer->emote(mEmotes[index - 1]);
@@ -92,7 +92,7 @@ void EmoteShortcut::useEmote(const size_t index) const
     if (localPlayer == nullptr)
         return;
 
-    if (index <= SHORTCUT_EMOTES)
+    if (index <= CAST_SIZE(SHORTCUT_EMOTES))
     {
         if (mEmotes[index - 1] > 0)
         {
diff --git a/src/gui/shortcut/emoteshortcut.h b/src/gui/shortcut/emoteshortcut.h
index 282f12943..2ecc2c1b7 100644
--- a/src/gui/shortcut/emoteshortcut.h
+++ b/src/gui/shortcut/emoteshortcut.h
@@ -24,6 +24,8 @@
 
 #include "const/emoteshortcut.h"
 
+#include "utils/cast.h"
+
 #include "localconsts.h"
 
 /**
@@ -105,7 +107,7 @@ class EmoteShortcut final
          * Remove a Emote from the shortcut.
          */
         void removeEmote(const size_t index)
-        { if (index < SHORTCUT_EMOTES) mEmotes[index] = 0; }
+        { if (index < CAST_SIZE(SHORTCUT_EMOTES)) mEmotes[index] = 0; }
 
         /**
          * Try to use the Emote specified by the index.
-- 
cgit v1.2.3-70-g09d2