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/bmesh/intern/bmesh_operators.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/bmesh/intern/bmesh_operators.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 19e42b33c80..746e9668671 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -55,17 +55,17 @@ BLI_STATIC_ASSERT(ARRAY_SIZE(bmo_error_messages) == BMERR_TOTAL, "message mismat /* operator slot type information - size of one element of the type given. */ const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES] = { - 0, /* 0: BMO_OP_SLOT_SENTINEL */ - sizeof(int), /* 1: BMO_OP_SLOT_BOOL */ - sizeof(int), /* 2: BMO_OP_SLOT_INT */ - sizeof(float), /* 3: BMO_OP_SLOT_FLT */ - sizeof(void *), /* 4: BMO_OP_SLOT_PNT */ - sizeof(void *), /* 5: BMO_OP_SLOT_PNT */ - 0, /* 6: unused */ - 0, /* 7: unused */ - sizeof(float) * 3, /* 8: BMO_OP_SLOT_VEC */ - sizeof(void *), /* 9: BMO_OP_SLOT_ELEMENT_BUF */ - sizeof(void *), /* 10: BMO_OP_SLOT_MAPPING */ + 0, /* 0: BMO_OP_SLOT_SENTINEL */ + sizeof(int), /* 1: BMO_OP_SLOT_BOOL */ + sizeof(int), /* 2: BMO_OP_SLOT_INT */ + sizeof(float), /* 3: BMO_OP_SLOT_FLT */ + sizeof(void *), /* 4: BMO_OP_SLOT_PNT */ + sizeof(void *), /* 5: BMO_OP_SLOT_PNT */ + 0, /* 6: unused */ + 0, /* 7: unused */ + sizeof(float[3]), /* 8: BMO_OP_SLOT_VEC */ + sizeof(void *), /* 9: BMO_OP_SLOT_ELEMENT_BUF */ + sizeof(void *), /* 10: BMO_OP_SLOT_MAPPING */ }; /* Dummy slot so there is something to return when slot name lookup fails */ @@ -418,7 +418,7 @@ void BMO_slot_mat_set(BMOperator *op, } slot->len = 4; - slot->data.p = BLI_memarena_alloc(op->arena, sizeof(float) * 4 * 4); + slot->data.p = BLI_memarena_alloc(op->arena, sizeof(float[4][4])); if (size == 4) { copy_m4_m4(slot->data.p, (float(*)[4])mat); |