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:
authorJacques Lucke <jacques@blender.org>2020-09-02 20:10:18 +0300
committerJacques Lucke <jacques@blender.org>2020-09-02 20:10:40 +0300
commitf5e55c33378b96e614710006121860eb880e6820 (patch)
tree4f24b19e6b5e187d9b7b3d43f741c26f2c843fc8 /source/blender/blenkernel/intern/colorband.c
parentf20f82ce3ee55c12adcec024e0133e71183e07b3 (diff)
Cleanup: use bool instead of int in various places
Diffstat (limited to 'source/blender/blenkernel/intern/colorband.c')
-rw-r--r--source/blender/blenkernel/intern/colorband.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/colorband.c b/source/blender/blenkernel/intern/colorband.c
index 323a2f0cf53..cb30e4f1658 100644
--- a/source/blender/blenkernel/intern/colorband.c
+++ b/source/blender/blenkernel/intern/colorband.c
@@ -641,24 +641,22 @@ CBData *BKE_colorband_element_add(struct ColorBand *coba, float position)
return coba->data + coba->cur;
}
-int BKE_colorband_element_remove(struct ColorBand *coba, int index)
+bool BKE_colorband_element_remove(struct ColorBand *coba, int index)
{
- int a;
-
if (coba->tot < 2) {
- return 0;
+ return false;
}
if (index < 0 || index >= coba->tot) {
- return 0;
+ return false;
}
coba->tot--;
- for (a = index; a < coba->tot; a++) {
+ for (int a = index; a < coba->tot; a++) {
coba->data[a] = coba->data[a + 1];
}
if (coba->cur) {
coba->cur--;
}
- return 1;
+ return true;
}