From ea5bfedb4925485192e40cab98f2d5f1d3fe5012 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sat, 14 May 2022 18:57:52 +0200 Subject: Cleanup: Further use of const for retrieved custom data layers Similar to cf69652618fefcd22b2cde9a2. --- source/blender/render/intern/texture_margin.cc | 4 ++-- source/blender/render/intern/texture_pointdensity.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/render/intern') diff --git a/source/blender/render/intern/texture_margin.cc b/source/blender/render/intern/texture_margin.cc index 60585789416..9096936a3ff 100644 --- a/source/blender/render/intern/texture_margin.cc +++ b/source/blender/render/intern/texture_margin.cc @@ -508,11 +508,11 @@ static void generate_margin(ImBuf *ibuf, mloop = me->mloop; if ((uv_layer == nullptr) || (uv_layer[0] == '\0')) { - mloopuv = static_cast(CustomData_get_layer(&me->ldata, CD_MLOOPUV)); + mloopuv = static_cast(CustomData_get_layer(&me->ldata, CD_MLOOPUV)); } else { int uv_id = CustomData_get_named_layer(&me->ldata, CD_MLOOPUV, uv_layer); - mloopuv = static_cast( + mloopuv = static_cast( CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, uv_id)); } diff --git a/source/blender/render/intern/texture_pointdensity.c b/source/blender/render/intern/texture_pointdensity.c index b9721f49ce7..6e0bae700dc 100644 --- a/source/blender/render/intern/texture_pointdensity.c +++ b/source/blender/render/intern/texture_pointdensity.c @@ -271,7 +271,6 @@ static void pointdensity_cache_vertex_color(PointDensity *pd, { const MLoop *mloop = mesh->mloop; const int totloop = mesh->totloop; - const MLoopCol *mcol; char layername[MAX_CUSTOMDATA_LAYER_NAME]; int i; @@ -282,7 +281,7 @@ static void pointdensity_cache_vertex_color(PointDensity *pd, } CustomData_validate_layer_name( &mesh->ldata, CD_PROP_BYTE_COLOR, pd->vertex_attribute_name, layername); - mcol = CustomData_get_layer_named(&mesh->ldata, CD_PROP_BYTE_COLOR, layername); + const MLoopCol *mcol = CustomData_get_layer_named(&mesh->ldata, CD_PROP_BYTE_COLOR, layername); if (!mcol) { return; } -- cgit v1.2.3