Cleanup: Use const qualifier for UV vertex map

This commit is contained in:
Sergey Sharybin 2018-07-16 15:58:12 +02:00
parent 20f3cbfb78
commit 72d1fb9934
Notes: blender-bot 2023-02-14 08:08:54 +01:00
Referenced by issue #56116, Blender 2.79 Latest Build CRASH
Referenced by issue #55997, crash
2 changed files with 7 additions and 6 deletions

View File

@ -104,9 +104,9 @@ typedef struct MeshElemMap {
/* mapping */
UvVertMap *BKE_mesh_uv_vert_map_create(
struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
unsigned int totpoly, unsigned int totvert,
const float limit[2], const bool selected, const bool use_winding);
const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopUV *mloopuv,
unsigned int totpoly, unsigned int totvert, const float limit[2],
const bool selected, const bool use_winding);
UvMapVert *BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v);
void BKE_mesh_uv_vert_map_free(UvVertMap *vmap);

View File

@ -55,13 +55,13 @@
* but for now this replaces it because its unused. */
UvVertMap *BKE_mesh_uv_vert_map_create(
struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
const MPoly *mpoly, const MLoop *mloop, const MLoopUV *mloopuv,
unsigned int totpoly, unsigned int totvert,
const float limit[2], const bool selected, const bool use_winding)
{
UvVertMap *vmap;
UvMapVert *buf;
MPoly *mp;
const MPoly *mp;
unsigned int a;
int i, totuv, nverts;
@ -126,7 +126,8 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
for (a = 0; a < totvert; a++) {
UvMapVert *newvlist = NULL, *vlist = vmap->vert[a];
UvMapVert *iterv, *v, *lastv, *next;
float *uv, *uv2, uvdiff[2];
const float *uv, *uv2;
float uvdiff[2];
while (vlist) {
v = vlist;