From 576142dc85c78ced792e3440a7665ea57e45a0cc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2021 10:17:33 +1100 Subject: Cleanup: pass the sizeof(..) as the second arg for array allocation By argument naming and convention this is the intended argument order. --- source/blender/editors/sculpt_paint/sculpt_expand.c | 12 ++++++------ source/blender/editors/sculpt_paint/sculpt_face_set.c | 2 +- source/blender/editors/sculpt_paint/sculpt_filter_mesh.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c index 40874375772..2ba03969f38 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_expand.c @@ -465,7 +465,7 @@ static float *sculpt_expand_topology_falloff_create(Sculpt *sd, Object *ob, cons { SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - float *dists = MEM_calloc_arrayN(sizeof(float), totvert, "topology dist"); + float *dists = MEM_calloc_arrayN(totvert, sizeof(float), "topology dist"); SculptFloodFill flood; SCULPT_floodfill_init(ss, &flood); @@ -515,7 +515,7 @@ static float *sculpt_expand_normal_falloff_create(Sculpt *sd, { SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - float *dists = MEM_malloc_arrayN(sizeof(float), totvert, "normal dist"); + float *dists = MEM_malloc_arrayN(totvert, sizeof(float), "normal dist"); float *edge_factor = MEM_callocN(sizeof(float) * totvert, "mask edge factor"); for (int i = 0; i < totvert; i++) { edge_factor[i] = 1.0f; @@ -560,7 +560,7 @@ static float *sculpt_expand_spherical_falloff_create(Object *ob, const int v) SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - float *dists = MEM_malloc_arrayN(sizeof(float), totvert, "spherical dist"); + float *dists = MEM_malloc_arrayN(totvert, sizeof(float), "spherical dist"); for (int i = 0; i < totvert; i++) { dists[i] = FLT_MAX; } @@ -591,7 +591,7 @@ static float *sculpt_expand_boundary_topology_falloff_create(Object *ob, const i { SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - float *dists = MEM_calloc_arrayN(sizeof(float), totvert, "spherical dist"); + float *dists = MEM_calloc_arrayN(totvert, sizeof(float), "spherical dist"); BLI_bitmap *visited_vertices = BLI_BITMAP_NEW(totvert, "visited vertices"); GSQueue *queue = BLI_gsqueue_new(sizeof(int)); @@ -652,7 +652,7 @@ static float *sculpt_expand_diagonals_falloff_create(Object *ob, const int v) { SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - float *dists = MEM_calloc_arrayN(sizeof(float), totvert, "spherical dist"); + float *dists = MEM_calloc_arrayN(totvert, sizeof(float), "spherical dist"); /* This algorithm uses mesh data (polys and loops), so this falloff type can't be initialized for * Multires. It also does not make sense to implement it for dyntopo as the result will be the @@ -863,7 +863,7 @@ static void sculpt_expand_topology_from_state_boundary(Object *ob, SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - float *dists = MEM_calloc_arrayN(sizeof(float), totvert, "topology dist"); + float *dists = MEM_calloc_arrayN(totvert, sizeof(float), "topology dist"); BLI_bitmap *boundary_vertices = sculpt_expand_boundary_from_enabled(ss, enabled_vertices, false); SculptFloodFill flood; diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c index bdbdb75732a..89e07081802 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.c +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c @@ -1233,7 +1233,7 @@ static void sculpt_face_set_edit_fair_face_set(Object *ob, const int totvert = SCULPT_vertex_count_get(ss); Mesh *mesh = ob->data; - bool *fair_vertices = MEM_malloc_arrayN(sizeof(bool), totvert, "fair vertices"); + bool *fair_vertices = MEM_malloc_arrayN(totvert, sizeof(bool), "fair vertices"); SCULPT_boundary_info_ensure(ob); diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c index 3fc1a7674f7..2a7c2a46818 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c @@ -511,7 +511,7 @@ static void mesh_filter_init_limit_surface_co(SculptSession *ss) FilterCache *filter_cache = ss->filter_cache; filter_cache->limit_surface_co = MEM_malloc_arrayN( - sizeof(float[3]), totvert, "limit surface co"); + totvert, sizeof(float[3]), "limit surface co"); for (int i = 0; i < totvert; i++) { SCULPT_vertex_limit_surface_get(ss, i, filter_cache->limit_surface_co[i]); } @@ -528,7 +528,7 @@ static void mesh_filter_sharpen_init(SculptSession *ss, filter_cache->sharpen_smooth_ratio = smooth_ratio; filter_cache->sharpen_intensify_detail_strength = intensify_detail_strength; filter_cache->sharpen_curvature_smooth_iterations = curvature_smooth_iterations; - filter_cache->sharpen_factor = MEM_malloc_arrayN(sizeof(float), totvert, "sharpen factor"); + filter_cache->sharpen_factor = MEM_malloc_arrayN(totvert, sizeof(float), "sharpen factor"); filter_cache->detail_directions = MEM_malloc_arrayN( totvert, sizeof(float[3]), "sharpen detail direction"); -- cgit v1.2.3