diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 06:29:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 06:38:00 +0300 |
commit | 171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 (patch) | |
tree | ea51f4fa508a39807e6f6d333b2d53af8a2b9fc1 /source/blender/editors/mesh/meshtools.c | |
parent | 4bf3ca20165959f98c7c830a138ba2901d3dd851 (diff) |
Cleanup: use array syntax for sizeof with fixed values
Also order sizeof(..) first to promote other values to size_t.
Diffstat (limited to 'source/blender/editors/mesh/meshtools.c')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 4d84db9b35b..b96eeedd86f 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -452,7 +452,7 @@ int ED_mesh_join_objects_exec(bContext *C, wmOperator *op) if (kb->data) { MEM_freeN(kb->data); } - kb->data = MEM_callocN(sizeof(float) * 3 * totvert, "join_shapekey"); + kb->data = MEM_callocN(sizeof(float[3]) * totvert, "join_shapekey"); kb->totelem = totvert; } } @@ -550,7 +550,7 @@ int ED_mesh_join_objects_exec(bContext *C, wmOperator *op) BKE_keyblock_copy_settings(kbn, kb); /* adjust settings to fit (allocate a new data-array) */ - kbn->data = MEM_callocN(sizeof(float) * 3 * totvert, "joined_shapekey"); + kbn->data = MEM_callocN(sizeof(float[3]) * totvert, "joined_shapekey"); kbn->totelem = totvert; } @@ -1154,7 +1154,7 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em, Mesh *me_eval) int a; mirrorverts = MEM_callocN(sizeof(int) * totvert, "MirrorVerts"); - mirrorfaces = MEM_callocN(sizeof(int) * 2 * totface, "MirrorFaces"); + mirrorfaces = MEM_callocN(sizeof(int[2]) * totface, "MirrorFaces"); mvert = me_eval ? me_eval->mvert : me->mvert; mface = me_eval ? me_eval->mface : me->mface; |