diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:07:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:24:05 +0400 |
commit | b3afbcab8ff2330c1473647be330a3ffe9b11885 (patch) | |
tree | e86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/editors/sculpt_paint | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/editors/sculpt_paint')
4 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index b4bd46376d3..fd8cc4df41e 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -191,7 +191,7 @@ static int undo_stack_step(bContext *C, UndoStack *stack, int step, const char * } } else if (step == -1) { - if ((stack->current != NULL && stack->current->next == NULL) || stack->elems.first == NULL) { + if ((stack->current != NULL && stack->current->next == NULL) || BLI_listbase_is_empty(&stack->elems)) { /* pass */ } else { diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index dd414a7b2b2..e6efba4fa0c 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -41,6 +41,7 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_listbase.h" #include "BLI_rect.h" #include "BLF_translation.h" @@ -523,7 +524,7 @@ static int vert_select_ungrouped_exec(bContext *C, wmOperator *op) Object *ob = CTX_data_active_object(C); Mesh *me = ob->data; - if ((ob->defbase.first == NULL) || (me->dvert == NULL)) { + if (BLI_listbase_is_empty(&ob->defbase) || (me->dvert == NULL)) { BKE_report(op->reports, RPT_ERROR, "No weights/vertex groups on object"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index d97eb223c3d..55296aeda18 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2183,7 +2183,7 @@ static bool wpaint_ensure_data(bContext *C, wmOperator *op) } } } - if (ob->defbase.first == NULL) { + if (BLI_listbase_is_empty(&ob->defbase)) { ED_vgroup_add(ob); } diff --git a/source/blender/editors/sculpt_paint/paint_vertex_proj.c b/source/blender/editors/sculpt_paint/paint_vertex_proj.c index cf15fc3b2db..a04e15d3729 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_proj.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_proj.c @@ -34,6 +34,7 @@ #include "MEM_guardedalloc.h" #include "BLI_math.h" +#include "BLI_listbase.h" #include "DNA_mesh_types.h" #include "DNA_object_types.h" @@ -175,7 +176,7 @@ static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle, DerivedMesh *dm; /* quick sanity check - we shouldn't have to run this if there are no modifiers */ - BLI_assert(ob->modifiers.first != NULL); + BLI_assert(BLI_listbase_is_empty(&ob->modifiers) == false); dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); |