diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-21 17:49:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-21 17:49:34 +0300 |
commit | b0f87a17460578382cabb8447934cb045eee223a (patch) | |
tree | 094315e2d96395e84b2a391006ea438dfd518904 | |
parent | 3d1896bc6deb8c5f3a03af374de731e3be54bb2d (diff) |
rename addlisttolist() to BLI_movelisttolist()
name was misleading because the list items were removed from the source list.
(no functional changes)
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_listbase.h | 17 | ||||
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 56 | ||||
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 8 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 4 | ||||
-rw-r--r-- | source/blender/editors/armature/reeb.c | 2 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_lib.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 2 |
17 files changed, 63 insertions, 62 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 0d1d08af44c..22d27dc2fde 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1500,7 +1500,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected */ extract_proxylocal_constraints(&proxylocal_constraints, &pchan->constraints); copy_constraints(&pchanw.constraints, &pchanp->constraints, FALSE); - addlisttolist(&pchanw.constraints, &proxylocal_constraints); + BLI_movelisttolist(&pchanw.constraints, &proxylocal_constraints); /* constraints - set target ob pointer to own object */ for (con= pchanw.constraints.first; con; con= con->next) { diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 5be8bda4cd9..a040c27caa0 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1516,14 +1516,14 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[], } /* add F-Curves to action */ - addlisttolist(&adt->action->curves, &anim); + BLI_movelisttolist(&adt->action->curves, &anim); } /* deal with drivers */ if (drivers.first) { if (G.f & G_DEBUG) printf("\thas drivers \n"); /* add drivers to end of driver stack */ - addlisttolist(&adt->drivers, &drivers); + BLI_movelisttolist(&adt->drivers, &drivers); } } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 3962c6a7500..7a8d3a8b19c 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -890,7 +890,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup if(dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */ ListBase lb_dupli_pid; BKE_ptcache_ids_from_object(&lb_dupli_pid, dob->ob, scene, duplis); - addlisttolist(lb, &lb_dupli_pid); + BLI_movelisttolist(lb, &lb_dupli_pid); if(lb_dupli_pid.first) printf("Adding Dupli\n"); } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index d35fee2addc..19f872fbd40 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -790,7 +790,7 @@ void sort_seq(Scene *scene) } } - addlisttolist(&seqbase, &effbase); + BLI_movelisttolist(&seqbase, &effbase); *(ed->seqbasep)= seqbase; } @@ -3234,7 +3234,7 @@ void seq_dupe_animdata(Scene *scene, char *name_from, char *name_to) BKE_animdata_fix_paths_rename(&scene->id, scene->adt, "sequence_editor.sequences_all", name_from, name_to, 0, 0, 0); /* add the original fcurves back */ - addlisttolist(&scene->adt->action->curves, &lb); + BLI_movelisttolist(&scene->adt->action->curves, &lb); } /* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */ diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index c4dc0894f80..a41b49de242 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -40,13 +40,12 @@ extern "C" { #endif -void addlisttolist(struct ListBase *list1, struct ListBase *list2); void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink); -void *BLI_findlink(struct ListBase *listbase, int number); -int BLI_findindex(struct ListBase *listbase, void *vlink); -void *BLI_findstring(struct ListBase *listbase, const char *id, int offset); -void *BLI_findstring_ptr(struct ListBase *listbase, const char *id, int offset); -int BLI_findstringindex(struct ListBase *listbase, const char *id, int offset); +void *BLI_findlink(const struct ListBase *listbase, int number); +int BLI_findindex(const struct ListBase *listbase, void *vlink); +void *BLI_findstring(const struct ListBase *listbase, const char *id, const int offset); +void *BLI_findstring_ptr(const struct ListBase *listbase, const char *id, const int offset); +int BLI_findstringindex(const struct ListBase *listbase, const char *id, const int offset); void BLI_freelistN(struct ListBase *listbase); void BLI_addtail(struct ListBase *listbase, void *vlink); void BLI_remlink(struct ListBase *listbase, void *vlink); @@ -57,9 +56,11 @@ void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnew void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink); void BLI_sortlist(struct ListBase *listbase, int (*cmp)(void *, void *)); void BLI_freelist(struct ListBase *listbase); -int BLI_countlist(struct ListBase *listbase); +int BLI_countlist(const struct ListBase *listbase); void BLI_freelinkN(struct ListBase *listbase, void *vlink); -void BLI_duplicatelist(struct ListBase *list1, const struct ListBase *list2); + +void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src); +void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src); /* create a generic list node containing link to provided data */ struct LinkData *BLI_genericNodeN(void *data); diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 776f2d085df..b8b0b5b6eda 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -46,20 +46,20 @@ /* implementation */ /* Ripped this from blender.c */ -void addlisttolist(ListBase *list1, ListBase *list2) +void BLI_movelisttolist(ListBase *dst, ListBase *src) { - if (list2->first==0) return; + if (src->first==0) return; - if (list1->first==0) { - list1->first= list2->first; - list1->last= list2->last; + if (dst->first==0) { + dst->first= src->first; + dst->last= src->last; } else { - ((Link *)list1->last)->next= list2->first; - ((Link *)list2->first)->prev= list1->last; - list1->last= list2->last; + ((Link *)dst->last)->next= src->first; + ((Link *)src->first)->prev= dst->last; + dst->last= src->last; } - list2->first= list2->last= 0; + src->first= src->last= 0; } void BLI_addhead(ListBase *listbase, void *vlink) @@ -304,7 +304,7 @@ void BLI_freelistN(ListBase *listbase) } -int BLI_countlist(ListBase *listbase) +int BLI_countlist(const ListBase *listbase) { Link *link; int count = 0; @@ -319,7 +319,7 @@ int BLI_countlist(ListBase *listbase) return count; } -void *BLI_findlink(ListBase *listbase, int number) +void *BLI_findlink(const ListBase *listbase, int number) { Link *link = NULL; @@ -334,7 +334,7 @@ void *BLI_findlink(ListBase *listbase, int number) return link; } -int BLI_findindex(ListBase *listbase, void *vlink) +int BLI_findindex(const ListBase *listbase, void *vlink) { Link *link= NULL; int number= 0; @@ -354,7 +354,7 @@ int BLI_findindex(ListBase *listbase, void *vlink) return -1; } -void *BLI_findstring(ListBase *listbase, const char *id, int offset) +void *BLI_findstring(const ListBase *listbase, const char *id, const int offset) { Link *link= NULL; const char *id_iter; @@ -374,7 +374,7 @@ void *BLI_findstring(ListBase *listbase, const char *id, int offset) return NULL; } -void *BLI_findstring_ptr(ListBase *listbase, const char *id, int offset) +void *BLI_findstring_ptr(const ListBase *listbase, const char *id, const int offset) { Link *link= NULL; const char *id_iter; @@ -395,7 +395,7 @@ void *BLI_findstring_ptr(ListBase *listbase, const char *id, int offset) return NULL; } -int BLI_findstringindex(ListBase *listbase, const char *id, int offset) +int BLI_findstringindex(const ListBase *listbase, const char *id, const int offset) { Link *link= NULL; const char *id_iter; @@ -416,20 +416,20 @@ int BLI_findstringindex(ListBase *listbase, const char *id, int offset) return -1; } -void BLI_duplicatelist(ListBase *list1, const ListBase *list2) +void BLI_duplicatelist(ListBase *dst, const ListBase *src) { - struct Link *link1, *link2; - - /* in this order, to ensure it works if list1 == list2 */ - link2= list2->first; - list1->first= list1->last= 0; - - while(link2) { - link1= MEM_dupallocN(link2); - BLI_addtail(list1, link1); - - link2= link2->next; - } + struct Link *dst_link, *src_link; + + /* in this order, to ensure it works if dst == src */ + src_link= src->first; + dst->first= dst->last= 0; + + while(src_link) { + dst_link= MEM_dupallocN(src_link); + BLI_addtail(dst, dst_link); + + src_link= src_link->next; + } } /* create a generic list node containing link to provided data */ diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 85412e28c4f..86167078094 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -465,8 +465,8 @@ static void splitlist(ListBase *tempve, ListBase *temped, short nr) EditVert *eve,*nextve; EditEdge *eed,*nexted; - addlisttolist(tempve,&fillvertbase); - addlisttolist(temped,&filledgebase); + BLI_movelisttolist(tempve,&fillvertbase); + BLI_movelisttolist(temped,&filledgebase); eve= tempve->first; while(eve) { @@ -1029,8 +1029,8 @@ int BLI_edgefill(int mat_nr) } pf++; } - addlisttolist(&fillvertbase,&tempve); - addlisttolist(&filledgebase,&temped); + BLI_movelisttolist(&fillvertbase,&tempve); + BLI_movelisttolist(&filledgebase,&temped); /* FREE */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9e63b1be87d..612e6ba55e9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -384,7 +384,7 @@ static void add_main_to_main(Main *mainvar, Main *from) a= set_listbasepointers(mainvar, lbarray); a= set_listbasepointers(from, fromarray); while(a--) { - addlisttolist(lbarray[a], fromarray[a]); + BLI_movelisttolist(lbarray[a], fromarray[a]); } } diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 04cb5091f33..4c022e38d26 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -887,7 +887,7 @@ static void join_groups_action_temp (bAction *act) /* add list of channels to action's channels */ tempGroup= agrp->channels; - addlisttolist(&act->curves, &agrp->channels); + BLI_movelisttolist(&act->curves, &agrp->channels); agrp->channels= tempGroup; /* clear moved flag */ diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index f1bace1201f..a985b3b828a 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -729,7 +729,7 @@ void pose_copy_menu(Scene *scene) for (con= tmp_constraints.first; con; con= con->next) con->flag |= CONSTRAINT_PROXY_LOCAL; } - addlisttolist(&pchan->constraints, &tmp_constraints); + BLI_movelisttolist(&pchan->constraints, &tmp_constraints); /* update flags (need to add here, not just copy) */ pchan->constflag |= pchanact->constflag; @@ -836,7 +836,7 @@ void pose_copy_menu(Scene *scene) for (con= tmp_constraints.first; con; con= con->next) con->flag |= CONSTRAINT_PROXY_LOCAL; } - addlisttolist(&pchan->constraints, &tmp_constraints); + BLI_movelisttolist(&pchan->constraints, &tmp_constraints); /* update flags (need to add here, not just copy) */ pchan->constflag |= pchanact->constflag; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 3ac78f2c727..e896cccd1b3 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2204,7 +2204,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d e->arc = aDst; // Edge is stolen by new arc } - addlisttolist(&aDst->edges , &aSrc->edges); + BLI_movelisttolist(&aDst->edges , &aSrc->edges); } else { diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 5f9e56e324c..d24eb2e5f1e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -6025,7 +6025,7 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op)) CTX_DATA_END; cu= ob->data; - addlisttolist(&cu->nurb, &tempbase); + BLI_movelisttolist(&cu->nurb, &tempbase); DAG_scene_sort(bmain, scene); // because we removed object(s), call before editmode! diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index acbd9a3bb3e..e50f65256a7 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -698,7 +698,7 @@ static void check_fgons_selection(EditMesh *em) if(sel) efa->f |= SELECT; else efa->f &= ~SELECT; } - addlisttolist(&em->faces, &lbar[index]); + BLI_movelisttolist(&em->faces, &lbar[index]); } MEM_freeN(lbar); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index aebcde9749b..b1306a5c262 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -555,7 +555,7 @@ void xsortvert_flag(bContext *C, int flag) } } - addlisttolist(&vc.em->verts, &tbase); + BLI_movelisttolist(&vc.em->verts, &tbase); MEM_freeN(sortblock); @@ -613,7 +613,7 @@ void hashvert_flag(EditMesh *em, int flag) sb++; } - addlisttolist(&em->verts, &tbase); + BLI_movelisttolist(&em->verts, &tbase); MEM_freeN(sortblock); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index a5361ec676f..d98513e5509 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1564,7 +1564,7 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) if (newlist.first) { /* got new strips ? */ Sequence *seq; - addlisttolist(ed->seqbasep, &newlist); + BLI_movelisttolist(ed->seqbasep, &newlist); if (cut_side != SEQ_SIDE_BOTH) { SEQP_BEGIN(ed, seq) { @@ -1658,7 +1658,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) if(nseqbase.first) { Sequence * seq= nseqbase.first; /* rely on the nseqbase list being added at the end */ - addlisttolist(ed->seqbasep, &nseqbase); + BLI_movelisttolist(ed->seqbasep, &nseqbase); for( ; seq; seq= seq->next) seq_recursive_apply(seq, apply_unique_name_cb, scene); @@ -2029,7 +2029,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op)) if(last_seq==NULL || last_seq->type!=SEQ_META) return OPERATOR_CANCELLED; - addlisttolist(ed->seqbasep, &last_seq->seqbase); + BLI_movelisttolist(ed->seqbasep, &last_seq->seqbase); last_seq->seqbase.first= 0; last_seq->seqbase.last= 0; @@ -2701,7 +2701,7 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) } } - addlisttolist(ed->seqbasep, &nseqbase); + BLI_movelisttolist(ed->seqbasep, &nseqbase); WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 9c8bd3f4fec..8403dc55577 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -440,7 +440,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int pop ReportTimerInfo *rti; /* add reports to the global list, otherwise they are not seen */ - addlisttolist(&CTX_wm_reports(C)->list, &op->reports->list); + BLI_movelisttolist(&CTX_wm_reports(C)->list, &op->reports->list); /* After adding reports to the global list, reset the report timer. */ WM_event_remove_timer(wm, NULL, reports->reporttimer); @@ -1345,7 +1345,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa /* XXX - copied from 'wm_operator_finished()' */ /* add reports to the global list, otherwise they are not seen */ - addlisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list); + BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list); CTX_wm_window_set(C, win_prev); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 9ab8f08fba4..c3e8bd27e94 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -229,7 +229,7 @@ int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event, wmOper else if(opm->type->exec) retval= opm->type->exec(C, opm); - addlisttolist(&op->reports->list, &opm->reports->list); + BLI_movelisttolist(&op->reports->list, &opm->reports->list); if (retval & OPERATOR_FINISHED) { MacroData *md = op->customdata; |