[Bf-blender-cvs] [959a58da9e4] master: Cleanup: redundant casts

Campbell Barton noreply at git.blender.org
Fri Oct 20 05:10:37 CEST 2017


Commit: 959a58da9e4d23be2738b6979ec208f05468f50c
Author: Campbell Barton
Date:   Fri Oct 20 14:03:22 2017 +1100
Branches: master
https://developer.blender.org/rB959a58da9e4d23be2738b6979ec208f05468f50c

Cleanup: redundant casts

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

M	source/blender/blenkernel/intern/mesh_evaluate.c
M	source/blender/blenkernel/intern/mesh_mapping.c
M	source/blender/blenkernel/intern/mesh_remap.c
M	source/blender/blenlib/intern/convexhull2d.c
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/uvedit/uvedit_draw.c
M	source/blender/editors/uvedit/uvedit_parametrizer.c
M	source/blender/python/mathutils/mathutils_bvhtree.c
M	source/blender/python/mathutils/mathutils_geometry.c

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

diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index b28ec7f4fff..a0df43ca102 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -2750,7 +2750,7 @@ int BKE_mesh_recalc_tessellation(
 				mul_v2_m3v3(projverts[j], axis_mat, mvert[ml->v].co);
 			}
 
-			BLI_polyfill_calc_arena((const float (*)[2])projverts, mp_totloop, 1, tris, arena);
+			BLI_polyfill_calc_arena(projverts, mp_totloop, 1, tris, arena);
 
 			/* apply fill */
 			for (j = 0; j < totfilltri; j++) {
@@ -2949,7 +2949,7 @@ void BKE_mesh_recalc_looptri(
 				mul_v2_m3v3(projverts[j], axis_mat, mvert[ml->v].co);
 			}
 
-			BLI_polyfill_calc_arena((const float (*)[2])projverts, mp_totloop, 1, tris, arena);
+			BLI_polyfill_calc_arena(projverts, mp_totloop, 1, tris, arena);
 
 			/* apply fill */
 			for (j = 0; j < totfilltri; j++) {
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c b/source/blender/blenkernel/intern/mesh_mapping.c
index 525c0c9728e..0143125490e 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -117,7 +117,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
 			}
 
 			if (use_winding) {
-				winding[a] = cross_poly_v2((const float (*)[2])tf_uv, (unsigned int)nverts) > 0;
+				winding[a] = cross_poly_v2(tf_uv, (unsigned int)nverts) > 0;
 			}
 		}
 	}
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index d2fe8f27f4a..b0580f75044 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -2169,7 +2169,7 @@ void BKE_mesh_remap_calc_polys_from_dm(
 					tri_vidx_2d[1][2] = 3;
 				}
 				else {
-					BLI_polyfill_calc((const float(*)[2])poly_vcos_2d, (unsigned int)mp->totloop, -1,
+					BLI_polyfill_calc(poly_vcos_2d, (unsigned int)mp->totloop, -1,
 					                  (unsigned int (*)[3])tri_vidx_2d);
 				}
 
diff --git a/source/blender/blenlib/intern/convexhull2d.c b/source/blender/blenlib/intern/convexhull2d.c
index 740f3cce4a4..1f1f214ce32 100644
--- a/source/blender/blenlib/intern/convexhull2d.c
+++ b/source/blender/blenlib/intern/convexhull2d.c
@@ -209,7 +209,7 @@ int BLI_convexhull_2d(const float (*points)[2], const int n, int r_points[])
 		memcpy(points_sort[i], points_ref[i].pt, sizeof(float[2]));
 	}
 
-	tot = BLI_convexhull_2d_sorted((const float (*)[2])points_sort, n, r_points);
+	tot = BLI_convexhull_2d_sorted(points_sort, n, r_points);
 
 	/* map back to the original index values */
 	points_map = (int *)points_sort;  /* abuse float array for temp storage */
