[Bf-blender-cvs] [5f857378afd] master: Cleanup: Fix const pointers mess in previous commit.

Bastien Montagne noreply at git.blender.org
Thu Feb 22 15:42:22 CET 2018


Commit: 5f857378afd7939d6c49b46936c1afd5eaab098c
Author: Bastien Montagne
Date:   Thu Feb 22 15:41:41 2018 +0100
Branches: master
https://developer.blender.org/rB5f857378afd7939d6c49b46936c1afd5eaab098c

Cleanup: Fix const pointers mess in previous commit.

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

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

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

diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index a4cc6913fd9..788ebe4119f 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -698,10 +698,11 @@ static void mesh_edges_sharp_tag(
         LoopSplitTaskDataCommon *data,
         const bool check_angle, const float split_angle, const bool do_sharp_edges_tag)
 {
-	MVert *mverts = data->mverts;
-	MEdge *medges = data->medges;
-	MLoop *mloops = data->mloops;
-	MPoly *mpolys = data->mpolys;
+	const MVert *mverts = data->mverts;
+	const MEdge *medges = data->medges;
+	const MLoop *mloops = data->mloops;
+
+	const MPoly *mpolys = data->mpolys;
 
 	const int numEdges = data->numEdges;
 	const int numPolys = data->numPolys;
@@ -714,13 +715,13 @@ static void mesh_edges_sharp_tag(
 
 	BLI_bitmap *sharp_edges = do_sharp_edges_tag ? BLI_BITMAP_NEW(numEdges, __func__) : NULL;
 
-	MPoly *mp;
+	const MPoly *mp;
 	int mp_index;
 
 	const float split_angle_cos = check_angle ? cosf(split_angle) : -1.0f;
 
 	for (mp = mpolys, mp_index = 0; mp_index < numPolys; mp++, mp_index++) {
-		MLoop *ml_curr;
+		const MLoop *ml_curr;
 		int *e2l;
 		int ml_curr_index = mp->loopstart;
 		const int ml_last_index = (ml_curr_index + mp->totloop) - 1;
@@ -728,8 +729,6 @@ static void mesh_edges_sharp_tag(
 		ml_curr = &mloops[ml_curr_index];
 
 		for (; ml_curr_index <= ml_last_index; ml_curr++, ml_curr_index++) {
-			MEdge *me = &medges[ml_curr->e];
-
 			e2l = edge_to_loops[ml_curr->e];
 
 			loop_to_poly[ml_curr_index] = mp_index;
@@ -757,7 +756,7 @@ static void mesh_edges_sharp_tag(
 				 * or both poly have opposed (flipped) normals, i.e. both loops on the same edge share the same vertex,
 				 * or angle between both its polys' normals is above split_angle value.
 				 */
-				if (!(mp->flag & ME_SMOOTH) || (me->flag & ME_SHARP) ||
+				if (!(mp->flag & ME_SMOOTH) || (medges[ml_curr->e].flag & ME_SHARP) ||
 				    ml_curr->v == mloops[e2l[0]].v ||
 				    is_angle_sharp)
 				{
@@ -792,7 +791,7 @@ static void mesh_edges_sharp_tag(
 	if (do_sharp_edges_tag) {
 		MEdge *me;
 		int me_index;
-		for (me = medges, me_index = 0; me_index < numEdges; me++, me_index++) {
+		for (me = (MEdge *)medges, me_index = 0; me_index < numEdges; me++, me_index++) {
 			if (BLI_BITMAP_TEST(sharp_edges, me_index)) {
 				me->flag |= ME_SHARP;
 			}



More information about the Bf-blender-cvs mailing list