diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-22 18:12:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-22 18:12:55 +0400 |
commit | 4df5b943edeb7bb65a5b19c6130e1959966c2878 (patch) | |
tree | beb841832257c4d97c5c930662eaec53d39c3cc5 /source/blender/editors/physics | |
parent | 7ad0790189c77c1f910578928e69be48cc7aad37 (diff) |
patch [#34103] - listbase.patch, insertlinkbefore.patch
from Lawrence D'Oliveiro (ldo)
notes from tracker:
use bool for return type from BLI_remlink_safe, necessitating including BLI_utildefines.h in BLI_listbase.h
get rid of duplicate BLI_insertlink, use BLI_insertlinkafter instead.
A few places which were using BLI_insertlinkafter (actually BLI_insertlink), when it would be simpler to use BLI_insertlinkbefore instead.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_boids.c | 8 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index 154daf0eb72..8a5f623c533 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -157,7 +157,7 @@ static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op)) for (rule = state->rules.first; rule; rule=rule->next) { if (rule->flag & BOIDRULE_CURRENT && rule->prev) { BLI_remlink(&state->rules, rule); - BLI_insertlink(&state->rules, rule->prev->prev, rule); + BLI_insertlinkbefore(&state->rules, rule->prev, rule); DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); break; @@ -193,7 +193,7 @@ static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op)) for (rule = state->rules.first; rule; rule=rule->next) { if (rule->flag & BOIDRULE_CURRENT && rule->next) { BLI_remlink(&state->rules, rule); - BLI_insertlink(&state->rules, rule->next, rule); + BLI_insertlinkafter(&state->rules, rule->next, rule); DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); break; @@ -314,7 +314,7 @@ static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op)) for (state = boids->states.first; state; state=state->next) { if (state->flag & BOIDSTATE_CURRENT && state->prev) { BLI_remlink(&boids->states, state); - BLI_insertlink(&boids->states, state->prev->prev, state); + BLI_insertlinkbefore(&boids->states, state->prev, state); break; } } @@ -349,7 +349,7 @@ static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op)) for (state = boids->states.first; state; state=state->next) { if (state->flag & BOIDSTATE_CURRENT && state->next) { BLI_remlink(&boids->states, state); - BLI_insertlink(&boids->states, state->next, state); + BLI_insertlinkafter(&boids->states, state->next, state); DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); break; } diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 8cae0140b5a..5fd2a0806e9 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -310,7 +310,7 @@ static int target_move_up_exec(bContext *C, wmOperator *UNUSED(op)) for (; pt; pt=pt->next) { if (pt->flag & PTARGET_CURRENT && pt->prev) { BLI_remlink(&psys->targets, pt); - BLI_insertlink(&psys->targets, pt->prev->prev, pt); + BLI_insertlinkbefore(&psys->targets, pt->prev, pt); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); @@ -348,7 +348,7 @@ static int target_move_down_exec(bContext *C, wmOperator *UNUSED(op)) for (; pt; pt=pt->next) { if (pt->flag & PTARGET_CURRENT && pt->next) { BLI_remlink(&psys->targets, pt); - BLI_insertlink(&psys->targets, pt->next, pt); + BLI_insertlinkafter(&psys->targets, pt->next, pt); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); @@ -387,7 +387,7 @@ static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op)) for (dw=part->dupliweights.first; dw; dw=dw->next) { if (dw->flag & PART_DUPLIW_CURRENT && dw->prev) { BLI_remlink(&part->dupliweights, dw); - BLI_insertlink(&part->dupliweights, dw->prev->prev, dw); + BLI_insertlinkbefore(&part->dupliweights, dw->prev, dw); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, NULL); break; @@ -509,7 +509,7 @@ static int dupliob_move_down_exec(bContext *C, wmOperator *UNUSED(op)) for (dw=part->dupliweights.first; dw; dw=dw->next) { if (dw->flag & PART_DUPLIW_CURRENT && dw->next) { BLI_remlink(&part->dupliweights, dw); - BLI_insertlink(&part->dupliweights, dw->next, dw); + BLI_insertlinkafter(&part->dupliweights, dw->next, dw); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, NULL); break; |