From 30240e46fa66a68e25fb0cc8bd254ab8ce246957 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 21 Apr 2015 14:06:44 +0000 Subject: [PATCH] math: deprecate some mixed-case method names. --- src/lol/math/arraynd.h | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/lol/math/arraynd.h b/src/lol/math/arraynd.h index 7898448f..e6045d09 100644 --- a/src/lol/math/arraynd.h +++ b/src/lol/math/arraynd.h @@ -110,14 +110,14 @@ public: inline arraynd(vec_t sizes, element_t e = element_t()) : m_sizes(sizes) { - FixSizes(e); + fix_sizes(e); } #if PTRDIFF_MAX > INT_MAX inline arraynd(vec_t sizes, element_t e = element_t()) { m_sizes = vec_t(sizes); - FixSizes(e); + fix_sizes(e); } #endif @@ -128,7 +128,7 @@ public: for (auto inner_initializer : initializer) inner_initializer.FillSizes(&m_sizes[N - 2]); - FixSizes(); + fix_sizes(); ptrdiff_t pos = 0; @@ -232,25 +232,38 @@ public: /* Resize the array. * FIXME: data gets scrambled; should we care? */ - inline void SetSize(vec_t sizes, element_t e = element_t()) + inline void set_size(vec_t sizes, element_t e = element_t()) { m_sizes = sizes; - FixSizes(e); + fix_sizes(e); } #if PTRDIFF_MAX > INT_MAX - inline void SetSize(vec_t sizes, element_t e = element_t()) + inline void set_size(vec_t sizes, element_t e = element_t()) { m_sizes = vec_t(sizes); - FixSizes(e); + fix_sizes(e); } #endif - inline vec_t GetSize() const + inline vec_t get_size() const { return this->m_sizes; } + /* TODO: remove these legacy functions one day */ + inline vec_t GetSize() const { return get_size(); } + inline void SetSize(vec_t sizes, element_t e = element_t()) + { + return set_size(sizes, e); + } +#if PTRDIFF_MAX > INT_MAX + inline void SetSize(vec_t sizes, element_t e = element_t()) + { + return set_size(sizes, e); + } +#endif + public: inline element_t *data() { 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(); } private: - inline void FixSizes(element_t e = element_t()) + inline void fix_sizes(element_t e = element_t()) { ptrdiff_t total_size = 1;