Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-08-08 06:29:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-08 06:38:00 +0300
commit171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 (patch)
treeea51f4fa508a39807e6f6d333b2d53af8a2b9fc1 /source/blender/editors/gpencil
parent4bf3ca20165959f98c7c830a138ba2901d3dd851 (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/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_armature.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_uv.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_armature.c b/source/blender/editors/gpencil/gpencil_armature.c
index 962a74d9e6f..5cc5e7ecdcd 100644
--- a/source/blender/editors/gpencil/gpencil_armature.c
+++ b/source/blender/editors/gpencil/gpencil_armature.c
@@ -308,10 +308,10 @@ static void gpencil_add_verts_to_dgroups(
/* create an array of root and tip positions transformed into
* global coords */
- root = MEM_callocN(numbones * sizeof(float) * 3, "root");
- tip = MEM_callocN(numbones * sizeof(float) * 3, "tip");
- selected = MEM_callocN(numbones * sizeof(int), "selected");
- radsqr = MEM_callocN(numbones * sizeof(float), "radsqr");
+ root = MEM_callocN(sizeof(float[3]) * numbones, "root");
+ tip = MEM_callocN(sizeof(float[3]) * numbones, "tip");
+ selected = MEM_callocN(sizeof(int) * numbones, "selected");
+ radsqr = MEM_callocN(sizeof(float) * numbones, "radsqr");
for (j = 0; j < numbones; j++) {
bone = bonelist[j];
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index aaf88e1a0b0..5aae10a5db5 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2980,7 +2980,7 @@ bool ED_gpencil_stroke_point_is_inside(bGPDstroke *gps,
int(*mcoords)[2] = NULL;
int len = gps->totpoints;
- mcoords = MEM_mallocN(sizeof(int) * 2 * len, __func__);
+ mcoords = MEM_mallocN(sizeof(int[2]) * len, __func__);
/* Convert stroke to 2D array of points. */
bGPDspoint *pt;
diff --git a/source/blender/editors/gpencil/gpencil_uv.c b/source/blender/editors/gpencil/gpencil_uv.c
index e21b2049028..8304641611e 100644
--- a/source/blender/editors/gpencil/gpencil_uv.c
+++ b/source/blender/editors/gpencil/gpencil_uv.c
@@ -182,7 +182,7 @@ static bool gpencil_uv_transform_init(bContext *C, wmOperator *op)
if (i > 0) {
mul_v3_fl(center, 1.0f / i);
/* Create arrays to save all transformations. */
- opdata->array_loc = MEM_calloc_arrayN(i, 2 * sizeof(float), __func__);
+ opdata->array_loc = MEM_calloc_arrayN(i, sizeof(float[2]), __func__);
opdata->array_rot = MEM_calloc_arrayN(i, sizeof(float), __func__);
opdata->array_scale = MEM_calloc_arrayN(i, sizeof(float), __func__);
i = 0;