rename addlisttolist() to BLI_movelisttolist()
name was misleading because the list items were removed from the source list. (no functional changes)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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!
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user