diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 11:33:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 13:17:08 +0300 |
commit | f68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch) | |
tree | 2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/io/collada/collada_utils.cpp | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/io/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/io/collada/collada_utils.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp index bfa150faf8b..22a73cd7db2 100644 --- a/source/blender/io/collada/collada_utils.cpp +++ b/source/blender/io/collada/collada_utils.cpp @@ -710,13 +710,13 @@ float bc_get_property(Bone *bone, std::string key, float def) if (property) { switch (property->type) { case IDP_INT: - result = (float)(IDP_Int(property)); + result = float(IDP_Int(property)); break; case IDP_FLOAT: - result = (float)(IDP_Float(property)); + result = float(IDP_Float(property)); break; case IDP_DOUBLE: - result = (float)(IDP_Double(property)); + result = float(IDP_Double(property)); break; default: result = def; @@ -1008,9 +1008,9 @@ void bc_create_restpose_mat(BCExportSettings &export_settings, void bc_sanitize_v3(float v[3], int precision) { for (int i = 0; i < 3; i++) { - double val = (double)v[i]; + double val = double(v[i]); val = double_round(val, precision); - v[i] = (float)val; + v[i] = float(val); } } @@ -1339,7 +1339,7 @@ bool bc_get_float_from_shader(bNode *shader, double &val, std::string nodeid) bNodeSocket *socket = nodeFindSocket(shader, SOCK_IN, nodeid.c_str()); if (socket) { bNodeSocketValueFloat *ref = (bNodeSocketValueFloat *)socket->default_value; - val = (double)ref->value; + val = double(ref->value); return true; } return false; |