@@ -305,7 +305,7 @@ float BLI_convexhull_aabb_fit_points_2d(const float (*points)[2], unsigned int n
 
 	index_map = MEM_mallocN(sizeof(*index_map) * n * 2, __func__);
 
-	tot = BLI_convexhull_2d((const float (*)[2])points, (int)n, index_map);
+	tot = BLI_convexhull_2d(points, (int)n, index_map);
 
 	if (tot) {
 		float (*points_hull)[2];
@@ -316,7 +316,7 @@ float BLI_convexhull_aabb_fit_points_2d(const float (*points)[2], unsigned int n
 			copy_v2_v2(points_hull[j], points[index_map[j]]);
 		}
 
-		angle = BLI_convexhull_aabb_fit_hull_2d((const float (*)[2])points_hull, (unsigned int)tot);
+		angle = BLI_convexhull_aabb_fit_hull_2d(points_hull, (unsigned int)tot);
 		MEM_freeN(points_hull);
 	}
 	else {
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 7b9d17b27b5..977ae192c79 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -178,7 +178,7 @@ void BM_face_calc_tessellation(
 		} while ((l_iter = l_iter->next) != l_first);
 
 		/* complete the loop */
-		BLI_polyfill_calc((const float (*)[2])projverts, f->len, -1, r_index);
+		BLI_polyfill_calc(projverts, f->len, -1, r_index);
 	}
 }
 
@@ -885,7 +885,7 @@ bool BM_face_point_inside_test(const BMFace *f, const float co[3])
 		mul_v2_m3v3(projverts[i], axis_mat, l_iter->v->co);
 	}
 
-	return isect_point_poly_v2(co_2d, (const float (*)[2])projverts, f->len, false);
+	return isect_point_poly_v2(co_2d, projverts, f->len, false);
 }
 
 /**
@@ -1035,12 +1035,12 @@ void BM_face_triangulate(
 				mul_v2_m3v3(projverts[i], axis_mat, l_iter->v->co);
 			}
 
-			BLI_polyfill_calc_arena((const float (*)[2])projverts, f->len, 1, tris,
+			BLI_polyfill_calc_arena(projverts, f->len, 1, tris,
 			                        pf_arena);
 
 			if (use_beauty) {
 				BLI_polyfill_beautify(
-				        (const float (*)[2])projverts, f->len, tris,
+				        projverts, f->len, tris,
 				        pf_arena, pf_heap, pf_ehash);
 			}
 
@@ -1171,7 +1171,7 @@ void BM_face_splits_check_legal(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int l
 	}
 
 	/* first test for completely convex face */
-	if (is_poly_convex_v2((const float (*)[2])projverts, f->len)) {
+	if (is_poly_convex_v2(projverts, f->len)) {
 		return;
 	}
 
@@ -1449,7 +1449,7 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptri
 				j++;
 			} while ((l_iter = l_iter->next) != l_first);
 
-			BLI_polyfill_calc_arena((const float (*)[2])projverts, efa->len, 1, tris, arena);
+			BLI_polyfill_calc_arena(projverts, efa->len, 1, tris, arena);
 
 			for (j = 0; j < totfilltri; j++) {
 				BMLoop **l_ptr = looptris[i++];
@@ -1591,9 +1591,9 @@ void BM_mesh_calc_tessellation_beauty(BMesh *bm, BMLoop *(*looptris)[3], int *r_
 				j++;
 			} while ((l_iter = l_iter->next) != l_first);
 
-			BLI_polyfill_calc_arena((const float (*)[2])projverts, efa->len, 1, tris, pf_arena);
+			BLI_polyfill_calc_arena(projverts, efa->len, 1, tris, pf_arena);
 
-			BLI_polyfill_beautify((const float (*)[2])projverts, efa->len, tris, pf_arena, pf_heap, pf_ehash);
+			BLI_polyfill_beautify(projverts, efa->len, tris, pf_arena, pf_heap, pf_ehash);
 
 			for (j = 0; j < totfilltri; j++) {
 				BMLoop **l_ptr = looptris[i++];
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index bba7137c3ee..100e2dc8295 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -426,7 +426,7 @@ static void gp_triangulate_stroke_fill(bGPDstroke *gps)
 	
 	/* convert to 2d and triangulate */
 	gp_stroke_2d_flat(gps->points, gps->totpoints, points2d, &direction);
-	BLI_polyfill_calc((const float(*)[2])points2d, (unsigned int)gps->totpoints, direction, (unsigned int(*)[3])tmp_triangles);
+	BLI_polyfill_calc(points2d, (unsigned int)gps->totpoints, direction, tmp_triangles);
 
 	/* Number of triangles */
 	gps->tot_triangles = gps->totpoints - 2;
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 438c3acdb11..c8151862b6c 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -584,7 +584,7 @@ UvVertMap *BM_uv_vert_map_create(
 			}
 
 			if (use_winding) {
-				winding[a] = cross_poly_v2((const float (*)[2])tf_uv, efa->len) > 0;
+				winding[a] = cross_poly_v2(tf_uv, efa->len) > 0;
 			}
 		}
 	}
