Change !BLI_ghashIterator_isDone to BLI_ghashIterator_notDone. It is
authorAntony Riakiotakis <kalast@gmail.com>
Wed, 6 Mar 2013 20:55:04 +0000 (20:55 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Wed, 6 Mar 2013 20:55:04 +0000 (20:55 +0000)
always used in that context so we can at least avoid reverting it twice
:p.

24 files changed:
source/blender/blenkernel/BKE_pbvh.h
source/blender/blenkernel/intern/pbvh.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/intern/BLI_ghash.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/editcurve.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_text/text_autocomplete.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/imbuf/intern/moviecache.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_rna.c
source/blender/render/intern/source/sss.c
source/blender/windowmanager/intern/wm.c

index 99ed978..cdc8ef0 100644 (file)
@@ -295,7 +295,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
                                                vi.mask = &vi.vmask[vi.vert_indices[vi.gx]]; \
                                } \
                                else { \
-                                       if (!BLI_ghashIterator_isDone(&vi.bm_unique_verts)) {\
+                                       if (BLI_ghashIterator_notDone(&vi.bm_unique_verts)) {\
                                                vi.bm_vert = BLI_ghashIterator_getKey(&vi.bm_unique_verts); \
                                                BLI_ghashIterator_step(&vi.bm_unique_verts); \
                                        } \
index 477ae27..5efeeae 100644 (file)
@@ -294,7 +294,7 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
 
        /* Build the vertex list, unique verts first */
        for (iter = BLI_ghashIterator_new(map), i = 0;
-            BLI_ghashIterator_isDone(iter) == FALSE;
+            BLI_ghashIterator_notDone(iter);
             BLI_ghashIterator_step(iter), ++i)
        {
                void *value = BLI_ghashIterator_getValue(iter);
@@ -1217,7 +1217,7 @@ void BKE_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot
        faces = MEM_callocN(sizeof(void *) * tot, "PBVH Grid Faces");
 
        for (hiter = BLI_ghashIterator_new(map), i = 0;
-            !BLI_ghashIterator_isDone(hiter);
+            BLI_ghashIterator_notDone(hiter);
             BLI_ghashIterator_step(hiter), ++i)
        {
                faces[i] = BLI_ghashIterator_getKey(hiter);
index e2c6df5..01d4696 100644 (file)
@@ -1034,7 +1034,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), unsigned int U
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1113,7 +1113,7 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1205,7 +1205,7 @@ static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], fl
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1433,7 +1433,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3], float edge_v2[3], fl
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
@@ -1763,7 +1763,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
        outerforceaccu[0]=outerforceaccu[1]=outerforceaccu[2]=0.0f;
        innerforceaccu[0]=innerforceaccu[1]=innerforceaccu[2]=0.0f;
 /* go */
-       while (!BLI_ghashIterator_isDone(ihash) ) {
+       while (BLI_ghashIterator_notDone(ihash) ) {
 
                ccd_Mesh *ccdm = BLI_ghashIterator_getValue     (ihash);
                ob             = BLI_ghashIterator_getKey       (ihash);
index 82e71f4..2ccc28d 100644 (file)
@@ -130,11 +130,11 @@ void            BLI_ghashIterator_step(GHashIterator *ghi);
  * \param ghi The iterator.
  * \return True if done, False otherwise.
  */
-int             BLI_ghashIterator_isDone(GHashIterator *ghi);
+int             BLI_ghashIterator_notDone(GHashIterator *ghi);
 
 #define GHASH_ITER(gh_iter_, ghash_)                                          \
        for (BLI_ghashIterator_init(&gh_iter_, ghash_);                           \
-            !BLI_ghashIterator_isDone(&gh_iter_);                                \
+            BLI_ghashIterator_notDone(&gh_iter_);                                \
             BLI_ghashIterator_step(&gh_iter_))
 
 /* *** */
index bd06f52..c3b3a3e 100644 (file)
@@ -271,9 +271,9 @@ void BLI_ghashIterator_step(GHashIterator *ghi)
                }
        }
 }
