Add GHASH_ITER macro
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 29 Apr 2012 16:09:28 +0000 (16:09 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 29 Apr 2012 16:09:28 +0000 (16:09 +0000)
source/blender/blenlib/BLI_ghash.h

index 457f098bff7a085d6c6d7dee87d5eee7ba641e69..eaf4d4420008cb98f683ef47bd2af151b74cb284 100644 (file)
@@ -131,6 +131,11 @@ void                       BLI_ghashIterator_step          (GHashIterator *ghi);
         */
 int                            BLI_ghashIterator_isDone        (GHashIterator *ghi);
 
+#define GHASH_ITER(gh_iter_, ghash_) \
+       for (BLI_ghashIterator_init(&gh_iter_, ghash_); \
+                !BLI_ghashIterator_isDone(&gh_iter_); \
+                BLI_ghashIterator_step(&gh_iter_))
+
 /* *** */
 
 unsigned int   BLI_ghashutil_ptrhash   (const void *key);