From ccdacf1c9b31b15e188aa9e9adb044ffd0ca0da4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Feb 2018 23:36:11 +1100 Subject: Cleanup: use '_len' instead of '_size' w/ BLI API - When returning the number of items in a collection use BLI_*_len() - Keep _size() for size in bytes. - Keep _count() for data structures that don't store length (hint this isn't a simple getter). See P611 to apply instead of manually resolving conflicts. --- source/blender/blenlib/BLI_edgehash.h | 4 ++-- source/blender/blenlib/BLI_ghash.h | 8 ++++---- source/blender/blenlib/BLI_gsqueue.h | 4 ++-- source/blender/blenlib/BLI_heap.h | 4 ++-- source/blender/blenlib/BLI_kdopbvh.h | 2 +- source/blender/blenlib/BLI_linklist_stack.h | 2 +- source/blender/blenlib/BLI_mempool.h | 2 +- source/blender/blenlib/BLI_smallhash.h | 2 +- source/blender/blenlib/BLI_threads.h | 2 +- source/blender/blenlib/intern/BLI_ghash.c | 16 ++++++++-------- source/blender/blenlib/intern/BLI_heap.c | 6 +++--- source/blender/blenlib/intern/BLI_kdopbvh.c | 2 +- source/blender/blenlib/intern/BLI_mempool.c | 2 +- source/blender/blenlib/intern/array_store.c | 6 +++--- source/blender/blenlib/intern/astar.c | 2 +- source/blender/blenlib/intern/edgehash.c | 10 +++++----- source/blender/blenlib/intern/gsqueue.c | 4 ++-- source/blender/blenlib/intern/polyfill2d_beautify.c | 2 +- source/blender/blenlib/intern/smallhash.c | 2 +- source/blender/blenlib/intern/task.c | 2 +- source/blender/blenlib/intern/threads.c | 4 ++-- 21 files changed, 44 insertions(+), 44 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index 20272dd97cd..41789201265 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -59,7 +59,7 @@ bool BLI_edgehash_remove(EdgeHash *eh, unsigned int v0, unsigned int void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; -int BLI_edgehash_size(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT; +int BLI_edgehash_len(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT; void BLI_edgehash_clear_ex(EdgeHash *eh, EdgeHashFreeFP valfreefp, const unsigned int nentries_reserve); void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp); @@ -104,7 +104,7 @@ typedef struct EdgeSetIterator EdgeSetIterator; EdgeSet *BLI_edgeset_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; EdgeSet *BLI_edgeset_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; -int BLI_edgeset_size(EdgeSet *es) ATTR_WARN_UNUSED_RESULT; +int BLI_edgeset_len(EdgeSet *es) ATTR_WARN_UNUSED_RESULT; bool BLI_edgeset_add(EdgeSet *es, unsigned int v0, unsigned int v1); void BLI_edgeset_insert(EdgeSet *es, unsigned int v0, unsigned int v1); bool BLI_edgeset_haskey(EdgeSet *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index b4819ff4e55..7a2d9924904 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -110,7 +110,7 @@ void BLI_ghash_clear_ex( void *BLI_ghash_popkey(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT; bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT; bool BLI_ghash_pop(GHash *gh, GHashIterState *state, void **r_key, void **r_val) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -unsigned int BLI_ghash_size(GHash *gh) ATTR_WARN_UNUSED_RESULT; +unsigned int BLI_ghash_len(GHash *gh) ATTR_WARN_UNUSED_RESULT; void BLI_ghash_flag_set(GHash *gh, unsigned int flag); void BLI_ghash_flag_clear(GHash *gh, unsigned int flag); @@ -261,7 +261,7 @@ GSet *BLI_gset_new_ex( const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; GSet *BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; GSet *BLI_gset_copy(GSet *gs, GSetKeyCopyFP keycopyfp) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; -unsigned int BLI_gset_size(GSet *gs) ATTR_WARN_UNUSED_RESULT; +unsigned int BLI_gset_len(GSet *gs) ATTR_WARN_UNUSED_RESULT; void BLI_gset_flag_set(GSet *gs, unsigned int flag); void BLI_gset_flag_clear(GSet *gs, unsigned int flag); void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp); @@ -309,8 +309,8 @@ BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi) { return BLI_ghashItera /* For testing, debugging only */ #ifdef GHASH_INTERNAL_API -int BLI_ghash_buckets_size(GHash *gh); -int BLI_gset_buckets_size(GSet *gs); +int BLI_ghash_buckets_len(GHash *gh); +int BLI_gset_buckets_len(GSet *gs); double BLI_ghash_calc_quality_ex( GHash *gh, double *r_load, double *r_variance, diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h index 4600d6f6325..ef0e0f3ab31 100644 --- a/source/blender/blenlib/BLI_gsqueue.h +++ b/source/blender/blenlib/BLI_gsqueue.h @@ -36,11 +36,11 @@ typedef struct _GSQueue GSQueue; GSQueue *BLI_gsqueue_new(size_t elem_size); bool BLI_gsqueue_is_empty(GSQueue *gq); -int BLI_gsqueue_size(GSQueue *gq); +int BLI_gsqueue_len(GSQueue *gq); void BLI_gsqueue_peek(GSQueue *gq, void *r_item); void BLI_gsqueue_pop(GSQueue *gq, void *r_item); void BLI_gsqueue_push(GSQueue *gq, const void *item); -void BLI_gsqueue_pushback(GSQueue *gq, const void *item); +void BLI_gsqueue_push_back(GSQueue *gq, const void *item); void BLI_gsqueue_free(GSQueue *gq); #endif /* __BLI_GSQUEUE_H__ */ diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h index d3f6d44e164..19e162d777f 100644 --- a/source/blender/blenlib/BLI_heap.h +++ b/source/blender/blenlib/BLI_heap.h @@ -41,9 +41,9 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL void BLI_heap_insert_or_update(Heap *heap, HeapNode **node_p, float value, void *ptr) ATTR_NONNULL(1, 2); void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1, 2); bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1); -unsigned int BLI_heap_size(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); +unsigned int BLI_heap_len(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); HeapNode *BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); -void *BLI_heap_popmin(Heap *heap) ATTR_NONNULL(1); +void *BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1); void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1, 2); void BLI_heap_node_value_update_ptr(Heap *heap, HeapNode *node, float value, void *ptr) ATTR_NONNULL(1, 2); diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 564659ad21e..db53035dc7b 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -129,7 +129,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap( const BVHTree *tree1, const BVHTree *tree2, unsigned int *r_overlap_tot, BVHTree_OverlapCallback callback, void *userdata); -int BLI_bvhtree_get_size(const BVHTree *tree); +int BLI_bvhtree_get_len(const BVHTree *tree); float BLI_bvhtree_get_epsilon(const BVHTree *tree); diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index dd92dcec936..dd6d737f111 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -60,7 +60,7 @@ } (void)0 #define BLI_LINKSTACK_SIZE(var) \ - BLI_mempool_count(var##_pool_) + BLI_mempool_len(var##_pool_) /* check for typeof() */ #ifdef __GNUC__ diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h index b68ca6b1f2b..45efb8d7ef1 100644 --- a/source/blender/blenlib/BLI_mempool.h +++ b/source/blender/blenlib/BLI_mempool.h @@ -53,7 +53,7 @@ void BLI_mempool_clear_ex(BLI_mempool *pool, const int totelem_reserve) ATTR_NONNULL(1); void BLI_mempool_clear(BLI_mempool *pool) ATTR_NONNULL(1); void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1); -int BLI_mempool_count(BLI_mempool *pool) ATTR_NONNULL(1); +int BLI_mempool_len(BLI_mempool *pool) ATTR_NONNULL(1); void *BLI_mempool_findelem(BLI_mempool *pool, unsigned int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); void BLI_mempool_as_table(BLI_mempool *pool, void **data) ATTR_NONNULL(1, 2); diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index e096354e5b1..495fc94a53c 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -66,7 +66,7 @@ bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); void *BLI_smallhash_lookup(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; void **BLI_smallhash_lookup_p(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); -int BLI_smallhash_count(const SmallHash *sh) ATTR_NONNULL(1); +int BLI_smallhash_len(const SmallHash *sh) ATTR_NONNULL(1); void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; void **BLI_smallhash_iternext_p(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; void *BLI_smallhash_iternew(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 60da6b39cbe..84e25daa348 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -177,7 +177,7 @@ void BLI_thread_queue_free(ThreadQueue *queue); void BLI_thread_queue_push(ThreadQueue *queue, void *work); void *BLI_thread_queue_pop(ThreadQueue *queue); void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms); -int BLI_thread_queue_size(ThreadQueue *queue); +int BLI_thread_queue_len(ThreadQueue *queue); bool BLI_thread_queue_is_empty(ThreadQueue *queue); void BLI_thread_queue_wait_finish(ThreadQueue *queue); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index bf2f25fae69..edfbccca660 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -741,7 +741,7 @@ void BLI_ghash_reserve(GHash *gh, const uint nentries_reserve) /** * \return size of the GHash. */ -uint BLI_ghash_size(GHash *gh) +uint BLI_ghash_len(GHash *gh) { return gh->nentries; } @@ -1010,7 +1010,7 @@ void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfree */ void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) { - BLI_assert((int)gh->nentries == BLI_mempool_count(gh->entrypool)); + BLI_assert((int)gh->nentries == BLI_mempool_len(gh->entrypool)); if (keyfreefp || valfreefp) ghash_free_cb(gh, keyfreefp, valfreefp); @@ -1044,7 +1044,7 @@ void BLI_ghash_flag_clear(GHash *gh, uint flag) /** * Create a new GHashIterator. The hash table must not be mutated * while the iterator is in use, and the iterator will step exactly - * BLI_ghash_size(gh) times before becoming done. + * BLI_ghash_len(gh) times before becoming done. * * \param gh The GHash to iterate over. * \return Pointer to a new DynStr. @@ -1059,7 +1059,7 @@ GHashIterator *BLI_ghashIterator_new(GHash *gh) /** * Init an already allocated GHashIterator. The hash table must not * be mutated while the iterator is in use, and the iterator will - * step exactly BLI_ghash_size(gh) times before becoming done. + * step exactly BLI_ghash_len(gh) times before becoming done. * * \param ghi The GHashIterator to initialize. * \param gh The GHash to iterate over. @@ -1398,7 +1398,7 @@ GSet *BLI_gset_copy(GSet *gs, GHashKeyCopyFP keycopyfp) return (GSet *)ghash_copy((GHash *)gs, keycopyfp, NULL); } -uint BLI_gset_size(GSet *gs) +uint BLI_gset_len(GSet *gs) { return ((GHash *)gs)->nentries; } @@ -1618,13 +1618,13 @@ GSet *BLI_gset_pair_new(const char *info) /** * \return number of buckets in the GHash. */ -int BLI_ghash_buckets_size(GHash *gh) +int BLI_ghash_buckets_len(GHash *gh) { return (int)gh->nbuckets; } -int BLI_gset_buckets_size(GSet *gs) +int BLI_gset_buckets_len(GSet *gs) { - return BLI_ghash_buckets_size((GHash *)gs); + return BLI_ghash_buckets_len((GHash *)gs); } /** diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 7c249344541..0c71e75e40f 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -303,7 +303,7 @@ bool BLI_heap_is_empty(const Heap *heap) return (heap->size == 0); } -uint BLI_heap_size(const Heap *heap) +uint BLI_heap_len(const Heap *heap) { return heap->size; } @@ -320,7 +320,7 @@ HeapNode *BLI_heap_top(const Heap *heap) /** * Pop the top node off the heap and return it's pointer. */ -void *BLI_heap_popmin(Heap *heap) +void *BLI_heap_pop_min(Heap *heap) { BLI_assert(heap->size != 0); @@ -348,7 +348,7 @@ void BLI_heap_remove(Heap *heap, HeapNode *node) i = p; } - BLI_heap_popmin(heap); + BLI_heap_pop_min(heap); } /** diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 9c055a227a9..d6c58780603 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1147,7 +1147,7 @@ void BLI_bvhtree_update_tree(BVHTree *tree) * Number of times #BLI_bvhtree_insert has been called. * mainly useful for asserts functions to check we added the correct number. */ -int BLI_bvhtree_get_size(const BVHTree *tree) +int BLI_bvhtree_get_len(const BVHTree *tree) { return tree->totleaf; } diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 5b13f129ad4..3a65e6c42ca 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -474,7 +474,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) } } -int BLI_mempool_count(BLI_mempool *pool) +int BLI_mempool_len(BLI_mempool *pool) { return (int)pool->totused; } diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index 5b1715bbb3d..acf15b1c892 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -1759,7 +1759,7 @@ bool BLI_array_store_is_valid( goto user_finally; } } - if (!(BLI_mempool_count(bs->memory.chunk_list) == (int)BLI_ghash_size(chunk_list_map))) { + if (!(BLI_mempool_len(bs->memory.chunk_list) == (int)BLI_ghash_len(chunk_list_map))) { ok = false; goto user_finally; } @@ -1772,11 +1772,11 @@ bool BLI_array_store_is_valid( totrefs += 1; } } - if (!(BLI_mempool_count(bs->memory.chunk) == (int)BLI_ghash_size(chunk_map))) { + if (!(BLI_mempool_len(bs->memory.chunk) == (int)BLI_ghash_len(chunk_map))) { ok = false; goto user_finally; } - if (!(BLI_mempool_count(bs->memory.chunk_ref) == totrefs)) { + if (!(BLI_mempool_len(bs->memory.chunk_ref) == totrefs)) { ok = false; goto user_finally; } diff --git a/source/blender/blenlib/intern/astar.c b/source/blender/blenlib/intern/astar.c index 0020dbe4612..1b57dc5a683 100644 --- a/source/blender/blenlib/intern/astar.c +++ b/source/blender/blenlib/intern/astar.c @@ -231,7 +231,7 @@ bool BLI_astar_graph_solve( SET_INT_IN_POINTER(node_index_src)); while (!BLI_heap_is_empty(todo_nodes)) { - const int node_curr_idx = GET_INT_FROM_POINTER(BLI_heap_popmin(todo_nodes)); + const int node_curr_idx = GET_INT_FROM_POINTER(BLI_heap_pop_min(todo_nodes)); BLI_AStarGNode *node_curr = &as_graph->nodes[node_curr_idx]; LinkData *ld; diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 772c8bd6247..7074a776aaf 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -527,7 +527,7 @@ bool BLI_edgehash_haskey(EdgeHash *eh, uint v0, uint v1) /** * Return number of keys in hash. */ -int BLI_edgehash_size(EdgeHash *eh) +int BLI_edgehash_len(EdgeHash *eh) { return (int)eh->nentries; } @@ -565,7 +565,7 @@ void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp) void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp) { - BLI_assert((int)eh->nentries == BLI_mempool_count(eh->epool)); + BLI_assert((int)eh->nentries == BLI_mempool_len(eh->epool)); if (valfreefp) edgehash_free_cb(eh, valfreefp); @@ -599,7 +599,7 @@ void BLI_edgehash_flag_clear(EdgeHash *eh, uint flag) /** * Create a new EdgeHashIterator. The hash table must not be mutated * while the iterator is in use, and the iterator will step exactly - * BLI_edgehash_size(eh) times before becoming done. + * BLI_edgehash_len(eh) times before becoming done. */ EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) { @@ -611,7 +611,7 @@ EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) /** * Init an already allocated EdgeHashIterator. The hash table must not * be mutated while the iterator is in use, and the iterator will - * step exactly BLI_edgehash_size(eh) times before becoming done. + * step exactly BLI_edgehash_len(eh) times before becoming done. * * \param ehi The EdgeHashIterator to initialize. * \param eh The EdgeHash to iterate over. @@ -729,7 +729,7 @@ EdgeSet *BLI_edgeset_new(const char *info) return BLI_edgeset_new_ex(info, 0); } -int BLI_edgeset_size(EdgeSet *es) +int BLI_edgeset_len(EdgeSet *es) { return (int)((EdgeHash *)es)->nentries; } diff --git a/source/blender/blenlib/intern/gsqueue.c b/source/blender/blenlib/intern/gsqueue.c index 25da7701924..5c8c43ab92a 100644 --- a/source/blender/blenlib/intern/gsqueue.c +++ b/source/blender/blenlib/intern/gsqueue.c @@ -81,7 +81,7 @@ bool BLI_gsqueue_is_empty(GSQueue *gq) /** * Query number elements in the queue */ -int BLI_gsqueue_size(GSQueue *gq) +int BLI_gsqueue_len(GSQueue *gq) { GSQueueElem *elem; int size = 0; @@ -162,7 +162,7 @@ void BLI_gsqueue_push(GSQueue *gq, const void *item) * \param item A pointer to an appropriately * sized structure (the size passed to BLI_gsqueue_new). */ -void BLI_gsqueue_pushback(GSQueue *gq, const void *item) +void BLI_gsqueue_push_back(GSQueue *gq, const void *item) { GSQueueElem *elem = MEM_mallocN(sizeof(*elem) + gq->elem_size, "gqueue_push"); memcpy(elem->data, item, gq->elem_size); diff --git a/source/blender/blenlib/intern/polyfill2d_beautify.c b/source/blender/blenlib/intern/polyfill2d_beautify.c index c0c95da5c63..625c54d0e9b 100644 --- a/source/blender/blenlib/intern/polyfill2d_beautify.c +++ b/source/blender/blenlib/intern/polyfill2d_beautify.c @@ -401,7 +401,7 @@ void BLI_polyfill_beautify( } while (BLI_heap_is_empty(eheap) == false) { - struct HalfEdge *e = BLI_heap_popmin(eheap); + struct HalfEdge *e = BLI_heap_pop_min(eheap); eheap_table[e->base_index] = NULL; polyedge_rotate(half_edges, e); diff --git a/source/blender/blenlib/intern/smallhash.c b/source/blender/blenlib/intern/smallhash.c index 1b862ffe005..56d77abed24 100644 --- a/source/blender/blenlib/intern/smallhash.c +++ b/source/blender/blenlib/intern/smallhash.c @@ -310,7 +310,7 @@ bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) return (e != NULL); } -int BLI_smallhash_count(const SmallHash *sh) +int BLI_smallhash_len(const SmallHash *sh) { return (int)sh->nentries; } diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c index 05cfe4f3972..c892ffbfd4a 100644 --- a/source/blender/blenlib/intern/task.c +++ b/source/blender/blenlib/intern/task.c @@ -1329,7 +1329,7 @@ void BLI_task_parallel_mempool( ParallelMempoolState state; int i, num_threads, num_tasks; - if (BLI_mempool_count(mempool) == 0) { + if (BLI_mempool_len(mempool) == 0) { return; } diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 2f961701801..9dc458fa0b9 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -773,12 +773,12 @@ void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms) return work; } -int BLI_thread_queue_size(ThreadQueue *queue) +int BLI_thread_queue_len(ThreadQueue *queue) { int size; pthread_mutex_lock(&queue->mutex); - size = BLI_gsqueue_size(queue->queue); + size = BLI_gsqueue_len(queue->queue); pthread_mutex_unlock(&queue->mutex); return size; -- cgit v1.2.3