Cleanup: Use signed integers for mesh vertex indices

This commit is contained in:
Hans Goudey 2022-09-27 14:02:22 -05:00
parent b6ee599d92
commit 2f0c40c7a2
3 changed files with 6 additions and 6 deletions

View File

@ -106,7 +106,7 @@ void BKE_mesh_ensure_default_orig_index_customdata_no_check(struct Mesh *mesh);
* Find the index of the loop in 'poly' which references vertex,
* returns -1 if not found
*/
int poly_find_loop_from_vert(const struct MPoly *poly, const struct MLoop *loopstart, uint vert);
int poly_find_loop_from_vert(const struct MPoly *poly, const struct MLoop *loopstart, int vert);
/**
* Fill \a r_adj with the loop indices in \a poly adjacent to the
* vertex. Returns the index of the loop matching vertex, or -1 if the
@ -114,8 +114,8 @@ int poly_find_loop_from_vert(const struct MPoly *poly, const struct MLoop *loops
*/
int poly_get_adj_loops_from_vert(const struct MPoly *poly,
const struct MLoop *mloop,
unsigned int vert,
unsigned int r_adj[2]);
int vert,
int r_adj[2]);
/**
* Return the index of the edge vert that is not equal to \a v. If

View File

@ -1459,7 +1459,7 @@ void BKE_mesh_auto_smooth_flag_set(Mesh *me,
}
}
int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart, uint vert)
int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart, int vert)
{
for (int j = 0; j < poly->totloop; j++, loopstart++) {
if (loopstart->v == vert) {
@ -1470,7 +1470,7 @@ int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart, uint ver
return -1;
}
int poly_get_adj_loops_from_vert(const MPoly *poly, const MLoop *mloop, uint vert, uint r_adj[2])
int poly_get_adj_loops_from_vert(const MPoly *poly, const MLoop *mloop, int vert, int r_adj[2])
{
int corner = poly_find_loop_from_vert(poly, &mloop[poly->loopstart], vert);

View File

@ -799,7 +799,7 @@ static void sculpt_vertex_neighbors_get_faces(SculptSession *ss,
continue;
}
const MPoly *p = &ss->mpoly[vert_map->indices[i]];
uint f_adj_v[2];
int f_adj_v[2];
if (poly_get_adj_loops_from_vert(p, ss->mloop, vertex.i, f_adj_v) != -1) {
for (int j = 0; j < ARRAY_SIZE(f_adj_v); j += 1) {
if (f_adj_v[j] != vertex.i) {