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/gpencil | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/editaction_gpencil.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_undo.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index 9b7d691f081..8fcbee6f758 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -275,7 +275,7 @@ void free_gpcopybuf() { free_gpencil_layers(&gpcopybuf); - gpcopybuf.first = gpcopybuf.last = NULL; + BLI_listbase_clear(&gpcopybuf); gpcopy_firstframe = 999999999; } @@ -311,7 +311,7 @@ void copy_gpdata() gpls = (bGPDlayer *)ale->data; gpln = MEM_callocN(sizeof(bGPDlayer), "GPCopyPasteLayer"); - gpln->frames.first = gpln->frames.last = NULL; + BLI_listbase_clear(&gpln->frames); BLI_strncpy(gpln->info, gpls->info, sizeof(gpln->info)); BLI_addtail(&gpcopybuf, gpln); @@ -449,7 +449,7 @@ void paste_gpdata(Scene *scene) } /* if no strokes (i.e. new frame) added, free gpf */ - if (gpf->strokes.first == NULL) + if (BLI_listbase_is_empty(&gpf->strokes)) gpencil_layer_delframe(gpld, gpf); } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index a5376741ffd..94400682f9e 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1422,7 +1422,7 @@ static void gp_layer_to_curve(bContext *C, ReportList *reports, bGPdata *gpd, bG return; /* only convert if there are any strokes on this layer's frame to convert */ - if (gpf->strokes.first == NULL) + if (BLI_listbase_is_empty(&gpf->strokes)) return; /* initialize camera framing */ diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c index 7edf723022f..136e9da389d 100644 --- a/source/blender/editors/gpencil/gpencil_undo.c +++ b/source/blender/editors/gpencil/gpencil_undo.c @@ -63,7 +63,7 @@ static bGPundonode *cur_node = NULL; int ED_gpencil_session_active(void) { - return undo_nodes.first != NULL; + return (BLI_listbase_is_empty(&undo_nodes) == false); } int ED_undo_gpencil_step(bContext *C, int step, const char *name) @@ -100,7 +100,7 @@ int ED_undo_gpencil_step(bContext *C, int step, const char *name) free_gpencil_layers(&gpd->layers); /* copy layers */ - gpd->layers.first = gpd->layers.last = NULL; + BLI_listbase_clear(&gpd->layers); for (gpl = new_gpd->layers.first; gpl; gpl = gpl->next) { /* make a copy of source layer and its data */ |