diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 15:51:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 15:55:15 +0300 |
commit | d8dbd49a2f23b7637f05fc058f39bdf6ab706624 (patch) | |
tree | 0805b9372c82ae6505d87e879824efe1d3e32f8e /source/blender/freestyle/intern/system | |
parent | 8987f7987d8160e1f6e79e8c85d6ce65b885ab25 (diff) |
Cleanup: style, use braces in source/
Automated using clang-tidy.
Diffstat (limited to 'source/blender/freestyle/intern/system')
-rw-r--r-- | source/blender/freestyle/intern/system/BaseObject.h | 3 | ||||
-rw-r--r-- | source/blender/freestyle/intern/system/PseudoNoise.cpp | 9 | ||||
-rw-r--r-- | source/blender/freestyle/intern/system/StringUtils.cpp | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/system/BaseObject.h b/source/blender/freestyle/intern/system/BaseObject.h index d64c47b2445..335221223dc 100644 --- a/source/blender/freestyle/intern/system/BaseObject.h +++ b/source/blender/freestyle/intern/system/BaseObject.h @@ -57,8 +57,9 @@ class BaseObject { /*! Decrements the reference counter */ inline int release() { - if (_ref_counter) + if (_ref_counter) { _ref_counter--; + } return _ref_counter; } diff --git a/source/blender/freestyle/intern/system/PseudoNoise.cpp b/source/blender/freestyle/intern/system/PseudoNoise.cpp index 877cdee0814..048be5d018c 100644 --- a/source/blender/freestyle/intern/system/PseudoNoise.cpp +++ b/source/blender/freestyle/intern/system/PseudoNoise.cpp @@ -49,8 +49,9 @@ PseudoNoise::PseudoNoise() void PseudoNoise::init(long seed) { RandGen::srand48(seed); - for (unsigned int i = 0; i < NB_VALUE_NOISE; i++) + for (unsigned int i = 0; i < NB_VALUE_NOISE; i++) { _values[i] = -1.0 + 2.0 * RandGen::drand48(); + } } real PseudoNoise::linearNoise(real x) @@ -64,10 +65,12 @@ real PseudoNoise::linearNoise(real x) static real LanczosWindowed(real t) { - if (fabs(t) > 2) + if (fabs(t) > 2) { return 0; - if (fabs(t) < M_EPSILON) + } + if (fabs(t) < M_EPSILON) { return 1.0; + } return sin(M_PI * t) / (M_PI * t) * sin(M_PI * t / 2.0) / (M_PI * t / 2.0); } diff --git a/source/blender/freestyle/intern/system/StringUtils.cpp b/source/blender/freestyle/intern/system/StringUtils.cpp index 99ec9aed632..5e56dba17bf 100644 --- a/source/blender/freestyle/intern/system/StringUtils.cpp +++ b/source/blender/freestyle/intern/system/StringUtils.cpp @@ -39,8 +39,9 @@ void getPathName(const string &path, const string &base, vector<string> &pathnam for (unsigned int pos = 0, sep = path.find(Config::PATH_SEP, pos); pos < size; pos = sep + 1, sep = path.find(Config::PATH_SEP, pos)) { - if (sep == (unsigned)string::npos) + if (sep == (unsigned)string::npos) { sep = size; + } dir = path.substr(pos, sep - pos); @@ -48,8 +49,9 @@ void getPathName(const string &path, const string &base, vector<string> &pathnam BLI_cleanup_file(NULL, cleaned); res = string(cleaned); - if (!base.empty()) + if (!base.empty()) { res += Config::DIR_SEP + base; + } pathnames.push_back(res); } |