From 416550ab679fb7e011021ac385bff4ca4cf138a1 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 25 Aug 2014 18:08:45 +0000 Subject: [PATCH] math: fix compilation on 32-bit platforms. --- src/lol/math/arraynd.h | 6 ++++++ src/lol/math/vector.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lol/math/arraynd.h b/src/lol/math/arraynd.h index 50817a5a..65f5f1d4 100644 --- a/src/lol/math/arraynd.h +++ b/src/lol/math/arraynd.h @@ -115,11 +115,13 @@ public: } #endif +#if PTRDIFF_MAX != INT_MAX inline arraynd(vec_t sizes, element_t e = element_t()) { m_sizes = vec_t(sizes); FixSizes(e); } +#endif inline arraynd(std::initializer_list > initializer) @@ -154,6 +156,7 @@ public: } #endif +#if PTRDIFF_MAX != INT_MAX /* Access elements directly using an ivec2, ivec3 etc. index */ inline element_t const & operator[](vec_t const &pos) const { @@ -168,6 +171,7 @@ public: return const_cast( const_cast const&>(*this)[pos]); } +#endif /* Proxy to access slices */ template @@ -241,11 +245,13 @@ public: } #endif +#if PTRDIFF_MAX != INT_MAX inline void SetSize(vec_t sizes, element_t e = element_t()) { m_sizes = vec_t(sizes); FixSizes(e); } +#endif inline vec_t GetSize() const { diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index c88244dd..c5aa93a3 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -1191,15 +1191,15 @@ public: return m_vec[m_pos]; } - inline vec_const_iter const & operator ++() + inline vec_const_iter & operator ++() { ++m_pos; return *this; } private: - int m_pos; vec_t const &m_vec; + int m_pos; }; /* FIXME: do we need a non-const iterator? Looks almost useless to me,