diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-23 04:21:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-23 04:22:25 +0300 |
commit | 3302fbaeb1d5f58d926c06b6153ec5d6f1a9b0be (patch) | |
tree | 5be399e227415fef745bcdb2b7f20a578628718b /source/blender/compositor/operations/COM_MathBaseOperation.cpp | |
parent | 64b4b719ebd5201d27aa25d7fa2d765eabded9b0 (diff) |
Cleanup: style, use braces for compositor
Diffstat (limited to 'source/blender/compositor/operations/COM_MathBaseOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MathBaseOperation.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index b3251d32005..15dbd4e2ac9 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -124,10 +124,12 @@ void MathDivideOperation::executePixelSampled(float output[4], this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - if (inputValue2[0] == 0) /* We don't want to divide by zero. */ + if (inputValue2[0] == 0) { /* We don't want to divide by zero. */ output[0] = 0.0; - else + } + else { output[0] = inputValue1[0] / inputValue2[0]; + } clampIfNeeded(output); } @@ -191,10 +193,12 @@ void MathArcSineOperation::executePixelSampled(float output[4], this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - if (inputValue1[0] <= 1 && inputValue1[0] >= -1) + if (inputValue1[0] <= 1 && inputValue1[0] >= -1) { output[0] = asin(inputValue1[0]); - else + } + else { output[0] = 0.0; + } clampIfNeeded(output); } @@ -210,10 +214,12 @@ void MathArcCosineOperation::executePixelSampled(float output[4], this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - if (inputValue1[0] <= 1 && inputValue1[0] >= -1) + if (inputValue1[0] <= 1 && inputValue1[0] >= -1) { output[0] = acos(inputValue1[0]); - else + } + else { output[0] = 0.0; + } clampIfNeeded(output); } @@ -273,10 +279,12 @@ void MathLogarithmOperation::executePixelSampled(float output[4], this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - if (inputValue1[0] > 0 && inputValue2[0] > 0) + if (inputValue1[0] > 0 && inputValue2[0] > 0) { output[0] = log(inputValue1[0]) / log(inputValue2[0]); - else + } + else { output[0] = 0.0; + } clampIfNeeded(output); } @@ -372,10 +380,12 @@ void MathModuloOperation::executePixelSampled(float output[4], this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler); - if (inputValue2[0] == 0) + if (inputValue2[0] == 0) { output[0] = 0.0; - else + } + else { output[0] = fmod(inputValue1[0], inputValue2[0]); + } clampIfNeeded(output); } @@ -461,10 +471,12 @@ void MathSqrtOperation::executePixelSampled(float output[4], this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler); - if (inputValue1[0] > 0) + if (inputValue1[0] > 0) { output[0] = sqrt(inputValue1[0]); - else + } + else { output[0] = 0.0f; + } clampIfNeeded(output); } |