Cleanup: Use const for retrieved custom data layers

This commit is contained in:
Hans Goudey 2022-06-04 17:12:17 +02:00
parent 6572ad8620
commit db5ffdd1a4
3 changed files with 4 additions and 4 deletions

View File

@ -867,10 +867,10 @@ static bool draw_subdiv_topology_info_cb(const SubdivForeachContext *foreach_con
ctx->subdiv_loop_subdiv_edge_index = cache->subdiv_loop_subdiv_edge_index;
ctx->subdiv_loop_poly_index = cache->subdiv_loop_poly_index;
ctx->v_origindex = static_cast<int *>(
ctx->v_origindex = static_cast<const int *>(
CustomData_get_layer(&ctx->coarse_mesh->vdata, CD_ORIGINDEX));
ctx->e_origindex = static_cast<int *>(
ctx->e_origindex = static_cast<const int *>(
CustomData_get_layer(&ctx->coarse_mesh->edata, CD_ORIGINDEX));
if (cache->num_subdiv_verts) {

View File

@ -234,7 +234,7 @@ static void extract_pos_nor_init_subdiv(const DRWSubdivCache *subdiv_cache,
if (subdiv_cache->use_custom_loop_normals) {
Mesh *coarse_mesh = subdiv_cache->mesh;
const float(*lnors)[3] = static_cast<float(*)[3]>(
const float(*lnors)[3] = static_cast<const float(*)[3]>(
CustomData_get_layer(&coarse_mesh->ldata, CD_NORMAL));
BLI_assert(lnors != nullptr);

View File

@ -453,7 +453,7 @@ int16_t OBJMesh::get_poly_deform_group_index(const int poly_index,
BLI_assert(poly_index < export_mesh_eval_->totpoly);
BLI_assert(group_weights.size() == BKE_object_defgroup_count(&export_object_eval_));
const MDeformVert *dvert_layer = static_cast<MDeformVert *>(
const MDeformVert *dvert_layer = static_cast<const MDeformVert *>(
CustomData_get_layer(&export_mesh_eval_->vdata, CD_MDEFORMVERT));
if (!dvert_layer) {
return NOT_FOUND;