-int BLI_ghashIterator_isDone(GHashIterator *ghi)
+int BLI_ghashIterator_notDone(GHashIterator *ghi)
 {
-       return !ghi->curEntry;
+       return ghi->curEntry != NULL;
 }
 
 /***/
index 62cce6b..d002d82 100644 (file)
@@ -896,7 +896,7 @@ static void RIG_reconnectControlBones(RigGraph *rg)
                        /* look on deform bones first */
                        BLI_ghashIterator_init(&ghi, rg->bones_map);
                        
-                       for (; !BLI_ghashIterator_isDone(&ghi); BLI_ghashIterator_step(&ghi)) {
+                       for (; BLI_ghashIterator_notDone(&ghi); BLI_ghashIterator_step(&ghi)) {
                                EditBone *bone = (EditBone *)BLI_ghashIterator_getValue(&ghi);
                                
                                /* don't link with parent */
index ec96c57..5101d5f 100644 (file)
@@ -183,7 +183,7 @@ const char *BIF_listTemplates(const bContext *UNUSED(C))
 
        BLI_ghashIterator_init(&ghi, TEMPLATES_HASH);
 
-       while (!BLI_ghashIterator_isDone(&ghi)) {
+       while (BLI_ghashIterator_notDone(&ghi)) {
                Object *ob = BLI_ghashIterator_getValue(&ghi);
                int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
 
@@ -203,7 +203,7 @@ int   BIF_currentTemplate(const bContext *C)
                GHashIterator ghi;
                BLI_ghashIterator_init(&ghi, TEMPLATES_HASH);
 
-               while (!BLI_ghashIterator_isDone(&ghi)) {
+               while (BLI_ghashIterator_notDone(&ghi)) {
                        Object *ob = BLI_ghashIterator_getValue(&ghi);
                        int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
 
index 454b0f0..d04938f 100644 (file)
@@ -1659,7 +1659,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
                        float avg_vec[3] = {0, 0, 0};
                        
                        for (BLI_ghashIterator_init(&ghi, arc->faces);
-                            !BLI_ghashIterator_isDone(&ghi);
+                            BLI_ghashIterator_notDone(&ghi);
                             BLI_ghashIterator_step(&ghi))
                        {
                                EditFace *efa = BLI_ghashIterator_getValue(&ghi);
@@ -2045,7 +2045,7 @@ void mergeArcFaces(ReebGraph *UNUSED(rg), ReebArc *aDst, ReebArc *aSrc)
        GHashIterator ghi;
        
        for (BLI_ghashIterator_init(&ghi, aSrc->faces);
-            !BLI_ghashIterator_isDone(&ghi);
+            BLI_ghashIterator_notDone(&ghi);
             BLI_ghashIterator_step(&ghi))
        {
                EditFace *efa = BLI_ghashIterator_getValue(&ghi);
index d01e5c5..c91734f 100644 (file)
@@ -672,7 +672,7 @@ static GHash *dupli_keyIndexHash(GHash *keyindex)
        gh = BLI_ghash_ptr_new("dupli_keyIndex gh");
 
        for (hashIter = BLI_ghashIterator_new(keyindex);
-            !BLI_ghashIterator_isDone(hashIter);
+            BLI_ghashIterator_notDone(hashIter);
             BLI_ghashIterator_step(hashIter))
        {
                void *cv = BLI_ghashIterator_getKey(hashIter);
index 3298859..64221a1 100644 (file)
@@ -853,7 +853,7 @@ static int editsource_exec(bContext *C, wmOperator *op)
                ED_region_do_draw(C, ar);
 
                for (BLI_ghashIterator_init(&ghi, ui_editsource_info->hash);
-                    !BLI_ghashIterator_isDone(&ghi);
+                    BLI_ghashIterator_notDone(&ghi);
                     BLI_ghashIterator_step(&ghi))
                {
                        uiBut *but_key = BLI_ghashIterator_getKey(&ghi);
index 3a9c43c..5c0a2b8 100644 (file)
@@ -2718,7 +2718,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char
 {
        GHashIterator *iter = WM_operatortype_iter();
 
-       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
 
                if ((ot->flag & OPTYPE_INTERNAL) && (G.debug & G_DEBUG_WM) == 0)
index 3baf5d8..b40933c 100644 (file)
@@ -712,7 +712,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
                        return NULL;
                }
                /* fill the edges with data */
-               for (i = 0; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
+               for (i = 0; BLI_ghashIterator_notDone(ghi); BLI_ghashIterator_step(ghi)) {
                        data->uvedges[i++] = *((UvEdge *)BLI_ghashIterator_getKey(ghi));
                }
                data->totalUvEdges = BLI_ghash_size(edgeHash);
index cacbc6d..3d5125f 100644 (file)
@@ -615,7 +615,7 @@ static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(ar
 {
        GHashIterator *iter = WM_operatortype_iter();
 
-       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
                
                if (BLI_strcasestr(ot->idname, str)) {
index 7c18b5c..106093d 100644 (file)
@@ -220,7 +220,7 @@ static GHash *text_autocomplete_build(Text *text)
                        TextFormatType *tft;
                        tft = ED_text_format_get(text);
 
-                       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+                       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                                const char *s = BLI_ghashIterator_getValue(iter);
                                texttool_suggest_add(s, tft->format_identifier(s));
                        }
index bb5b7aa..d3bf8a3 100644 (file)
@@ -156,7 +156,7 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons
 {
        GHashIterator *iter = WM_operatortype_iter();
 
-       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
 
                if (BLI_strcasestr(ot->name, str)) {
index 825e8b7..e4599b2 100644 (file)
@@ -1749,7 +1749,7 @@ static int stitch_init(bContext *C, wmOperator *op)
        state->total_separate_edges = total_edges;
 
        /* fill the edges with data */
-       for (i = 0, BLI_ghashIterator_init(ghi, edge_hash); !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
+       for (i = 0, BLI_ghashIterator_init(ghi, edge_hash); BLI_ghashIterator_notDone(ghi); BLI_ghashIterator_step(ghi)) {
                edges[i++] = *((UvEdge *)BLI_ghashIterator_getKey(ghi));
        }
 
index 5995365..840b16a 100644 (file)
@@ -197,7 +197,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
         * generated code, to avoid have to add the actual code & recompile all */
        ghi = BLI_ghashIterator_new(hash);
 
-       for (; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
+       for (; BLI_ghashIterator_notDone(ghi); BLI_ghashIterator_step(ghi)) {
                name = BLI_ghashIterator_getValue(ghi);
                function = BLI_ghashIterator_getValue(ghi);
 
index d5aa635..a168c9c 100644 (file)
@@ -145,7 +145,7 @@ static void check_unused_keys(MovieCache *cache)
        GHashIterator *iter;
 
        iter = BLI_ghashIterator_new(cache->hash);
-       while (!BLI_ghashIterator_isDone(iter)) {
+       while (BLI_ghashIterator_notDone(iter)) {
                MovieCacheKey *key = BLI_ghashIterator_getKey(iter);
                MovieCacheItem *item = BLI_ghashIterator_getValue(iter);
                int remove = 0;
@@ -408,7 +408,7 @@ void IMB_moviecache_cleanup(MovieCache *cache, int (cleanup_check_cb) (void *use
        GHashIterator *iter;
 
        iter = BLI_ghashIterator_new(cache->hash);
-       while (!BLI_ghashIterator_isDone(iter)) {
+       while (BLI_ghashIterator_notDone(iter)) {
                MovieCacheKey *key = BLI_ghashIterator_getKey(iter);
                int remove;
 
@@ -457,7 +457,7 @@ void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_
 
                iter = BLI_ghashIterator_new(cache->hash);
                a = 0;
-               while (!BLI_ghashIterator_isDone(iter)) {
+               while (BLI_ghashIterator_notDone(iter)) {
                        MovieCacheKey *key = BLI_ghashIterator_getKey(iter);
                        MovieCacheItem *item = BLI_ghashIterator_getValue(iter);
                        int framenr, curproxy, curflags;
index c5a7567..0f5f9db 100644 (file)
@@ -230,7 +230,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 
        /* copy the vertices across */
        for (hashIter = BLI_ghashIterator_new(vertHash);
-            !BLI_ghashIterator_isDone(hashIter);
+            BLI_ghashIterator_notDone(hashIter);
             BLI_ghashIterator_step(hashIter)
             )
        {
index 23ce8cd..b868023 100644 (file)
@@ -316,7 +316,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        /* using ghash-iterators, map data into new mesh */
        /* vertices */
        for (hashIter = BLI_ghashIterator_new(vertHash);
-            !BLI_ghashIterator_isDone(hashIter);
+            BLI_ghashIterator_notDone(hashIter);
             BLI_ghashIterator_step(hashIter) )
        {
                MVert source;
@@ -334,7 +334,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                
        /* edges */
        for (hashIter = BLI_ghashIterator_new(edgeHash);
-            !BLI_ghashIterator_isDone(hashIter);
+            BLI_ghashIterator_notDone(hashIter);
             BLI_ghashIterator_step(hashIter))
        {
                MEdge source;
@@ -355,7 +355,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        
        /* faces */
        for (hashIter = BLI_ghashIterator_new(polyHash);
-            !BLI_ghashIterator_isDone(hashIter);
+            BLI_ghashIterator_notDone(hashIter);
             BLI_ghashIterator_step(hashIter) )
        {
                int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
index ee88568..26c043f 100644 (file)
@@ -369,7 +369,7 @@ static PyObject *pyop_dir(PyObject *UNUSED(self))
        GHashIterator *iter = WM_operatortype_iter();
        PyObject *list = PyList_New(0), *name;
 
-       for ( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for ( ; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
 
                name = PyUnicode_FromString(ot->idname);
index cef4e23..d884225 100644 (file)
@@ -250,7 +250,7 @@ static void id_release_weakref_list(struct ID *id, GHash *weakinfo_hash)
        fprintf(stdout, "id_release_weakref: '%s', %d items\n", id->name, BLI_ghash_size(weakinfo_hash));
 #endif
 
-       while (!BLI_ghashIterator_isDone(&weakinfo_hash_iter)) {
+       while (BLI_ghashIterator_notDone(&weakinfo_hash_iter)) {
                PyObject *weakref = (PyObject *)BLI_ghashIterator_getKey(&weakinfo_hash_iter);
                PyObject *item = PyWeakref_GET_OBJECT(weakref);
                if (item != Py_None) {
index 6d0e15e..b6ff547 100644 (file)
@@ -1016,7 +1016,7 @@ void free_sss(Render *re)
        if (re->sss_hash) {
                GHashIterator *it= BLI_ghashIterator_new(re->sss_hash);
 
-               while (!BLI_ghashIterator_isDone(it)) {
+               while (BLI_ghashIterator_notDone(it)) {
                        sss_free_tree(BLI_ghashIterator_getValue(it));
                        BLI_ghashIterator_step(it);
                }
index a01f730..29e0fcf 100644 (file)
@@ -218,7 +218,7 @@ void WM_uilisttype_free(void)
 {
        GHashIterator *iter = BLI_ghashIterator_new(uilisttypes_hash);
 
-       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                uiListType *ult = BLI_ghashIterator_getValue(iter);
                if (ult->ext.free) {
                        ult->ext.free(ult->ext.data);
@@ -271,7 +271,7 @@ void WM_menutype_free(void)
 {
        GHashIterator *iter = BLI_ghashIterator_new(menutypes_hash);
 
-       for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+       for (; BLI_ghashIterator_notDone(iter); BLI_ghashIterator_step(iter)) {
                MenuType *mt = BLI_ghashIterator_getValue(iter);
                if (mt->ext.free) {
                        mt->ext.free(mt->ext.data);