[Bf-blender-cvs] [cc2b114a21b] master: Cleanup: Clang-Tidy readability-static-accessed-through-instance fixes

Sybren A. Stüvel noreply at git.blender.org
Fri Sep 4 12:39:05 CEST 2020


Commit: cc2b114a21bbd311bd5f497241403aab80fd79a1
Author: Sybren A. Stüvel
Date:   Fri Sep 4 12:26:24 2020 +0200
Branches: master
https://developer.blender.org/rBcc2b114a21bbd311bd5f497241403aab80fd79a1

Cleanup: Clang-Tidy readability-static-accessed-through-instance fixes

No functional changes.

===================================================================

M	.clang-tidy
M	source/blender/compositor/operations/COM_WriteBufferOperation.cpp
M	source/blender/io/collada/AnimationImporter.cpp
M	source/blender/io/collada/SkinInfo.cpp
M	source/blender/io/collada/TransformReader.cpp
M	source/blender/io/collada/TransformWriter.cpp

===================================================================

diff --git a/.clang-tidy b/.clang-tidy
index 4a6550a558e..8d2abc5897c 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -14,7 +14,6 @@ Checks:  >
 
   -readability-inconsistent-declaration-parameter-name,
   -readability-redundant-member-init,
-  -readability-static-accessed-through-instance,
   -readability-redundant-declaration,
   -readability-qualified-auto,
   -readability-use-anyofallof,
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
index 8cc53f8c6a9..640e3e3d381 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
@@ -128,7 +128,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device,
   const unsigned int outputBufferWidth = outputBuffer->getWidth();
   const unsigned int outputBufferHeight = outputBuffer->getHeight();
 
-  const cl_image_format *imageFormat = device->determineImageFormat(outputBuffer);
+  const cl_image_format *imageFormat = OpenCLDevice::determineImageFormat(outputBuffer);
 
   cl_mem clOutputBuffer = clCreateImage2D(device->getContext(),
                                           CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR,
diff --git a/source/blender/io/collada/AnimationImporter.cpp b/source/blender/io/collada/AnimationImporter.cpp
index 08d9386cb42..8e6e51fc282 100644
--- a/source/blender/io/collada/AnimationImporter.cpp
+++ b/source/blender/io/collada/AnimationImporter.cpp
@@ -2043,7 +2043,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm,
             mj = 0;
           }
         }
-        unit_converter->dae_matrix_to_mat4_(mat, matrix);
+        UnitConverter::dae_matrix_to_mat4_(mat, matrix);
         return true;
       }
     }
diff --git a/source/blender/io/collada/SkinInfo.cpp b/source/blender/io/collada/SkinInfo.cpp
index 5692d11d0c3..eef45a5be90 100644
--- a/source/blender/io/collada/SkinInfo.cpp
+++ b/source/blender/io/collada/SkinInfo.cpp
@@ -115,7 +115,7 @@ void SkinInfo::borrow_skin_controller_data(const COLLADAFW::SkinControllerData *
     weights.push_back(bc_get_float_value(weight, i));
   }
 
-  unit_converter->dae_matrix_to_mat4_(bind_shape_matrix, skin->getBindShapeMatrix());
+  UnitConverter::dae_matrix_to_mat4_(bind_shape_matrix, skin->getBindShapeMatrix());
 }
 
 void SkinInfo::free()
@@ -132,7 +132,7 @@ void SkinInfo::free()
 void SkinInfo::add_joint(const COLLADABU::Math::Matrix4 &matrix)
 {
   JointData jd;
-  unit_converter->dae_matrix_to_mat4_(jd.inv_bind_mat, matrix);
+  UnitConverter::dae_matrix_to_mat4_(jd.inv_bind_mat, matrix);
   joint_data.push_back(jd);
 }
 
diff --git a/source/blender/io/collada/TransformReader.cpp b/source/blender/io/collada/TransformReader.cpp
index 8ee31f80405..87b8763fb6a 100644
--- a/source/blender/io/collada/TransformReader.cpp
+++ b/source/blender/io/collada/TransformReader.cpp
@@ -130,7 +130,7 @@ void TransformReader::dae_scale_to_mat4(COLLADAFW::Transformation *tm, float m[4
 
 void TransformReader::dae_matrix_to_mat4(COLLADAFW::Transformation *tm, float m[4][4])
 {
-  unit_converter->dae_matrix_to_mat4_(m, ((COLLADAFW::Matrix *)tm)->getMatrix());
+  UnitConverter::dae_matrix_to_mat4_(m, ((COLLADAFW::Matrix *)tm)->getMatrix());
 }
 
 void TransformReader::dae_translate_to_v3(COLLADAFW::Transformation *tm, float v[3])
diff --git a/source/blender/io/collada/TransformWriter.cpp b/source/blender/io/collada/TransformWriter.cpp
index b7455837379..0311f22fe11 100644
--- a/source/blender/io/collada/TransformWriter.cpp
+++ b/source/blender/io/collada/TransformWriter.cpp
@@ -47,9 +47,7 @@ void TransformWriter::add_joint_transform(COLLADASW::Node &node,
   }
 
   double dmat[4][4];
-  UnitConverter *converter = new UnitConverter();
-  converter->mat4_to_dae_double(dmat, local);
-  delete converter;
+  UnitConverter::mat4_to_dae_double(dmat, local);
 
   if (export_settings.get_object_transformation_type() == BC_TRANSFORMATION_TYPE_MATRIX) {
     node.addMatrix("transform", dmat);
@@ -81,9 +79,8 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node &node,
 
   switch (export_settings.get_object_transformation_type()) {
     case BC_TRANSFORMATION_TYPE_MATRIX: {
-      UnitConverter converter;
       double d_obmat[4][4];
-      converter.mat4_to_dae_double(d_obmat, f_obmat);
+      UnitConverter::mat4_to_dae_double(d_obmat, f_obmat);
 
       if (limit_precision) {
         BCMatrix::sanitize(d_obmat, LIMITTED_PRECISION);



More information about the Bf-blender-cvs mailing list