[Bf-blender-cvs] [03b2371387d] master: Cleanup: move trailing comments to avoid wrapping code

Campbell Barton noreply at git.blender.org
Wed Aug 14 15:34:01 CEST 2019


Commit: 03b2371387dcae9f801cabbc1819b1d7e3350829
Author: Campbell Barton
Date:   Wed Aug 14 23:29:46 2019 +1000
Branches: master
https://developer.blender.org/rB03b2371387dcae9f801cabbc1819b1d7e3350829

Cleanup: move trailing comments to avoid wrapping code

Some statements were split across multiple lines because of their
trailing comments.

In most cases it's clearer to put the comments above.

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

M	source/blender/alembic/intern/abc_exporter.cc
M	source/blender/blenfont/intern/blf_font.c
M	source/blender/blenfont/intern/blf_glyph.c
M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/BKE_writeavi.h
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/collection.c
M	source/blender/blenkernel/intern/curve.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/effect.c
M	source/blender/blenkernel/intern/fcurve.c
M	source/blender/blenkernel/intern/fmodifier.c
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/library_override.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/main.c
M	source/blender/blenkernel/intern/mask.c
M	source/blender/blenkernel/intern/nla.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenkernel/intern/softbody.c
M	source/blender/blenkernel/intern/unit.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/bmesh/operators/bmo_primitive.c
M	source/blender/bmesh/operators/bmo_removedoubles.c
M	source/blender/collada/MeshImporter.cpp
M	source/blender/draw/engines/eevee/eevee_lights.c
M	source/blender/draw/engines/eevee/eevee_mist.c
M	source/blender/draw/engines/eevee/eevee_occlusion.c
M	source/blender/draw/engines/eevee/shaders/lights_lib.glsl
M	source/blender/draw/engines/workbench/workbench_studiolight.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/interface/interface_utils.c
M	source/blender/editors/object/object_shader_fx.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/gpu/GPU_batch.h
M	source/blender/gpu/GPU_matrix.h
M	source/blender/gpu/GPU_vertex_buffer.h
M	source/blender/gpu/intern/gpu_context.cpp
M	source/blender/gpu/intern/gpu_immediate.c
M	source/blender/gpu/intern/gpu_vertex_format.c
M	source/blender/imbuf/intern/imageprocess.c
M	source/blender/imbuf/intern/openexr/openexr_api.cpp
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_access.c
M	source/blender/makesrna/intern/rna_curve.c
M	source/blender/makesrna/intern/rna_define.c
M	source/blender/makesrna/intern/rna_rna.c
M	source/blender/makesrna/intern/rna_ui_api.c
M	source/blender/makesrna/intern/rna_wm.c
M	source/blender/makesrna/intern/rna_wm_gizmo.c
M	source/blender/modifiers/intern/MOD_bevel.c
M	source/blender/modifiers/intern/MOD_boolean.c
M	source/blender/modifiers/intern/MOD_simpledeform.c
M	source/blender/physics/intern/implicit_blender.c
M	source/blender/python/bmesh/bmesh_py_types.h
M	source/blender/python/bmesh/bmesh_py_types_customdata.c
M	source/blender/python/generic/idprop_py_api.c
M	source/blender/python/intern/bpy_operator.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna_anim.c
M	source/blender/python/intern/bpy_rna_array.c
M	source/blender/python/mathutils/mathutils.h
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_operator_props.c
M	source/blender/windowmanager/intern/wm_operators.c
M	tests/gtests/blenlib/BLI_string_test.cc

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

diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index 56fb5a68402..f19e0257b1b 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -241,9 +241,9 @@ Alembic::Abc::TimeSamplingPtr AbcExporter::createTimeSampling(double step)
 
   getShutterSamples(step, true, samples);
 
