[Bf-blender-cvs] [8eeacca9cbc] temp_bmesh_multires: Fix a few cast warnings

Joseph Eagar noreply at git.blender.org
Thu Apr 29 17:02:21 CEST 2021


Commit: 8eeacca9cbc1e82b8cd869ae43e44fec2d4492c9
Author: Joseph Eagar
Date:   Thu Apr 29 08:01:32 2021 -0700
Branches: temp_bmesh_multires
https://developer.blender.org/rB8eeacca9cbc1e82b8cd869ae43e44fec2d4492c9

Fix a few cast warnings

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

M	source/blender/blenkernel/intern/mesh.c
M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_boundary.c
M	source/blender/editors/sculpt_paint/sculpt_dyntopo.c
M	source/blender/gpu/intern/gpu_buffers.c
M	source/creator/creator.c

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

diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 13efde374d0..5ab7b38ed69 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1012,7 +1012,7 @@ BMesh *BKE_mesh_to_bmesh_ex(const Object *ob,
   const BMAllocTemplate allocsize = BMALLOC_TEMPLATE_FROM_ME(me);
 
   BMesh *bm = BM_mesh_create(&allocsize, create_params);
-  BM_mesh_bm_from_me(ob, bm, me, convert_params);
+  BM_mesh_bm_from_me((Object*)ob, bm, me, convert_params);
 
   return bm;
 }
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index e63cf5f0c73..36f920fb2ba 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1572,8 +1572,11 @@ static bool edge_queue_tri_in_sphere(const EdgeQueue *q, BMFace *f)
   BMLoop *l = f->l_first;
 
   /* Check if triangle intersects the sphere */
-  float dis = dist_to_tri_sphere_simple(
-      q->center, l->v->co, l->next->v->co, l->prev->v->co, f->no);
+  float dis = dist_to_tri_sphere_simple((float *)q->center,
+                                        (float *)l->v->co,
+                                        (float *)l->next->v->co,
+                                        (float *)l->prev->v->co,
+                                        (float *)f->no);
 
   // closest_on_tri_to_point_v3(c, co, v1, v2, v3);
 
