diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-09-13 11:39:20 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-09-13 11:39:37 +0300 |
commit | 394318da74e5fddf14e19d7129a6d8406b67eb34 (patch) | |
tree | ef668419c2b698e8f735ee8c54fdbbb8a28ea3f5 /source/blender/blenlib/BLI_allocator.h | |
parent | 57e55906f04a48a951fbbcfd7c197eef35ad4387 (diff) |
BLI: fix some integer conversions
Diffstat (limited to 'source/blender/blenlib/BLI_allocator.h')
-rw-r--r-- | source/blender/blenlib/BLI_allocator.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_allocator.h b/source/blender/blenlib/BLI_allocator.h index 77506aa3dc5..fd8c94eee4c 100644 --- a/source/blender/blenlib/BLI_allocator.h +++ b/source/blender/blenlib/BLI_allocator.h @@ -82,13 +82,13 @@ class RawAllocator { void *allocate_aligned(uint size, uint alignment, const char *UNUSED(name)) { - BLI_assert(is_power_of_2_i(alignment)); + BLI_assert(is_power_of_2_i((int)alignment)); void *ptr = malloc(size + alignment + sizeof(MemHead)); void *used_ptr = (void *)((uintptr_t)POINTER_OFFSET(ptr, alignment + sizeof(MemHead)) & ~((uintptr_t)alignment - 1)); - uint offset = (uintptr_t)used_ptr - (uintptr_t)ptr; + uint offset = (uint)((uintptr_t)used_ptr - (uintptr_t)ptr); BLI_assert(offset >= sizeof(MemHead)); - ((MemHead *)used_ptr - 1)->offset = offset; + ((MemHead *)used_ptr - 1)->offset = (int)offset; return used_ptr; } |