[Bf-blender-cvs] [4518c0f3e84] master: Cleanup: const args
Campbell Barton
noreply at git.blender.org
Sun Oct 29 05:52:43 CET 2017
Commit: 4518c0f3e845fc1de58b6824bcc8fb77e594c0f1
Author: Campbell Barton
Date: Sun Oct 29 15:42:54 2017 +1100
Branches: master
https://developer.blender.org/rB4518c0f3e845fc1de58b6824bcc8fb77e594c0f1
Cleanup: const args
===================================================================
M source/blender/blenlib/BLI_heap.h
M source/blender/blenlib/intern/BLI_heap.c
===================================================================
diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h
index f7c1fd26985..3d7e526ebe4 100644
--- a/source/blender/blenlib/BLI_heap.h
+++ b/source/blender/blenlib/BLI_heap.h
@@ -51,13 +51,13 @@ void BLI_heap_insert_or_update(Heap *heap, HeapNode **node_p, float v
void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1, 2);
/* Return 0 if the heap is empty, 1 otherwise. */
-bool BLI_heap_is_empty(Heap *heap) ATTR_NONNULL(1);
+bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1);
/* Return the size of the heap. */
-unsigned int BLI_heap_size(Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
+unsigned int BLI_heap_size(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
/* Return the top node of the heap. This is the node with the lowest value. */
-HeapNode *BLI_heap_top(Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
+HeapNode *BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
/* Pop the top node off the heap and return it's pointer. */
void *BLI_heap_popmin(Heap *heap) ATTR_NONNULL(1);
@@ -67,7 +67,7 @@ void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float val
void BLI_heap_node_value_update_ptr(Heap *heap, HeapNode *node, float value, void *ptr) ATTR_NONNULL(1, 2);
/* Return the value or pointer of a heap node. */
-float BLI_heap_node_value(HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
-void *BLI_heap_node_ptr(HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
+float BLI_heap_node_value(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
+void *BLI_heap_node_ptr(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
#endif /* __BLI_HEAP_H__ */
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c
index d6e8721faa7..84b15ca1cf9 100644
--- a/source/blender/blenlib/intern/BLI_heap.c
+++ b/source/blender/blenlib/intern/BLI_heap.c
@@ -289,17 +289,17 @@ void BLI_heap_insert_or_update(Heap *heap, HeapNode **node_p, float value, void
}
-bool BLI_heap_is_empty(Heap *heap)
+bool BLI_heap_is_empty(const Heap *heap)
{
return (heap->size == 0);
}
-uint BLI_heap_size(Heap *heap)
+uint BLI_heap_size(const Heap *heap)
{
return heap->size;
}
-HeapNode *BLI_heap_top(Heap *heap)
+HeapNode *BLI_heap_top(const Heap *heap)
{
return heap->tree[0];
}
@@ -358,12 +358,12 @@ void BLI_heap_node_value_update_ptr(Heap *heap, HeapNode *node, float value, voi
BLI_heap_node_value_update(heap, node, value);
}
-float BLI_heap_node_value(HeapNode *node)
+float BLI_heap_node_value(const HeapNode *node)
{
return node->value;
}
-void *BLI_heap_node_ptr(HeapNode *node)
+void *BLI_heap_node_ptr(const HeapNode *node)
{
return node->ptr;
}
More information about the Bf-blender-cvs
mailing list