@@ -2291,7 +2294,7 @@ static void pbvh_bmesh_split_edge(EdgeQueueContext *eq_ctx,
 
   void *vsrcs[2] = {e->v1->head.data, e->v2->head.data};
   float vws[2] = {0.5f, 0.5f};
-  CustomData_bmesh_interp(&pbvh->bm->vdata, vsrcs, vws, NULL, 2, v_new->head.data);
+  CustomData_bmesh_interp(&pbvh->bm->vdata, (const void**)vsrcs, (float*)vws, NULL, 2, v_new->head.data);
 
   if (boundary) {
     MDynTopoVert *mv_new = BKE_PBVH_DYNVERT(pbvh->cd_dyn_vert, v_new);
@@ -2387,17 +2390,19 @@ static void pbvh_bmesh_split_edge(EdgeQueueContext *eq_ctx,
     void *lsrcs[2] = {l1->head.data, l2->head.data};
     float lws[2] = {0.5f, 0.5f};
 
-    CustomData_bmesh_interp(&pbvh->bm->ldata, lsrcs, lws, lws, 2, f_new->l_first->next->head.data);
+    CustomData_bmesh_interp(&pbvh->bm->ldata, (const void**)lsrcs, lws, lws, 2, f_new->l_first->next->head.data);
 
     lsrcs[0] = l1->head.data;
     lws[0] = 1.0f;
 
-    CustomData_bmesh_interp(&pbvh->bm->ldata, lsrcs, lws, lws, 1, f_new->l_first->head.data);
+    CustomData_bmesh_interp(
+        &pbvh->bm->ldata, (const void **)lsrcs, lws, lws, 1, f_new->l_first->head.data);
 
     lsrcs[0] = l3->head.data;
     lws[0] = 1.0f;
 
-    CustomData_bmesh_interp(&pbvh->bm->ldata, lsrcs, lws, lws, 1, f_new->l_first->prev->head.data);
+    CustomData_bmesh_interp(
+        &pbvh->bm->ldata, (const void **)lsrcs, lws, lws, 1, f_new->l_first->prev->head.data);
 
     v_tri[0] = v_new;
     v_tri[1] = v2;
@@ -2416,18 +2421,21 @@ static void pbvh_bmesh_split_edge(EdgeQueueContext *eq_ctx,
     lsrcs[1] = lfirst->next->head.data;
     lws[0] = lws[1] = 0.5f;
 
-    CustomData_bmesh_interp(&pbvh->bm->ldata, lsrcs, lws, lws, 2, f_new->l_first->head.data);
+    CustomData_bmesh_interp(
+        &pbvh->bm->ldata, (const void **)lsrcs, lws, lws, 2, f_new->l_first->head.data);
 
     lsrcs[0] = lfirst->next->head.data;
     ;
     lws[0] = 1.0f;
 
-    CustomData_bmesh_interp(&pbvh->bm->ldata, lsrcs, lws, lws, 1, f_new->l_first->next->head.data);
+    CustomData_bmesh_interp(
+        &pbvh->bm->ldata, (const void **)lsrcs, lws, lws, 1, f_new->l_first->next->head.data);
 
     lsrcs[0] = lfirst->prev->head.data;
     lws[0] = 1.0f;
 
-    CustomData_bmesh_interp(&pbvh->bm->ldata, lsrcs, lws, lws, 1, f_new->l_first->prev->head.data);
+    CustomData_bmesh_interp(
+        &pbvh->bm->ldata, (const void **)lsrcs, lws, lws, 1, f_new->l_first->prev->head.data);
 
     /* Delete original */
     pbvh_bmesh_face_remove(pbvh, f_adj);
@@ -2659,7 +2667,8 @@ static void pbvh_bmesh_collapse_edge(PBVH *pbvh,
 
   // snap customdata
   if (totl > 0) {
-    CustomData_bmesh_interp(&pbvh->bm->ldata, blocks, ws, NULL, totl, ls[0]->head.data);
+    CustomData_bmesh_interp(
+        &pbvh->bm->ldata, (const void **)blocks, ws, NULL, totl, ls[0]->head.data);
     //*
     BM_LOOPS_OF_VERT_ITER_BEGIN (l, v_del) {
       BMLoop *l2 = l->v != v_del ? l->next : l;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index a407ad677cc..0f119b33529 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -293,7 +293,7 @@ void SCULPT_vertex_persistent_normal_get(SculptSession *ss,
       BMVert *v = (BMVert *)index.i;
       float(*no2)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
 
-      copy_v3_v3(no, no2);
+      copy_v3_v3(no, (float*)no2);
       return;
     }
 
@@ -8867,8 +8867,8 @@ static int sculpt_set_persistent_base_exec(bContext *C, wmOperator *UNUSED(op))
       SculptVertRef vertex = BKE_pbvh_table_index_to_vertex(ss->pbvh, i);
       BMVert *v = (BMVert *)vertex.i;
 
-      float(*co)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_co);
-      float(*no)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
+      float *co = BM_ELEM_CD_GET_VOID_P(v, cd_pers_co);
+      float *no = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
       float *disp = BM_ELEM_CD_GET_VOID_P(v, cd_pers_disp);
 
       copy_v3_v3(co, SCULPT_vertex_co_get(ss, vertex));
diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.c b/source/blender/editors/sculpt_paint/sculpt_boundary.c
index 1c110a6df40..437bc30efba 100644
--- a/source/blender/editors/sculpt_paint/sculpt_boundary.c
+++ b/source/blender/editors/sculpt_paint/sculpt_boundary.c
@@ -770,7 +770,7 @@ static void sculpt_boundary_bend_data_init(SculptSession *ss, SculptBoundary *bo
       }
       else {
         SculptVertRef vertex = BKE_pbvh_table_index_to_vertex(ss->pbvh, i);
-        float *co = SCULPT_vertex_co_get(ss, vertex);
+        const float *co = SCULPT_vertex_co_get(ss, vertex);
 
         //boundary->bend.pivot_positions[i][0] = co[0];
         //boundary->bend.pivot_positions[i][1] = co[1];
diff --git a/source/blender/editors/sculpt_paint/sculpt_dyntopo.c b/source/blender/editors/sculpt_paint/sculpt_dyntopo.c
index c478f3d29c5..d046bf9b7f3 100644
--- a/source/blender/editors/sculpt_paint/sculpt_dyntopo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_dyntopo.c
@@ -415,8 +415,8 @@ void SCULPT_dynamic_topology_enable_ex(Main *bmain, Depsgraph *depsgraph, Scene
 
     // persistent base
     if (cd_pers_co >= 0) {
-      float(*co)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_co);
-      float(*no)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
+      float *co = BM_ELEM_CD_GET_VOID_P(v, cd_pers_co);
+      float *no = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
       float *disp = BM_ELEM_CD_GET_VOID_P(v, cd_pers_disp);
 
       copy_v3_v3(co, ss->persistent_base[i].co);
@@ -473,8 +473,8 @@ void SCULPT_dyntopo_save_persistent_base(SculptSession *ss)
     int i = 0;
 
     BM_ITER_MESH (v, &iter, ss->bm, BM_VERTS_OF_MESH) {
-      float(*co)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_co);
-      float(*no)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
+      float *co = BM_ELEM_CD_GET_VOID_P(v, cd_pers_co);
+      float *no = BM_ELEM_CD_GET_VOID_P(v, cd_pers_no);
       float *disp = BM_ELEM_CD_GET_VOID_P(v, cd_pers_disp);
 
       copy_v3_v3(ss->persistent_base[i].co, co);
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index d2ae66e8eaf..8ba0cca863b 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1159,7 +1159,7 @@ static void GPU_pbvh_bmesh_buffers_update_flat_vcol(GPU_PBVH_Buffers *buffers,
       add_v3_v3(cent, v[2]->co);
       mul_v3_fl(cent, 1.0 / 3.0);
 
-      float *cos[7][3];
+      float cos[7][3];
 
       copy_v3_v3(cos[0], v[0]->co);
       copy_v3_v3(cos[1], v[1]->co);
diff --git a/source/creator/creator.c b/source/creator/creator.c
index b40718d1f7c..bed27f8bc87 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -274,7 +274,7 @@ int main(int argc,
     LocalFree(argv_16);
 
     /* free on early-exit */
-    app_init_data.argv = argv;
+    app_init_data.argv = (const char**) argv;
     app_init_data.argv_num = argv_num;
   }
 #endif /* WIN32 */



More information about the Bf-blender-cvs mailing list