Page Menu
Home
Search
Configure Global Search
Log In
Files
F22160
listbase.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Lawrence D'Oliveiro (ldo)
Nov 13 2013, 4:42 PM
Size
24 KB
Subscribers
None
listbase.patch
View Options
commit f99dd1cedccdcc2039f73d6d1847e61a0717c816
Author: Lawrence D'Oliveiro <ldo@geek-central.gen.nz>
Date: Wed Feb 6 02:47:48 2013 +0000
add explanatory comments to listbase.c
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
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 9fdf51c..19ef1e3 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -454,7 +454,7 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
if (strcmp(loop->name, prop->name) == 0) {
IDProperty *copy = IDP_CopyProperty(prop);
- BLI_insertlink(&dest->data.group, loop, copy);
+ BLI_insertlinkafter(&dest->data.group, loop, copy);
BLI_remlink(&dest->data.group, loop);
IDP_FreeProperty(loop);
@@ -479,7 +479,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
{
IDProperty *loop;
if ((loop = IDP_GetPropertyFromGroup(group, prop->name))) {
- BLI_insertlink(&group->data.group, loop, prop);
+ BLI_insertlinkafter(&group->data.group, loop, prop);
BLI_remlink(&group->data.group, loop);
IDP_FreeProperty(loop);
@@ -532,7 +532,7 @@ int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew)
{
if (IDP_GetPropertyFromGroup(group, pnew->name) == NULL) {
group->len++;
- BLI_insertlink(&group->data.group, previous, pnew);
+ BLI_insertlinkafter(&group->data.group, previous, pnew);
return 1;
}
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index cb0a11a..f3dc391 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -246,7 +246,7 @@ void BKE_key_sort(Key *key)
/* find the right location and insert before */
for (kb2 = key->block.first; kb2; kb2 = kb2->next) {
if (kb2->pos > kb->pos) {
- BLI_insertlink(&key->block, kb2->prev, kb);
+ BLI_insertlinkafter(&key->block, kb2->prev, kb);
break;
}
}
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index eb4e0d9..6433b73 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -734,7 +734,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
}
if (tmp) {
BLI_remlink(&ob->sensors, sens);
- BLI_insertlink(&ob->sensors, tmp, sens);
+ BLI_insertlinkafter(&ob->sensors, tmp, sens);
}
}
}
@@ -778,7 +778,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
tmp = tmp->next;
}
BLI_remlink(&ob->controllers, cont);
- BLI_insertlink(&ob->controllers, tmp, cont);
+ BLI_insertlinkafter(&ob->controllers, tmp, cont);
}
}
@@ -818,7 +818,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
}
if (tmp) {
BLI_remlink(&ob->actuators, act);
- BLI_insertlink(&ob->actuators, tmp, act);
+ BLI_insertlinkafter(&ob->actuators, tmp, act);
}
}
}
diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index d06956e..54cd687 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -32,6 +32,7 @@
* \ingroup bli
*/
+#include "BLI_utildefines.h"
#include "DNA_listBase.h"
//struct ListBase;
//struct LinkData;
@@ -40,7 +41,6 @@
extern "C" {
#endif
-void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink);
int BLI_findindex(const struct ListBase *listbase, const void *vlink);
int BLI_findstringindex(const struct ListBase *listbase, const char *id, const int offset);
@@ -59,7 +59,7 @@ void *BLI_rfindptr(const struct ListBase *listbase, const void *ptr, const int o
void BLI_freelistN(struct ListBase *listbase);
void BLI_addtail(struct ListBase *listbase, void *vlink);
void BLI_remlink(struct ListBase *listbase, void *vlink);
-int BLI_remlink_safe(struct ListBase *listbase, void *vlink);
+bool BLI_remlink_safe(struct ListBase *listbase, void *vlink);
void BLI_addhead(struct ListBase *listbase, void *vlink);
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink);
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index c60a9ae..ee96673 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -28,6 +28,8 @@
/** \file blender/blenlib/intern/listbase.c
* \ingroup bli
+ *
+ * Manipulations on ListBase structs
*/
@@ -46,6 +48,7 @@
/* Ripped this from blender.c */
void BLI_movelisttolist(ListBase *dst, ListBase *src)
+/* moves the entire contents of src onto the end of dst. */
{
if (src->first == NULL) return;
@@ -62,6 +65,7 @@ void BLI_movelisttolist(ListBase *dst, ListBase *src)
}
void BLI_addhead(ListBase *listbase, void *vlink)
+/* prepends vLink (assumed to begin with a Link) onto listbase. */
{
Link *link = vlink;
@@ -78,6 +82,7 @@ void BLI_addhead(ListBase *listbase, void *vlink)
void BLI_addtail(ListBase *listbase, void *vlink)
+/* appends vLink (assumed to begin with a Link) onto listbase. */
{
Link *link = vlink;
@@ -94,6 +99,7 @@ void BLI_addtail(ListBase *listbase, void *vlink)
void BLI_remlink(ListBase *listbase, void *vlink)
+/* removes vlink from listbase. Assumes it is linked into there! */
{
Link *link = vlink;
@@ -107,19 +113,21 @@ void BLI_remlink(ListBase *listbase, void *vlink)
if (listbase->first == link) listbase->first = link->next;
}
-int BLI_remlink_safe(ListBase *listbase, void *vlink)
+bool BLI_remlink_safe(ListBase *listbase, void *vlink)
+/* checks that vlink is linked into listbase, removing it from there if so. */
{
if (BLI_findindex(listbase, vlink) != -1) {
BLI_remlink(listbase, vlink);
- return 1;
+ return true;
}
else {
- return 0;
+ return false;
}
}
void BLI_freelinkN(ListBase *listbase, void *vlink)
+/* removes vlink from listbase and disposes of it. Assumes it is linked into there! */
{
Link *link = vlink;
@@ -131,44 +139,10 @@ void BLI_freelinkN(ListBase *listbase, void *vlink)
}
-void BLI_insertlink(ListBase *listbase, void *vprevlink, void *vnewlink)
-{
- Link *prevlink = vprevlink;
- Link *newlink = vnewlink;
-
- /* newlink comes after prevlink */
- if (newlink == NULL) return;
- if (listbase == NULL) return;
-
- /* empty list */
- if (listbase->first == NULL) {
-
- listbase->first = newlink;
- listbase->last = newlink;
- return;
- }
-
- /* insert before first element */
- if (prevlink == NULL) {
- newlink->next = listbase->first;
- newlink->prev = NULL;
- newlink->next->prev = newlink;
- listbase->first = newlink;
- return;
- }
-
- /* at end of list */
- if (listbase->last == prevlink)
- listbase->last = newlink;
-
- newlink->next = prevlink->next;
- prevlink->next = newlink;
- if (newlink->next) newlink->next->prev = newlink;
- newlink->prev = prevlink;
-}
-
-/* This uses insertion sort, so NOT ok for large list */
void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *))
+/* sorts the elements of listbase into the order defined by cmp
+(which should return 1 iff its first arg should come after its second
+arg). This uses insertion sort, so NOT ok for large list. */
{
Link *current = NULL;
Link *previous = NULL;
@@ -194,6 +168,8 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *))
}
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink)
+/* inserts vnewlink immediately following vprevlink in listbase. Or, if
+vprevlink is NULL, puts vnewlink at the front of the list. */
{
Link *prevlink = vprevlink;
Link *newlink = vnewlink;
@@ -213,7 +189,7 @@ void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink)
if (prevlink == NULL) {
newlink->prev = NULL;
newlink->next = listbase->first;
- ((Link *)listbase->first)->prev = newlink;
+ newlink->next->prev = newlink;
listbase->first = newlink;
return;
}
@@ -229,6 +205,8 @@ void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink)
}
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink)
+/* inserts vnewlink immediately preceding vnextlink in listbase. Or, if vnextlink
+is NULL, puts vnewlink at the end of the list. */
{
Link *nextlink = vnextlink;
Link *newlink = vnewlink;
@@ -265,6 +243,7 @@ void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink)
void BLI_freelist(ListBase *listbase)
+/* removes and disposes of the entire contents of listbase using direct free(3). */
{
Link *link, *next;
@@ -283,6 +262,7 @@ void BLI_freelist(ListBase *listbase)
}
void BLI_freelistN(ListBase *listbase)
+/* removes and disposes of the entire contents of listbase using guardedalloc. */
{
Link *link, *next;
@@ -301,6 +281,7 @@ void BLI_freelistN(ListBase *listbase)
int BLI_countlist(const ListBase *listbase)
+/* returns the number of elements in listbase. */
{
Link *link;
int count = 0;
@@ -316,6 +297,7 @@ int BLI_countlist(const ListBase *listbase)
}
void *BLI_findlink(const ListBase *listbase, int number)
+/* returns the nth element of listbase, numbering from 1. */
{
Link *link = NULL;
@@ -331,6 +313,7 @@ void *BLI_findlink(const ListBase *listbase, int number)
}
void *BLI_rfindlink(const ListBase *listbase, int number)
+/* returns the nth-last element of listbase, numbering from 1. */
{
Link *link = NULL;
@@ -346,6 +329,7 @@ void *BLI_rfindlink(const ListBase *listbase, int number)
}
int BLI_findindex(const ListBase *listbase, const void *vlink)
+/* returns the position of vlink within listbase, numbering from 1, or -1 if not found. */
{
Link *link = NULL;
int number = 0;
@@ -366,6 +350,8 @@ int BLI_findindex(const ListBase *listbase, const void *vlink)
}
void *BLI_findstring(const ListBase *listbase, const char *id, const int offset)
+/* finds the first element of listbase which contains the null-terminated string *id at the
+specified offset, returning NULL if not found. */
{
Link *link = NULL;
const char *id_iter;
@@ -384,6 +370,8 @@ void *BLI_findstring(const ListBase *listbase, const char *id, const int offset)
}
/* same as above but find reverse */
void *BLI_rfindstring(const ListBase *listbase, const char *id, const int offset)
+/* finds the last element of listbase which contains the null-terminated string *id at the
+specified offset, returning NULL if not found. */
{
Link *link = NULL;
const char *id_iter;
@@ -402,6 +390,8 @@ void *BLI_rfindstring(const ListBase *listbase, const char *id, const int offset
}
void *BLI_findstring_ptr(const ListBase *listbase, const char *id, const int offset)
+/* finds the first element of listbase which contains a pointer to the null-terminated
+string *id at the specified offset, returning NULL if not found. */
{
Link *link = NULL;
const char *id_iter;
@@ -421,6 +411,8 @@ void *BLI_findstring_ptr(const ListBase *listbase, const char *id, const int off
}
/* same as above but find reverse */
void *BLI_rfindstring_ptr(const ListBase *listbase, const char *id, const int offset)
+/* finds the last element of listbase which contains a pointer to the null-terminated
+string *id at the specified offset, returning NULL if not found. */
{
Link *link = NULL;
const char *id_iter;
@@ -440,6 +432,8 @@ void *BLI_rfindstring_ptr(const ListBase *listbase, const char *id, const int of
}
void *BLI_findptr(const ListBase *listbase, const void *ptr, const int offset)
+/* finds the first element of listbase which contains the specified pointer value
+at the specified offset, returning NULL if not found. */
{
Link *link = NULL;
const void *ptr_iter;
@@ -448,7 +442,7 @@ void *BLI_findptr(const ListBase *listbase, const void *ptr, const int offset)
for (link = listbase->first; link; link = link->next) {
/* exact copy of BLI_findstring(), except for this line */
- ptr_iter = *((const char **)(((const char *)link) + offset));
+ ptr_iter = *((const void **)(((const char *)link) + offset));
if (ptr == ptr_iter) {
return link;
@@ -459,6 +453,8 @@ void *BLI_findptr(const ListBase *listbase, const void *ptr, const int offset)
}
/* same as above but find reverse */
void *BLI_rfindptr(const ListBase *listbase, const void *ptr, const int offset)
+/* finds the last element of listbase which contains the specified pointer value
+at the specified offset, returning NULL if not found. */
{
Link *link = NULL;
const void *ptr_iter;
@@ -467,7 +463,7 @@ void *BLI_rfindptr(const ListBase *listbase, const void *ptr, const int offset)
for (link = listbase->last; link; link = link->prev) {
/* exact copy of BLI_rfindstring(), except for this line */
- ptr_iter = *((const char **)(((const char *)link) + offset));
+ ptr_iter = *((const void **)(((const char *)link) + offset));
if (ptr == ptr_iter) {
return link;
@@ -478,6 +474,8 @@ void *BLI_rfindptr(const ListBase *listbase, const void *ptr, const int offset)
}
int BLI_findstringindex(const ListBase *listbase, const char *id, const int offset)
+/* returns the 1-based index of the first element of listbase which contains the specified
+null-terminated string at the specified offset, or -1 if not found. */
{
Link *link = NULL;
const char *id_iter;
@@ -499,6 +497,7 @@ int BLI_findstringindex(const ListBase *listbase, const char *id, const int offs
}
void BLI_duplicatelist(ListBase *dst, const ListBase *src)
+/* sets dst to a duplicate of the entire contents of src. dst may be the same as src. */
{
struct Link *dst_link, *src_link;
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 2fc942d..c1f836c 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -635,7 +635,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 7d3d686..86d572f 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -391,7 +391,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_insertlinkafter(&ob->modifiers, md->prev->prev, md);
}
return 1;
@@ -412,7 +412,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;
@@ -728,7 +728,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 dc309ec..791ea83 100644
--- a/source/blender/editors/physics/particle_boids.c
+++ b/source/blender/editors/physics/particle_boids.c
@@ -158,7 +158,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_insertlinkafter(&state->rules, rule->prev->prev, rule);
DAG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
break;
@@ -194,7 +194,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;
@@ -316,7 +316,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_insertlinkafter(&boids->states, state->prev->prev, state);
break;
}
}
@@ -351,7 +351,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 23069ab..dc49bbe 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -313,7 +313,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_insertlinkafter(&psys->targets, pt->prev->prev, pt);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -351,7 +351,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);
@@ -390,7 +390,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_insertlinkafter(&part->dupliweights, dw->prev->prev, dw);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, NULL);
break;
@@ -512,7 +512,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 a4a485b..bee9667 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_insertlinkafter(&seq->modifiers, smd->prev->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);
}
}
diff --git a/source/blender/makesdna/DNA_listBase.h b/source/blender/makesdna/DNA_listBase.h
index 333e414..f6035cd 100644
--- a/source/blender/makesdna/DNA_listBase.h
+++ b/source/blender/makesdna/DNA_listBase.h
@@ -31,6 +31,9 @@
* \ingroup DNA
* \brief These structs are the foundation for all linked lists in the
* library system.
+ *
+ * Doubly-linked lists start from a ListBase and contain elements beginning
+ * with Link.
*/
#ifndef __DNA_LISTBASE_H__
@@ -40,13 +43,13 @@
extern "C" {
#endif
-/* generic - all structs which are used in linked-lists used this */
+/* generic - all structs which are put into linked lists begin with this */
typedef struct Link {
struct Link *next, *prev;
} Link;
-/* use this when it is not worth defining a custom one... */
+/* simple subclass of Link--use this when it is not worth defining a custom one... */
typedef struct LinkData {
struct LinkData *next, *prev;
void *data;
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index bf6faa3..80e5c36 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -81,7 +81,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, PointerR
FCurve *fcu, *fcn;
/* try to remove the F-Curve from the action */
- if (BLI_remlink_safe(&act->groups, agrp) == FALSE) {
+ if (!BLI_remlink_safe(&act->groups, agrp)) {
BKE_reportf(reports, RPT_ERROR, "Action group '%s' not found in action '%s'", agrp->name, act->id.name + 2);
return;
}
@@ -159,7 +159,7 @@ static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[])
static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, PointerRNA *marker_ptr)
{
TimeMarker *marker = marker_ptr->data;
- if (BLI_remlink_safe(&act->markers, marker) == FALSE) {
+ if (!BLI_remlink_safe(&act->markers, marker)) {
BKE_reportf(reports, RPT_ERROR, "Timeline marker '%s' not found in action '%s'", marker->name, act->id.name + 2);
return;
}
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 8f8136b..e6321d6 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -577,7 +577,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, PointerRNA *
Nurb *nu = nu_ptr->data;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
- if (BLI_remlink_safe(nurbs, nu) == FALSE) {
+ if (!BLI_remlink_safe(nurbs, nu)) {
BKE_reportf(reports, RPT_ERROR, "Curve '%s' does not contain spline given", cu->id.name + 2);
return;
}
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 08eefc0..dae7263 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -131,7 +131,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Poin
{
MetaElem *ml = ml_ptr->data;
- if (BLI_remlink_safe(&mb->elems, ml) == FALSE) {
+ if (!BLI_remlink_safe(&mb->elems, ml)) {
BKE_reportf(reports, RPT_ERROR, "Metaball '%s' does not contain spline given", mb->id.name + 2);
return;
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 4763c4d..fa2b3e7 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1364,7 +1364,7 @@ static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
static void rna_TimeLine_remove(Scene *scene, ReportList *reports, PointerRNA *marker_ptr)
{
TimeMarker *marker = marker_ptr->data;
- if (BLI_remlink_safe(&scene->markers, marker) == FALSE) {
+ if (!BLI_remlink_safe(&scene->markers, marker)) {
BKE_reportf(reports, RPT_ERROR, "Timeline marker '%s' not found in scene '%s'",
marker->name, scene->id.name + 2);
return;
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index 386263c..6de1020 100644
--- a/source/blender/makesrna/intern/rna_sequencer_api.c
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -326,7 +326,7 @@ static void rna_Sequences_remove(ID *id, Editing *ed, ReportList *reports, Point
Sequence *seq = seq_ptr->data;
Scene *scene = (Scene *)id;
- if (BLI_remlink_safe(&ed->seqbase, seq) == FALSE) {
+ if (!BLI_remlink_safe(&ed->seqbase, seq)) {
BKE_reportf(reports, RPT_ERROR, "Sequence '%s' not in scene '%s'", seq->name + 2, scene->id.name + 2);
return;
}
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
80/bf/6c87987abd849b698ea2b6694cda
Event Timeline
Log In to Comment