Cleanup: Clang format

Mostly bad white space from a bad find & replace in my own cleanup commit.
This commit is contained in:
Hans Goudey 2023-01-09 23:26:32 -05:00
parent 92449e634f
commit 13450c2d22
10 changed files with 37 additions and 36 deletions

View File

@ -3048,7 +3048,7 @@ void BKE_curve_bevelList_make(Object *ob, const ListBase *nurbs, const bool for_
bevp2 = bevp1 + (bl->nr - 1);
nr = bl->nr / 2;
while (nr--) {
std::swap( *bevp1, *bevp2);
std::swap(*bevp1, *bevp2);
bevp1++;
bevp2--;
}
@ -4446,12 +4446,12 @@ void BKE_nurb_direction_switch(Nurb *nu)
swap_v3_v3(bezt2->vec[0], bezt2->vec[2]);
}
std::swap( bezt1->h1, bezt1->h2);
std::swap( bezt1->f1, bezt1->f3);
std::swap(bezt1->h1, bezt1->h2);
std::swap(bezt1->f1, bezt1->f3);
if (bezt1 != bezt2) {
std::swap( bezt2->h1, bezt2->h2);
std::swap( bezt2->f1, bezt2->f3);
std::swap(bezt2->h1, bezt2->h2);
std::swap(bezt2->f1, bezt2->f3);
bezt1->tilt = -bezt1->tilt;
bezt2->tilt = -bezt2->tilt;
}
@ -4469,7 +4469,7 @@ void BKE_nurb_direction_switch(Nurb *nu)
bp2 = bp1 + (a - 1);
a /= 2;
while (bp1 != bp2 && a > 0) {
std::swap( *bp1, *bp2);
std::swap(*bp1, *bp2);
a--;
bp1->tilt = -bp1->tilt;
bp2->tilt = -bp2->tilt;
@ -4491,7 +4491,7 @@ void BKE_nurb_direction_switch(Nurb *nu)
fp2 = fp1 + (a - 1);
a /= 2;
while (fp1 != fp2 && a > 0) {
std::swap( *fp1, *fp2);
std::swap(*fp1, *fp2);
a--;
fp1++;
fp2--;
@ -4530,7 +4530,7 @@ void BKE_nurb_direction_switch(Nurb *nu)
a /= 2;
while (bp1 != bp2 && a > 0) {
std::swap( *bp1, *bp2);
std::swap(*bp1, *bp2);
a--;
bp1++;
bp2--;

View File

@ -1686,14 +1686,14 @@ static void scene_undo_preserve(BlendLibReader *reader, ID *id_new, ID *id_old)
Scene *scene_new = (Scene *)id_new;
Scene *scene_old = (Scene *)id_old;
std::swap( scene_old->cursor, scene_new->cursor);
std::swap(scene_old->cursor, scene_new->cursor);
if (scene_new->toolsettings != nullptr && scene_old->toolsettings != nullptr) {
/* First try to restore ID pointers that can be and should be preserved (like brushes or
* palettes), and counteract the swap of the whole ToolSettings structs below for the others
* (like object ones). */
scene_foreach_toolsettings(
nullptr, scene_new->toolsettings, true, reader, scene_old->toolsettings);
std::swap( *scene_old->toolsettings, *scene_new->toolsettings);
std::swap(*scene_old->toolsettings, *scene_new->toolsettings);
}
}

View File

@ -3087,7 +3087,7 @@ static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data,
but->selsta = but->pos;
but->selend = data->sel_pos_init;
if (but->selend < but->selsta) {
std::swap(but->selsta, but->selend);
std::swap(but->selsta, but->selend);
}
ui_but_update(but);
@ -3190,7 +3190,7 @@ static void ui_textedit_move(uiBut *but,
but->selend = data->sel_pos_init;
}
if (but->selend < but->selsta) {
std::swap( but->selsta, but->selend);
std::swap(but->selsta, but->selend);
}
}
}

View File

