Cleanup: redundant casts

This commit is contained in:
2017-10-20 14:03:22 +11:00
parent cb957fd8e0
commit 959a58da9e
12 changed files with 25 additions and 25 deletions

View File

@@ -2750,7 +2750,7 @@ int BKE_mesh_recalc_tessellation(
mul_v2_m3v3(projverts[j], axis_mat, mvert[ml->v].co); 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 */ /* apply fill */
for (j = 0; j < totfilltri; j++) { 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); 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 */ /* apply fill */
for (j = 0; j < totfilltri; j++) { for (j = 0; j < totfilltri; j++) {

View File

@@ -117,7 +117,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
} }
if (use_winding) { 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;
} }
} }
} }

View File

@@ -2169,7 +2169,7 @@ void BKE_mesh_remap_calc_polys_from_dm(
tri_vidx_2d[1][2] = 3; tri_vidx_2d[1][2] = 3;
} }
else { 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); (unsigned int (*)[3])tri_vidx_2d);
} }

View File

@@ -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])); 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 */ /* map back to the original index values */
points_map = (int *)points_sort; /* abuse float array for temp storage */ 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__); 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) { if (tot) {
float (*points_hull)[2]; 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]]); 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); MEM_freeN(points_hull);
} }
else { else {

View File

@@ -178,7 +178,7 @@ void BM_face_calc_tessellation(
} while ((l_iter = l_iter->next) != l_first); } while ((l_iter = l_iter->next) != l_first);
/* complete the loop */ /* 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); 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); 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); pf_arena);
if (use_beauty) { if (use_beauty) {
BLI_polyfill_beautify( BLI_polyfill_beautify(
(const float (*)[2])projverts, f->len, tris, projverts, f->len, tris,
pf_arena, pf_heap, pf_ehash); 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 */ /* 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; return;
} }
@@ -1449,7 +1449,7 @@ void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptri
j++; j++;
} while ((l_iter = l_iter->next) != l_first); } 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++) { for (j = 0; j < totfilltri; j++) {
BMLoop **l_ptr = looptris[i++]; BMLoop **l_ptr = looptris[i++];
@@ -1591,9 +1591,9 @@ void BM_mesh_calc_tessellation_beauty(BMesh *bm, BMLoop *(*looptris)[3], int *r_
j++; j++;
} while ((l_iter = l_iter->next) != l_first); } 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++) { for (j = 0; j < totfilltri; j++) {
BMLoop **l_ptr = looptris[i++]; BMLoop **l_ptr = looptris[i++];

View File

@@ -426,7 +426,7 @@ static void gp_triangulate_stroke_fill(bGPDstroke *gps)
/* convert to 2d and triangulate */ /* convert to 2d and triangulate */
gp_stroke_2d_flat(gps->points, gps->totpoints, points2d, &direction); 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 */ /* Number of triangles */
gps->tot_triangles = gps->totpoints - 2; gps->tot_triangles = gps->totpoints - 2;

View File

@@ -584,7 +584,7 @@ UvVertMap *BM_uv_vert_map_create(
} }
if (use_winding) { 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) { 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;
} }
} }
} }

View File

@@ -2777,7 +2777,7 @@ static void project_paint_face_init(
interp_v3_v3v3(edge_verts_inset_clip[1], insetCos[fidx1], insetCos[fidx2], fac2); 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 */ /* bounds between the seam rect and the uvspace bucket pixels */
has_isect = 0; has_isect = 0;

View File

@@ -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); uv_poly_copy_aspect(tf_uvorig, tf_uv, aspx, aspy, efa->len);
totarea += BM_face_calc_area(efa); 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)) { if (uvedit_face_visible_test(scene, ima, efa, tf)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG); 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); 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) if (area < FLT_EPSILON || uvarea < FLT_EPSILON)
areadiff = 1.0f; areadiff = 1.0f;

View File

@@ -4483,7 +4483,7 @@ static void param_pack_rotate(ParamHandle *handle)
p_chart_uv_to_array(chart, points); 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); MEM_freeN(points);

View File

@@ -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]]); mul_v2_m3v3(proj_coords[j], axis_mat, coords[plink->poly[j]]);
} }
BLI_polyfill_calc_arena((const float (*)[2])proj_coords, plink->len, 1, tris_offset, pf_arena); BLI_polyfill_calc_arena(proj_coords, plink->len, 1, tris_offset, pf_arena);
j = plink->len - 2; j = plink->len - 2;
while (j--) { while (j--) {

View File

@@ -1430,7 +1430,7 @@ static PyObject *M_Geometry_box_fit_2d(PyObject *UNUSED(self), PyObject *pointli
if (len) { if (len) {
/* Non Python function */ /* Non Python function */
angle = BLI_convexhull_aabb_fit_points_2d((const float (*)[2])points, len); angle = BLI_convexhull_aabb_fit_points_2d(points, len);
PyMem_Free(points); PyMem_Free(points);
} }
@@ -1468,7 +1468,7 @@ static PyObject *M_Geometry_convex_hull_2d(PyObject *UNUSED(self), PyObject *poi
index_map = MEM_mallocN(sizeof(*index_map) * len * 2, __func__); index_map = MEM_mallocN(sizeof(*index_map) * len * 2, __func__);
/* Non Python function */ /* Non Python function */
len_ret = BLI_convexhull_2d((const float (*)[2])points, len, index_map); len_ret = BLI_convexhull_2d(points, len, index_map);
ret = PyList_New(len_ret); ret = PyList_New(len_ret);
for (i = 0; i < len_ret; i++) { for (i = 0; i < len_ret; i++) {