[Bf-blender-cvs] [2fb9c8ef125] master: Cleanup: add missing macros to clang-format

Campbell Barton noreply at git.blender.org
Sat Apr 20 20:45:05 CEST 2019


Commit: 2fb9c8ef125f975596b6ef9c8f021403f8279bdf
Author: Campbell Barton
Date:   Sun Apr 21 04:40:16 2019 +1000
Branches: master
https://developer.blender.org/rB2fb9c8ef125f975596b6ef9c8f021403f8279bdf

Cleanup: add missing macros to clang-format

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

M	.clang-format
M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenkernel/intern/blendfile.c
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/library_override.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/library_remap.c
M	source/blender/blenkernel/intern/main.c
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/blenkernel/intern/studiolight.c
M	source/blender/blenlib/intern/edgehash.c
M	source/blender/blenloader/intern/blend_validate.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/bmesh/intern/bmesh_core.c
M	source/blender/bmesh/intern/bmesh_edgeloop.c
M	source/blender/bmesh/intern/bmesh_mods.c
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/bmesh/intern/bmesh_query.c
M	source/blender/bmesh/operators/bmo_extrude.c
M	source/blender/bmesh/operators/bmo_planar_faces.c
M	source/blender/bmesh/operators/bmo_primitive.c
M	source/blender/bmesh/operators/bmo_rotate_edges.c
M	source/blender/bmesh/operators/bmo_smooth_laplacian.c
M	source/blender/bmesh/operators/bmo_subdivide.c
M	source/blender/bmesh/operators/bmo_subdivide_edgering.c
M	source/blender/bmesh/operators/bmo_utils.c
M	source/blender/bmesh/tools/bmesh_bisect_plane.c
M	source/blender/bmesh/tools/bmesh_region_match.c
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/draw/intern/draw_manager_exec.c
M	source/blender/editors/animation/anim_filter.c
M	source/blender/editors/armature/armature_add.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_select.c
M	source/blender/editors/armature/pose_utils.c
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/mesh/mesh_data.c
M	source/blender/editors/object/object_collection.c
M	source/blender/editors/object/object_constraint.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_constraints.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_snap.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/editors/uvedit/uvedit_smart_stitch.c
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c
M	source/blender/imbuf/intern/jp2.c
M	source/blender/makesrna/intern/rna_mesh.c
M	source/blender/python/bmesh/bmesh_py_ops_call.c
M	source/blender/python/bmesh/bmesh_py_types.c
M	source/blender/python/intern/bpy_rna_id_collection.c
M	source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
M	source/blender/windowmanager/intern/wm_event_system.c

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

diff --git a/.clang-format b/.clang-format
index 0ce77f88785..6374b48f2b6 100644
--- a/.clang-format
+++ b/.clang-format
@@ -159,18 +159,27 @@ PenaltyBreakString: 1000000
 
 # There are macros in Blender for custom for loops; tell Clang to treat them
 # like loops rather than an expression, and so put the { on the same line.
+#
+# To find these use multi-line regex search:
+# "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{"
 ForEachMacros:
+  - BEGIN_ANIMFILTER_SUBCHANNELS
+  - BLI_FOREACH_SPARSE_RANGE
   - BLI_SMALLSTACK_ITER_BEGIN
   - BMO_ITER
+  - BMO_ITER_INDEX
   - BMW_ITER
   - BM_FACES_OF_VERT_ITER_BEGIN
+  - BM_ITER_BPY_BM_SEQ
   - BM_ITER_ELEM
+  - BM_ITER_ELEM_INDEX
   - BM_ITER_MESH
   - BM_ITER_MESH_INDEX
   - BM_ITER_MESH_MUTABLE
   - BM_LOOPS_OF_VERT_ITER_BEGIN
   - BOOST_FOREACH
   - CTX_DATA_BEGIN
+  - CTX_DATA_BEGIN_WITH_ID
   - DEG_OBJECT_ITER_BEGIN
   - DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
   - DRIVER_TARGETS_LOOPER_BEGIN
@@ -179,9 +188,13 @@ ForEachMacros:
   - FOREACH_BASE_IN_EDIT_MODE_BEGIN
   - FOREACH_BASE_IN_MODE_BEGIN
   - FOREACH_BEGIN
+  - FOREACH_COLLECTION_BEGIN
   - FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN
   - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN
   - FOREACH_EDIT_OBJECT_BEGIN
+  - FOREACH_MAIN_ID_BEGIN
+  - FOREACH_MAIN_LISTBASE_BEGIN
+  - FOREACH_MAIN_LISTBASE_ID_BEGIN
   - FOREACH_NODETREE_BEGIN
   - FOREACH_OBJECT_BEGIN
   - FOREACH_OBJECT_FLAG_BEGIN
@@ -195,25 +208,33 @@ ForEachMacros:
   - FOREACH_SELECTED_BASE_BEGIN
   - FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
   - FOREACH_SELECTED_OBJECT_BEGIN
+  - FOREACH_TRANS_DATA_CONTAINER
   - FOREACH_VIEW_LAYER_TO_RENDER_BEGIN
   - FOREACH_VISIBLE_BASE_BEGIN
   - FOREACH_VISIBLE_OBJECT_BEGIN
   - GHASH_FOREACH_BEGIN
   - GHASH_ITER
-  - GSET_FOREACH_BEGIN
-  - GSET_ITER
+  - GHASH_ITER_INDEX
+  - GPU_SELECT_LOAD_IF_PICKSEL_LIST
   - GP_EDITABLE_STROKES_BEGIN
   - GSET_FOREACH_BEGIN
+  - GSET_ITER
+  - GSET_ITER_INDEX
   - ITER_BEGIN
+  - ITER_PIXELS
+  - ITER_SLOTS
   - LISTBASE_CIRCULAR_BACKWARD_BEGIN
   - LISTBASE_CIRCULAR_FORWARD_BEGIN
   - LISTBASE_FOREACH
+  - LISTBASE_FOREACH_MUTABLE
   - MAN2D_ITER_AXES_BEGIN
   - MAN_ITER_AXES_BEGIN
+  - NODE_INSTANCE_HASH_ITER
   - NODE_SOCKET_TYPES_BEGIN
   - NODE_TREE_TYPES_BEGIN
   - NODE_TYPES_BEGIN
   - PIXEL_LOOPER_BEGIN
