From aab4f2b76253936d1ba09562f1b1a21661860bf7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Jan 2015 23:26:03 +1100 Subject: cleanup: redundant casts & const cast correctness --- source/blender/blenkernel/intern/editderivedmesh.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/editderivedmesh.c') diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 68fc6e68ef2..b47d9d06132 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -1560,7 +1560,8 @@ static void *emDM_getTessFaceDataArray(DerivedMesh *dm, int type) if (type == CD_MTFACE || type == CD_MCOL) { const int type_from = (type == CD_MTFACE) ? CD_MTEXPOLY : CD_MLOOPCOL; int index; - const char *data, *bmdata; + const char *bmdata; + char *data; index = CustomData_get_layer_index(&bm->pdata, type_from); if (index != -1) { @@ -1585,11 +1586,11 @@ static void *emDM_getTessFaceDataArray(DerivedMesh *dm, int type) // bmdata = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY); bmdata = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset); - ME_MTEXFACE_CPY(((MTFace *)data), ((MTexPoly *)bmdata)); + ME_MTEXFACE_CPY(((MTFace *)data), ((const MTexPoly *)bmdata)); for (j = 0; j < 3; j++) { // bmdata = CustomData_bmesh_get(&bm->ldata, looptris[i][j]->head.data, CD_MLOOPUV); bmdata = BM_ELEM_CD_GET_VOID_P(looptris[i][j], cd_loop_uv_offset); - copy_v2_v2(((MTFace *)data)->uv[j], ((MLoopUV *)bmdata)->uv); + copy_v2_v2(((MTFace *)data)->uv[j], ((const MLoopUV *)bmdata)->uv); } } } @@ -1599,7 +1600,7 @@ static void *emDM_getTessFaceDataArray(DerivedMesh *dm, int type) for (j = 0; j < 3; j++) { // bmdata = CustomData_bmesh_get(&bm->ldata, looptris[i][j]->head.data, CD_MLOOPCOL); bmdata = BM_ELEM_CD_GET_VOID_P(looptris[i][j], cd_loop_color_offset); - MESH_MLOOPCOL_TO_MCOL(((MLoopCol *)bmdata), (((MCol *)data) + j)); + MESH_MLOOPCOL_TO_MCOL(((const MLoopCol *)bmdata), (((MCol *)data) + j)); } } } -- cgit v1.2.3