-  Alembic::Abc::TimeSamplingType ts(
-      static_cast<uint32_t>(samples.size()),
-      1.0 / m_settings.scene->r.frs_sec); /* TODO(Sybren): shouldn't we use the FPS macro here? */
+  /* TODO(Sybren): shouldn't we use the FPS macro here? */
+  Alembic::Abc::TimeSamplingType ts(static_cast<uint32_t>(samples.size()),
+                                    1.0 / m_settings.scene->r.frs_sec);
 
   return TimeSamplingPtr(new Alembic::Abc::TimeSampling(ts, samples));
 }
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 7283ade3ae5..6748a5324ac 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -619,8 +619,8 @@ static void blf_font_draw_buffer_ex(
                 cbuf[0] = (unsigned char)((b_col_char[0] * a) + (cbuf[0] * (1.0f - a)));
                 cbuf[1] = (unsigned char)((b_col_char[1] * a) + (cbuf[1] * (1.0f - a)));
                 cbuf[2] = (unsigned char)((b_col_char[2] * a) + (cbuf[2] * (1.0f - a)));
-                cbuf[3] = (unsigned char)MIN2((int)cbuf[3] + (int)(a * 255),
-                                              255); /* clamp to 255 */
+                /* clamp to 255 */
+                cbuf[3] = (unsigned char)MIN2((int)cbuf[3] + (int)(a * 255), 255);
               }
             }
           }
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 66be94aaa06..c0a53cbf282 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -329,10 +329,10 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
     /* Convert result from 1 bit per pixel to 8 bit per pixel */
     /* Accum errors for later, fine if not interested beyond "ok vs any error" */
     FT_Bitmap_New(&tempbitmap);
