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 12:49:59 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-08-07 13:01:40 +0300
commit156448ba4ba350dd6f9718b4610f14f4ba187af6 (patch)
tree5ad43590fbf4d7536f58a38935cbbac3c2ec27bd /source/blender/draw/engines/gpencil
parent88cc3f167f7ee404640289ed9cfd6b13f0494d98 (diff)
Cleanup: Draw, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/draw` module. Not all warnings are addressed in this commit. No functional changes.
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c9
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_data.c7
2 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index 8a4134ec8ea..41a7196cb90 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -132,12 +132,11 @@ static int gpencil_tobject_dist_sort(const void *a, const void *b)
if (ob_a->camera_z > ob_b->camera_z) {
return 1;
}
- else if (ob_a->camera_z < ob_b->camera_z) {
+ if (ob_a->camera_z < ob_b->camera_z) {
return -1;
}
- else {
- return 0;
- }
+
+ return 0;
}
void gpencil_object_cache_sort(GPENCIL_PrivateData *pd)
@@ -193,7 +192,7 @@ static float gpencil_layer_final_opacity_get(const GPENCIL_PrivateData *pd,
if (is_obact && is_fade) {
return gpl->opacity * pd->fade_layer_opacity;
}
- else if (!is_obact && (pd->fade_gp_object_opacity > -1.0f)) {
+ if (!is_obact && (pd->fade_gp_object_opacity > -1.0f)) {
return gpl->opacity * pd->fade_gp_object_opacity;
}
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_data.c b/source/blender/draw/engines/gpencil/gpencil_draw_data.c
index ed443b2c73f..51152475a06 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_data.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_data.c
@@ -359,12 +359,11 @@ static float light_power_get(const Light *la)
if (la->type == LA_AREA) {
return 1.0f / (4.0f * M_PI);
}
- else if (la->type == LA_SPOT || la->type == LA_LOCAL) {
+ if (la->type == LA_SPOT || la->type == LA_LOCAL) {
return 1.0f / (4.0f * M_PI * M_PI);
}
- else {
- return 1.0f / M_PI;
- }
+
+ return 1.0f / M_PI;
}
void gpencil_light_pool_populate(GPENCIL_LightPool *lightpool, Object *ob)