Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-13 12:03:49 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-13 12:03:49 +0300
commitbb7c858598ff263eb29f676ec8ef8b2f43b20c43 (patch)
tree4481ffc8fcd16548c8436883e54f10d8c41ffe46 /source/blender/blenlib/BLI_vector.h
parent394318da74e5fddf14e19d7129a6d8406b67eb34 (diff)
BLI: make more integer type conversions explicit
Diffstat (limited to 'source/blender/blenlib/BLI_vector.h')
-rw-r--r--source/blender/blenlib/BLI_vector.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_vector.h b/source/blender/blenlib/BLI_vector.h
index 167131cc99e..1901f2a60ad 100644
--- a/source/blender/blenlib/BLI_vector.h
+++ b/source/blender/blenlib/BLI_vector.h
@@ -52,7 +52,7 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
#ifdef DEBUG
/* Storing size in debug builds, because it makes debugging much easier sometimes. */
uint m_debug_size;
-# define UPDATE_VECTOR_SIZE(ptr) (ptr)->m_debug_size = (ptr)->m_end - (ptr)->m_begin
+# define UPDATE_VECTOR_SIZE(ptr) (ptr)->m_debug_size = (uint)((ptr)->m_end - (ptr)->m_begin)
#else
# define UPDATE_VECTOR_SIZE(ptr) ((void)0)
#endif
@@ -387,8 +387,8 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
*/
uint size() const
{
- BLI_assert(m_debug_size == m_end - m_begin);
- return m_end - m_begin;
+ BLI_assert(m_debug_size == (uint)(m_end - m_begin));
+ return (uint)(m_end - m_begin);
}
/**
@@ -539,7 +539,7 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
uint capacity() const
{
- return m_capacity_end - m_begin;
+ return (uint)(m_capacity_end - m_begin);
}
BLI_NOINLINE void grow(uint min_capacity)
@@ -554,7 +554,7 @@ template<typename T, uint N = 4, typename Allocator = GuardedAllocator> class Ve
uint size = this->size();
T *new_array = (T *)m_allocator.allocate_aligned(
- min_capacity * sizeof(T), std::alignment_of<T>::value, __func__);
+ min_capacity * (uint)sizeof(T), std::alignment_of<T>::value, __func__);
uninitialized_relocate_n(m_begin, size, new_array);
if (!this->is_small()) {