diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-05 21:44:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-05 21:48:01 +0300 |
commit | 548a2cbe06b23d90b0e09da49fc854178c270b8a (patch) | |
tree | 8706b5be97ace0ff0ca18d4109586ccb5cf0a666 /source/blender/blenkernel/intern/mesh_mapping.cc | |
parent | 6306d747b770685f38f95bc57f8681335ddfa506 (diff) |
Cleanup: Clang tidy
Also remove unnecessary struct keywords in C++ files.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_mapping.cc')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_mapping.cc | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/blenkernel/intern/mesh_mapping.cc b/source/blender/blenkernel/intern/mesh_mapping.cc index 05d1a478c09..bb9f8274b72 100644 --- a/source/blender/blenkernel/intern/mesh_mapping.cc +++ b/source/blender/blenkernel/intern/mesh_mapping.cc @@ -47,7 +47,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, uint a; int i, totuv, nverts; - bool *winding = NULL; + bool *winding = nullptr; BLI_buffer_declare_static(vec2f, tf_uv_buf, BLI_BUFFER_NOP, 32); totuv = 0; @@ -61,7 +61,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, } if (totuv == 0) { - return NULL; + return nullptr; } vmap = (UvVertMap *)MEM_callocN(sizeof(*vmap), "UvVertMap"); @@ -73,13 +73,13 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, if (!vmap->vert || !vmap->buf) { BKE_mesh_uv_vert_map_free(vmap); - return NULL; + return nullptr; } mp = mpoly; for (a = 0; a < totpoly; a++, mp++) { if (!selected || (!(hide_poly && hide_poly[a]) && (select_poly && select_poly[a]))) { - float(*tf_uv)[2] = NULL; + float(*tf_uv)[2] = nullptr; if (use_winding) { tf_uv = (float(*)[2])BLI_buffer_reinit_data(&tf_uv_buf, vec2f, size_t(mp->totloop)); @@ -90,7 +90,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, for (i = 0; i < nverts; i++) { buf->loop_of_poly_index = ushort(i); buf->poly_index = a; - buf->separate = 0; + buf->separate = false; buf->next = vmap->vert[mloop[mp->loopstart + i].v]; vmap->vert[mloop[mp->loopstart + i].v] = buf; @@ -109,7 +109,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, /* sort individual uvs for each vert */ for (a = 0; a < totvert; a++) { - UvMapVert *newvlist = NULL, *vlist = vmap->vert[a]; + UvMapVert *newvlist = nullptr, *vlist = vmap->vert[a]; UvMapVert *iterv, *v, *lastv, *next; const float *uv, *uv2; float uvdiff[2]; @@ -121,7 +121,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, newvlist = v; uv = mloopuv[mpoly[v->poly_index].loopstart + v->loop_of_poly_index].uv; - lastv = NULL; + lastv = nullptr; iterv = vlist; while (iterv) { @@ -148,7 +148,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, iterv = next; } - newvlist->separate = 1; + newvlist->separate = true; } vmap->vert[a] = newvlist; @@ -624,7 +624,7 @@ static void poly_edge_loop_islands_calc(const MEdge *medge, int *poly_groups; int *poly_stack; - BLI_bitmap *edge_borders = NULL; + BLI_bitmap *edge_borders = nullptr; int num_edgeborders = 0; int poly_prev = 0; @@ -637,13 +637,13 @@ static void poly_edge_loop_islands_calc(const MEdge *medge, bool group_id_overflow = false; /* map vars */ - int *edge_poly_mem = NULL; + int *edge_poly_mem = nullptr; if (totpoly == 0) { *r_totgroup = 0; - *r_poly_groups = NULL; + *r_poly_groups = nullptr; if (r_edge_borders) { - *r_edge_borders = NULL; + *r_edge_borders = nullptr; *r_totedgeborder = 0; } return; @@ -830,7 +830,7 @@ int *BKE_mesh_calc_smoothgroups(const MEdge *medge, int *r_totgroup, const bool use_bitflags) { - int *poly_groups = NULL; + int *poly_groups = nullptr; poly_edge_loop_islands_calc(medge, totedge, @@ -838,14 +838,14 @@ int *BKE_mesh_calc_smoothgroups(const MEdge *medge, totpoly, mloop, totloop, - NULL, + nullptr, use_bitflags, poly_is_island_boundary_smooth_cb, - NULL, + nullptr, &poly_groups, r_totgroup, - NULL, - NULL); + nullptr, + nullptr); return poly_groups; } @@ -860,7 +860,7 @@ void BKE_mesh_loop_islands_init(MeshIslandStore *island_store, { MemArena *mem = island_store->mem; - if (mem == NULL) { + if (mem == nullptr) { mem = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__); island_store->mem = mem; } @@ -890,14 +890,14 @@ void BKE_mesh_loop_islands_clear(MeshIslandStore *island_store) { island_store->item_type = MISLAND_TYPE_NONE; island_store->items_to_islands_num = 0; - island_store->items_to_islands = NULL; + island_store->items_to_islands = nullptr; island_store->island_type = MISLAND_TYPE_NONE; island_store->islands_num = 0; - island_store->islands = NULL; + island_store->islands = nullptr; island_store->innercut_type = MISLAND_TYPE_NONE; - island_store->innercuts = NULL; + island_store->innercuts = nullptr; if (island_store->mem) { BLI_memarena_clear(island_store->mem); @@ -910,7 +910,7 @@ void BKE_mesh_loop_islands_free(MeshIslandStore *island_store) { if (island_store->mem) { BLI_memarena_free(island_store->mem); - island_store->mem = NULL; + island_store->mem = nullptr; } } @@ -1032,7 +1032,7 @@ static bool mesh_calc_islands_loop_poly_uv(const MVert * /*verts*/, const MLoopUV *luvs, MeshIslandStore *r_island_store) { - int *poly_groups = NULL; + int *poly_groups = nullptr; int num_poly_groups; /* map vars */ @@ -1051,10 +1051,10 @@ static bool mesh_calc_islands_loop_poly_uv(const MVert * /*verts*/, /* Those are used to detect 'inner cuts', i.e. edges that are borders, * and yet have two or more polys of a same group using them * (typical case: seam used to unwrap properly a cylinder). */ - BLI_bitmap *edge_borders = NULL; + BLI_bitmap *edge_borders = nullptr; int num_edge_borders = 0; - char *edge_border_count = NULL; - int *edge_innercut_indices = NULL; + char *edge_border_count = nullptr; + int *edge_innercut_indices = nullptr; int num_einnercuts = 0; int grp_idx, p_idx, pl_idx, l_idx; @@ -1083,7 +1083,7 @@ static bool mesh_calc_islands_loop_poly_uv(const MVert * /*verts*/, edge_poly_map, false, mesh_check_island_boundary_uv, - luvs ? &edge_boundary_check_data : NULL, + luvs ? &edge_boundary_check_data : nullptr, &poly_groups, &num_poly_groups, &edge_borders, @@ -1182,7 +1182,7 @@ bool BKE_mesh_calc_islands_loop_poly_edgeseam(const MVert *verts, MeshIslandStore *r_island_store) { return mesh_calc_islands_loop_poly_uv( - verts, totvert, edges, totedge, polys, totpoly, loops, totloop, NULL, r_island_store); + verts, totvert, edges, totedge, polys, totpoly, loops, totloop, nullptr, r_island_store); } bool BKE_mesh_calc_islands_loop_poly_uvmap(MVert *verts, @@ -1196,7 +1196,7 @@ bool BKE_mesh_calc_islands_loop_poly_uvmap(MVert *verts, const MLoopUV *luvs, MeshIslandStore *r_island_store) { - BLI_assert(luvs != NULL); + BLI_assert(luvs != nullptr); return mesh_calc_islands_loop_poly_uv( verts, totvert, edges, totedge, polys, totpoly, loops, totloop, luvs, r_island_store); } |