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 <ideasman42@gmail.com>2019-05-31 16:21:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-31 16:22:52 +0300
commitaba4e6810f8b4d0e459137b64e061a2cadc457d1 (patch)
tree2b6159c7ba0f23c020600b71276772fa4a882b5b /source/blender/blenlib
parent72a563cdee8fef198a200ff65b57ddb847c01795 (diff)
Cleanup: style, use braces in source/ (include disabled blocks)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c18
-rw-r--r--source/blender/blenlib/intern/math_geom.c24
-rw-r--r--source/blender/blenlib/intern/smallhash.c3
3 files changed, 30 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index 221a27f69ed..8f30255a08b 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -230,23 +230,29 @@ MINLINE unsigned power_of_2_min_u(unsigned x)
#define _round_clamp_fl_impl(arg, ty, min, max) \
{ \
float r = floorf(arg + 0.5f); \
- if (UNLIKELY(r <= (float)min)) \
+ if (UNLIKELY(r <= (float)min)) { \
return (ty)min; \
- else if (UNLIKELY(r >= (float)max)) \
+ } \
+ else if (UNLIKELY(r >= (float)max)) { \
return (ty)max; \
- else \
+ } \
+ else { \
return (ty)r; \
+ } \
}
#define _round_clamp_db_impl(arg, ty, min, max) \
{ \
double r = floor(arg + 0.5); \
- if (UNLIKELY(r <= (double)min)) \
+ if (UNLIKELY(r <= (double)min)) { \
return (ty)min; \
- else if (UNLIKELY(r >= (double)max)) \
+ } \
+ else if (UNLIKELY(r >= (double)max)) { \
return (ty)max; \
- else \
+ } \
+ else { \
return (ty)r; \
+ } \
}
#define _round_fl_impl(arg, ty) \
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 898e97613c1..99eee0aa51c 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -1959,16 +1959,18 @@ bool isect_ray_tri_threshold_v3(const float ray_origin[3],
cross_v3_v3v3(p, ray_direction, e2);
a = dot_v3v3(e1, p);
- if ((a > -epsilon) && (a < epsilon))
+ if ((a > -epsilon) && (a < epsilon)) {
return false;
+ }
f = 1.0f / a;
sub_v3_v3v3(s, ray_origin, v0);
cross_v3_v3v3(q, s, e1);
*r_lambda = f * dot_v3v3(e2, q);
- if ((*r_lambda < 0.0f))
+ if ((*r_lambda < 0.0f)) {
return false;
+ }
u = f * dot_v3v3(s, p);
v = f * dot_v3v3(ray_direction, q);
@@ -1979,19 +1981,25 @@ bool isect_ray_tri_threshold_v3(const float ray_origin[3],
dv = v - t;
}
else {
- if (u < 0)
+ if (u < 0) {
du = u;
- else if (u > 1)
+ }
+ else if (u > 1) {
du = u - 1;
- else
+ }
+ else {
du = 0.0f;
+ }
- if (v < 0)
+ if (v < 0) {
dv = v;
- else if (v > 1)
+ }
+ else if (v > 1) {
dv = v - 1;
- else
+ }
+ else {
dv = 0.0f;
+ }
}
mul_v3_fl(e1, du);
diff --git a/source/blender/blenlib/intern/smallhash.c b/source/blender/blenlib/intern/smallhash.c
index ea15c14d3d2..d5fdf003aef 100644
--- a/source/blender/blenlib/intern/smallhash.c
+++ b/source/blender/blenlib/intern/smallhash.c
@@ -372,8 +372,9 @@ void BLI_smallhash_print(SmallHash *sh)
printf("%2x", (uint)sh->buckets[i].key);
}
- if (i != sh->nbuckets - 1)
+ if (i != sh->nbuckets - 1) {
printf(", ");
+ }
c += 6;