[Bf-blender-cvs] [1019c9f582f] master: Clang-Tidy: enable bugprone-too-small-loop-variable

Jacques Lucke noreply at git.blender.org
Fri Jul 3 16:54:16 CEST 2020


Commit: 1019c9f582f2cb588eea16ac0e23abea71de6308
Author: Jacques Lucke
Date:   Fri Jul 3 16:54:08 2020 +0200
Branches: master
https://developer.blender.org/rB1019c9f582f2cb588eea16ac0e23abea71de6308

Clang-Tidy: enable bugprone-too-small-loop-variable

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

M	.clang-tidy
M	source/blender/editors/render/render_shading.c
M	source/blender/io/usd/intern/usd_writer_mesh.cc

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

diff --git a/.clang-tidy b/.clang-tidy
index 108adffe64a..b39d77136f2 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -37,7 +37,6 @@ Checks:  >
   -bugprone-integer-division,
   -bugprone-incorrect-roundings,
   -bugprone-suspicious-string-compare,
-  -bugprone-too-small-loop-variable,
   -bugprone-misplaced-widening-cast,
   -bugprone-not-null-terminated-result,
   -bugprone-suspicious-missing-comma,
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 49ab2c485b1..0e15db17e14 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -238,7 +238,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
     else {
       /* Find the first matching material.
        * Note: there may be multiple but that's not a common use case. */
-      for (short i = 0; i < ob->totcol; i++) {
+      for (int i = 0; i < ob->totcol; i++) {
         const Material *mat = BKE_object_material_get(ob, i + 1);
         if (mat_active == mat) {
           mat_nr_active = i;
@@ -339,7 +339,7 @@ static int material_slot_de_select(bContext *C, bool select)
     else {
       /* Find the first matching material.
        * Note: there may be multiple but that's not a common use case. */
-      for (short i = 0; i < ob->totcol; i++) {
+      for (int i = 0; i < ob->totcol; i++) {
         const Material *mat = BKE_object_material_get(ob, i + 1);
         if (mat_active == mat) {
           mat_nr_active = i;
diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc b/source/blender/io/usd/intern/usd_writer_mesh.cc
index 29a9734f876..bd2c549e729 100644
--- a/source/blender/io/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/io/usd/intern/usd_writer_mesh.cc
@@ -338,7 +338,7 @@ void USDGenericMeshWriter::assign_materials(const HierarchyContext &context,
    * https://github.com/PixarAnimationStudios/USD/issues/542 for more info. */
   bool mesh_material_bound = false;
   pxr::UsdShadeMaterialBindingAPI material_binding_api(usd_mesh.GetPrim());
-  for (short mat_num = 0; mat_num < context.object->totcol; mat_num++) {
+  for (int mat_num = 0; mat_num < context.object->totcol; mat_num++) {
     Material *material = BKE_object_material_get(context.object, mat_num + 1);
     if (material == nullptr) {
       continue;



More information about the Bf-blender-cvs mailing list