@@ -736,7 +736,7 @@ UvElementMap *BM_uv_element_map_create(
 			}
 
 			if (use_winding) {
-				winding[j] = cross_poly_v2((const float (*)[2])tf_uv, efa->len) > 0;
+				winding[j] = cross_poly_v2(tf_uv, efa->len) > 0;
 			}
 		}
 	}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 29de680d16d..d14b75149c9 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2777,7 +2777,7 @@ static void project_paint_face_init(
 						interp_v3_v3v3(edge_verts_inset_clip[1], insetCos[fidx1], insetCos[fidx2], fac2);
 
 
-						if (pixel_bounds_uv((const float (*)[2])seam_subsection, &bounds_px, ibuf->x, ibuf->y)) {
+						if (pixel_bounds_uv(seam_subsection, &bounds_px, ibuf->x, ibuf->y)) {
 							/* bounds between the seam rect and the uvspace bucket pixels */
 
 							has_isect = 0;
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index 15be6ab3b78..fecacd07997 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -201,7 +201,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 				uv_poly_copy_aspect(tf_uvorig, tf_uv, aspx, aspy, efa->len);
 
 				totarea += BM_face_calc_area(efa);
-				totuvarea += area_poly_v2((const float (*)[2])tf_uv, efa->len);
+				totuvarea += area_poly_v2(tf_uv, efa->len);
 				
 				if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 					BM_elem_flag_enable(efa, BM_ELEM_TAG);
@@ -244,7 +244,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
 
 						uv_poly_copy_aspect(tf_uvorig, tf_uv, aspx, aspy, efa->len);
 
-						uvarea = area_poly_v2((const float (*)[2])tf_uv, efa->len) / totuvarea;
+						uvarea = area_poly_v2(tf_uv, efa->len) / totuvarea;
 						
 						if (area < FLT_EPSILON || uvarea < FLT_EPSILON)
 							areadiff = 1.0f;
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 8c76d03035a..29c908ff900 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -4483,7 +4483,7 @@ static void param_pack_rotate(ParamHandle *handle)
 
 		p_chart_uv_to_array(chart, points);
 
-		angle = BLI_convexhull_aabb_fit_points_2d((const float (*)[2])points, chart->nverts);
+		angle = BLI_convexhull_aabb_fit_points_2d(points, chart->nverts);
 
 		MEM_freeN(points);
 
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c
index 42771d93b4e..e1b414d9ba1 100644
--- a/source/blender/python/mathutils/mathutils_bvhtree.c
+++ b/source/blender/python/mathutils/mathutils_bvhtree.c
@@ -872,7 +872,7 @@ static PyObject *C_BVHTree_FromPolygons(PyObject *UNUSED(cls), PyObject *args, P
 					mul_v2_m3v3(proj_coords[j], axis_mat, coords[plink->poly[j]]);
 				}
 
-				BLI_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list