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 | |
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')
5 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index e10d588c19f..37249896e34 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -636,7 +636,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut /* move button over from oldblock to new block */ BLI_remlink(&oldblock->buttons, oldbut); - BLI_insertlink(&block->buttons, but, oldbut); + BLI_insertlinkafter(&block->buttons, but, oldbut); oldbut->block = block; *butpp = oldbut; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 7c74fa24893..8d29813e2ac 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -385,7 +385,7 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md } BLI_remlink(&ob->modifiers, md); - BLI_insertlink(&ob->modifiers, md->prev->prev, md); + BLI_insertlinkbefore(&ob->modifiers, md->prev, md); } return 1; @@ -406,7 +406,7 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData * } BLI_remlink(&ob->modifiers, md); - BLI_insertlink(&ob->modifiers, md->next, md); + BLI_insertlinkafter(&ob->modifiers, md->next, md); } return 1; @@ -722,7 +722,7 @@ int ED_object_modifier_copy(ReportList *UNUSED(reports), Object *ob, ModifierDat nmd = modifier_new(md->type); modifier_copyData(md, nmd); - BLI_insertlink(&ob->modifiers, md, nmd); + BLI_insertlinkafter(&ob->modifiers, md, nmd); modifier_unique_name(&ob->modifiers, nmd); return 1; 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; diff --git a/source/blender/editors/space_sequencer/sequencer_modifier.c b/source/blender/editors/space_sequencer/sequencer_modifier.c index a4a485b34c6..51df21e509a 100644 --- a/source/blender/editors/space_sequencer/sequencer_modifier.c +++ b/source/blender/editors/space_sequencer/sequencer_modifier.c @@ -180,13 +180,13 @@ static int strip_modifier_move_exec(bContext *C, wmOperator *op) if (direction == SEQ_MODIFIER_MOVE_UP) { if (smd->prev) { BLI_remlink(&seq->modifiers, smd); - BLI_insertlink(&seq->modifiers, smd->prev->prev, smd); + BLI_insertlinkbefore(&seq->modifiers, smd->prev, smd); } } else if (direction == SEQ_MODIFIER_MOVE_DOWN) { if (smd->next) { BLI_remlink(&seq->modifiers, smd); - BLI_insertlink(&seq->modifiers, smd->next, smd); + BLI_insertlinkafter(&seq->modifiers, smd->next, smd); } } |