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>2012-03-25 16:41:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-25 16:41:58 +0400
commit53d32a0bd2ca038c8fc6f82fac0009395c3d2490 (patch)
treeb024b98c37bd3f2ad1f0f803a2f7eb80b02dc1ce /source/blender/blenlib/intern/math_base_inline.c
parente99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff)
style cleanup: conform to style guide - mostly operator whitespace changes
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index d706f28e722..9e32ff5ad4e 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -43,61 +43,61 @@
MINLINE float sqrt3f(float f)
{
- if (f==0.0f) return 0.0f;
- if (f<0) return (float)(-exp(log(-f)/3));
- else return (float)(exp(log(f)/3));
+ if (f == 0.0f) return 0.0f;
+ if (f < 0) return (float)(-exp(log(-f) / 3));
+ else return (float)(exp(log(f) / 3));
}
MINLINE double sqrt3d(double d)
{
- if (d==0.0) return 0;
- if (d<0) return -exp(log(-d)/3);
- else return exp(log(d)/3);
+ if (d == 0.0) return 0;
+ if (d < 0) return -exp(log(-d) / 3);
+ else return exp(log(d) / 3);
}
MINLINE float saacos(float fac)
{
- if (fac<= -1.0f) return (float)M_PI;
- else if (fac>=1.0f) return 0.0;
+ if (fac <= -1.0f) return (float)M_PI;
+ else if (fac >= 1.0f) return 0.0;
else return (float)acos(fac);
}
MINLINE float saasin(float fac)
{
- if (fac<= -1.0f) return (float)-M_PI/2.0f;
- else if (fac>=1.0f) return (float)M_PI/2.0f;
+ if (fac <= -1.0f) return (float)-M_PI / 2.0f;
+ else if (fac >= 1.0f) return (float)M_PI / 2.0f;
else return (float)asin(fac);
}
MINLINE float sasqrt(float fac)
{
- if (fac<=0.0f) return 0.0f;
+ if (fac <= 0.0f) return 0.0f;
return (float)sqrt(fac);
}
MINLINE float saacosf(float fac)
{
- if (fac<= -1.0f) return (float)M_PI;
- else if (fac>=1.0f) return 0.0f;
+ if (fac <= -1.0f) return (float)M_PI;
+ else if (fac >= 1.0f) return 0.0f;
else return (float)acosf(fac);
}
MINLINE float saasinf(float fac)
{
- if (fac<= -1.0f) return (float)-M_PI/2.0f;
- else if (fac>=1.0f) return (float)M_PI/2.0f;
+ if (fac <= -1.0f) return (float)-M_PI / 2.0f;
+ else if (fac >= 1.0f) return (float)M_PI / 2.0f;
else return (float)asinf(fac);
}
MINLINE float sasqrtf(float fac)
{
- if (fac<=0.0f) return 0.0f;
+ if (fac <= 0.0f) return 0.0f;
return (float)sqrtf(fac);
}
MINLINE float interpf(float target, float origin, float fac)
{
- return (fac*target) + (1.0f-fac)*origin;
+ return (fac * target) + (1.0f - fac) * origin;
}
/* useful to calculate an even width shell, by taking the angle between 2 planes.
@@ -139,20 +139,19 @@ MINLINE int power_of_2_min_i(int n)
return n;
}
-
MINLINE float minf(float a, float b)
{
- return (a < b)? a: b;
+ return (a < b) ? a : b;
}
MINLINE float maxf(float a, float b)
{
- return (a > b)? a: b;
+ return (a > b) ? a : b;
}
MINLINE float signf(float f)
{
- return (f < 0.f)? -1.f: 1.f;
+ return (f < 0.f) ? -1.f : 1.f;
}