Browse Source

math: another 32-bit compilation fix.

undefined
Sam Hocevar 10 years ago
parent
commit
ad9c4a779b
1 changed files with 3 additions and 10 deletions
  1. +3
    -10
      src/lol/math/arraynd.h

+ 3
- 10
src/lol/math/arraynd.h View File

@@ -107,15 +107,13 @@ public:
{ {
} }


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


#if PTRDIFF_MAX != INT_MAX
#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);
@@ -123,7 +121,6 @@ public:
} }
#endif #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)
{ {
m_sizes[N - 1] = initializer.size(); m_sizes[N - 1] = initializer.size();
@@ -140,7 +137,6 @@ public:
} }


/* Access elements directly using an vec_t<ptrdiff_t, N> index */ /* Access elements directly using an vec_t<ptrdiff_t, N> index */
#if PTRDIFF_MAX > INT_MAX
inline element_t const & operator[](vec_t<ptrdiff_t, N> const &pos) const inline element_t const & operator[](vec_t<ptrdiff_t, N> const &pos) const
{ {
ptrdiff_t n = pos[N - 1]; ptrdiff_t n = pos[N - 1];
@@ -154,9 +150,8 @@ 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


#if PTRDIFF_MAX != INT_MAX
#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
{ {
@@ -237,15 +232,13 @@ public:


/* Resize the array. /* Resize the array.
* FIXME: data gets scrambled; should we care? */ * FIXME: data gets scrambled; should we care? */
#if PTRDIFF_MAX > INT_MAX
inline void SetSize(vec_t<ptrdiff_t, N> sizes, element_t e = element_t()) inline void SetSize(vec_t<ptrdiff_t, N> sizes, element_t e = element_t())
{ {
m_sizes = sizes; m_sizes = sizes;
FixSizes(e); FixSizes(e);
} }
#endif


#if PTRDIFF_MAX != INT_MAX
#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);


Loading…
Cancel
Save