Pārlūkot izejas kodu

math: fix compilation on 32-bit platforms.

undefined
Sam Hocevar pirms 10 gadiem
vecāks
revīzija
416550ab67
2 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. +6
    -0
      src/lol/math/arraynd.h
  2. +2
    -2
      src/lol/math/vector.h

+ 6
- 0
src/lol/math/arraynd.h Parādīt failu

@@ -115,11 +115,13 @@ public:
} }
#endif #endif


#if PTRDIFF_MAX != INT_MAX
inline arraynd(vec_t<int, N> sizes, element_t e = element_t()) inline arraynd(vec_t<int, N> sizes, element_t e = element_t())
{ {
m_sizes = vec_t<ptrdiff_t, N>(sizes); m_sizes = vec_t<ptrdiff_t, N>(sizes);
FixSizes(e); FixSizes(e);
} }
#endif




inline arraynd(std::initializer_list<arraynd_initializer<element_t, N - 1> > initializer) inline arraynd(std::initializer_list<arraynd_initializer<element_t, N - 1> > initializer)
@@ -154,6 +156,7 @@ public:
} }
#endif #endif


#if PTRDIFF_MAX != INT_MAX
/* Access elements directly using an ivec2, ivec3 etc. index */ /* Access elements directly using an ivec2, ivec3 etc. index */
inline element_t const & operator[](vec_t<int, N> const &pos) const inline element_t const & operator[](vec_t<int, N> const &pos) const
{ {
@@ -168,6 +171,7 @@ public:
return const_cast<element_t &>( return const_cast<element_t &>(
const_cast<arraynd<N, T...> const&>(*this)[pos]); const_cast<arraynd<N, T...> const&>(*this)[pos]);
} }
#endif


/* Proxy to access slices */ /* Proxy to access slices */
template<typename ARRAY_TYPE, ptrdiff_t L = N - 1> template<typename ARRAY_TYPE, ptrdiff_t L = N - 1>
@@ -241,11 +245,13 @@ public:
} }
#endif #endif


#if PTRDIFF_MAX != INT_MAX
inline void SetSize(vec_t<int, N> sizes, element_t e = element_t()) inline void SetSize(vec_t<int, N> sizes, element_t e = element_t())
{ {
m_sizes = vec_t<ptrdiff_t, N>(sizes); m_sizes = vec_t<ptrdiff_t, N>(sizes);
FixSizes(e); FixSizes(e);
} }
#endif


inline vec_t<ptrdiff_t, N> GetSize() const inline vec_t<ptrdiff_t, N> GetSize() const
{ {


+ 2
- 2
src/lol/math/vector.h Parādīt failu

@@ -1191,15 +1191,15 @@ public:
return m_vec[m_pos]; return m_vec[m_pos];
} }


inline vec_const_iter<T,N,SWIZZLE> const & operator ++()
inline vec_const_iter<T,N,SWIZZLE> & operator ++()
{ {
++m_pos; ++m_pos;
return *this; return *this;
} }


private: private:
int m_pos;
vec_t<T,N,SWIZZLE> const &m_vec; vec_t<T,N,SWIZZLE> const &m_vec;
int m_pos;
}; };


/* FIXME: do we need a non-const iterator? Looks almost useless to me, /* FIXME: do we need a non-const iterator? Looks almost useless to me,


Notiek ielāde…
Atcelt
Saglabāt