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>2021-02-05 14:34:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-05 14:34:03 +0300
commit606805d1b78e32fe007452fd75b5d8522eb43a04 (patch)
tree2394adb4c0743d014d7e3e78369f91b074a8ed29 /source/blender/blenkernel
parentf8cbd333d653022d3a3340d0249dd957f02e31e5 (diff)
Cleanup: use 'r_' prefix for return arguments, order last
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_mask.h12
-rw-r--r--source/blender/blenkernel/BKE_node.h4
-rw-r--r--source/blender/blenkernel/intern/collection.c19
-rw-r--r--source/blender/blenkernel/intern/mask_evaluate.c52
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c4
-rw-r--r--source/blender/blenkernel/intern/node.cc13
6 files changed, 55 insertions, 49 deletions
diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h
index 29072742f81..8e2f6e6f10c 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -269,18 +269,18 @@ int BKE_mask_spline_differentiate_calc_total(const struct MaskSpline *spline,
const unsigned int resol);
float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline,
- unsigned int *tot_diff_point,
- const unsigned int resol))[2];
+ const unsigned int resol,
+ unsigned int *r_tot_diff_point))[2];
void BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline,
float (*feather_points)[2],
const unsigned int tot_feather_point);
float (*BKE_mask_spline_differentiate(
- struct MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2];
+ struct MaskSpline *spline, int width, int height, unsigned int *r_tot_diff_point))[2];
float (*BKE_mask_spline_feather_differentiated_points_with_resolution(
struct MaskSpline *spline,
- unsigned int *tot_feather_point,
const unsigned int resol,
- const bool do_feather_isect))[2];
+ const bool do_feather_isect,
+ unsigned int *r_tot_feather_point))[2];
/* *** mask point functions which involve evaluation *** */
float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
@@ -289,7 +289,7 @@ float *BKE_mask_point_segment_diff(struct MaskSpline *spline,
struct MaskSplinePoint *point,
int width,
int height,
- unsigned int *tot_diff_point);
+ unsigned int *r_tot_diff_point);
float *BKE_mask_point_segment_feather_diff(struct MaskSpline *spline,
struct MaskSplinePoint *point,
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index dcfd6ca7bdd..9ee21c6e825 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -453,7 +453,9 @@ void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree);
void ntreeUpdateAllNew(struct Main *main);
void ntreeUpdateAllUsers(struct Main *main, struct ID *id);
-void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes);
+void ntreeGetDependencyList(struct bNodeTree *ntree,
+ struct bNode ***r_deplist,
+ int *r_deplist_len);
/* XXX old trees handle output flags automatically based on special output
* node types and last active selection.
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 601ee57fc89..dd0572f9b12 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1909,7 +1909,7 @@ bool BKE_collection_move(Main *bmain,
/** \name Iterators
* \{ */
-/* scene collection iteractor */
+/* Scene collection iterator. */
typedef struct CollectionsIteratorData {
Scene *scene;
@@ -1941,10 +1941,12 @@ static void scene_collections_build_array(Collection *collection, void *data)
(*array)++;
}
-static void scene_collections_array(Scene *scene, Collection ***collections_array, int *tot)
+static void scene_collections_array(Scene *scene,
+ Collection ***r_collections_array,
+ int *r_collections_array_len)
{
- *collections_array = NULL;
- *tot = 0;
+ *r_collections_array = NULL;
+ *r_collections_array_len = 0;
if (scene == NULL) {
return;
@@ -1952,14 +1954,15 @@ static void scene_collections_array(Scene *scene, Collection ***collections_arra
Collection *collection = scene->master_collection;
BLI_assert(collection != NULL);
- scene_collection_callback(collection, scene_collections_count, tot);
+ scene_collection_callback(collection, scene_collections_count, r_collections_array_len);
- if (*tot == 0) {
+ if (*r_collections_array_len == 0) {
return;
}
- Collection **array = MEM_mallocN(sizeof(Collection *) * (*tot), "CollectionArray");
- *collections_array = array;
+ Collection **array = MEM_mallocN(sizeof(Collection *) * (*r_collections_array_len),
+ "CollectionArray");
+ *r_collections_array = array;
scene_collection_callback(collection, scene_collections_build_array, &array);
}
diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c
index 595fd0c9550..a42836b5399 100644
--- a/source/blender/blenkernel/intern/mask_evaluate.c
+++ b/source/blender/blenkernel/intern/mask_evaluate.c
@@ -128,8 +128,8 @@ int BKE_mask_spline_differentiate_calc_total(const MaskSpline *spline, const uns
}
float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline,
- unsigned int *tot_diff_point,
- const unsigned int resol))[2]
+ const unsigned int resol,
+ unsigned int *r_tot_diff_point))[2]
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -140,12 +140,12 @@ float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline,
if (spline->tot_point <= 1) {
/* nothing to differentiate */
- *tot_diff_point = 0;
+ *r_tot_diff_point = 0;
return NULL;
}
/* len+1 because of 'forward_diff_bezier' function */
- *tot_diff_point = tot;
+ *r_tot_diff_point = tot;
diff_points = fp = MEM_mallocN((tot + 1) * sizeof(*diff_points), "mask spline vets");
a = spline->tot_point - 1;
@@ -192,11 +192,11 @@ float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline,
}
float (*BKE_mask_spline_differentiate(
- MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2]
+ MaskSpline *spline, int width, int height, unsigned int *r_tot_diff_point))[2]
{
uint resol = BKE_mask_spline_resolution(spline, width, height);
- return BKE_mask_spline_differentiate_with_resolution(spline, tot_diff_point, resol);
+ return BKE_mask_spline_differentiate_with_resolution(spline, resol, r_tot_diff_point);
}
/* ** feather points self-intersection collapse routine ** */
@@ -507,9 +507,9 @@ void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline,
/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */
static float (*mask_spline_feather_differentiated_points_with_resolution__even(
MaskSpline *spline,
- unsigned int *tot_feather_point,
const unsigned int resol,
- const bool do_feather_isect))[2]
+ const bool do_feather_isect,
+ unsigned int *r_tot_feather_point))[2]
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
MaskSplinePoint *point_curr, *point_prev;
@@ -569,7 +569,7 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__even(
point_curr++;
}
- *tot_feather_point = tot;
+ *r_tot_feather_point = tot;
if ((spline->flag & MASK_SPLINE_NOINTERSECT) && do_feather_isect) {
BKE_mask_spline_feather_collapse_inner_loops(spline, feather, tot);
@@ -581,9 +581,9 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__even(
/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution() ! */
static float (*mask_spline_feather_differentiated_points_with_resolution__double(
MaskSpline *spline,
- unsigned int *tot_feather_point,
const unsigned int resol,
- const bool do_feather_isect))[2]
+ const bool do_feather_isect,
+ unsigned int *r_tot_feather_point))[2]
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -594,12 +594,12 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double
if (spline->tot_point <= 1) {
/* nothing to differentiate */
- *tot_feather_point = 0;
+ *r_tot_feather_point = 0;
return NULL;
}
/* len+1 because of 'forward_diff_bezier' function */
- *tot_feather_point = tot;
+ *r_tot_feather_point = tot;
feather = fp = MEM_mallocN((tot + 1) * sizeof(*feather), "mask spline vets");
a = spline->tot_point - 1;
@@ -724,24 +724,24 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double
* values align with #BKE_mask_spline_differentiate_with_resolution
* when \a resol arguments match.
*/
-float (
- *BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline,
- unsigned int *tot_feather_point,
- const unsigned int resol,
- const bool do_feather_isect))[2]
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution(
+ MaskSpline *spline,
+ const unsigned int resol,
+ const bool do_feather_isect,
+ unsigned int *r_tot_feather_point))[2]
{
switch (spline->offset_mode) {
case MASK_SPLINE_OFFSET_EVEN:
return mask_spline_feather_differentiated_points_with_resolution__even(
- spline, tot_feather_point, resol, do_feather_isect);
+ spline, resol, do_feather_isect, r_tot_feather_point);
case MASK_SPLINE_OFFSET_SMOOTH:
default:
return mask_spline_feather_differentiated_points_with_resolution__double(
- spline, tot_feather_point, resol, do_feather_isect);
+ spline, resol, do_feather_isect, r_tot_feather_point);
}
}
-float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_point))[2]
+float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *r_tot_feather_point))[2]
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -783,7 +783,7 @@ float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_poin
}
}
- *tot_feather_point = tot;
+ *r_tot_feather_point = tot;
return feather;
}
@@ -793,7 +793,7 @@ float *BKE_mask_point_segment_feather_diff(MaskSpline *spline,
MaskSplinePoint *point,
int width,
int height,
- unsigned int *tot_feather_point)
+ unsigned int *r_tot_feather_point)
{
float *feather, *fp;
unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height);
@@ -812,7 +812,7 @@ float *BKE_mask_point_segment_feather_diff(MaskSpline *spline,
fp[1] = co[1] + n[1] * weight;
}
- *tot_feather_point = resol;
+ *r_tot_feather_point = resol;
return feather;
}
@@ -821,7 +821,7 @@ float *BKE_mask_point_segment_diff(MaskSpline *spline,
MaskSplinePoint *point,
int width,
int height,
- unsigned int *tot_diff_point)
+ unsigned int *r_tot_diff_point)
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point);
@@ -837,7 +837,7 @@ float *BKE_mask_point_segment_diff(MaskSpline *spline,
}
/* resol+1 because of 'forward_diff_bezier' function */
- *tot_diff_point = resol + 1;
+ *r_tot_diff_point = resol + 1;
diff_points = fp = MEM_callocN(sizeof(float[2]) * (resol + 1), "mask segment vets");
for (j = 0; j < 2; j++) {
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 583ee8f2857..d29a6e75954 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -646,11 +646,11 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle,
const unsigned int resol_b = BKE_mask_spline_feather_resolution(spline, width, height) / 4;
const unsigned int resol = CLAMPIS(MAX2(resol_a, resol_b), 4, 512);
- diff_points = BKE_mask_spline_differentiate_with_resolution(spline, &tot_diff_point, resol);
+ diff_points = BKE_mask_spline_differentiate_with_resolution(spline, resol, &tot_diff_point);
if (do_feather) {
diff_feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution(
- spline, &tot_diff_feather_points, resol, false);
+ spline, resol, false, &tot_diff_feather_points);
BLI_assert(diff_feather_points);
}
else {
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 3c9c255cacd..d78ba2a414e 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -3917,22 +3917,23 @@ static int node_get_deplist_recurs(bNodeTree *ntree, bNode *node, bNode ***nsort
return level;
}
-void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes)
+void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***r_deplist, int *r_deplist_len)
{
- *totnodes = 0;
+ *r_deplist_len = 0;
/* first clear data */
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
node->done = false;
- (*totnodes)++;
+ (*r_deplist_len)++;
}
- if (*totnodes == 0) {
- *deplist = nullptr;
+ if (*r_deplist_len == 0) {
+ *r_deplist = nullptr;
return;
}
bNode **nsort;
- nsort = *deplist = (bNode **)MEM_callocN((*totnodes) * sizeof(bNode *), "sorted node array");
+ nsort = *r_deplist = (bNode **)MEM_callocN((*r_deplist_len) * sizeof(bNode *),
+ "sorted node array");
/* recursive check */
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {