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); bNodePreview *from = BKE_node_instance_hash_iterator_get_value(&iter); bNodePreview *to = BKE_node_instance_hash_lookup(to_previews, key); @@ -1650,8 +1647,7 @@ void BKE_node_preview_merge_tree(bNodeTree *to_ntree, bNodeTree *from_ntree, boo bNodeInstanceHashIterator iter; if (from_ntree->previews) { - NODE_INSTANCE_HASH_ITER(iter, from_ntree->previews) - { + NODE_INSTANCE_HASH_ITER (iter, from_ntree->previews) { bNodeInstanceKey key = BKE_node_instance_hash_iterator_get_key(&iter); bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter); @@ -2901,8 +2897,7 @@ void BKE_node_instance_hash_clear_tags(bNodeInstanceHash *hash) { bNodeInstanceHashIterator iter; - NODE_INSTANCE_HASH_ITER(iter, hash) - { + NODE_INSTANCE_HASH_ITER (iter, hash) { bNodeInstanceHashEntry *value = BKE_node_instance_hash_iterator_get_value(&iter); value->tag = 0; @@ -2940,8 +2935,7 @@ void BKE_node_instance_hash_remove_untagged(bNodeInstanceHash *hash, int num_untagged, i; num_untagged = 0; - NODE_INSTANCE_HASH_ITER(iter, hash) - { + NODE_INSTANCE_HASH_ITER (iter, hash) { bNodeInstanceHashEntry *value = BKE_node_instance_hash_iterator_get_value(&iter); if (!value->tag) diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 445205a513a..7933f98868a 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1287,8 +1287,7 @@ void BKE_pbvh_get_grid_updates(PBVH *bvh, bool clear, void ***r_gridfaces, int * GSetIterator gs_iter; int i; - GSET_ITER_INDEX(gs_iter, face_set, i) - { + GSET_ITER_INDEX (gs_iter, face_set, i) { faces[i] = BLI_gsetIterator_getKey(&gs_iter); } diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 40172a4778c..f2daab5ef38 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -393,8 +393,7 @@ static bool pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index) GSetIterator gs_iter; int i; - GSET_ITER_INDEX(gs_iter, bm_faces, i) - { + GSET_ITER_INDEX (gs_iter, bm_faces, i) { BMFace *f = BLI_gsetIterator_getKey(&gs_iter); BBC *bbc = &bbc_array[i]; diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index b64f6a1d076..955f23f43e7 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -433,9 +433,8 @@ static void studiolight_calculate_radiance_buffer(ImBuf *ibuf, const float ysign, const float zsign) { - ITER_PIXELS( - float, colbuf, 4, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) - { + ITER_PIXELS ( + float, colbuf, 4, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) { float direction[3]; direction[index_x] = xsign * (x - 0.5f); direction[index_y] = ysign * (y - 0.5f); @@ -544,12 +543,11 @@ static void studiolight_spherical_harmonics_calculate_coefficients(StudioLight * memset(sh, 0, sizeof(float) * 3 * STUDIOLIGHT_SH_COEFS_LEN); for (int face = 0; face < 6; face++) { - ITER_PIXELS(float, - sl->radiance_cubemap_buffers[face]->rect_float, - 4, - STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, - STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) - { + ITER_PIXELS (float, + sl->radiance_cubemap_buffers[face]->rect_float, + 4, + STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, + STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) { float color[3], cubevec[3], weight; studiolight_calculate_cubemap_vector_weight(cubevec, &weight, face, x, y); mul_v3_v3fl(color, pixel, weight); @@ -835,12 +833,11 @@ BLI_INLINE void studiolight_evaluate_specular_radiance_buffer(ImBuf *radiance_bu float accum[3] = {0.0f, 0.0f, 0.0f}; float accum_weight = 0.00001f; - ITER_PIXELS(float, - radiance_buffer->rect_float, - 4, - STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, - STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) - { + ITER_PIXELS (float, + radiance_buffer->rect_float, + 4, + STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, + STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) { float direction[3]; direction[zoffset] = zsign * 0.5f; direction[xoffset] = x - 0.5f; @@ -1027,12 +1024,11 @@ static void studiolight_calculate_irradiance_equirect_image(StudioLight *sl) STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT * sizeof(float[4]), __func__); - ITER_PIXELS(float, - colbuf, - 4, - STUDIOLIGHT_IRRADIANCE_EQUIRECT_WIDTH, - STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT) - { + ITER_PIXELS (float, + colbuf, + 4, + STUDIOLIGHT_IRRADIANCE_EQUIRECT_WIDTH, + STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT) { float dir[3]; equirect_to_direction(dir, x, y); #ifdef STUDIOLIGHT_IRRADIANCE_METHOD_RADIANCE @@ -1166,8 +1162,7 @@ static void studiolight_radiance_preview(uint *icon_buffer, StudioLight *sl) { BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED); - ITER_PIXELS(uint, icon_buffer, 1, STUDIOLIGHT_ICON_SIZE, STUDIOLIGHT_ICON_SIZE) - { + ITER_PIXELS (uint, icon_buffer, 1, STUDIOLIGHT_ICON_SIZE, STUDIOLIGHT_ICON_SIZE) { float dy = RESCALE_COORD(y); float dx = RESCALE_COORD(x); @@ -1201,8 +1196,7 @@ static void studiolight_matcap_preview(uint *icon_buffer, StudioLight *sl, bool ImBuf *ibuf = sl->equirect_radiance_buffer; - ITER_PIXELS(uint, icon_buffer, 1, STUDIOLIGHT_ICON_SIZE, STUDIOLIGHT_ICON_SIZE) - { + ITER_PIXELS (uint, icon_buffer, 1, STUDIOLIGHT_ICON_SIZE, STUDIOLIGHT_ICON_SIZE) { float dy = RESCALE_COORD(y); float dx = RESCALE_COORD(x); if (flipped) { @@ -1224,8 +1218,7 @@ static void studiolight_matcap_preview(uint *icon_buffer, StudioLight *sl, bool static void studiolight_irradiance_preview(uint *icon_buffer, StudioLight *sl) { - ITER_PIXELS(uint, icon_buffer, 1, STUDIOLIGHT_ICON_SIZE, STUDIOLIGHT_ICON_SIZE) - { + ITER_PIXELS (uint, icon_buffer, 1, STUDIOLIGHT_ICON_SIZE, STUDIOLIGHT_ICON_SIZE) { float dy = RESCALE_COORD(y); float dx = RESCALE_COORD(x); diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 528f206c02e..9b846dfa08d 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -144,8 +144,7 @@ static void edgehash_free_values(EdgeHash *eh, EdgeHashFreeFP free_value) BLI_INLINE void edgehash_insert_index(EdgeHash *eh, Edge edge, uint entry_index) { - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (index == SLOT_EMPTY) { eh->map[slot] = (int32_t)entry_index; break; @@ -182,8 +181,7 @@ BLI_INLINE bool edgehash_ensure_can_insert(EdgeHash *eh) BLI_INLINE EdgeHashEntry *edgehash_insert(EdgeHash *eh, Edge edge, void *value) { - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (index == SLOT_EMPTY) { return edgehash_insert_at_slot(eh, slot, edge, value); } @@ -198,8 +196,7 @@ BLI_INLINE EdgeHashEntry *edgehash_lookup_entry(EdgeHash *eh, uint v0, uint v1) { Edge edge = init_edge(v0, v1); - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (EH_INDEX_HAS_EDGE(eh, index, edge)) { return &eh->entries[index]; } @@ -211,8 +208,7 @@ BLI_INLINE EdgeHashEntry *edgehash_lookup_entry(EdgeHash *eh, uint v0, uint v1) BLI_INLINE void edgehash_change_index(EdgeHash *eh, Edge edge, int new_index) { - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (EH_INDEX_HAS_EDGE(eh, index, edge)) { eh->map[slot] = new_index; break; @@ -293,8 +289,7 @@ bool BLI_edgehash_reinsert(EdgeHash *eh, uint v0, uint v1, void *value) { Edge edge = init_edge(v0, v1); - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (EH_INDEX_HAS_EDGE(eh, index, edge)) { eh->entries[index].value = value; return false; @@ -360,8 +355,7 @@ bool BLI_edgehash_ensure_p(EdgeHash *eh, uint v0, uint v1, void ***r_value) { Edge edge = init_edge(v0, v1); - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (EH_INDEX_HAS_EDGE(eh, index, edge)) { *r_value = &eh->entries[index].value; return true; @@ -407,8 +401,7 @@ void *BLI_edgehash_popkey(EdgeHash *eh, uint v0, uint v1) { Edge edge = init_edge(v0, v1); - ITER_SLOTS(eh, edge, slot, index) - { + ITER_SLOTS (eh, edge, slot, index) { if (EH_INDEX_HAS_EDGE(eh, index, edge)) { void *value = eh->entries[index].value; eh->length--; @@ -546,8 +539,7 @@ int BLI_edgeset_len(EdgeSet *es) static void edgeset_insert_index(EdgeSet *es, Edge edge, uint entry_index) { - ITER_SLOTS(es, edge, slot, index) - { + ITER_SLOTS (es, edge, slot, index) { if (index == SLOT_EMPTY) { es->map[slot] = (int)entry_index; break; @@ -587,8 +579,7 @@ bool BLI_edgeset_add(EdgeSet *es, uint v0, uint v1) edgeset_ensure_can_insert(es); Edge edge = init_edge(v0, v1); - ITER_SLOTS(es, edge, slot, index) - { + ITER_SLOTS (es, edge, slot, index) { if (ES_INDEX_HAS_EDGE(es, index, edge)) { return false; } @@ -608,8 +599,7 @@ void BLI_edgeset_insert(EdgeSet *es, uint v0, uint v1) edgeset_ensure_can_insert(es); Edge edge = init_edge(v0, v1); - ITER_SLOTS(es, edge, slot, index) - { + ITER_SLOTS (es, edge, slot, index) { if (index == SLOT_EMPTY) { edgeset_insert_at_slot(es, slot, edge); return; @@ -621,8 +611,7 @@ bool BLI_edgeset_haskey(EdgeSet *es, uint v0, uint v1) { Edge edge = init_edge(v0, v1); - ITER_SLOTS(es, edge, slot, index) - { + ITER_SLOTS (es, edge, slot, index) { if (ES_INDEX_HAS_EDGE(es, index, edge)) { return true; } diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c index 1ca274dd68a..a71fe9f1adb 100644 --- a/source/blender/blenloader/intern/blend_validate.c +++ b/source/blender/blenloader/intern/blend_validate.c @@ -168,10 +168,8 @@ bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports) BKE_main_lock(bmain); - 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 (!BKE_key_idtype_support(GS(id->name))) { break; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6e3c459ddda..2708ad4fa3e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -344,8 +344,7 @@ typedef struct OldNewMap { static void oldnewmap_insert_index_in_map(OldNewMap *onm, const void *ptr, int index) { - ITER_SLOTS(onm, ptr, slot, stored_index) - { + ITER_SLOTS (onm, ptr, slot, stored_index) { if (stored_index == -1) { onm->map[slot] = index; break; @@ -355,8 +354,7 @@ static void oldnewmap_insert_index_in_map(OldNewMap *onm, const void *ptr, int i static void oldnewmap_insert_or_replace(OldNewMap *onm, OldNew entry) { - ITER_SLOTS(onm, entry.oldp, slot, index) - { + ITER_SLOTS (onm, entry.oldp, slot, index) { if (index == -1) { onm->entries[onm->nentries] = entry; onm->map[slot] = onm->nentries; @@ -372,8 +370,7 @@ static void oldnewmap_insert_or_replace(OldNewMap *onm, OldNew entry) static OldNew *oldnewmap_lookup_entry(const OldNewMap *onm, const void *addr) { - ITER_SLOTS(onm, addr, slot, index) - { + ITER_SLOTS (onm, addr, slot, index) { if (index >= 0) { OldNew *entry = &onm->entries[index]; if (entry->oldp == addr) { @@ -1511,8 +1508,7 @@ void blo_filedata_free(FileData *fd) BLI_freelistN(&fd->bhead_list); #else /* Sanity check we're not keeping memory we don't need. */ - LISTBASE_FOREACH_MUTABLE(BHeadN *, new_bhead, &fd->bhead_list) - { + LISTBASE_FOREACH_MUTABLE (BHeadN *, new_bhead, &fd->bhead_list) { if (fd->seek != NULL && BHEAD_USE_READ_ON_DEMAND(&new_bhead->bhead)) { BLI_assert(new_bhead->has_data == 0); } @@ -1889,8 +1885,7 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) for (; sce; sce = sce->id.next) { if (sce->nodetree && sce->nodetree->previews) { bNodeInstanceHashIterator iter; - NODE_INSTANCE_HASH_ITER(iter, sce->nodetree->previews) - { + NODE_INSTANCE_HASH_ITER (iter, sce->nodetree->previews) { bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter); oldnewmap_insert(fd->imamap, preview, preview, 0); } @@ -1936,8 +1931,7 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) bNodeInstanceHashIterator iter; /* reconstruct the preview hash, only using remaining pointers */ - NODE_INSTANCE_HASH_ITER(iter, sce->nodetree->previews) - { + NODE_INSTANCE_HASH_ITER (iter, sce->nodetree->previews) { bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter); if (preview) { bNodePreview *new_preview = newimaadr(fd, preview); @@ -3724,8 +3718,7 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews"); bNodeInstanceHashIterator iter; - NODE_INSTANCE_HASH_ITER(iter, ntree->previews) - { + NODE_INSTANCE_HASH_ITER(iter, ntree->previews) { bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter); if (preview) { bNodePreview *new_preview = newimaadr(fd, preview); diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 5dcf6acad57..36abb1dc5c4 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -69,7 +69,7 @@ BMVert *BM_vert_create(BMesh *bm, v->head.data = NULL; #ifdef USE_DEBUG_INDEX_MEMCHECK - DEBUG_MEMCHECK_INDEX_INVALIDATE(v) + DEBUG_MEMCHECK_INDEX_INVALIDATE(v); #else BM_elem_index_set(v, -1); /* set_ok_invalid */ #endif @@ -162,7 +162,7 @@ BMEdge *BM_edge_create( e->head.data = NULL; #ifdef USE_DEBUG_INDEX_MEMCHECK - DEBUG_MEMCHECK_INDEX_INVALIDATE(e) + DEBUG_MEMCHECK_INDEX_INVALIDATE(e); #else BM_elem_index_set(e, -1); /* set_ok_invalid */ #endif @@ -237,7 +237,7 @@ static BMLoop *bm_loop_create(BMesh *bm, l->head.data = NULL; #ifdef USE_DEBUG_INDEX_MEMCHECK - DEBUG_MEMCHECK_INDEX_INVALIDATE(l) + DEBUG_MEMCHECK_INDEX_INVALIDATE(l); #else BM_elem_index_set(l, -1); /* set_ok_invalid */ #endif @@ -373,7 +373,7 @@ BLI_INLINE BMFace *bm_face_create__internal(BMesh *bm) /* --- assign all members --- */ f->head.data = NULL; #ifdef USE_DEBUG_INDEX_MEMCHECK - DEBUG_MEMCHECK_INDEX_INVALIDATE(f) + DEBUG_MEMCHECK_INDEX_INVALIDATE(f); #else BM_elem_index_set(f, -1); /* set_ok_invalid */ #endif diff --git a/source/blender/bmesh/intern/bmesh_edgeloop.c b/source/blender/bmesh/intern/bmesh_edgeloop.c index a802515a3b2..f97ae0ace1e 100644 --- a/source/blender/bmesh/intern/bmesh_edgeloop.c +++ b/source/blender/bmesh/intern/bmesh_edgeloop.c @@ -750,8 +750,7 @@ void BM_edgeloop_expand( LinkData *node_curr = el_store->verts.first; int iter_prev = 0; - BLI_FOREACH_SPARSE_RANGE(el_store->len, (el_store_len - el_store->len), iter) - { + BLI_FOREACH_SPARSE_RANGE (el_store->len, (el_store_len - el_store->len), iter) { while (iter_prev < iter) { node_curr = node_curr->next; iter_prev += 1; diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 606051ebefa..8728186ef33 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -749,8 +749,7 @@ bool BM_face_validate(BMFace *face, FILE *err) } BLI_array_grow_items(verts, face->len); - BM_ITER_ELEM_INDEX(l, &iter, face, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &iter, face, BM_LOOPS_OF_FACE, i) { verts[i] = l->v; if (l->e->v1 == l->e->v2) { fprintf(err, "Found bmesh edge with identical verts!\n"); diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 3f2c93f570e..1a0e167b93d 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -1432,8 +1432,7 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptri else if (efa->len == 3) { # if 0 int j; - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j) - { + BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j) { looptris[i][j] = l; } i += 1; @@ -1451,8 +1450,7 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptri BMLoop *ltmp[4]; int j; BLI_array_grow_items(looptris, 2); - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j) - { + BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, j) { ltmp[j] = l; } diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index 1986a1c782d..d7266121874 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -1841,8 +1841,7 @@ float BM_vert_calc_median_tagged_edge_length(const BMVert *v) int tot; float length = 0.0f; - BM_ITER_ELEM_INDEX(e, &iter, (BMVert *)v, BM_EDGES_OF_VERT, tot) - { + BM_ITER_ELEM_INDEX (e, &iter, (BMVert *)v, BM_EDGES_OF_VERT, tot) { const BMVert *v_other = BM_edge_other_vert(e, v); if (BM_elem_flag_test(v_other, BM_ELEM_TAG)) { length += BM_edge_calc_length(e); diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index cec7a920abb..7d557204369 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -740,8 +740,7 @@ static void solidify_add_thickness(BMesh *bm, const float dist) /* array for receiving angles from angle_poly_v3 */ float **verts = BLI_buffer_reinit_data(&verts_buf, float *, f->len); - BM_ITER_ELEM_INDEX(l, &loopIter, f, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &loopIter, f, BM_LOOPS_OF_FACE, i) { verts[i] = l->v->co; } diff --git a/source/blender/bmesh/operators/bmo_planar_faces.c b/source/blender/bmesh/operators/bmo_planar_faces.c index ca336175f19..30aa473b2c7 100644 --- a/source/blender/bmesh/operators/bmo_planar_faces.c +++ b/source/blender/bmesh/operators/bmo_planar_faces.c @@ -56,8 +56,7 @@ void bmo_planar_faces_exec(BMesh *bm, BMOperator *op) faces_center = MEM_mallocN(sizeof(*faces_center) * faces_num, __func__); shared_vert_num = 0; - BMO_ITER_INDEX(f, &oiter, op->slots_in, "faces", BM_FACE, i) - { + BMO_ITER_INDEX (f, &oiter, op->slots_in, "faces", BM_FACE, i) { BMLoop *l_iter, *l_first; if (f->len == 3) { @@ -84,8 +83,7 @@ void bmo_planar_faces_exec(BMesh *bm, BMOperator *op) GHashIterator gh_iter; bool changed = false; - BMO_ITER_INDEX(f, &oiter, op->slots_in, "faces", BM_FACE, i) - { + BMO_ITER_INDEX (f, &oiter, op->slots_in, "faces", BM_FACE, i) { BMLoop *l_iter, *l_first; float plane[4]; diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index bea7c56b1d4..3ed74d68317 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -819,8 +819,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm, continue; } - BM_ITER_ELEM_INDEX(l, &liter, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &liter, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); switch (loop_index) { @@ -1022,8 +1021,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op) * so it's best to set the UVs right after the face is created. */ if (calc_uvs) { int loop_index; - BM_ITER_ELEM_INDEX(l, &liter, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &liter, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); luv->uv[0] = icouvs[uvi][0]; luv->uv[1] = icouvs[uvi][1]; @@ -1077,8 +1075,7 @@ static void bm_mesh_calc_uvs_sphere_face(BMFace *f, const int cd_loop_uv_offset) /* If face has 3 vertices, it's a polar face, in which case we need to * compute a nearby to determine its latitude. */ float avgx = 0.0f, avgy = 0.0f; - BM_ITER_ELEM_INDEX(l, &iter, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, loop_index) { if (f->len == 3) { avgx += l->v->co[0]; avgy += l->v->co[1]; @@ -1087,8 +1084,7 @@ static void bm_mesh_calc_uvs_sphere_face(BMFace *f, const int cd_loop_uv_offset) avgx /= 3.0f; avgy /= 3.0f; - BM_ITER_ELEM_INDEX(l, &iter, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); float x = l->v->co[0]; float y = l->v->co[1]; @@ -1164,8 +1160,7 @@ void BM_mesh_calc_uvs_sphere(BMesh *bm, const short oflag, const int cd_loop_uv_ if (!BMO_face_flag_test(bm, f, oflag)) { continue; } - BM_ITER_ELEM_INDEX(l, &iter2, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &iter2, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); if (luv->uv[0] < minx) { minx = luv->uv[0]; @@ -1177,8 +1172,7 @@ void BM_mesh_calc_uvs_sphere(BMesh *bm, const short oflag, const int cd_loop_uv_ if (!BMO_face_flag_test(bm, f, oflag)) { continue; } - BM_ITER_ELEM_INDEX(l, &iter2, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &iter2, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); luv->uv[0] -= minx; } @@ -1582,8 +1576,7 @@ void BM_mesh_calc_uvs_cone(BMesh *bm, if (f->len == 4 && radius_top && radius_bottom) { /* side face - so unwrap it in a rectangle */ - BM_ITER_ELEM_INDEX(l, &liter, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &liter, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); switch (loop_index) { @@ -1720,8 +1713,7 @@ void BM_mesh_calc_uvs_cube(BMesh *bm, const short oflag) continue; } - BM_ITER_ELEM_INDEX(l, &liter, f, BM_LOOPS_OF_FACE, loop_index) - { + BM_ITER_ELEM_INDEX (l, &liter, f, BM_LOOPS_OF_FACE, loop_index) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); luv->uv[0] = x; diff --git a/source/blender/bmesh/operators/bmo_rotate_edges.c b/source/blender/bmesh/operators/bmo_rotate_edges.c index e017806df0d..b999e942d10 100644 --- a/source/blender/bmesh/operators/bmo_rotate_edges.c +++ b/source/blender/bmesh/operators/bmo_rotate_edges.c @@ -116,8 +116,7 @@ static void bm_rotate_edges_shared( BMOIter siter; BMEdge *e; uint i; - BMO_ITER_INDEX(e, &siter, op->slots_in, "edges", BM_EDGE, i) - { + BMO_ITER_INDEX (e, &siter, op->slots_in, "edges", BM_EDGE, i) { BM_elem_index_set(e, BM_edge_is_manifold(e) ? i : -1); /* set_dirty! */ eheap_table[i] = NULL; } @@ -138,8 +137,7 @@ static void bm_rotate_edges_shared( BMOIter siter; BMEdge *e; uint i; - BMO_ITER_INDEX(e, &siter, op->slots_in, "edges", BM_EDGE, i) - { + BMO_ITER_INDEX (e, &siter, op->slots_in, "edges", BM_EDGE, i) { BLI_assert(eheap_table[i] == NULL); bool ok = (BM_elem_index_get(e) != -1) && BM_edge_rotate_check(e); diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index 85f62241782..01bdf5d933a 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -205,8 +205,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys) BM_ITER_MESH (f, &fiter, sys->bm, BM_FACES_OF_MESH) { if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { - BM_ITER_ELEM_INDEX(vn, &vi, f, BM_VERTS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, i) { vf[i] = vn; } has_4_vert = (i == 4) ? 1 : 0; @@ -305,8 +304,7 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) BM_ITER_MESH (f, &fiter, sys->bm, BM_FACES_OF_MESH) { if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { - BM_ITER_ELEM_INDEX(vn, &vi, f, BM_VERTS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, i) { vf[i] = vn; } has_4_vert = (i == 4) ? 1 : 0; diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 869c61832f9..66021624025 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -1042,8 +1042,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BLI_array_grow_items(verts, face->len); totesel = 0; - BM_ITER_ELEM_INDEX(l_new, &liter, face, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l_new, &liter, face, BM_LOOPS_OF_FACE, i) { edges[i] = l_new->e; verts[i] = l_new->v; @@ -1181,8 +1180,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) /* for case of two edges, connecting them shouldn't be too hard */ BLI_array_grow_items(loops, face->len); - BM_ITER_ELEM_INDEX(l, &liter, face, BM_LOOPS_OF_FACE, a) - { + BM_ITER_ELEM_INDEX (l, &liter, face, BM_LOOPS_OF_FACE, a) { loops[a] = l; } @@ -1283,8 +1281,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) } a = 0; - BM_ITER_ELEM_INDEX(l_new, &liter, face, BM_LOOPS_OF_FACE, j) - { + BM_ITER_ELEM_INDEX (l_new, &liter, face, BM_LOOPS_OF_FACE, j) { if (l_new->v == fd->start) { a = j + 1; break; @@ -1293,8 +1290,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BLI_array_grow_items(verts, face->len); - BM_ITER_ELEM_INDEX(l_new, &liter, face, BM_LOOPS_OF_FACE, j) - { + BM_ITER_ELEM_INDEX (l_new, &liter, face, BM_LOOPS_OF_FACE, j) { b = (j - a + face->len) % face->len; verts[b] = l_new->v; } diff --git a/source/blender/bmesh/operators/bmo_subdivide_edgering.c b/source/blender/bmesh/operators/bmo_subdivide_edgering.c index c6d2910d214..6baf56f1723 100644 --- a/source/blender/bmesh/operators/bmo_subdivide_edgering.c +++ b/source/blender/bmesh/operators/bmo_subdivide_edgering.c @@ -1183,8 +1183,7 @@ void bmo_subdivide_edgering_exec(BMesh *bm, BMOperator *op) lpair_arr = BLI_array_alloca(lpair_arr, BLI_gset_len(eloop_pairs_gs)); /* first cache pairs */ - GSET_ITER_INDEX(gs_iter, eloop_pairs_gs, i) - { + GSET_ITER_INDEX (gs_iter, eloop_pairs_gs, i) { GHashPair *eloop_pair = BLI_gsetIterator_getKey(&gs_iter); struct BMEdgeLoopStore *el_store_a = (void *)eloop_pair->first; struct BMEdgeLoopStore *el_store_b = (void *)eloop_pair->second; @@ -1201,8 +1200,7 @@ void bmo_subdivide_edgering_exec(BMesh *bm, BMOperator *op) BLI_assert(bm_verts_tag_count(bm) == 0); } - GSET_ITER_INDEX(gs_iter, eloop_pairs_gs, i) - { + GSET_ITER_INDEX (gs_iter, eloop_pairs_gs, i) { GHashPair *eloop_pair = BLI_gsetIterator_getKey(&gs_iter); struct BMEdgeLoopStore *el_store_a = (void *)eloop_pair->first; struct BMEdgeLoopStore *el_store_b = (void *)eloop_pair->second; diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 6495f2b0afe..bc06d5e454b 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -503,15 +503,13 @@ static void bm_face_reverse_uvs(BMFace *f, const int cd_loop_uv_offset) float(*uvs)[2] = BLI_array_alloca(uvs, f->len); - BM_ITER_ELEM_INDEX(l, &iter, f, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); copy_v2_v2(uvs[i], luv->uv); } /* now that we have the uvs in the array, reverse! */ - BM_ITER_ELEM_INDEX(l, &iter, f, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) { /* current loop uv is the previous loop uv */ MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); copy_v2_v2(luv->uv, uvs[(f->len - i - 1)]); @@ -607,15 +605,13 @@ static void bm_face_reverse_colors(BMFace *f, const int cd_loop_color_offset) MLoopCol *cols = BLI_array_alloca(cols, f->len); - BM_ITER_ELEM_INDEX(l, &iter, f, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) { MLoopCol *lcol = BM_ELEM_CD_GET_VOID_P(l, cd_loop_color_offset); cols[i] = *lcol; } /* now that we have the uvs in the array, reverse! */ - BM_ITER_ELEM_INDEX(l, &iter, f, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) { /* current loop uv is the previous loop color */ MLoopCol *lcol = BM_ELEM_CD_GET_VOID_P(l, cd_loop_color_offset); *lcol = cols[(f->len - i - 1)]; diff --git a/source/blender/bmesh/tools/bmesh_bisect_plane.c b/source/blender/bmesh/tools/bmesh_bisect_plane.c index f314ae6848b..8ae0dfecf55 100644 --- a/source/blender/bmesh/tools/bmesh_bisect_plane.c +++ b/source/blender/bmesh/tools/bmesh_bisect_plane.c @@ -456,8 +456,7 @@ void BM_mesh_bisect_plane(BMesh *bm, /* check if either edge verts are aligned, * if so - tag and push all faces that use it into the stack */ uint j; - BM_ITER_ELEM_INDEX(v, &iter, e, BM_VERTS_OF_EDGE, j) - { + BM_ITER_ELEM_INDEX (v, &iter, e, BM_VERTS_OF_EDGE, j) { if (side[j] == 0) { if (vert_is_center_test(v) == 0) { BMIter itersub; diff --git a/source/blender/bmesh/tools/bmesh_region_match.c b/source/blender/bmesh/tools/bmesh_region_match.c index 6ddbaa6bb2e..8b9a9de3988 100644 --- a/source/blender/bmesh/tools/bmesh_region_match.c +++ b/source/blender/bmesh/tools/bmesh_region_match.c @@ -854,8 +854,7 @@ static BMFace **bm_mesh_region_match_pair( uint i; faces_result = MEM_mallocN(sizeof(*faces_result) * (faces_result_len + 1), __func__); - GHASH_ITER_INDEX(gh_iter, w_dst->faces_uuid, i) - { + GHASH_ITER_INDEX (gh_iter, w_dst->faces_uuid, i) { BMFace *f = BLI_ghashIterator_getKey(&gh_iter); faces_result[i] = f; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index d134bc1ee2e..49975407c0b 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -368,8 +368,7 @@ void scene_remove_unused_view_layers(const Depsgraph *depsgraph, void view_layer_remove_disabled_bases(const Depsgraph *depsgraph, ViewLayer *view_layer) { ListBase enabled_bases = {NULL, NULL}; - LISTBASE_FOREACH_MUTABLE(Base *, base, &view_layer->object_bases) - { + LISTBASE_FOREACH_MUTABLE (Base *, base, &view_layer->object_bases) { /* TODO(sergey): Would be cool to optimize this somehow, or make it so * builder tags bases. * diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index a433135e8b9..b4b57237943 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -4429,8 +4429,7 @@ BLI_INLINE void edit_uv_preprocess_stretch_angle(float (*auv)[2], BMLoop *l; BMIter liter; int i; - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); MLoopUV *luv_prev = BM_ELEM_CD_GET_VOID_P(l->prev, cd_loop_uv_offset); @@ -4529,8 +4528,7 @@ static void uvedit_fill_buffer_data(MeshRenderData *rdata, } } - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); if (vbo_area) { GPU_vertbuf_attr_set(vbo_area, uv_attr_id.area, vidx, &area_stretch); diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 79c1d77bbf1..15e7c2389b8 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -1231,12 +1231,13 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) # define GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(_start, _count) \ _start += _count; \ - } + } \ + ((void)0) #else # define GPU_SELECT_LOAD_IF_PICKSEL(select_id) # define GPU_SELECT_LOAD_IF_PICKSEL_CALL(call) -# define GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(start, count) +# define GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(start, count) ((void)0) # define GPU_SELECT_LOAD_IF_PICKSEL_LIST(_shgroup, _start, _count) \ _start = 0; \ _count = _shgroup->instance_count; @@ -1260,11 +1261,10 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) if (shgroup->instance_count > 0) { uint count, start; draw_geometry_prepare(shgroup, NULL); - GPU_SELECT_LOAD_IF_PICKSEL_LIST(shgroup, start, count) - { + GPU_SELECT_LOAD_IF_PICKSEL_LIST (shgroup, start, count) { draw_geometry_execute_ex(shgroup, shgroup->instance_geom, start, count, true); } - GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(start, count) + GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(start, count); } } } @@ -1273,11 +1273,10 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) if (shgroup->instance_count > 0) { uint count, start; draw_geometry_prepare(shgroup, NULL); - GPU_SELECT_LOAD_IF_PICKSEL_LIST(shgroup, start, count) - { + GPU_SELECT_LOAD_IF_PICKSEL_LIST (shgroup, start, count) { draw_geometry_execute_ex(shgroup, shgroup->batch_geom, start, count, false); } - GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(start, count) + GPU_SELECT_LOAD_IF_PICKSEL_LIST_END(start, count); } } } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index b5891a03f0a..bb0db9cf8a1 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1310,8 +1310,7 @@ static size_t animfilter_act_group(bAnimContext *ac, } /* add grouped F-Curves */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_AGRP(ac, agrp)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_AGRP(ac, agrp)) { /* special filter so that we can get just the F-Curves within the active group */ if (!(filter_mode & ANIMFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) { /* for the Graph Editor, curves may be set to not be visible in the view to lessen @@ -1510,8 +1509,7 @@ static size_t animfilter_nla_controls( /* add control curves from each NLA strip... */ /* NOTE: ANIMTYPE_FCURVES are created here, to avoid duplicating the code needed */ - BEGIN_ANIMFILTER_SUBCHANNELS(((adt->flag & ADT_NLA_SKEYS_COLLAPSED) == 0)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (((adt->flag & ADT_NLA_SKEYS_COLLAPSED) == 0)) { NlaTrack *nlt; NlaStrip *strip; @@ -1697,8 +1695,7 @@ static size_t animdata_filter_gpencil_data(ListBase *anim_data, size_t tmp_items = 0; /* add gpencil animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_GPD(gpd)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_GPD(gpd)) { tmp_items += animdata_filter_gpencil_layers_data(&tmp_data, ads, gpd, filter_mode); } END_ANIMFILTER_SUBCHANNELS; @@ -1817,8 +1814,7 @@ static size_t animdata_filter_ds_gpencil( size_t items = 0; /* add relevant animation channels for Grease Pencil */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_GPD(gpd)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_GPD(gpd)) { /* add animation channels */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, &gpd->id, filter_mode); @@ -1858,8 +1854,7 @@ static size_t animdata_filter_ds_cachefile( size_t items = 0; /* add relevant animation channels for Cache File */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_CACHEFILE_OBJD(cache_file)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_CACHEFILE_OBJD(cache_file)) { /* add animation channels */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, &cache_file->id, filter_mode); } @@ -1931,8 +1926,7 @@ static size_t animdata_filter_mask(Main *bmain, continue; /* add mask animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_MASK(mask)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_MASK(mask)) { tmp_items += animdata_filter_mask_data(&tmp_data, mask, filter_mode); } END_ANIMFILTER_SUBCHANNELS; @@ -1969,8 +1963,7 @@ static size_t animdata_filter_ds_nodetree_group(bAnimContext *ac, size_t items = 0; /* add nodetree animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_NTREE_DATA(ntree)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_NTREE_DATA(ntree)) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)ntree, filter_mode); } @@ -2061,8 +2054,7 @@ static size_t animdata_filter_ds_linestyle( linestyle->id.tag &= ~LIB_TAG_DOIT; /* add scene-level animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_LS_SCED(linestyle)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_LS_SCED(linestyle)) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)linestyle, filter_mode); } @@ -2102,8 +2094,7 @@ static size_t animdata_filter_ds_texture(bAnimContext *ac, size_t items = 0; /* add texture's animation data to temp collection */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_TEX_DATA(tex)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_TEX_DATA(tex)) { /* texture animdata */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)tex, filter_mode); @@ -2191,8 +2182,7 @@ static size_t animdata_filter_ds_material( size_t items = 0; /* add material's animation data to temp collection */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_MAT_OBJD(ma)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_MAT_OBJD(ma)) { /* material's animation data */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)ma, filter_mode); @@ -2370,8 +2360,7 @@ static size_t animdata_filter_ds_particles( continue; /* add particle-system's animation data to temp collection */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_PART_OBJD(psys->part)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_PART_OBJD(psys->part)) { /* particle system's animation data */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)psys->part, filter_mode); @@ -2505,8 +2494,7 @@ static size_t animdata_filter_ds_obdata( } /* add object data animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(expanded) - { + BEGIN_ANIMFILTER_SUBCHANNELS (expanded) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)iat, filter_mode); @@ -2556,8 +2544,7 @@ static size_t animdata_filter_ds_keyanim( size_t items = 0; /* add shapekey-level animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_SKE_OBJD(key)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_SKE_OBJD(key)) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)key, filter_mode); } @@ -2613,8 +2600,7 @@ static size_t animdata_filter_ds_obanim( }); /* add object-level animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(expanded) - { + BEGIN_ANIMFILTER_SUBCHANNELS (expanded) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)ob, filter_mode); } @@ -2650,8 +2636,7 @@ static size_t animdata_filter_dopesheet_ob( size_t items = 0; /* filter data contained under object first */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_OBJC(ob)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_OBJC(ob)) { Key *key = BKE_key_from_object(ob); /* object-level animation */ @@ -2723,8 +2708,7 @@ static size_t animdata_filter_ds_world( size_t items = 0; /* add world animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_WOR_SCED(wo)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (FILTER_WOR_SCED(wo)) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)wo, filter_mode); @@ -2785,8 +2769,7 @@ static size_t animdata_filter_ds_scene( }); /* add scene-level animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(expanded) - { + BEGIN_ANIMFILTER_SUBCHANNELS (expanded) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)sce, filter_mode); } @@ -2820,8 +2803,7 @@ static size_t animdata_filter_dopesheet_scene( size_t items = 0; /* filter data contained under object first */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_SCEC(sce)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_SCEC(sce)) { bNodeTree *ntree = sce->nodetree; bGPdata *gpd = sce->gpd; World *wo = sce->world; @@ -2883,8 +2865,7 @@ static size_t animdata_filter_ds_movieclip( size_t tmp_items = 0; size_t items = 0; /* add world animation channels */ - BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_MCLIP(clip)) - { + BEGIN_ANIMFILTER_SUBCHANNELS (EXPANDED_MCLIP(clip)) { /* animation data filtering */ tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)clip, filter_mode); } diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index 6943d6bdc54..b5d7975a0c5 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -1136,8 +1136,7 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op) /* loop over all editable bones */ // XXX the old code did this in reverse order though! - CTX_DATA_BEGIN_WITH_ID(C, EditBone *, ebone, selected_editable_bones, bArmature *, arm) - { + CTX_DATA_BEGIN_WITH_ID (C, EditBone *, ebone, selected_editable_bones, bArmature *, arm) { for (i = cuts + 1; i > 1; i--) { /* compute cut ratio first */ float cutratio = 1.0f / (float)i; diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index dfcd0bf69f7..0e6a3eb5695 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -688,8 +688,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op) /* loop over all bones, and only consider if visible */ bArmature *arm = NULL; - CTX_DATA_BEGIN_WITH_ID(C, EditBone *, ebone, visible_bones, bArmature *, arm_iter) - { + CTX_DATA_BEGIN_WITH_ID (C, EditBone *, ebone, visible_bones, bArmature *, arm_iter) { bool check = false; if (!(ebone->flag & BONE_CONNECTED) && (ebone->flag & BONE_ROOTSEL)) { fill_add_joint(ebone, 0, &points); diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 599823a6401..9c31b66a3d1 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -601,8 +601,7 @@ static int pose_autoside_names_exec(bContext *C, wmOperator *op) Object *ob_prev = NULL; /* loop through selected bones, auto-naming them */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { bArmature *arm = ob->data; BLI_strncpy(newname, pchan->name, sizeof(newname)); if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis])) { @@ -659,8 +658,7 @@ static int pose_bone_rotmode_exec(bContext *C, wmOperator *op) Object *prev_ob = NULL; /* set rotation mode of selected bones */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { pchan->rotmode = mode; if (prev_ob != ob) { @@ -887,8 +885,7 @@ static int pose_bone_layers_exec(bContext *C, wmOperator *op) Object *prev_ob = NULL; /* set layers of pchans based on the values set in the operator props */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { /* get pointer for pchan, and write flags this way */ RNA_pointer_create((ID *)ob->data, &RNA_Bone, pchan->bone, &ptr); RNA_boolean_set_array(&ptr, "layers", layers); @@ -964,8 +961,7 @@ static int armature_bone_layers_exec(bContext *C, wmOperator *op) RNA_boolean_get_array(op->ptr, "layers", layers); /* set layers of pchans based on the values set in the operator props */ - CTX_DATA_BEGIN_WITH_ID(C, EditBone *, ebone, selected_editable_bones, bArmature *, arm) - { + CTX_DATA_BEGIN_WITH_ID (C, EditBone *, ebone, selected_editable_bones, bArmature *, arm) { /* get pointer for pchan, and write flags this way */ RNA_pointer_create((ID *)arm, &RNA_EditBone, ebone, &ptr); RNA_boolean_set_array(&ptr, "layers", layers); diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index b825d821fe8..d26eb7e904d 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -444,8 +444,7 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op) Object *ob_prev = NULL; /* Set the flags */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) { bArmature *arm = ob->data; pose_do_bone_select(pchan, action); @@ -741,8 +740,7 @@ static bool pose_select_same_group(bContext *C, bool extend) group_flags = NULL; ob_index = -1; ob_prev = NULL; - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, visible_pose_bones, Object, *ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object, *ob) { if (ob != ob_prev) { ob_index++; group_flags = group_flags_array + (ob_index * groups_len); @@ -768,8 +766,7 @@ static bool pose_select_same_group(bContext *C, bool extend) ob_index = -1; ob_prev = NULL; /* only if group matches (and is not selected or current bone) */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) { if (ob != ob_prev) { ob_index++; group_flags = group_flags_array + (ob_index * groups_len); @@ -824,8 +821,7 @@ static bool pose_select_same_layer(bContext *C, bool extend) layers = NULL; ob_prev = NULL; ob_index = -1; - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) { if (ob != ob_prev) { layers = &layers_array[++ob_index]; ob_prev = ob; @@ -856,8 +852,7 @@ static bool pose_select_same_layer(bContext *C, bool extend) /* Select bones that are on same layers as layers flag. */ ob_prev = NULL; ob_index = -1; - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) { if (ob != ob_prev) { layers = &layers_array[++ob_index]; ob_prev = ob; diff --git a/source/blender/editors/armature/pose_utils.c b/source/blender/editors/armature/pose_utils.c index d8793bc2a1e..844fce49d28 100644 --- a/source/blender/editors/armature/pose_utils.c +++ b/source/blender/editors/armature/pose_utils.c @@ -148,8 +148,7 @@ void poseAnim_mapping_get(bContext *C, ListBase *pfLinks) prev_ob = NULL; ob_pose_armature = NULL; - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { if (ob != prev_ob) { prev_ob = ob; ob_pose_armature = poseAnim_object_get(ob); @@ -169,8 +168,7 @@ void poseAnim_mapping_get(bContext *C, ListBase *pfLinks) if (BLI_listbase_is_empty(pfLinks)) { prev_ob = NULL; ob_pose_armature = NULL; - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) { if (ob != prev_ob) { prev_ob = ob; ob_pose_armature = poseAnim_object_get(ob); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 7d318fb16e1..7aa7c2e6114 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -573,8 +573,7 @@ UvVertMap *BM_uv_vert_map_create(BMesh *bm, tf_uv = (float(*)[2])BLI_buffer_reinit_data(&tf_uv_buf, vec2f, efa->len); } - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { buf->loop_of_poly_index = i; buf->poly_index = a; buf->separate = 0; @@ -723,8 +722,7 @@ UvElementMap *BM_uv_element_map_create(BMesh *bm, tf_uv = (float(*)[2])BLI_buffer_reinit_data(&tf_uv_buf, vec2f, efa->len); } - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { buf->l = l; buf->separate = 0; buf->island = INVALID_ISLAND; diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 2f4fbcab9bc..580221496ca 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -183,8 +183,7 @@ static void mesh_uv_reset_bmface(BMFace *f, const int cd_loop_uv_offset) BMLoop *l; int i; - BM_ITER_ELEM_INDEX(l, &liter, f, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, f, BM_LOOPS_OF_FACE, i) { fuv[i] = ((MLoopUV *)BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset))->uv; } diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 0b22dec99c7..e0de4b8faef 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -139,8 +139,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* now add all selected objects to the collection(s) */ - FOREACH_COLLECTION_BEGIN(bmain, scene, Collection *, collection) - { + FOREACH_COLLECTION_BEGIN (bmain, scene, Collection *, collection) { if (single_collection && collection != single_collection) continue; if (!BKE_collection_has_object(collection, ob)) @@ -220,8 +219,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) /* Linking to same collection requires its own loop so we can avoid * looking up the active objects collections each time. */ - FOREACH_COLLECTION_BEGIN(bmain, scene, Collection *, collection) - { + FOREACH_COLLECTION_BEGIN (bmain, scene, Collection *, collection) { if (single_collection && collection != single_collection) continue; @@ -319,8 +317,7 @@ static int collection_objects_remove_exec(bContext *C, wmOperator *op) if (ob == NULL) return OPERATOR_CANCELLED; - FOREACH_COLLECTION_BEGIN(bmain, scene, Collection *, collection) - { + FOREACH_COLLECTION_BEGIN (bmain, scene, Collection *, collection) { if (single_collection && collection != single_collection) continue; if (!BKE_collection_has_object(collection, ob)) diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index c571fc6821e..39eb4b9333c 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1479,8 +1479,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) Object *prev_ob = NULL; /* free constraints for all selected bones */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { BKE_constraints_free(&pchan->constraints); pchan->constflag &= ~(PCHAN_HAS_IK | PCHAN_HAS_SPLINEIK | PCHAN_HAS_CONST); @@ -1561,8 +1560,7 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) Object *prev_ob = NULL; /* copy all constraints from active posebone to all selected posebones */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, chan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, chan, selected_pose_bones, Object *, ob) { /* if we're not handling the object we're copying from, copy all constraints over */ if (pchan != chan) { BKE_constraints_copy(&chan->constraints, &pchan->constraints, true); @@ -2129,8 +2127,7 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op)) Object *prev_ob = NULL; /* only remove IK Constraints */ - CTX_DATA_BEGIN_WITH_ID(C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) - { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { bConstraint *con, *next; /* TODO: should we be checking if these constraints were local before we try and remove them? */ diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 6cfb5ce8202..72c420f00cb 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -2101,8 +2101,7 @@ static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEv /* Tag all IDs having zero users. */ ID *id; - FOREACH_MAIN_ID_BEGIN(bmain, id) - { + FOREACH_MAIN_ID_BEGIN (bmain, id) { outliner_orphans_purge_tag(id, num_tagged); } FOREACH_MAIN_ID_END; @@ -2149,8 +2148,7 @@ static int outliner_orphans_purge_exec(bContext *C, wmOperator *op) if ((num_tagged[INDEX_ID_NULL] = RNA_int_get(op->ptr, "num_deleted")) == 0) { /* Tag all IDs having zero users. */ ID *id; - FOREACH_MAIN_ID_BEGIN(bmain, id) - { + FOREACH_MAIN_ID_BEGIN (bmain, id) { outliner_orphans_purge_tag(id, num_tagged); } FOREACH_MAIN_ID_END; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d4837084a5f..499971b9a50 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2686,8 +2686,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve if ((prop = RNA_struct_find_property(op->ptr, "preserve_clnor"))) { if ((t->flag & T_EDIT) && t->obedit_type == OB_MESH) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if ((((Mesh *)(tc->obedit->data))->flag & ME_AUTOSMOOTH)) { BMEditMesh *em = NULL; // BKE_editmesh_from_object(t->obedit); bool do_skip = false; @@ -2780,8 +2779,7 @@ int transformEnd(bContext *C, TransInfo *t) } else { if (t->flag & T_CLNOR_REBUILD) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); BM_lnorspace_rebuild(em->bm, true); } @@ -3364,8 +3362,7 @@ static void Bend(TransInfo *t, const int UNUSED(mval[2])) } /* TODO(campbell): xform, compensate object center. */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; float warp_sta_local[3]; @@ -3591,8 +3588,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2])) mul_m3_series(totmat, axismat_inv, smat, axismat); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { const float *center, *co; @@ -3947,8 +3943,7 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2])) copy_m3_m3(t->mat, mat); // used in gizmo - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -3969,8 +3964,7 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2])) t->con.applySize(t, NULL, NULL, mat); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) ElementResize(t, tc, td, mat); @@ -4057,8 +4051,7 @@ static void applySkinResize(TransInfo *t, const int UNUSED(mval[2])) headerResize(t, size, str); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { float tmat[3][3], smat[3][3]; @@ -4123,8 +4116,7 @@ static void initToSphere(TransInfo *t) t->flag |= T_NO_CONSTRAINT; // Calculate average radius - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { t->val += len_v3v3(tc->center_local, td->iloc); @@ -4164,8 +4156,7 @@ static void applyToSphere(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("To Sphere: %.4f %s"), ratio, t->proptext); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { float tratio; @@ -4519,8 +4510,7 @@ static void applyRotationValue(TransInfo *t, float angle, float axis[3]) axis_angle_normalized_to_mat3(mat, axis, angle); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { @@ -4621,8 +4611,7 @@ static void applyTrackballValue(TransInfo *t, angle = normalize_v3(axis); axis_angle_normalized_to_mat3(mat, axis, angle); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -4763,8 +4752,7 @@ static void initNormalRotation(TransInfo *t) t->num.unit_use_radians = (t->scene->unit.system_rotation == USER_UNIT_ROT_RADIANS); t->num.unit_type[0] = B_UNIT_ROTATION; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); BMesh *bm = em->bm; @@ -4786,8 +4774,7 @@ static void applyNormalRotation(TransInfo *t, const int UNUSED(mval[2])) t->con.applyRot(t, NULL, NULL, axis_final, NULL); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); BMesh *bm = em->bm; @@ -5074,8 +5061,7 @@ static void applyTranslationValue(TransInfo *t, const float vec[3]) /* The ideal would be "apply_snap_align_rotation" only when a snap point is found * so, maybe inside this function is not the best place to apply this rotation. * but you need "handle snapping rotation before doing the translation" (really?) */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { float pivot[3]; if (apply_snap_align_rotation) { @@ -5295,8 +5281,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0)); /* done with header string */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { float tdistance; /* temp dist */ @@ -5378,8 +5363,7 @@ static void applyTilt(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Tilt: %.2f° %s"), RAD2DEGF(final), t->proptext); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5456,8 +5440,7 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Shrink/Fatten: %3f"), ratio); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5543,8 +5526,7 @@ static void applyMaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) if (ratio > 1.0f) { initial_feather = true; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5560,8 +5542,7 @@ static void applyMaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) } /* apply shrink/fatten */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (td = tc->data, i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5646,8 +5627,7 @@ static void applyGPShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Shrink/Fatten: %3f"), ratio); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5726,8 +5706,7 @@ static void applyGPOpacity(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Opacity: %3f"), ratio); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5806,8 +5785,7 @@ static void applyPushPull(TransInfo *t, const int UNUSED(mval[2])) t->con.applyRot(t, NULL, NULL, axis_global, NULL); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5905,8 +5883,7 @@ static void applyBevelWeight(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Bevel Weight: %.3f %s"), weight, t->proptext); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -5989,8 +5966,7 @@ static void applyCrease(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Crease: %.3f %s"), crease, t->proptext); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -6131,8 +6107,7 @@ static void applyBoneSize(TransInfo *t, const int UNUSED(mval[2])) headerBoneSize(t, size, str); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -6202,8 +6177,7 @@ static void applyBoneEnvelope(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Envelope: %3f"), ratio); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -6500,13 +6474,11 @@ static void slide_origdata_interp_data_vert(SlideOrigData *sod, float(*faces_center)[3] = BLI_array_alloca(faces_center, l_num); BMLoop *l; - BM_ITER_ELEM_INDEX(l, &liter, sv->v, BM_LOOPS_OF_VERT, j) - { + BM_ITER_ELEM_INDEX (l, &liter, sv->v, BM_LOOPS_OF_VERT, j) { BM_face_calc_center_median(l->f, faces_center[j]); } - BM_ITER_ELEM_INDEX(l, &liter, sv->v, BM_LOOPS_OF_VERT, j) - { + BM_ITER_ELEM_INDEX (l, &liter, sv->v, BM_LOOPS_OF_VERT, j) { BMFace *f_copy = BLI_ghash_lookup(sod->origfaces, l->f); float f_copy_center[3]; BMIter liter_other; @@ -6515,8 +6487,7 @@ static void slide_origdata_interp_data_vert(SlideOrigData *sod, BM_face_calc_center_median(f_copy, f_copy_center); - BM_ITER_ELEM_INDEX(l_other, &liter_other, sv->v, BM_LOOPS_OF_VERT, j_other) - { + BM_ITER_ELEM_INDEX (l_other, &liter_other, sv->v, BM_LOOPS_OF_VERT, j_other) { BM_face_interp_multires_ex(bm, l_other->f, f_copy, @@ -7563,8 +7534,7 @@ static bool createEdgeSlideVerts_single_side(TransInfo *t, TransDataContainer *t void projectEdgeSlideData(TransInfo *t, bool is_final) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; SlideOrigData *sod = &sld->orig_data; @@ -7634,14 +7604,12 @@ static void initEdgeSlide_ex( } if (use_double_side) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { ok |= createEdgeSlideVerts_double_side(t, tc); } } else { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { ok |= createEdgeSlideVerts_single_side(t, tc); } } @@ -7651,8 +7619,7 @@ static void initEdgeSlide_ex( return; } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { sld = tc->custom.mode.data; if (!sld) { continue; @@ -7864,8 +7831,7 @@ static void doEdgeSlide(TransInfo *t, float perc) if (is_clamp) { const int side_index = (perc < 0.0f); const float perc_final = fabsf(perc); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; TransDataEdgeSlideVert *sv = sld->sv; for (int i = 0; i < sld->totsv; i++, sv++) { @@ -7878,8 +7844,7 @@ static void doEdgeSlide(TransInfo *t, float perc) const float perc_init = fabsf(perc) * ((sld_active->curr_side_unclamp == (perc < 0.0f)) ? 1 : -1); const int side_index = sld_active->curr_side_unclamp; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; TransDataEdgeSlideVert *sv = sld->sv; for (int i = 0; i < sld->totsv; i++, sv++) { @@ -7915,8 +7880,7 @@ static void doEdgeSlide(TransInfo *t, float perc) float co_a[3]; float co_b[3]; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; TransDataEdgeSlideVert *sv = sld->sv; for (int i = 0; i < sld->totsv; i++, sv++) { @@ -8220,8 +8184,7 @@ static bool createVertSlideVerts(TransInfo *t, TransDataContainer *tc) void projectVertSlideData(TransInfo *t, bool is_final) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { VertSlideData *sld = tc->custom.mode.data; SlideOrigData *sod = &sld->orig_data; if (sod->use_origfaces == true) { @@ -8289,8 +8252,7 @@ static void initVertSlide_ex(TransInfo *t, bool use_even, bool flipped, bool use } bool ok = false; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { ok |= createVertSlideVerts(t, tc); VertSlideData *sld = tc->custom.mode.data; if (sld) { @@ -8509,8 +8471,7 @@ static void doVertSlide(TransInfo *t, float perc) slp->perc = perc; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { VertSlideData *sld = tc->custom.mode.data; TransDataVertSlideVert *svlist = sld->sv, *sv; int i; @@ -8658,8 +8619,7 @@ static void applyBoneRoll(TransInfo *t, const int UNUSED(mval[2])) } /* set roll values */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -8745,8 +8705,7 @@ static void applyBakeTime(TransInfo *t, const int mval[2]) BLI_snprintf(str, sizeof(str), IFACE_("Time: %.3f %s"), time, t->proptext); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -8812,8 +8771,7 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), IFACE_("Mirror%s"), t->con.text); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -8835,8 +8793,7 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2])) size_to_mat3(mat, size); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -8879,8 +8836,7 @@ static void applyAlign(TransInfo *t, const int UNUSED(mval[2])) float center[3]; int i; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { /* saving original center */ copy_v3_v3(center, tc->center_local); TransData *td = tc->data; @@ -8978,8 +8934,7 @@ static void applySeqSlideValue(TransInfo *t, const float val[2]) { int i; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_NOACTION) @@ -9231,8 +9186,7 @@ static void applyTimeTranslateValue(TransInfo *t) float deltax, val /* , valprev */; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; TransData2D *td2d = tc->data_2d; /* It doesn't matter whether we apply to t->data or @@ -9341,8 +9295,7 @@ static void initTimeSlide(TransInfo *t) float min = 999999999.0f, max = -999999999.0f; int i; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { AnimData *adt = (t->spacetype != SPACE_NLA) ? td->extra : NULL; @@ -9424,8 +9377,7 @@ static void applyTimeSlideValue(TransInfo *t, float sval) /* It doesn't matter whether we apply to t->data or * t->data2d, but t->data2d is more convenient. */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { /* it is assumed that td->extra is a pointer to the AnimData, @@ -9572,8 +9524,7 @@ static void applyTimeScaleValue(TransInfo *t) const short autosnap = getAnimEdit_SnapMode(t); const double secf = FPS; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; TransData2D *td2d = tc->data_2d; for (i = 0; i < tc->data_len; i++, td++, td2d++) { diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 3e58cecd42b..9414d5862b6 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -874,8 +874,7 @@ static void drawObjectConstraint(TransInfo *t) int i; float tmp_axismtx[3][3]; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { float co[3]; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 4f288f56f8f..49817db35a8 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -187,8 +187,7 @@ static void sort_trans_data_dist_container(const TransInfo *t, TransDataContaine } void sort_trans_data_dist(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { sort_trans_data_dist_container(t, tc); } } @@ -222,8 +221,7 @@ static void sort_trans_data_container(TransDataContainer *tc) } static void sort_trans_data(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { sort_trans_data_container(tc); } } @@ -248,8 +246,7 @@ static void set_prop_dist(TransInfo *t, const bool with_dist) } } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *tob = tc->data; for (a = 0; a < tc->data_len; a++, tob++) { @@ -453,8 +450,7 @@ static void createTransCursor_view3d(TransInfo *t) static void createTransEdge(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); TransData *td = NULL; @@ -947,8 +943,7 @@ void transform_autoik_update(TransInfo *t, short mode) /* apply to all pose-channels */ bool changed = false; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { /* sanity checks (don't assume t->poseobj is set, or that it is an armature) */ if (ELEM(NULL, tc->poseobj, tc->poseobj->pose)) { @@ -1193,8 +1188,7 @@ static void createTransPose(TransInfo *t) bool has_translate_rotate_buf[2] = {false, false}; bool *has_translate_rotate = (t->mode == TFM_TRANSLATION) ? has_translate_rotate_buf : NULL; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Object *ob = tc->poseobj; bArmature *arm; @@ -1240,8 +1234,7 @@ static void createTransPose(TransInfo *t) } } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->data_len == 0) { continue; } @@ -1331,8 +1324,7 @@ static void createTransArmatureVerts(TransInfo *t) { t->data_len_all = 0; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { EditBone *ebo, *eboflip; bArmature *arm = tc->obedit->data; ListBase *edbo = arm->edbo; @@ -1385,8 +1377,7 @@ static void createTransArmatureVerts(TransInfo *t) transform_around_single_fallback(t); t->data_len_all = -1; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (!tc->data_len) { continue; } @@ -1579,8 +1570,7 @@ static void createTransArmatureVerts(TransInfo *t) static void createTransMBallVerts(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { MetaBall *mb = (MetaBall *)tc->obedit->data; MetaElem *ml; TransData *td; @@ -1766,8 +1756,7 @@ static void createTransCurveVerts(TransInfo *t) t->data_len_all = 0; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Curve *cu = tc->obedit->data; BLI_assert(cu->editnurb != NULL); BezTriple *bezt; @@ -1830,8 +1819,7 @@ static void createTransCurveVerts(TransInfo *t) transform_around_single_fallback(t); t->data_len_all = -1; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->data_len == 0) { continue; } @@ -2087,8 +2075,7 @@ static void createTransCurveVerts(TransInfo *t) static void createTransLatticeVerts(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Lattice *latt = ((Lattice *)tc->obedit->data)->editlatt->latt; TransData *td = NULL; @@ -2155,8 +2142,7 @@ static void createTransLatticeVerts(TransInfo *t) /* ******************* particle edit **************** */ static void createTransParticleVerts(bContext *C, TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = NULL; TransDataExtension *tx; @@ -2284,8 +2270,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) void flushTransParticles(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Scene *scene = t->scene; ViewLayer *view_layer = t->view_layer; Object *ob = OBACT(view_layer); @@ -2739,8 +2724,7 @@ static void VertsToTransData(TransInfo *t, static void createTransEditVerts(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *tob = NULL; TransDataExtension *tx = NULL; BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); @@ -3011,8 +2995,7 @@ void flushTransNodes(TransInfo *t) { const float dpi_fac = UI_DPI_FAC; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { int a; TransData *td; TransData2D *td2d; @@ -3260,8 +3243,7 @@ static void createTransUVs(bContext *C, TransInfo *t) const bool is_prop_connected = (t->flag & T_PROP_CONNECTED) != 0; const bool is_island_center = (t->around == V3D_AROUND_LOCAL_ORIGINS); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = NULL; TransData2D *td2d = NULL; @@ -3426,8 +3408,7 @@ void flushTransUVs(TransInfo *t) const bool use_pixel_snap = ((sima->pixel_snap_mode != SI_PIXEL_SNAP_DISABLED) && (t->state != TRANS_CANCEL)); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData2D *td; int a; float aspect_inv[2], size[2]; @@ -3478,8 +3459,7 @@ bool clipUVTransform(TransInfo *t, float vec[2], const bool resize) max[0] = t->aspect[0]; max[1] = t->aspect[1]; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td; int a; @@ -3525,8 +3505,7 @@ bool clipUVTransform(TransInfo *t, float vec[2], const bool resize) void clipUVData(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (int a = 0; a < tc->data_len; a++, td++) { if (td->flag & TD_NOACTION) @@ -6687,8 +6666,7 @@ static void special_aftertrans_update__mesh(bContext *UNUSED(C), TransInfo *t) { /* so automerge supports mirror */ if ((t->scene->toolsettings->automerge) && ((t->flag & T_EDIT) && t->obedit_type == OB_MESH)) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); BMesh *bm = em->bm; @@ -6760,8 +6738,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) * really slow -joeedh */ projectEdgeSlideData(t, true); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; /* Free temporary faces to avoid auto-merging and deleting @@ -6772,8 +6749,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->mode == TFM_VERT_SLIDE) { /* as above */ projectVertSlideData(t, true); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { VertSlideData *sld = tc->custom.mode.data; freeVertSlideTempFaces(sld); } @@ -7073,8 +7049,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) } else if (t->flag & T_EDIT) { if (t->obedit_type == OB_MESH) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); /* table needs to be created for each edit command, since vertices can move etc */ ED_mesh_mirror_spatial_table(tc->obedit, em, NULL, NULL, 'e'); @@ -7087,8 +7062,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* Handle the exception where for TFM_BONESIZE in edit mode we pretend to be * in pose mode (to use bone orientation matrix), * in that case we don't do operations like autokeyframing. */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { ob = tc->poseobj; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } @@ -7096,8 +7070,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->flag & T_POSE) { GSet *motionpath_updates = BLI_gset_ptr_new("motionpath updates"); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { bArmature *arm; bPoseChannel *pchan; @@ -9008,8 +8981,7 @@ void createTransData(bContext *C, TransInfo *t) else if (t->options & CTX_EDGE) { /* Multi object editing. */ initTransDataContainers_FromObjectData(t, ob, NULL, 0); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { tc->data_ext = NULL; } t->flag |= T_EDIT; @@ -9164,8 +9136,7 @@ void createTransData(bContext *C, TransInfo *t) /* Multi object editing. */ initTransDataContainers_FromObjectData(t, ob, NULL, 0); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { tc->data_ext = NULL; } if (t->obedit_type == OB_MESH) { @@ -9216,8 +9187,7 @@ void createTransData(bContext *C, TransInfo *t) t->flag |= T_POSE; t->obedit_type = -1; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { tc->poseobj = tc->obedit; tc->obedit = NULL; } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index eebb6382ccd..09593a44a54 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -126,8 +126,7 @@ void getViewVector(const TransInfo *t, const float coord[3], float vec[3]) static void clipMirrorModifier(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Object *ob = tc->obedit; ModifierData *md = ob->modifiers.first; float tolerance[3] = {0.0f, 0.0f, 0.0f}; @@ -221,8 +220,7 @@ static void clipMirrorModifier(TransInfo *t) /* assumes obedit set to mesh object */ static void editbmesh_apply_to_mirror(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->mirror.axis_flag) { TransData *td = tc->data; BMVert *eve; @@ -702,8 +700,7 @@ static void recalcData_image(TransInfo *t) if (sima->flag & SI_LIVE_UNWRAP) ED_uvedit_live_unwrap_re_solve(); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->data_len) { DEG_id_tag_update(tc->obedit->data, 0); } @@ -770,8 +767,7 @@ static void recalcData_objects(TransInfo *t) applyProject(t); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Curve *cu = tc->obedit->data; ListBase *nurbs = BKE_curve_editNurbs_get(cu); Nurb *nu = nurbs->first; @@ -801,8 +797,7 @@ static void recalcData_objects(TransInfo *t) applyProject(t); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Lattice *la = tc->obedit->data; DEG_id_tag_update(tc->obedit->data, 0); /* sets recalc flags */ if (la->editlatt->latt->flag & LT_OUTSIDE) { @@ -828,8 +823,7 @@ static void recalcData_objects(TransInfo *t) projectVertSlideData(t, false); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { DEG_id_tag_update(tc->obedit->data, 0); /* sets recalc flags */ BMEditMesh *em = BKE_editmesh_from_object(tc->obedit); EDBM_mesh_normals_update(em); @@ -842,8 +836,7 @@ static void recalcData_objects(TransInfo *t) applyProject(t); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { bArmature *arm = tc->obedit->data; ListBase *edbo = arm->edbo; EditBone *ebo, *ebo_parent; @@ -938,8 +931,7 @@ static void recalcData_objects(TransInfo *t) if (t->state != TRANS_CANCEL) { applyProject(t); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->data_len) { DEG_id_tag_update(tc->obedit->data, 0); /* sets recalc flags */ } @@ -949,8 +941,7 @@ static void recalcData_objects(TransInfo *t) else if (t->flag & T_POSE) { GSet *motionpath_updates = BLI_gset_ptr_new("motionpath updates"); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { Object *ob = tc->poseobj; bArmature *arm = ob->data; @@ -1008,8 +999,7 @@ static void recalcData_objects(TransInfo *t) applyProject(t); } - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (int i = 0; i < tc->data_len; i++, td++) { @@ -1726,8 +1716,7 @@ static void freeTransCustomDataContainer(TransInfo *t, void freeTransCustomDataForMode(TransInfo *t) { freeTransCustomData(t, NULL, &t->custom.mode); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { freeTransCustomData(t, tc, &tc->custom.mode); } } @@ -1750,15 +1739,13 @@ void postTrans(bContext *C, TransInfo *t) /* Free all custom-data */ freeTransCustomDataContainer(t, NULL, &t->custom); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { freeTransCustomDataContainer(t, tc, &tc->custom); } /* postTrans can be called when nothing is selected, so data is NULL already */ if (t->data_len_all != 0) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { /* free data malloced per trans-data */ if (ELEM(t->obedit_type, OB_CURVE, OB_SURF) || (t->spacetype == SPACE_GRAPH)) { TransData *td = tc->data; @@ -1864,8 +1851,7 @@ static void restoreElement(TransData *td) void restoreTransObjects(TransInfo *t) { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td; TransData2D *td2d; @@ -1901,8 +1887,7 @@ void calculateCenterLocal(TransInfo *t, const float center_global[3]) { /* setting constraint center */ /* note, init functions may over-ride t->center */ - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->use_local_mat) { mul_v3_m4v3(tc->center_local, tc->imat, center_global); } @@ -1994,8 +1979,7 @@ void calculateCenterMedian(TransInfo *t, float r_center[3]) float partial[3] = {0.0f, 0.0f, 0.0f}; int total = 0; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { for (int i = 0; i < tc->data_len; i++) { if (tc->data[i].flag & TD_SELECTED) { if (!(tc->data[i].flag & TD_NOCENTER)) { @@ -2023,8 +2007,7 @@ void calculateCenterBound(TransInfo *t, float r_center[3]) float max[3], min[3]; bool changed = false; INIT_MINMAX(min, max); - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { for (int i = 0; i < tc->data_len; i++) { if (tc->data[i].flag & TD_SELECTED) { if (!(tc->data[i].flag & TD_NOCENTER)) { @@ -2213,8 +2196,7 @@ void calculatePropRatio(TransInfo *t) if (t->flag & T_PROP_EDIT) { const char *pet_id = NULL; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_SELECTED) { @@ -2325,8 +2307,7 @@ void calculatePropRatio(TransInfo *t) } } else { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { td->factor = 1.0; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index d8e80265bec..da32908363a 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -289,8 +289,7 @@ void applyProject(TransInfo *t) float tvec[3]; int i; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (i = 0; i < tc->data_len; i++, td++) { float iloc[3], loc[3], no[3]; @@ -391,8 +390,7 @@ void applyGridAbsolute(TransInfo *t) if (grid_size == 0.0f) return; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td; for (i = 0, td = tc->data; i < tc->data_len; i++, td++) { @@ -1124,8 +1122,7 @@ static void TargetSnapMedian(TransInfo *t) t->tsnap.snapTarget[1] = 0; t->tsnap.snapTarget[2] = 0; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; int i; float v[3]; @@ -1161,8 +1158,7 @@ static void TargetSnapClosest(TransInfo *t) /* Object mode */ if (t->flag & T_OBJECT) { int i; - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; for (td = tc->data, i = 0; i < tc->data_len && td->flag & TD_SELECTED; i++, td++) { struct BoundBox *bb = BKE_object_boundbox_get(td->ob); @@ -1207,8 +1203,7 @@ static void TargetSnapClosest(TransInfo *t) } } else { - FOREACH_TRANS_DATA_CONTAINER(t, tc) - { + FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; int i; for (i = 0; i < tc->data_len && td->flag & TD_SELECTED; i++, td++) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index d1e63ad2986..f6182fa4318 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -756,8 +756,7 @@ bool uv_find_nearest_edge( if (!uvedit_face_visible_test(scene, obedit, ima, efa)) { continue; } - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); luv_next = BM_ELEM_CD_GET_VOID_P(l->next, cd_loop_uv_offset); @@ -901,8 +900,7 @@ bool uv_find_nearest_vert(Scene *scene, BMIter liter; BMLoop *l; int i; - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { float dist_test_sq; MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); if (penalty_dist != 0.0f && uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) { @@ -1306,8 +1304,7 @@ static void uv_select_linked_multi(Scene *scene, efa = BM_face_at_index(em->bm, a); - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { /* make_uv_vert_map_EM sets verts tmp.l to the indices */ vlist = BM_uv_vert_map_at_index(vmap, BM_elem_index_get(l->v)); @@ -2513,8 +2510,7 @@ static int uv_mouse_select_multi( hitv = BLI_array_alloca(hitv, hit.efa->len); hituv = BLI_array_alloca(hituv, hit.efa->len); - BM_ITER_ELEM_INDEX(l, &liter, hit.efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, hit.efa, BM_LOOPS_OF_FACE, i) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); hituv[i] = luv->uv; hitv[i] = BM_elem_index_get(l->v); diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 71a3fdf055e..54fe4188470 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1248,8 +1248,7 @@ static int stitch_process_data(StitchStateContainer *ssc, int face_preview_pos = preview_position[index].data_position; if (face_preview_pos != STITCH_NO_PREVIEW) { preview->uvs_per_polygon[preview_position[index].polycount_position] = efa->len; - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { luv = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_MLOOPUV); copy_v2_v2(preview->preview_polys + face_preview_pos + i * 2, luv->uv); } @@ -1260,8 +1259,7 @@ static int stitch_process_data(StitchStateContainer *ssc, BMLoop *fl = BM_FACE_FIRST_LOOP(efa); MLoopUV *fuv = CustomData_bmesh_get(&bm->ldata, fl->head.data, CD_MLOOPUV); - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { if (i < numoftris) { /* using next since the first uv is already accounted for */ BMLoop *lnext = l->next; @@ -2143,8 +2141,7 @@ static StitchState *stitch_init(bContext *C, "uv_stitch_selection_stack"); BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) { UvElement *element = BM_uv_element_get(state->element_map, efa, l); if (element) { diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 0caa478ffa9..cf0a6adbfc5 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -251,8 +251,7 @@ static void construct_param_handle_face_add( /* let parametrizer split the ngon, it can make better decisions * about which split is best for unwrapping than scanfill */ - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); vkeys[i] = (ParamKey)BM_elem_index_get(l->v); @@ -1992,8 +1991,7 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa) const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); - BM_ITER_ELEM_INDEX(l, &liter, efa, BM_LOOPS_OF_FACE, i) - { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); uvs[i] = luv->uv; } diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 4863da8ab18..c36b09c5a90 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -941,8 +941,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else if (channels_in_float == 3) { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 3) { r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0])); g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[1])); b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[2])); @@ -951,8 +950,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 1) { r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0])); g[i] = b[i] = r[i]; a[i] = 255; @@ -971,8 +969,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else if (channels_in_float == 3) { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 3) { r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0])); g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[1])); b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[2])); @@ -980,8 +977,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 1) { r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0])); g[i] = b[i] = r[i]; } @@ -1003,8 +999,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else if (channels_in_float == 3) { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 3) { r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0])); g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[1])); b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[2])); @@ -1013,8 +1008,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 1) { r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0])); g[i] = b[i] = r[i]; a[i] = 4095; @@ -1033,8 +1027,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else if (channels_in_float == 3) { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 3) { r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0])); g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[1])); b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[2])); @@ -1042,8 +1035,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 1) { r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0])); g[i] = b[i] = r[i]; } @@ -1065,8 +1057,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else if (channels_in_float == 3) { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 3) { r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0])); g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[1])); b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[2])); @@ -1075,8 +1066,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 1) { r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0])); g[i] = b[i] = r[i]; a[i] = 65535; @@ -1095,8 +1085,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else if (channels_in_float == 3) { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 3) { r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0])); g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[1])); b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[2])); @@ -1104,8 +1093,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) PIXEL_LOOPER_END; } else { - PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1) - { + PIXEL_LOOPER_BEGIN_CHANNELS (rect_float, 1) { r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0])); g[i] = b[i] = r[i]; } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index c76e243e100..7fb89ff6c7d 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -2076,7 +2076,8 @@ static void rna_def_mproperties(BlenderRNA *brna) prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); \ RNA_def_property_float_sdna(prop, NULL, "f"); \ RNA_def_property_ui_text(prop, "Value", ""); \ - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); \ + ((void)0) /* Int */ # define MESH_INT_PROPERTY_LAYER(elemname) \ @@ -2116,7 +2117,8 @@ static void rna_def_mproperties(BlenderRNA *brna) prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE); \ RNA_def_property_int_sdna(prop, NULL, "i"); \ RNA_def_property_ui_text(prop, "Value", ""); \ - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); \ + ((void)0) /* String */ # define MESH_STRING_PROPERTY_LAYER(elemname) \ @@ -2163,12 +2165,12 @@ static void rna_def_mproperties(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Value", ""); \ RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - MESH_FLOAT_PROPERTY_LAYER("Vertex") - MESH_FLOAT_PROPERTY_LAYER("Polygon") - MESH_INT_PROPERTY_LAYER("Vertex") - MESH_INT_PROPERTY_LAYER("Polygon") - MESH_STRING_PROPERTY_LAYER("Vertex") - MESH_STRING_PROPERTY_LAYER("Polygon") + MESH_FLOAT_PROPERTY_LAYER("Vertex"); + MESH_FLOAT_PROPERTY_LAYER("Polygon"); + MESH_INT_PROPERTY_LAYER("Vertex"); + MESH_INT_PROPERTY_LAYER("Polygon"); + MESH_STRING_PROPERTY_LAYER("Vertex"); + MESH_STRING_PROPERTY_LAYER("Polygon"); # undef MESH_PROPERTY_LAYER } diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c index 401dded5188..f9196f7f100 100644 --- a/source/blender/python/bmesh/bmesh_py_ops_call.c +++ b/source/blender/python/bmesh/bmesh_py_ops_call.c @@ -358,8 +358,7 @@ static int bpy_slot_from_py(BMesh *bm, BMO_slot_buffer_alloc(bmop, bmop->slots_in, slot_name, tot); i = 0; - BM_ITER_BPY_BM_SEQ(ele, &iter, ((BPy_BMElemSeq *)value)) - { + BM_ITER_BPY_BM_SEQ (ele, &iter, ((BPy_BMElemSeq *)value)) { slot->data.buf[i] = ele; i++; } diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 279208993a0..f540b2e102c 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -2593,8 +2593,7 @@ static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self) int index = 0; const char htype = bm_iter_itype_htype_map[self->itype]; - BM_ITER_BPY_BM_SEQ(ele, &iter, self) - { + BM_ITER_BPY_BM_SEQ (ele, &iter, self) { BM_elem_index_set(ele, index); /* set_dirty! */ index++; } @@ -2744,8 +2743,7 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec } i = 0; - BM_ITER_BPY_BM_SEQ(ele, &iter, self) - { + BM_ITER_BPY_BM_SEQ (ele, &iter, self) { if (keyfunc != NULL) { PyObject *py_elem; PyObject *index; @@ -3168,8 +3166,7 @@ static Py_ssize_t bpy_bmelemseq_length(BPy_BMElemSeq *self) BMHeader *ele; Py_ssize_t tot = 0; - BM_ITER_BPY_BM_SEQ(ele, &iter, self) - { + BM_ITER_BPY_BM_SEQ (ele, &iter, self) { tot++; } return tot; @@ -3343,8 +3340,7 @@ static int bpy_bmelemseq_contains(BPy_BMElemSeq *self, PyObject *value) if (value_bm_ele->bm == self->bm) { BMElem *ele, *ele_test = value_bm_ele->ele; BMIter iter; - BM_ITER_BPY_BM_SEQ(ele, &iter, self) - { + BM_ITER_BPY_BM_SEQ (ele, &iter, self) { if (ele == ele_test) { return 1; } diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c index 825961e807b..b07dea06fb4 100644 --- a/source/blender/python/intern/bpy_rna_id_collection.c +++ b/source/blender/python/intern/bpy_rna_id_collection.c @@ -225,10 +225,8 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject * data_cb.types_bitmap = key_types_bitmap; - 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) { /* We cannot skip here in case we have some filter on key types... */ if (key_types_bitmap == NULL && val_types_bitmap != NULL) { if (!id_check_type(id, val_types_bitmap)) { diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index db6b24376ca..f21baa21006 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -810,8 +810,7 @@ static bool wm_gizmomap_select_all_intern(bContext *C, wmGizmoMap *gzmap) wm_gizmomap_select_array_ensure_len_alloc(gzmap, BLI_ghash_len(hash)); - GHASH_ITER_INDEX(gh_iter, hash, i) - { + GHASH_ITER_INDEX (gh_iter, hash, i) { wmGizmo *gz_iter = BLI_ghashIterator_getValue(&gh_iter); WM_gizmo_select_set(gzmap, gz_iter, true); } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index fbe3253878f..46533cd7ef5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -640,8 +640,7 @@ static void wm_handler_ui_cancel(bContext *C) return; } - LISTBASE_FOREACH_MUTABLE(wmEventHandler *, handler_base, &ar->handlers) - { + LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, &ar->handlers) { if (handler_base->type == WM_HANDLER_TYPE_UI) { wmEventHandler_UI *handler = (wmEventHandler_UI *)handler_base; BLI_assert(handler->handle_fn != NULL); @@ -3380,8 +3379,7 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op) UI_popup_handlers_remove_all(C, &win->modalhandlers); /* only allow 1 file selector open per window */ - LISTBASE_FOREACH_MUTABLE(wmEventHandler *, handler_base, &win->modalhandlers) - { + LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, &win->modalhandlers) { if (handler_base->type == WM_HANDLER_TYPE_OP) { wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base; if (handler->is_fileselect == false) { @@ -3700,8 +3698,7 @@ void WM_event_free_ui_handler_all(bContext *C, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn) { - LISTBASE_FOREACH_MUTABLE(wmEventHandler *, handler_base, handlers) - { + LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, handlers) { if (handler_base->type == WM_HANDLER_TYPE_UI) { wmEventHandler_UI *handler = (wmEventHandler_UI *)handler_base; if ((handler->handle_fn == handle_fn) && (handler->remove_fn == remove_fn)) { @@ -3738,8 +3735,7 @@ wmEventHandler_Dropbox *WM_event_add_dropbox_handler(ListBase *handlers, ListBas /* XXX solution works, still better check the real cause (ton) */ void WM_event_remove_area_handler(ListBase *handlers, void *area) { - LISTBASE_FOREACH_MUTABLE(wmEventHandler *, handler_base, handlers) - { + LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, handlers) { if (handler_base->type == WM_HANDLER_TYPE_UI) { wmEventHandler_UI *handler = (wmEventHandler_UI *)handler_base; if (handler->context.area == area) {