diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-03 21:27:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-03 21:27:05 +0400 |
commit | a4b922ad9b7e99e6da3755f7ab488edb335576b5 (patch) | |
tree | afc58e50e2bd3e345d550db74903d62d2ebaaacc | |
parent | 8119791703f41c1b09dcc0c5747dc38df7d1bbd6 (diff) |
correct invalid sizeof() use in bmesh (harmless in practice)
-rw-r--r-- | source/blender/bmesh/intern/bmesh_construct.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_create.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_wireframe.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 1f7ace1ba6d..35a5a2230ad 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -523,7 +523,7 @@ BMFace *BM_face_create_ngon_vcloud(BMesh *bm, BMVert **vert_arr, int len, const /* --- */ /* create edges and find the winding (if faces are attached to any existing edges) */ - vert_arr_map = MEM_mallocN(sizeof(BMVert **) * len, __func__); + vert_arr_map = MEM_mallocN(sizeof(BMVert *) * len, __func__); for (i = 0; i < len; i++) { vert_arr_map[i] = vert_arr[vang[i].index]; diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 269501e1f02..b71d5a7e7d4 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -507,13 +507,13 @@ bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_na void *BMO_slot_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int *len) { BMOpSlot *slot = BMO_slot_get(slot_args, slot_name); - void *ret; + void **ret; /* could add support for mapping type */ BLI_assert(slot->slot_type == BMO_OP_SLOT_ELEMENT_BUF); - ret = MEM_mallocN(sizeof(void **) * slot->len, __func__); - memcpy(ret, slot->data.buf, sizeof(void **) * slot->len); + ret = MEM_mallocN(sizeof(void *) * slot->len, __func__); + memcpy(ret, slot->data.buf, sizeof(void *) * slot->len); *len = slot->len; return ret; } diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index e43c04f7d08..64d0ec6ac27 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -278,7 +278,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) * this connectivity could be used rather then treating * them as a bunch of isolated verts. */ - BMVert **vert_arr = MEM_mallocN(sizeof(BMVert **) * totv, __func__); + BMVert **vert_arr = MEM_mallocN(sizeof(BMVert *) * totv, __func__); BMFace *f; BMO_iter_as_array(op->slots_in, "geom", BM_VERT, (void **)vert_arr, totv); diff --git a/source/blender/bmesh/operators/bmo_wireframe.c b/source/blender/bmesh/operators/bmo_wireframe.c index fc2e1bbaf3e..cb2dc4b89f6 100644 --- a/source/blender/bmesh/operators/bmo_wireframe.c +++ b/source/blender/bmesh/operators/bmo_wireframe.c @@ -250,7 +250,7 @@ void bmo_wireframe_exec(BMesh *bm, BMOperator *op) BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_TAG, false); } - verts_loop = MEM_mallocN(sizeof(BMVert **) * verts_loop_tot, __func__); + verts_loop = MEM_mallocN(sizeof(BMVert *) * verts_loop_tot, __func__); verts_loop_tot = 0; /* count up again */ BMO_ITER (f_src, &oiter, op->slots_in, "faces", BM_FACE) { |