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:
authorDalai Felinto <dalai@blender.org>2020-04-03 20:15:01 +0300
committerDalai Felinto <dalai@blender.org>2020-04-03 20:27:46 +0300
commitd138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch)
treef4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/editors/curve
parentb0c1184875d39abac4a65a5d20e263ea6d841009 (diff)
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside the for loop. To handle it outside as well is a different challenge. Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c4
-rw-r--r--source/blender/editors/curve/editcurve_select.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 45e278d691c..8984c090a0e 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -5168,7 +5168,7 @@ static bool ed_editcurve_extrude(Curve *cu, EditNurb *editnurb, View3D *v3d)
BKE_curve_nurb_vert_active_get(cu, &cu_actnu, &cu_actvert.p);
int act_offset = 0;
- for (Nurb *nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
BLI_assert(nu->pntsu > 0);
int i;
int pnt_len = nu->pntsu;
@@ -6775,7 +6775,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
continue;
}
- for (Nurb *nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (ED_curve_nurb_select_check(v3d, nu)) {
if (!clear) {
nu->flag |= CU_SMOOTH;
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c
index e009add1acf..9cf61d02677 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -199,7 +199,7 @@ bool ED_curve_nurb_select_all(const Nurb *nu)
bool ED_curve_select_all(EditNurb *editnurb)
{
bool changed = false;
- for (Nurb *nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
changed |= ED_curve_nurb_select_all(nu);
}
return changed;
@@ -258,7 +258,7 @@ bool ED_curve_select_check(View3D *v3d, struct EditNurb *editnurb)
bool ED_curve_deselect_all(EditNurb *editnurb)
{
bool changed = false;
- for (Nurb *nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
changed |= ED_curve_nurb_deselect_all(nu);
}
return changed;