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/imbuf/intern/cache.c | 2 +- source/blender/imbuf/intern/colormanagement.c | 4 ++-- source/blender/imbuf/intern/openexr/openexr_api.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c index 4be521218f1..0c17dd21434 100644 --- a/source/blender/imbuf/intern/cache.c +++ b/source/blender/imbuf/intern/cache.c @@ -375,7 +375,7 @@ static unsigned int *imb_thread_cache_get_tile(ImThreadTileCache *cache, ImBuf * } /* not found, have to do slow lookup in global cache */ - if (cache->unused.first == NULL) { + if (BLI_listbase_is_empty(&cache->unused)) { ttile = cache->tiles.last; replacetile = ttile->global; BLI_remlink(&cache->tiles, ttile); diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index e5884f78b75..e8ffdc83240 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -583,7 +583,7 @@ static void colormanage_free_config(void) colorspace = colorspace_next; } - global_colorspaces.first = global_colorspaces.last = NULL; + BLI_listbase_clear(&global_colorspaces); global_tot_colorspace = 0; /* free displays */ @@ -604,7 +604,7 @@ static void colormanage_free_config(void) MEM_freeN(display); display = display_next; } - global_displays.first = global_displays.last = NULL; + BLI_listbase_clear(&global_displays); global_tot_display = 0; /* free views */ diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 6acd5154561..401070cd799 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -815,7 +815,7 @@ void IMB_exr_multilayer_convert(void *handle, void *base, ExrLayer *lay; ExrPass *pass; - if (data->layers.first == NULL) { + if (BLI_listbase_is_empty(&data->layers)) { printf("cannot convert multilayer, no layers in handle\n"); return; } -- cgit v1.2.3