@ -261,10 +261,10 @@ void *ED_image_paint_tile_push(PaintTileMap *paint_tile_map,
ED_IMAGE_UNDO_TILE_SIZE);
if (has_float) {
std::swap( ptile->rect.fp, (*tmpibuf)->rect_float);
std::swap(ptile->rect.fp, (*tmpibuf)->rect_float);
}
else {
std::swap(ptile->rect.uint, (*tmpibuf)->rect);
std::swap(ptile->rect.uint, (*tmpibuf)->rect);
}
PaintTileKey key = {};
@ -299,10 +299,10 @@ static void ptile_restore_runtime_map(PaintTileMap *paint_tile_map)
const bool has_float = (ibuf->rect_float != nullptr);
if (has_float) {
std::swap( ptile->rect.fp, tmpibuf->rect_float);
std::swap(ptile->rect.fp, tmpibuf->rect_float);
}
else {
std::swap(ptile->rect.uint, tmpibuf->rect);
std::swap(ptile->rect.uint, tmpibuf->rect);
}
IMB_rectcpy(ibuf,
@ -315,10 +315,10 @@ static void ptile_restore_runtime_map(PaintTileMap *paint_tile_map)
ED_IMAGE_UNDO_TILE_SIZE);
if (has_float) {
std::swap( ptile->rect.fp, tmpibuf->rect_float);
std::swap(ptile->rect.fp, tmpibuf->rect_float);
}
else {
std::swap(ptile->rect.uint, tmpibuf->rect);
std::swap(ptile->rect.uint, tmpibuf->rect);
}
/* Force OpenGL reload (maybe partial update will operate better?) */
@ -380,19 +380,19 @@ static void utile_init_from_imbuf(
const bool has_float = ibuf->rect_float;
if (has_float) {
std::swap( utile->rect.fp, tmpibuf->rect_float);
std::swap(utile->rect.fp, tmpibuf->rect_float);
}
else {
std::swap(utile->rect.uint_ptr, tmpibuf->rect);
std::swap(utile->rect.uint_ptr, tmpibuf->rect);
}
IMB_rectcpy(tmpibuf, ibuf, 0, 0, x, y, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE);
if (has_float) {
std::swap( utile->rect.fp, tmpibuf->rect_float);
std::swap(utile->rect.fp, tmpibuf->rect_float);
}
else {
std::swap(utile->rect.uint_ptr, tmpibuf->rect);
std::swap(utile->rect.uint_ptr, tmpibuf->rect);
}
}

View File

@ -285,10 +285,10 @@ static void gizmo_node_crop_prop_matrix_set(const wmGizmo *gz,
rct_isect.ymax = 1;
BLI_rctf_isect(&rct_isect, &rct, &rct);
if (nx) {
std::swap( rct.xmin, rct.xmax);
std::swap(rct.xmin, rct.xmax);
}
if (ny) {
std::swap( rct.ymin, rct.ymax);
std::swap(rct.ymin, rct.ymax);
}
two_xy_from_rect(nxy, &rct, dims, is_relative);
gizmo_node_crop_update(crop_group);

View File

@ -156,7 +156,8 @@ static void node_snap_grid_apply(TransInfo *t)
{
using namespace blender;
if (!(transform_snap_is_active(t) && (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)))) {
if (!(transform_snap_is_active(t) &&
(t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)))) {
return;
}

View File

@ -1654,7 +1654,7 @@ std::optional<Mesh *> mesh_merge_by_distance_connected(const Mesh &mesh,
continue;
}
if (v1 > v2) {
std::swap( v1, v2);
std::swap(v1, v2);
}
WeldVertexCluster *v1_cluster = &vert_clusters[v1];
WeldVertexCluster *v2_cluster = &vert_clusters[v2];

View File

@ -1878,7 +1878,7 @@ static void lineart_edge_neighbor_init_task(void *__restrict userdata,
adj_e->v1 = mloop[looptri->tri[i % 3]].v;
adj_e->v2 = mloop[looptri->tri[(i + 1) % 3]].v;
if (adj_e->v1 > adj_e->v2) {
std::swap( adj_e->v1, adj_e->v2);
std::swap(adj_e->v1, adj_e->v2);
}
edge_nabr->e = -1;
@ -3267,7 +3267,7 @@ static void lineart_add_isec_thread(LineartIsecThread *th,
isec_single->tri1 = tri1;
isec_single->tri2 = tri2;
if (tri1->target_reference > tri2->target_reference) {
std::swap( isec_single->tri1, isec_single->tri2);
std::swap(isec_single->tri1, isec_single->tri2);
}
th->current++;
}

View File

@ -259,7 +259,7 @@ static void rasterize_half(const MBakeRast *bake_rast,
float x_r = l_stable != 0 ? (s0_l + (((s1_l - s0_l) * (y - t0_l)) / (t1_l - t0_l))) : s0_l;
if (is_mid_right != 0) {
std::swap( x_l, x_r);
std::swap(x_l, x_r);
}
iXl = int(ceilf(x_l));
@ -298,17 +298,17 @@ static void bake_rasterize(const MBakeRast *bake_rast,
/* sort by T */
if (tlo > tmi && tlo > thi) {
std::swap( shi, slo);
std::swap( thi, tlo);
std::swap(shi, slo);
std::swap(thi, tlo);
}
else if (tmi > thi) {
std::swap( shi, smi);
std::swap( thi, tmi);
std::swap(shi, smi);
std::swap(thi, tmi);
}
if (tlo > tmi) {
std::swap( slo, smi);
std::swap( tlo, tmi);
std::swap(slo, smi);
std::swap(tlo, tmi);
}
/* check if mid point is to the left or to the right of the lo-hi edge */

View File

@ -4426,7 +4426,7 @@ static void wm_event_get_keymap_from_toolsystem_ex(wmWindowManager *wm,
if (is_gizmo_visible && !is_gizmo_highlight) {
if (keymap_id_list_len == 2) {
std::swap(keymap_id_list[0], keymap_id_list[1]);
std::swap(keymap_id_list[0], keymap_id_list[1]);
}
}