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:
authorSybren A. Stüvel <sybren@blender.org>2020-08-07 13:30:43 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-08-07 14:38:06 +0300
commit1b272a649b40e99dba4185167f6cee7cbece1942 (patch)
tree2785f52c566b36cbdcbf9355f698dc520ffbb482 /source/blender/blenkernel/intern/colortools.c
parentcfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff)
Cleanup: Blenkernel, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenkernel` module. No functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index fc326ffb390..11928dada2b 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -603,28 +603,24 @@ static float curvemap_calc_extend(const CurveMapping *cumap,
/* extrapolate horizontally */
return first[1];
}
- else {
- if (cuma->ext_in[0] == 0.0f) {
- return first[1] + cuma->ext_in[1] * 10000.0f;
- }
- else {
- return first[1] + cuma->ext_in[1] * (x - first[0]) / cuma->ext_in[0];
- }
+
+ if (cuma->ext_in[0] == 0.0f) {
+ return first[1] + cuma->ext_in[1] * 10000.0f;
}
+
+ return first[1] + cuma->ext_in[1] * (x - first[0]) / cuma->ext_in[0];
}
- else if (x >= last[0]) {
+ if (x >= last[0]) {
if ((cumap->flag & CUMA_EXTEND_EXTRAPOLATE) == 0) {
/* extrapolate horizontally */
return last[1];
}
- else {
- if (cuma->ext_out[0] == 0.0f) {
- return last[1] - cuma->ext_out[1] * 10000.0f;
- }
- else {
- return last[1] + cuma->ext_out[1] * (x - last[0]) / cuma->ext_out[0];
- }
+
+ if (cuma->ext_out[0] == 0.0f) {
+ return last[1] - cuma->ext_out[1] * 10000.0f;
}
+
+ return last[1] + cuma->ext_out[1] * (x - last[0]) / cuma->ext_out[0];
}
return 0.0f;
}
@@ -870,7 +866,7 @@ static int sort_curvepoints(const void *a1, const void *a2)
if (x1->x > x2->x) {
return 1;
}
- else if (x1->x < x2->x) {
+ if (x1->x < x2->x) {
return -1;
}
return 0;
@@ -984,17 +980,16 @@ float BKE_curvemap_evaluateF(const CurveMapping *cumap, const CurveMap *cuma, fl
if (fi < 0.0f || fi > CM_TABLE) {
return curvemap_calc_extend(cumap, cuma, value, &cuma->table[0].x, &cuma->table[CM_TABLE].x);
}
- else {
- if (i < 0) {
- return cuma->table[0].y;
- }
- if (i >= CM_TABLE) {
- return cuma->table[CM_TABLE].y;
- }
- fi = fi - (float)i;
- return (1.0f - fi) * cuma->table[i].y + (fi)*cuma->table[i + 1].y;
+ if (i < 0) {
+ return cuma->table[0].y;
}
+ if (i >= CM_TABLE) {
+ return cuma->table[CM_TABLE].y;
+ }
+
+ fi = fi - (float)i;
+ return (1.0f - fi) * cuma->table[i].y + (fi)*cuma->table[i + 1].y;
}
/* works with curve 'cur' */