diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-08 10:29:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-08 10:29:22 +0400 |
commit | c005fb407bbb7aac4cf138fbba903bbb2c821c93 (patch) | |
tree | a49185234ce1a01d26e8f1632e29323025322d17 /source/blender/blenlib/intern | |
parent | 8a9a060b673bb9b8c08967ccbd8009ca24cde4d1 (diff) |
Util-defines: avoid multiple calculation/access for MIN/MAX macros
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/BLI_heap.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_mempool.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 206a8041c4a..55dee4e8677 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -125,7 +125,7 @@ Heap *BLI_heap_new_ex(unsigned int tot_reserve) { Heap *heap = (Heap *)MEM_callocN(sizeof(Heap), __func__); /* ensure we have at least one so we can keep doubling it */ - heap->bufsize = MAX2(1, tot_reserve); + heap->bufsize = MAX2(1u, tot_reserve); heap->tree = (HeapNode **)MEM_mallocN(heap->bufsize * sizeof(HeapNode *), "BLIHeapTree"); heap->arena = BLI_memarena_new(MEM_SIZE_OPTIMAL(1 << 16), "heap arena"); diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 28539d9ca34..c2b54023621 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -257,7 +257,7 @@ BLI_mempool *BLI_mempool_create(unsigned int esize, unsigned int totelem, } if (flag & BLI_MEMPOOL_ALLOW_ITER) { - pool->esize = MAX2(esize, (int)sizeof(BLI_freenode)); + pool->esize = MAX2(esize, (unsigned int)sizeof(BLI_freenode)); } else { pool->esize = esize; |