From 6cd7d00b6eb7c4a65df52ec1719d03a9d30f2bca Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 27 Apr 2015 21:40:38 +0000 Subject: [PATCH] =?UTF-8?q?base:=20don=E2=80=99t=20use=20the=20%lld=20form?= =?UTF-8?q?at=20string=20specifier.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The C++ standard (21.5 Numeric conversions) says that %lld must be available, however mingw still does not support it and in the meantime the most practical solution seems to use long int instead of long long int. --- src/lol/base/array.h | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/lol/base/array.h b/src/lol/base/array.h index 812497af..64e406fe 100644 --- a/src/lol/base/array.h +++ b/src/lol/base/array.h @@ -146,16 +146,16 @@ public: /* Allow array[0] even if size is zero so that people can * always use &array[0] to get a pointer to the data. */ ASSERT(n >= 0 && (n < m_count || (!n && !m_count)), - "cannot access index %lld in array of size %lld", - (long long int)n, (long long int)m_count); + "cannot access index %ld in array of size %ld", + (long int)n, (long int)m_count); return m_data[n]; } inline element_t const& operator[](ptrdiff_t n) const { ASSERT(n >= 0 && (n < m_count || (!n && !m_count)), - "cannot access index %lld in array of size %lld", - (long long int)n, (long long int)m_count); + "cannot access index %ld in array of size %ld", + (long int)n, (long int)m_count); return m_data[n]; } @@ -220,8 +220,8 @@ public: inline void insert(T const &x, ptrdiff_t pos) { ASSERT(pos >= 0 && pos <= m_count, - "cannot insert at index %lld in array of size %lld", - (long long int)pos, (long long int)m_count); + "cannot insert at index %ld in array of size %ld", + (long int)pos, (long int)m_count); if (m_count >= m_reserved) grow(); @@ -238,8 +238,8 @@ public: inline bool insert_unique(T const &x, ptrdiff_t pos) { ASSERT(pos >= 0 && pos <= m_count, - "cannot insert at index %lld in array of size %lld", - (long long int)pos, (long long int)m_count); + "cannot insert at index %ld in array of size %ld", + (long int)pos, (long int)m_count); if (find(x) != INDEX_NONE) return false; @@ -289,8 +289,8 @@ public: inline void swap(ptrdiff_t i, ptrdiff_t j) { ASSERT(i >= 0 && i < m_count && j >= 0 && j < m_count, - "cannot swap elements %lld and %lld in array of size %lld", - (long long int)i, (long long int)j, (long long int)m_count); + "cannot swap elements %ld and %ld in array of size %ld", + (long int)i, (long int)j, (long int)m_count); std::swap(m_data[i], m_data[j]); } @@ -299,9 +299,8 @@ public: { ASSERT(todelete >= 0); ASSERT(pos - todelete >= -m_count - 1 && pos + todelete <= m_count, - "cannot remove %lld elements at %lld in array of size %lld", - (long long int)todelete, (long long int)pos, - (long long int)m_count); + "cannot remove %ld elements at %ld in array of size %ld", + (long int)todelete, (long int)pos, (long int)m_count); if (pos < 0) pos = m_count + pos; @@ -317,9 +316,8 @@ public: { ASSERT(todelete >= 0); ASSERT(pos - todelete >= -m_count - 1 && pos + todelete <= m_count, - "cannot remove %lld elements at %lld in array of size %lld", - (long long int)todelete, (long long int)pos, - (long long int)m_count); + "cannot remove %ld elements at %ld in array of size %ld", + (long int)todelete, (long int)pos, (long int)m_count); if (pos < 0) pos = m_count + pos; @@ -500,8 +498,8 @@ public: inline void insert(ptrdiff_t pos, T... args) { ASSERT(pos >= 0 && pos <= this->m_count, - "cannot insert at index %lld in array of size %lld", - (long long int)pos, (long long int)this->m_count); + "cannot insert at index %ld in array of size %ld", + (long int)pos, (long int)this->m_count); if (this->m_count >= this->m_reserved) this->grow();