summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2019-03-28 00:09:33 +0100
committerGitHub <noreply@github.com>2019-03-28 00:09:33 +0100
commit66dd7c3879123bb99b712375b66b577f81d53a96 (patch)
tree6231635658dab5ba63b776e9350884c083617cb1 /src/core
parente817951bfdc229b404d5fec188c67f5202a0e774 (diff)
downloadopenttd-66dd7c3879123bb99b712375b66b577f81d53a96.tar.xz
Fix: MSVC warnings (#7423)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/math_func.hpp8
-rw-r--r--src/core/sort_func.hpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp
index 4a19033f4..0b51d6bbf 100644
--- a/src/core/math_func.hpp
+++ b/src/core/math_func.hpp
@@ -247,9 +247,9 @@ static inline T Delta(const T a, const T b)
* @return True if the value is in the interval, false else.
*/
template <typename T>
-static inline bool IsInsideBS(const T x, const uint base, const uint size)
+static inline bool IsInsideBS(const T x, const size_t base, const size_t size)
{
- return (uint)(x - base) < size;
+ return (size_t)(x - base) < size;
}
/**
@@ -263,9 +263,9 @@ static inline bool IsInsideBS(const T x, const uint base, const uint size)
* @see IsInsideBS()
*/
template <typename T>
-static inline bool IsInsideMM(const T x, const uint min, const uint max)
+static inline bool IsInsideMM(const T x, const size_t min, const size_t max)
{
- return (uint)(x - min) < (max - min);
+ return (size_t)(x - min) < (max - min);
}
/**
diff --git a/src/core/sort_func.hpp b/src/core/sort_func.hpp
index 470a0ccf4..f3ac73a66 100644
--- a/src/core/sort_func.hpp
+++ b/src/core/sort_func.hpp
@@ -25,7 +25,7 @@
* @param desc Sort descending.
*/
template <typename T>
-static inline void QSortT(T *base, uint num, int (CDECL *comparator)(const T*, const T*), bool desc = false)
+static inline void QSortT(T *base, size_t num, int (CDECL *comparator)(const T*, const T*), bool desc = false)
{
if (num < 2) return;
@@ -49,7 +49,7 @@ static inline void QSortT(T *base, uint num, int (CDECL *comparator)(const T*, c
* @param desc Sort descending.
*/
template <typename T>
-static inline void GSortT(T *base, uint num, int (CDECL *comparator)(const T*, const T*), bool desc = false)
+static inline void GSortT(T *base, size_t num, int (CDECL *comparator)(const T*, const T*), bool desc = false)
{
if (num < 2) return;