From 171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Aug 2020 13:29:21 +1000 Subject: Cleanup: use array syntax for sizeof with fixed values Also order sizeof(..) first to promote other values to size_t. --- source/blender/blenlib/intern/boxpack_2d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/intern/boxpack_2d.c') diff --git a/source/blender/blenlib/intern/boxpack_2d.c b/source/blender/blenlib/intern/boxpack_2d.c index 5bcb0c0322a..250a3fdf21b 100644 --- a/source/blender/blenlib/intern/boxpack_2d.c +++ b/source/blender/blenlib/intern/boxpack_2d.c @@ -309,8 +309,8 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r qsort(boxarray, (size_t)len, sizeof(BoxPack), box_areasort); /* add verts to the boxes, these are only used internally */ - vert = MEM_mallocN((size_t)len * 4 * sizeof(BoxVert), "BoxPack Verts"); - vertex_pack_indices = MEM_mallocN((size_t)len * 3 * sizeof(int), "BoxPack Indices"); + vert = MEM_mallocN(sizeof(BoxVert[4]) * (size_t)len, "BoxPack Verts"); + vertex_pack_indices = MEM_mallocN(sizeof(int[3]) * (size_t)len, "BoxPack Indices"); vs_ctx.vertarray = vert; -- cgit v1.2.3