diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/key.c | 22 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 16 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/property.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sca.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 3 |
12 files changed, 31 insertions, 58 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 26f481e5341..3fbdba351b0 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -924,9 +924,7 @@ int BKE_copybuffer_save(const char *filename, ReportList *reports) ID *id; ListBase *lb1 = lbarray[a], *lb2 = fromarray[a]; - while (lb2->first) { - id = lb2->first; - BLI_remlink(lb2, id); + while ((id = BLI_pophead(lb2))) { BLI_addtail(lb1, id); id_sort_by_name(lb1, id); } diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 622b4f6df5a..2eb763831e4 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -198,8 +198,7 @@ void CTX_store_free_list(ListBase *contexts) { bContextStore *ctx; - while ((ctx = contexts->first)) { - BLI_remlink(contexts, ctx); + while ((ctx = BLI_pophead(contexts))) { CTX_store_free(ctx); } } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 5fa62c22a34..77ec333c173 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -81,11 +81,8 @@ void BKE_displist_free(ListBase *lb) { DispList *dl; - dl = lb->first; - while (dl) { - BLI_remlink(lb, dl); + while ((dl = BLI_pophead(lb))) { BKE_displist_elem_free(dl); - dl = lb->first; } } diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index ad0aed4691a..a5cbf064bc2 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -65,9 +65,7 @@ void BKE_group_free(Group *group) /* don't free group itself */ GroupObject *go; - while (group->gobject.first) { - go = group->gobject.first; - BLI_remlink(&group->gobject, go); + while ((go = BLI_pophead(&group->gobject))) { free_group_object(go); } } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 86382c64ed3..37dacd1a328 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -195,9 +195,7 @@ static void image_free_buffers(Image *ima) { ImBuf *ibuf; - while ((ibuf = ima->ibufs.first)) { - BLI_remlink(&ima->ibufs, ibuf); - + while ((ibuf = BLI_pophead(&ima->ibufs))) { if (ibuf->userdata) { MEM_freeN(ibuf->userdata); ibuf->userdata = NULL; @@ -524,8 +522,7 @@ void BKE_image_merge(Image *dest, Image *source) /* sanity check */ if (dest && source && dest != source) { - while ((ibuf = source->ibufs.first)) { - BLI_remlink(&source->ibufs, ibuf); + while ((ibuf = BLI_pophead(&source->ibufs))) { image_assign_ibuf(dest, ibuf, IMA_INDEX_PASS(ibuf->index), IMA_INDEX_FRAME(ibuf->index)); } diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index aaac17ac1ed..7b73dee73fc 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -85,29 +85,23 @@ void BKE_key_free(Key *key) KeyBlock *kb; BKE_free_animdata((ID *)key); - - while ( (kb = key->block.first) ) { - - if (kb->data) MEM_freeN(kb->data); - - BLI_remlink(&key->block, kb); + + while ((kb = BLI_pophead(&key->block))) { + if (kb->data) + MEM_freeN(kb->data); MEM_freeN(kb); } - } void BKE_key_free_nolib(Key *key) { KeyBlock *kb; - - while ( (kb = key->block.first) ) { - - if (kb->data) MEM_freeN(kb->data); - - BLI_remlink(&key->block, kb); + + while ((kb = BLI_pophead(&key->block))) { + if (kb->data) + MEM_freeN(kb->data); MEM_freeN(kb); } - } Key *BKE_key_add(ID *id) /* common function */ diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 1349c4dc8d4..ee5b11d3beb 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2666,7 +2666,7 @@ void BKE_node_instance_hash_clear(bNodeInstanceHash *hash, bNodeInstanceValueFP void *BKE_node_instance_hash_pop(bNodeInstanceHash *hash, bNodeInstanceKey key) { - return BLI_ghash_pop(hash->ghash, &key, NULL); + return BLI_ghash_popkey(hash->ghash, &key, NULL); } int BKE_node_instance_hash_haskey(bNodeInstanceHash *hash, bNodeInstanceKey key) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 8f64ce6bef7..d54ccb17710 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -142,11 +142,9 @@ void BKE_object_update_base_layer(struct Scene *scene, Object *ob) void BKE_object_free_particlesystems(Object *ob) { - while (ob->particlesystem.first) { - ParticleSystem *psys = ob->particlesystem.first; - - BLI_remlink(&ob->particlesystem, psys); - + ParticleSystem *psys; + + while ((psys = BLI_pophead(&ob->particlesystem))) { psys_free(ob, psys); } } @@ -182,11 +180,9 @@ void BKE_object_free_curve_cache(Object *ob) void BKE_object_free_modifiers(Object *ob) { - while (ob->modifiers.first) { - ModifierData *md = ob->modifiers.first; - - BLI_remlink(&ob->modifiers, md); - + ModifierData *md; + + while ((md = BLI_pophead(&ob->modifiers))) { modifier_free(md); } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 93f6965e97b..2e08e0587ac 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2969,12 +2969,10 @@ void BKE_ptcache_free(PointCache *cache) } void BKE_ptcache_free_list(ListBase *ptcaches) { - PointCache *cache = ptcaches->first; + PointCache *cache; - while (cache) { - BLI_remlink(ptcaches, cache); + while ((cache = BLI_pophead(ptcaches))) { BKE_ptcache_free(cache); - cache = ptcaches->first; } } diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index 73f2a864e32..bb04d548a44 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -59,9 +59,8 @@ void BKE_bproperty_free(bProperty *prop) void BKE_bproperty_free_list(ListBase *lb) { bProperty *prop; - - while ( (prop = lb->first) ) { - BLI_remlink(lb, prop); + + while ((prop = BLI_pophead(lb))) { BKE_bproperty_free(prop); } } diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 92f57a54a01..091b5f337c6 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -63,8 +63,7 @@ void free_sensors(ListBase *lb) { bSensor *sens; - while ((sens= lb->first)) { - BLI_remlink(lb, sens); + while ((sens = BLI_pophead(lb))) { free_sensor(sens); } } @@ -227,9 +226,9 @@ void free_controllers(ListBase *lb) { bController *cont; - while ((cont= lb->first)) { - BLI_remlink(lb, cont); - if (cont->slinks) MEM_freeN(cont->slinks); + while ((cont = BLI_pophead(lb))) { + if (cont->slinks) + MEM_freeN(cont->slinks); free_controller(cont); } } @@ -346,8 +345,7 @@ void free_actuators(ListBase *lb) { bActuator *act; - while ((act= lb->first)) { - BLI_remlink(lb, act); + while ((act = BLI_pophead(lb))) { free_actuator(act); } } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 8840e08c2a1..a43f6dbf645 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -865,8 +865,7 @@ void BKE_sequencer_sort(Scene *scene) seqbase.first = seqbase.last = NULL; effbase.first = effbase.last = NULL; - while ( (seq = ed->seqbasep->first) ) { - BLI_remlink(ed->seqbasep, seq); + while ((seq = BLI_pophead(ed->seqbasep))) { if (seq->type & SEQ_TYPE_EFFECT) { seqt = effbase.first; |