From 8d6bd102f52c653fa3ad57c8516064ab22b3692d Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Sat, 24 Oct 2020 17:49:46 -0700 Subject: [PATCH] fixing a few warnings --- public/blah/containers/vector.h | 10 +++++----- public/blah/drawing/batch.cpp | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/blah/containers/vector.h b/public/blah/containers/vector.h index 10201ca..581a857 100644 --- a/public/blah/containers/vector.h +++ b/public/blah/containers/vector.h @@ -185,7 +185,7 @@ namespace Blah } else { - for (int n = 0; n < m_size; n++) + for (auto n = 0; n < m_size; n++) { new (new_buffer + n) T(std::move(m_buffer[n])); m_buffer[n].~T(); @@ -203,12 +203,12 @@ namespace Blah if (new_size > m_size) { reserve(new_size); - for (int n = m_size; n < new_size; n++) + for (auto n = m_size; n < new_size; n++) new (m_buffer + n) T(); } else if (new_size < m_size) { - for (int i = new_size; i < m_size; i ++) + for (auto i = new_size; i < m_size; i ++) m_buffer[i].~T(); } @@ -219,7 +219,7 @@ namespace Blah T* Vector::expand(size_t amount) { reserve(m_size + amount); - for (int n = m_size; n < m_size + amount; n++) + for (auto n = m_size; n < m_size + amount; n++) new (m_buffer + n) T(); m_size += amount; return (m_buffer + m_size - amount); @@ -291,7 +291,7 @@ namespace Blah } else { - for (int i = index; i < m_size - 1; i++) + for (auto i = index; i < m_size - 1; i++) m_buffer[i] = std::move(m_buffer[i + 1]); m_buffer[m_size - 1].~T(); } diff --git a/public/blah/drawing/batch.cpp b/public/blah/drawing/batch.cpp index 7274953..1ce265e 100644 --- a/public/blah/drawing/batch.cpp +++ b/public/blah/drawing/batch.cpp @@ -84,12 +84,12 @@ namespace { \ m_batch.elements += 2; \ int* _i = m_indices.expand(6); \ - *_i++ = m_vertices.size() + 0; \ - *_i++ = m_vertices.size() + 1; \ - *_i++ = m_vertices.size() + 2; \ - *_i++ = m_vertices.size() + 0; \ - *_i++ = m_vertices.size() + 2; \ - *_i++ = m_vertices.size() + 3; \ + *_i++ = (int)m_vertices.size() + 0; \ + *_i++ = (int)m_vertices.size() + 1; \ + *_i++ = (int)m_vertices.size() + 2; \ + *_i++ = (int)m_vertices.size() + 0; \ + *_i++ = (int)m_vertices.size() + 2; \ + *_i++ = (int)m_vertices.size() + 3; \ Vertex* _v = m_vertices.expand(4); \ MAKE_VERTEX(_v, m_matrix, px0, py0, tx0, ty0, col0, mult, fill, wash); _v++; \ MAKE_VERTEX(_v, m_matrix, px1, py1, tx1, ty1, col1, mult, fill, wash); _v++; \ @@ -101,9 +101,9 @@ namespace { \ m_batch.elements += 1; \ int* _i = m_indices.expand(3); \ - *_i++ = m_vertices.size() + 0; \ - *_i++ = m_vertices.size() + 1; \ - *_i++ = m_vertices.size() + 2; \ + *_i++ = (int)m_vertices.size() + 0; \ + *_i++ = (int)m_vertices.size() + 1; \ + *_i++ = (int)m_vertices.size() + 2; \ Vertex* _v = m_vertices.expand(3); \ MAKE_VERTEX(_v, m_matrix, px0, py0, tx0, ty0, col0, mult, fill, wash); _v++; \ MAKE_VERTEX(_v, m_matrix, px1, py1, tx1, ty1, col1, mult, fill, wash); _v++; \