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:
authorCampbell Barton <campbell@blender.org>2022-03-30 09:26:42 +0300
committerCampbell Barton <campbell@blender.org>2022-03-30 10:01:22 +0300
commita8ec7845e0bdb9e63e9d3dbd7f4cd7caad36b5a2 (patch)
tree4531232281ddc4cda4df3fb1ccc0822018fe5682 /source/blender/blenlib/intern/gsqueue.c
parentaf3aaf80344e745e6c207102941513cb631194c3 (diff)
Cleanup: use "num" as a suffix in: source/blender/blenlib
Also replace "num" with: - "number" when it's not used to denote the number of items. - "digits" when digits in a string are being manipulated.
Diffstat (limited to 'source/blender/blenlib/intern/gsqueue.c')
-rw-r--r--source/blender/blenlib/intern/gsqueue.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/gsqueue.c b/source/blender/blenlib/intern/gsqueue.c
index 4bf4e15d864..b09f5113be7 100644
--- a/source/blender/blenlib/intern/gsqueue.c
+++ b/source/blender/blenlib/intern/gsqueue.c
@@ -33,7 +33,7 @@ struct _GSQueue {
size_t chunk_last_index; /* index into 'chunk_last' */
size_t chunk_elem_max; /* number of elements per chunk */
size_t elem_size; /* memory size of elements */
- size_t totelem; /* total number of elements */
+ size_t elem_num; /* total number of elements */
};
static void *queue_get_first_elem(GSQueue *queue)
@@ -97,7 +97,7 @@ void BLI_gsqueue_free(GSQueue *queue)
void BLI_gsqueue_push(GSQueue *queue, const void *item)
{
queue->chunk_last_index++;
- queue->totelem++;
+ queue->elem_num++;
if (UNLIKELY(queue->chunk_last_index == queue->chunk_elem_max)) {
struct QueueChunk *chunk;
@@ -134,9 +134,9 @@ void BLI_gsqueue_pop(GSQueue *queue, void *r_item)
memcpy(r_item, queue_get_first_elem(queue), queue->elem_size);
queue->chunk_first_index++;
- queue->totelem--;
+ queue->elem_num--;
- if (UNLIKELY(queue->chunk_first_index == queue->chunk_elem_max || queue->totelem == 0)) {
+ if (UNLIKELY(queue->chunk_first_index == queue->chunk_elem_max || queue->elem_num == 0)) {
struct QueueChunk *chunk_free = queue->chunk_first;
queue->chunk_first = queue->chunk_first->next;
@@ -153,7 +153,7 @@ void BLI_gsqueue_pop(GSQueue *queue, void *r_item)
size_t BLI_gsqueue_len(const GSQueue *queue)
{
- return queue->totelem;
+ return queue->elem_num;
}
bool BLI_gsqueue_is_empty(const GSQueue *queue)