[Bf-blender-cvs] [be7855591e3] master: Cleanup: rename cnt to count

Campbell Barton noreply at git.blender.org
Wed Mar 16 02:00:52 CET 2022


Commit: be7855591e3b47e5e72c09555946f75975a8c028
Author: Campbell Barton
Date:   Wed Mar 16 11:58:22 2022 +1100
Branches: master
https://developer.blender.org/rBbe7855591e3b47e5e72c09555946f75975a8c028

Cleanup: rename cnt to count

Follow naming from T85728.

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

M	intern/itasc/Scene.cpp
M	intern/mantaflow/intern/strings/fluid_script.h
M	source/blender/blenkernel/intern/fluid.c
M	source/blender/blenlib/intern/delaunay_2d.cc
M	source/blender/blenlib/intern/expr_pylike_eval.c
M	source/blender/bmesh/tools/bmesh_bevel.c
M	source/blender/editors/sculpt_paint/paint_stroke.c
M	source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
M	source/blender/ikplugin/intern/itasc_plugin.cpp
M	source/blender/imbuf/intern/dds/Stream.cpp
M	source/blender/imbuf/intern/dds/Stream.h
M	source/blender/imbuf/intern/indexer.c
M	source/blender/imbuf/intern/iris.c
M	source/blender/imbuf/intern/radiance_hdr.c
M	source/blender/io/alembic/intern/abc_customdata.cc
M	source/blender/io/avi/intern/avi_mjpeg.c
M	source/blender/sequencer/intern/effects.c

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

diff --git a/intern/itasc/Scene.cpp b/intern/itasc/Scene.cpp
index b5f8e4df386..7bbfc3a87f2 100644
--- a/intern/itasc/Scene.cpp
+++ b/intern/itasc/Scene.cpp
@@ -270,7 +270,7 @@ bool Scene::initialize()
 
   m_ytask.resize(m_ncTotal);
   bool toggle = true;
