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/blenkernel/intern/multires.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/blenkernel/intern/multires.c')
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 392f95af917..6e1168d8a16 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -608,7 +608,7 @@ static void multires_reallocate_mdisps(int totloop, MDisps *mdisps, int lvl) /* reallocate displacements to be filled in */ for (i = 0; i < totloop; i++) { int totdisp = multires_grid_tot[lvl]; - float(*disps)[3] = MEM_calloc_arrayN(totdisp, 3 * sizeof(float), "multires disps"); + float(*disps)[3] = MEM_calloc_arrayN(totdisp, sizeof(float[3]), "multires disps"); if (mdisps[i].disps) { MEM_freeN(mdisps[i].disps); @@ -726,7 +726,7 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl) float(*disps)[3], (*ndisps)[3], (*hdisps)[3]; int totdisp = multires_grid_tot[lvl]; - disps = MEM_calloc_arrayN(totdisp, 3 * sizeof(float), "multires disps"); + disps = MEM_calloc_arrayN(totdisp, sizeof(float[3]), "multires disps"); if (mdisp->disps != NULL) { ndisps = disps; @@ -1540,7 +1540,7 @@ static void old_mdisps_convert(MFace *mface, MDisps *mdisp) int x, y, S; float(*disps)[3], (*out)[3], u = 0.0f, v = 0.0f; /* Quite gcc barking. */ - disps = MEM_calloc_arrayN(newtotdisp, 3 * sizeof(float), "multires disps"); + disps = MEM_calloc_arrayN(newtotdisp, sizeof(float[3]), "multires disps"); out = disps; for (S = 0; S < nvert; S++) { @@ -1600,7 +1600,7 @@ void multires_load_old_250(Mesh *me) for (j = 0; j < nvert; j++, k++) { mdisps2[k].disps = MEM_calloc_arrayN( - totdisp, 3 * sizeof(float), "multires disp in conversion"); + totdisp, sizeof(float[3]), "multires disp in conversion"); mdisps2[k].totdisp = totdisp; mdisps2[k].level = mdisps[i].level; memcpy(mdisps2[k].disps, mdisps[i].disps + totdisp * j, totdisp); @@ -1672,7 +1672,7 @@ static void create_old_vert_face_map(ListBase **map, IndexNode *node = NULL; (*map) = MEM_calloc_arrayN(totvert, sizeof(ListBase), "vert face map"); - (*mem) = MEM_calloc_arrayN(totface, 4 * sizeof(IndexNode), "vert face map mem"); + (*mem) = MEM_calloc_arrayN(totface, sizeof(IndexNode[4]), "vert face map mem"); node = *mem; /* Find the users */ @@ -1694,7 +1694,7 @@ static void create_old_vert_edge_map(ListBase **map, IndexNode *node = NULL; (*map) = MEM_calloc_arrayN(totvert, sizeof(ListBase), "vert edge map"); - (*mem) = MEM_calloc_arrayN(totedge, 2 * sizeof(IndexNode), "vert edge map mem"); + (*mem) = MEM_calloc_arrayN(totedge, sizeof(IndexNode[2]), "vert edge map mem"); node = *mem; /* Find the users */ @@ -2376,7 +2376,7 @@ void multires_topology_changed(Mesh *me) if (!mdisp->totdisp || !mdisp->disps) { if (grid) { mdisp->totdisp = grid; - mdisp->disps = MEM_calloc_arrayN(3 * sizeof(float), mdisp->totdisp, "mdisp topology"); + mdisp->disps = MEM_calloc_arrayN(sizeof(float[3]), mdisp->totdisp, "mdisp topology"); } continue; |