Sfoglia il codice sorgente

math: fix compilation on 32-bit platforms.

undefined
Sam Hocevar 10 anni fa
parent
commit
416550ab67
2 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. +6
    -0
      src/lol/math/arraynd.h
  2. +2
    -2
      src/lol/math/vector.h

+ 6
- 0
src/lol/math/arraynd.h Vedi File

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

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


inline arraynd(std::initializer_list<arraynd_initializer<element_t, N - 1> > 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<int, N> const &pos) const
{
@@ -168,6 +171,7 @@ public:
return const_cast<element_t &>(
const_cast<arraynd<N, T...> const&>(*this)[pos]);
}
#endif

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

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

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


+ 2
- 2
src/lol/math/vector.h Vedi File

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

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

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

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


Caricamento…
Annulla
Salva