-  int cnt = 0;
+  int count = 0;
   // Initialize all ConstraintSets:
   for (ConstraintMap::iterator it = constraints.begin(); it != constraints.end(); ++it) {
     // Calculate the external pose:
@@ -279,8 +279,8 @@ bool Scene::initialize()
     getConstraintPose(cs->task, cs, external_pose);
     result &= cs->task->initialise(external_pose);
     cs->task->initCache(m_cache);
-    for (int i = 0; i < cs->constraintrange.count; i++, cnt++) {
-      m_ytask[cnt] = toggle;
+    for (int i = 0; i < cs->constraintrange.count; i++, count++) {
+      m_ytask[count] = toggle;
     }
     toggle = !toggle;
     project(m_Cf, cs->constraintrange, cs->featurerange) = cs->task->getCf();
diff --git a/intern/mantaflow/intern/strings/fluid_script.h b/intern/mantaflow/intern/strings/fluid_script.h
index 48e0c243e16..548606f1b32 100644
--- a/intern/mantaflow/intern/strings/fluid_script.h
+++ b/intern/mantaflow/intern/strings/fluid_script.h
@@ -739,13 +739,13 @@ file_format_data      = '$CACHE_DATA_FORMAT$'\n\
 file_format_mesh      = '$CACHE_MESH_FORMAT$'\n\
 \n\
 # How many frame to load from cache\n\
-from_cache_cnt = 100\n\
+from_cache_count = 100\n\
 \n\
-loop_cnt = 0\n\
+loop_count = 0\n\
 while current_frame_s$ID$ <= end_frame_s$ID$:\n\
     \n\
     # Load already simulated data from cache:\n\
-    if loop_cnt < from_cache_cnt:\n\
+    if loop_count < from_cache_count:\n\
         load_data(current_frame_s$ID$, cache_resumable)\n\
     \n\
     # Otherwise simulate new data\n\
@@ -756,7 +756,7 @@ while current_frame_s$ID$ <= end_frame_s$ID$:\n\
             step(current_frame_s$ID$)\n\
     \n\
     current_frame_s$ID$ += 1\n\
-    loop_cnt += 1\n\
+    loop_count += 1\n\
     \n\
     if gui:\n\
         gui.pause()\n";
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index ca9d758c692..81e73b6cf2c 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -1754,7 +1754,7 @@ static void update_distances(int index,
     /* Count ray mesh misses (i.e. no face hit) and cases where the ray direction matches the face
      * normal direction. From this information it can be derived whether a cell is inside or
      * outside the mesh. */
-    int miss_cnt = 0, dir_cnt = 0;
+    int miss_count = 0, dir_count = 0;
 
     for (int i = 0; i < ARRAY_SIZE(ray_dirs); i++) {
       BVHTreeRayHit hit_tree = {0};
@@ -1773,14 +1773,14 @@ static void update_distances(int index,
       /* Ray did not hit mesh.
        * Current point definitely not inside mesh. Inside mesh as all rays have to hit. */
       if (hit_tree.index == -1) {
-        miss_cnt++;
+        miss_count++;
         /* Skip this ray since nothing was hit. */
         continue;
       }
 
       /* Ray and normal are pointing in opposite directions. */
       if (dot_v3v3(ray_dirs[i], hit_tree.no) <= 0) {
-        dir_cnt++;
+        dir_count++;
       }
 
       if (hit_tree.dist < min_dist) {
@@ -1790,7 +1790,7 @@ static void update_distances(int index,
 
     /* Point lies inside mesh. Use negative sign for distance value.
      * This "if statement" has 2 conditions that can be true for points outside mesh. */
-    if (!(miss_cnt > 0 || dir_cnt == ARRAY_SIZE(ray_dirs))) {
+    if (!(miss_count > 0 || dir_count == ARRAY_SIZE(ray_dirs))) {
       min_dist = (-1.0f) * fabsf(min_dist);
     }
 
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc
index b7dbd7d679c..4a02072e770 100644
--- a/source/blender/blenlib/intern/delaunay_2d.cc
+++ b/source/blender/blenlib/intern/delaunay_2d.cc
@@ -423,7 +423,7 @@ template<typename T> std::ostream &operator<<(std::ostream &os, const CDT_state<
       os << " merge to " << vertname(cdt_state.cdt.verts[v->merge_to_index]) << "\n";
     }
     const SymEdge<T> *se = v->symedge;
-    int cnt = 0;
+    int count = 0;
     constexpr int print_count_limit = 25;
     if (se) {
       os << "  edges out:\n";
@@ -440,8 +440,8 @@ template<typename T> std::ostream &operator<<(std::ostream &os, const CDT_state<
         os << "    " << vertname(vother) << "(e=" << trunc_ptr(se->edge)
            << ", se=" << trunc_ptr(se) << ")\n";
         se = se->rot;
-        cnt++;
-      } while (se != v->symedge && cnt < print_count_limit);
+        count++;
+      } while (se != v->symedge && count < print_count_limit);
       os << "\n";
     }
   }
diff --git a/source/blender/blenlib/intern/expr_pylike_eval.c b/source/blender/blenlib/intern/expr_pylike_eval.c
index db677cd304c..1c32336fee0 100644
--- a/source/blender/blenlib/intern/expr_pylike_eval.c
+++ b/source/blender/blenlib/intern/expr_pylike_eval.c
@@ -829,18 +829,18 @@ static bool parse_unary(ExprParseState *state)
 
       /* Specially supported functions. */
       if (STREQ(state->tokenbuf, "min")) {
-        int cnt = parse_function_args(state);
-        CHECK_ERROR(cnt > 0);
+        int count = parse_function_args(state);
+        CHECK_ERROR(count > 0);
 
-        parse_add_op(state, OPCODE_MIN, 1 - cnt)->arg.ival = cnt;
+        parse_add_op(state, OPCODE_MIN, 1 - count)->arg.ival = count;
         return true;
       }
 
       if (STREQ(state->tokenbuf, "max")) {
-        int cnt = parse_function_args(state);
-        CHECK_ERROR(cnt > 0);
+        int count = parse_function_args(state);
+        CHECK_ERROR(count > 0);
 
-        parse_add_op(state, OPCODE_MAX, 1 - cnt)->arg.ival = cnt;
+        parse_add_op(state, OPCODE_MAX, 1 - count)->arg.ival = count;
         return true;
       }
 
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 5790d76936f..be5521d45ab 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -571,7 +571,7 @@ static EdgeHalf *next_bev(BevVert *bv, EdgeHalf *from_e)
 /* Return the count of edges between e1 and e2 when going around bv CCW. */
 static int count_ccw_edges_between(EdgeHalf *e1, EdgeHalf *e2)
 {
-  int cnt = 0;
+  int count = 0;
   EdgeHalf *e = e1;
 
   do {
@@ -579,9 +579,9 @@ static int count_ccw_edges_between(EdgeHalf *e1, EdgeHalf *e2)
       break;
     }
     e = e->next;
-    cnt++;
+    count++;
   } while (e != e1);
-  return cnt;
+  return count;
 }
 
 /* Assume bme1 and bme2 both share some vert. Do they share a face?
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 1705e36363e..c0bf89107e0 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -792,7 +792,7 @@ static int paint_space_stroke(bContext *C,
   Paint *paint = BKE_paint_get_active_from_context(C);
   ePaintMode mode = BKE_paintmode_get_active_from_context(C);
   Brush *brush = BKE_paint_brush(paint);
-  int cnt = 0;
+  int count = 0;
 
   const bool use_scene_spacing = paint_stroke_use_scene_spacing(brush, mode);
   float d_world_space_position[3] = {0.0f};
@@ -855,14 +855,14 @@ static int paint_space_stroke(bContext *C,
       pressure = stroke->last_pressure;
       dpressure = final_pressure - stroke->last_pressure;
 
-      cnt++;
+      count++;
     }
     else {
       break;
     }
   }
 
-  return cnt;
+  return count;
 }
 
 /**** Public API ****/
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index dc3b7d9795a..5642a80e77f 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -430,8 +430,8 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap,
   int nSamples = 0;
   vector<WFace *> wFaces;
   WFace *wFace = nullptr;
-  unsigned cnt = 0;
-  unsigned cntStep = (unsigned)ceil(0.01f * vedges.size());
+  unsigned count = 0;
+  unsigned count_step = (unsigned)ceil(0.01f * vedges.size());
   unsigned tmpQI = 0;
   unsigned qiClasses[256];
   unsigned maxIndex, maxCard;
@@ -441,13 +441,13 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap,
       if (iRenderMonitor->testBreak()) {
         break;
       }
-      if (cnt % cntStep == 0) {
+      if (count % count_step == 0) {
         stringstream ss;
-        ss << "Freestyle: Visibility computations " << (100 * cnt / vedges.size()) << "%";
+        ss << "Freestyle: Visibility computations " << (100 * count / vedges.size()) << "%";
         iRenderMonitor->setInfo(ss.str());
-        iRenderMonitor->progress((float)cnt / vedges.size());
+        iRenderMonitor->progress((float)count / vedges.size());
       }
-      cnt++;
+      count++;
     }
 #if LOGGING
     if (_global.debug & G_DEBUG_FREESTYLE) {
@@ -621,9 +621,9 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap,
   }
   if (iRenderMonitor && !vedges.empty()) {
     stringstream ss;
-    ss << "Freestyle: Visibility computations " << (100 * cnt / vedges.size()) << "%";
+    ss << "Freestyle: Visibility computations " << (100 * count / vedges.size()) << "%";
     iRenderMonitor->setInfo(ss.str());
-    iRenderMonitor->progress((float)cnt / vedges.size());
+    iRenderMonitor->progress((float)count / vedges.size());
   }
 }
 
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 470dfb01bdd..b9f7dd98073 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -1512,17 +1512,17 @@ static IK_Scene *convert_tree(
     iktarget->bldepsgraph = depsgraph;
     condata = (bKinematicConstraint *)iktarget->blenderConstraint->data;
     pchan = tree->pchan[iktarget->channel];
-    unsigned int controltype, bonecnt;
-    double bonelen;
+    unsigned int controltype, bone_count;
+    double bone_length;
     float mat[4][4];
 
     /* add the end effector
      * estimate the average bone length, used to clamp feedback error */
-    for (bonec

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list