[Bf-blender-cvs] [8500446] master: Workaround for non-bleeding edge compilers and const cast of pointer arrays.

Sergey Sharybin noreply at git.blender.org
Tue Jul 14 10:01:01 CEST 2015


Commit: 85004461ea374cceba6af1b4ec41d0d726133617
Author: Sergey Sharybin
Date:   Tue Jul 14 09:55:21 2015 +0200
Branches: master
https://developer.blender.org/rB85004461ea374cceba6af1b4ec41d0d726133617

Workaround for non-bleeding edge compilers and const cast of pointer arrays.

===================================================================

M	source/blender/blenkernel/intern/mesh_remap.c

===================================================================

diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index 32542d7..6ef167c 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -184,10 +184,15 @@ static void mesh_calc_eigen_matrix(
 		const MVert *mv;
 		float (*co)[3];
 
-		vcos = cos = MEM_mallocN(sizeof(*cos) * (size_t)numverts, __func__);
+		cos = MEM_mallocN(sizeof(*cos) * (size_t)numverts, __func__);
 		for (i = 0, co = cos, mv = verts; i < numverts; i++, co++, mv++) {
 			copy_v3_v3(*co, mv->co);
 		}
+		/* TODO(sergey): For until we officially drop all compilers which
+		 * doesn't handle casting correct we use workaround to avoid explicit
+		 * cast here.
+		 */
+		vcos = (void*)cos;
 	}
 	unit_m4(r_mat);




More information about the Bf-blender-cvs mailing list