Browse Source

math: deprecate some mixed-case method names.

undefined
Sam Hocevar 9 years ago
parent
commit
30240e46fa
1 changed files with 22 additions and 9 deletions
  1. +22
    -9
      src/lol/math/arraynd.h

+ 22
- 9
src/lol/math/arraynd.h View File

@@ -110,14 +110,14 @@ public:
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);
fix_sizes(e);
} }


#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);
FixSizes(e);
fix_sizes(e);
} }
#endif #endif


@@ -128,7 +128,7 @@ public:
for (auto inner_initializer : initializer) for (auto inner_initializer : initializer)
inner_initializer.FillSizes(&m_sizes[N - 2]); inner_initializer.FillSizes(&m_sizes[N - 2]);


FixSizes();
fix_sizes();


ptrdiff_t pos = 0; ptrdiff_t pos = 0;


@@ -232,25 +232,38 @@ public:


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


#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 set_size(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);
fix_sizes(e);
} }
#endif #endif


inline vec_t<ptrdiff_t, N> GetSize() const
inline vec_t<ptrdiff_t, N> get_size() const
{ {
return this->m_sizes; return this->m_sizes;
} }


/* TODO: remove these legacy functions one day */
inline vec_t<ptrdiff_t, N> GetSize() const { return get_size(); }
inline void SetSize(vec_t<ptrdiff_t, N> sizes, element_t e = element_t())
{
return set_size(sizes, e);
}
#if PTRDIFF_MAX > INT_MAX
inline void SetSize(vec_t<int, N> sizes, element_t e = element_t())
{
return set_size(sizes, e);
}
#endif

public: public:
inline element_t *data() { return super::data(); } inline element_t *data() { return super::data(); }
inline element_t const *data() const { return super::data(); } inline element_t const *data() const { return super::data(); }
@@ -258,7 +271,7 @@ public:
inline ptrdiff_t bytes() const { return super::bytes(); } inline ptrdiff_t bytes() const { return super::bytes(); }


private: private:
inline void FixSizes(element_t e = element_t())
inline void fix_sizes(element_t e = element_t())
{ {
ptrdiff_t total_size = 1; ptrdiff_t total_size = 1;




Loading…
Cancel
Save