+  - PIXEL_LOOPER_BEGIN_CHANNELS
   - RNA_BEGIN
   - RNA_PROP_BEGIN
   - RNA_STRUCT_BEGIN
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 84ff46aa5d0..b8721f61371 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -170,9 +170,8 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset);
 #define FOREACH_MAIN_ID_BEGIN(_bmain, _id) \
   { \
     ListBase *_lb; \
-    FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb) \
-    { \
-      FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
+    FOREACH_MAIN_LISTBASE_BEGIN (_bmain, _lb) { \
+      FOREACH_MAIN_LISTBASE_ID_BEGIN (_lb, _id)
 
 #define FOREACH_MAIN_ID_END \
   FOREACH_MAIN_LISTBASE_ID_END; \
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index 723c8bb48bf..98e7eea4d03 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -464,10 +464,8 @@ void BKE_blendfile_read_make_empty(bContext *C)
   ListBase *lb;
   ID *id;
 
-  FOREACH_MAIN_LISTBASE_BEGIN(bmain, lb)
-  {
-    FOREACH_MAIN_LISTBASE_ID_BEGIN(lb, id)
-    {
+  FOREACH_MAIN_LISTBASE_BEGIN (bmain, lb) {
+    FOREACH_MAIN_LISTBASE_ID_BEGIN (lb, id) {
       if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM, ID_WS)) {
         break;
       }
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 4230ab313d0..342cd98ffb0 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1723,8 +1723,7 @@ void BKE_main_id_clear_newpoins(Main *bmain)
 {
   ID *id;
 
-  FOREACH_MAIN_ID_BEGIN(bmain, id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, id) {
     id->newid = NULL;
     id->tag &= ~LIB_TAG_NEW;
   }
diff --git a/source/blender/blenkernel/intern/library_override.c b/source/blender/blenkernel/intern/library_override.c
index 7a29575dffe..8e2968ec7be 100644
--- a/source/blender/blenkernel/intern/library_override.c
+++ b/source/blender/blenkernel/intern/library_override.c
@@ -207,8 +207,7 @@ bool BKE_override_static_create_from_tag(Main *bmain)
   ID *reference_id;
   bool ret = true;
 
-  FOREACH_MAIN_ID_BEGIN(bmain, reference_id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, reference_id) {
     if ((reference_id->tag & LIB_TAG_DOIT) != 0 && reference_id->lib != NULL) {
       if ((reference_id->newid = override_static_create_from(bmain, reference_id)) == NULL) {
         ret = false;
@@ -217,8 +216,7 @@ bool BKE_override_static_create_from_tag(Main *bmain)
   }
   FOREACH_MAIN_ID_END;
 
-  FOREACH_MAIN_ID_BEGIN(bmain, reference_id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, reference_id) {
     if ((reference_id->tag & LIB_TAG_DOIT) != 0 && reference_id->lib != NULL &&
         reference_id->newid != NULL) {
       ID *local_id = reference_id->newid;
@@ -620,8 +618,7 @@ void BKE_main_override_static_operations_create(Main *bmain, const bool force_au
 {
   ID *id;
 
-  FOREACH_MAIN_ID_BEGIN(bmain, id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, id) {
     if (force_auto ||
         (ID_IS_STATIC_OVERRIDE_AUTO(id) && (id->tag & LIB_TAG_OVERRIDESTATIC_AUTOREFRESH))) {
       BKE_override_static_operations_create(bmain, id, force_auto);
@@ -705,8 +702,7 @@ void BKE_main_override_static_update(Main *bmain)
 {
   ID *id;
 
-  FOREACH_MAIN_ID_BEGIN(bmain, id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, id) {
     if (id->override_static != NULL && id->lib == NULL) {
       BKE_override_static_update(bmain, id);
     }
@@ -804,8 +800,7 @@ void BKE_override_static_operations_store_finalize(OverrideStaticStorage *overri
    * without increasing usercount of used data-blocks... */
   ID *id;
 
-  FOREACH_MAIN_ID_BEGIN(override_storage, id)
-  {
+  FOREACH_MAIN_ID_BEGIN (override_storage, id) {
     BKE_id_free_ex(override_storage, id, LIB_ID_FREE_NO_UI_USER, true);
   }
   FOREACH_MAIN_ID_END;
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index a87f8a4969a..09d868c894d 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -1412,8 +1412,7 @@ void BKE_library_unused_linked_data_set_tag(Main *bmain, const bool do_init_tag)
   ID *id;
 
   if (do_init_tag) {
-    FOREACH_MAIN_ID_BEGIN(bmain, id)
-    {
+    FOREACH_MAIN_ID_BEGIN (bmain, id) {
       if (id->lib && (id->tag & LIB_TAG_INDIRECT) != 0) {
         id->tag |= LIB_TAG_DOIT;
       }
@@ -1426,8 +1425,7 @@ void BKE_library_unused_linked_data_set_tag(Main *bmain, const bool do_init_tag)
 
   for (bool do_loop = true; do_loop;) {
     do_loop = false;
-    FOREACH_MAIN_ID_BEGIN(bmain, id)
-    {
+    FOREACH_MAIN_ID_BEGIN (bmain, id) {
       /* We only want to check that ID if it is currently known as used... */
       if ((id->tag & LIB_TAG_DOIT) == 0) {
         BKE_library_foreach_ID_link(
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index 9b6de945db8..d334804dcd6 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -448,8 +448,7 @@ static void libblock_remap_data(
      * objects actually using given old_id... sounds rather unlikely currently, though, so this will do for now. */
     ID *id_curr;
 
-    FOREACH_MAIN_ID_BEGIN(bmain, id_curr)
-    {
+    FOREACH_MAIN_ID_BEGIN (bmain, id_curr) {
       if (BKE_library_id_can_use_idtype(id_curr, GS(old_id->name))) {
         /* Note that we cannot skip indirect usages of old_id here (if requested), we still need to check it for
          * the user count handling...
diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c
index ef196430da7..8ae5ed7fbdd 100644
--- a/source/blender/blenkernel/intern/main.c
+++ b/source/blender/blenkernel/intern/main.c
@@ -260,8 +260,7 @@ void BKE_main_relations_create(Main *bmain)
       sizeof(MainIDRelationsEntry), 128, 128, BLI_MEMPOOL_NOP);
 
   ID *id;
-  FOREACH_MAIN_ID_BEGIN(bmain, id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, id) {
     BKE_library_foreach_ID_link(
         NULL, id, main_relations_create_idlink_cb, bmain->relations, IDWALK_READONLY);
   }
@@ -295,8 +294,7 @@ GSet *BKE_main_gset_create(Main *bmain, GSet *gset)
   }
 
   ID *id;
-  FOREACH_MAIN_ID_BEGIN(bmain, id)
-  {
+  FOREACH_MAIN_ID_BEGIN (bmain, id) {
     BLI_gset_add(gset, id);
   }
   FOREACH_MAIN_ID_END;
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 45bade78207..fe27e23a6bf 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1389,8 +1389,7 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain),
 
     ntree_dst->previews = BKE_node_instance_hash_new("node previews");
 
-    NODE_INSTANCE_HASH_ITER(iter, ntree_src->previews)
-    {
+    NODE_INSTANCE_HASH_ITER (iter, ntree_src->previews) {
       bNodeInstanceKey key = BKE_node_instance_hash_iterator_get_key(&iter);
       bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter);
       BKE_node_instance_hash_insert(ntree_dst->previews, key, BKE_node_preview_copy(preview));
@@ -1592,8 +1591,7 @@ void BKE_node_preview_clear_tree(bNodeTree *ntree)
   if (!ntree || !ntree->previews)
     return;
 
-  NODE_INSTANCE_HASH_ITER(iter, ntree->previews)
-  {
+  NODE_INSTANCE_HASH_ITER (iter, ntree->previews) {
     bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter);
     BKE_node_preview_clear(preview);
   }
@@ -1621,8 +1619,7 @@ void BKE_node_preview_sync_tree(bNodeTree *to_ntree, bNodeTree *from_ntree)
   if (!from_previews || !to_previews)
     return;
 
-  NODE_INSTANCE_HASH_ITER(iter, from_previews)
-  {
+  NODE_INSTANCE_HASH_ITER (iter, from_previews) {
     bNodeInstanceKey key = BKE_node_instance_hash_iterator_get_key(&iter);
     bNod

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list