From b3afbcab8ff2330c1473647be330a3ffe9b11885 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Feb 2014 06:07:10 +1100 Subject: ListBase API: add utility api funcs for clearing and checking empty --- source/blender/editors/space_graph/graph_draw.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 2 +- source/blender/editors/space_graph/graph_select.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_graph') diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 5e7a5690acd..ab69dc9e7b9 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -801,7 +801,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu) /* No curve to modify/visualise the result? * => We still want to show the 1-1 default... */ - if ((fcu->totvert == 0) && (fcu->modifiers.first == NULL)) { + if ((fcu->totvert == 0) && BLI_listbase_is_empty(&fcu->modifiers)) { float t; /* draw with thin dotted lines in style of what curve would have been */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 68d82cd2848..93d103e11a6 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -430,7 +430,7 @@ static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op)) sipo = (SpaceIpo *)ac.sl; /* if no ghost curves, don't do anything */ - if (sipo->ghostCurves.first == NULL) + if (BLI_listbase_is_empty(&sipo->ghostCurves)) return OPERATOR_CANCELLED; /* free ghost curves */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 6df6b6bf0ff..a8beaadd711 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1062,11 +1062,11 @@ static tNearestVertInfo *get_best_nearest_fcurve_vert(ListBase *matches) short found = 0; /* abort if list is empty */ - if (matches->first == NULL) + if (BLI_listbase_is_empty(matches)) return NULL; /* if list only has 1 item, remove it from the list and return */ - if (matches->first == matches->last) { + if (BLI_listbase_is_single(matches)) { /* need to remove from the list, otherwise it gets freed and then we can't return it */ return BLI_pophead(matches); } -- cgit v1.2.3