-    err += FT_Bitmap_Convert(font->ft_lib,
-                             &slot->bitmap,
-                             &tempbitmap,
-                             1); /* Does Blender use Pitch 1 always? It works so far */
+
+    /* Does Blender use Pitch 1 always? It works so far */
+    err += FT_Bitmap_Convert(font->ft_lib, &slot->bitmap, &tempbitmap, 1);
+
     err += FT_Bitmap_Copy(font->ft_lib, &tempbitmap, &slot->bitmap);
     err += FT_Bitmap_Done(font->ft_lib, &tempbitmap);
   }
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index b1200c7e608..c7d9a8350b3 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -103,8 +103,9 @@ void BKE_material_resize_id(struct Main *bmain, struct ID *id, short totcol, boo
 void BKE_material_append_id(struct Main *bmain, struct ID *id, struct Material *ma);
 struct Material *BKE_material_pop_id(struct Main *bmain,
                                      struct ID *id,
+                                     /* index is an int because of RNA. */
                                      int index,
-                                     bool update_data); /* index is an int because of RNA */
+                                     bool update_data);
 void BKE_material_clear_id(struct Main *bmain, struct ID *id, bool update_data);
 /* rendering */
 
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index f81fa2999ab..d9acbb3a843 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -310,9 +310,8 @@ typedef struct bNodeTreeType {
   /* callbacks */
   void (*free_cache)(struct bNodeTree *ntree);
   void (*free_node_cache)(struct bNodeTree *ntree, struct bNode *node);
-  void (*foreach_nodeclass)(struct Scene *scene,
-                            void *calldata,
-                            bNodeClassCallback func); /* iteration over all node classes */
+  /* Iteration over all node classes. */
+  void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func);
   /* Check visibility in the node editor */
   bool (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
   /* Select a node tree from the context */
diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h
index 3212bad75cb..7fc740a4a9b 100644
--- a/source/blender/blenkernel/BKE_writeavi.h
+++ b/source/blender/blenkernel/BKE_writeavi.h
@@ -53,10 +53,10 @@ typedef struct bMovieHandle {
                       const char *suffix,
                       struct ReportList *reports);
   void (*end_movie)(void *context_v);
-  void (*get_movie_path)(char *string,
-                         struct RenderData *rd,
-                         bool preview,
-                         const char *suffix); /* optional */
+
+  /* Optional function. */
+  void (*get_movie_path)(char *string, struct RenderData *rd, bool preview, const char *suffix);
+
   void *(*context_create)(void);
   void (*context_free)(void *context_v);
 } bMovieHandle;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 742e3634bf1..ea927ca9333 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2707,8 +2707,9 @@ void BKE_pose_where_is_bone(struct Depsgraph *depsgraph,
       cob = BKE_constraints_make_evalob(depsgraph, scene, ob, pchan, CONSTRAINT_OBTYPE_BONE);
 
       /* Solve PoseChannel's Constraints */
-      BKE_constraints_solve(
-          depsgraph, &pchan->constraints, cob, ctime); /* ctime doesn't alter objects */
+
+      /* ctime doesn't alter objects. */
+      BKE_constraints_solve(depsgraph, &pchan->constraints, cob, ctime);
 
       /* cleanup after Constraint Solving
        * - applies matrix back to pchan, and frees temporary struct used
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 25f2797915a..2031576190e 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -239,8 +239,9 @@ static Collection *collection_duplicate_recursive(Main *bmain,
 
   if (!do_hierarchy || collection_old->id.newid == NULL) {
     BKE_id_copy(bmain, &collection_old->id, (ID **)&collection_new);
-    id_us_min(
-        &collection_new->id); /* Copying add one user by default, need to get rid of that one. */
+
+    /* Copying add one user by default, need to get rid of that one. */
+    id_us_min(&collection_new->id);
 
     if (do_hierarchy) {
       ID_NEW_SET(collection_old, collection_new);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index efdfa2c19bb..980e8043a42 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -2737,8 +2737,10 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
 
     /* check if we will calculate tilt data */
     do_tilt = CU_DO_TILT(cu, nu);
-    do_radius = CU_DO_RADIUS(
-        cu, nu); /* normal display uses the radius, better just to calculate them */
+
+    /* Normal display uses the radius, better just to calculate them. */
+    do_radius = CU_DO_RADIUS(cu, nu);
+
     do_weight = true;
 
     /* check we are a single point? also check we are not a surface and that the orderu is sane,
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 1fb25375159..04cbdbb6bcd 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -4061,8 +4061,10 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
             hit_found = HIT_VOLUME;
 
             /* Mark hit info */
-            madd_v3_v3v3fl(
-                hitCoord, ray_start, ray_dir, hit.dist); /* Calculate final hit coordinates */
+
+            /* Calculate final hit coordinates */
+            madd_v3_v3v3fl(hitCoord, ray_start, ray_dir, hit.dist);
+
             depth += dist * sample_factor;
             hitTri = f_index;
           }
@@ -4113,8 +4115,10 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
             treeData->tree, ray_start, proj_ray, 0.0f, &hit, mesh_tris_spherecast_dp, treeData);
         if (hit.index != -1) {
           proxDist = hit.dist;
-          madd_v3_v3v3fl(
-              hitCo, ray_start, proj_ray, hit.dist); /* Calculate final hit coordinates */
+
+          /* Calculate final hit coordinates */
+          madd_v3_v3v3fl(hitCo, ray_start, proj_ray, hit.dist);
+
           tri = hit.index;
         }
       }
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 7cbd5b6b050..ffab82b75af 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -1338,8 +1338,9 @@ void BKE_sim_debug_data_clear_category(const char *category)
     BLI_ghashIterator_init(&iter, _sim_debug_data->gh);
     while (!BLI_ghashIterator_done(&iter)) {
       const SimDebugElement *elem = BLI_ghashIterator_getValue(&iter);
-      BLI_ghashIterator_step(
-          &iter); /* removing invalidates the current iterator, so step before removing */
+
+      /* Removing invalidates the current iterator, so step before removing. */
+      BLI_ghashIterator_step(&iter);
 
       if (elem->category_hash == category_hash) {
         BLI_ghash_remove(_sim_debug_data->gh, elem, NULL, debug_element_free);
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 140d1f0d26c..9580ea763fb 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -506,8 +506,10 @@ static int binarysearch_bezt_index_ex(
    */
   for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list