diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-27 03:37:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-27 03:37:08 +0400 |
commit | 8ef934c73f3baeaa582efb8de906b27a3854979c (patch) | |
tree | 95dcb068fc96b3323e6ffe425ee6a7481b23eab4 /source/blender/blenfont | |
parent | cdd57d499434061de35af23790c993220922b206 (diff) |
ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 4 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 15098d50531..1e604bd8107 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -524,9 +524,7 @@ void blf_font_free(FontBLF *font) GlyphCacheBLF *gc; font->glyph_cache = NULL; - while (font->cache.first) { - gc = font->cache.first; - BLI_remlink(&font->cache, gc); + while ((gc = BLI_pophead(&font->cache))) { blf_glyph_cache_free(gc); } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 37e874fa396..ae8e2d17c54 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -128,9 +128,7 @@ void blf_glyph_cache_clear(FontBLF *font) for (gc = font->cache.first; gc; gc = gc->next) { for (i = 0; i < 257; i++) { - while (gc->bucket[i].first) { - g = gc->bucket[i].first; - BLI_remlink(&(gc->bucket[i]), g); + while ((g = BLI_pophead(&gc->bucket[i]))) { blf_glyph_free(g); } } @@ -145,9 +143,7 @@ void blf_glyph_cache_free(GlyphCacheBLF *gc) int i; for (i = 0; i < 257; i++) { - while (gc->bucket[i].first) { - g = gc->bucket[i].first; - BLI_remlink(&(gc->bucket[i]), g); + while ((g = BLI_pophead(&gc->bucket[i]))) { blf_glyph_free(g); } } |