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 99ed978561e29d19c79a2237b434613bad427f8c..cdc8ef0bdf441808bc5dea8357ec29436ce4167d 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 477ae27394ffa0c85164d89e5e67d812f58d39b5..5efeeaeedaa6e02344ce726d410c5dba107034f7 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 e2c6df5e5282fa94a06ad6b97900db2fbcd17322..01d4696de94dcbd4b81faec4decafe407b501534 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 82e71f43c35dcd883f5a2c3422e085ab22fb8d89..2ccc28dc07b22a8a724a141607af72166ffab846 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 bd06f5202e5f932460222073eeda2aa49951d268..c3b3a3e348c4748c24b0a732a40a870d9ef2705f 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 62cce6b2c1e455ea4c14f303968cd8c197319208..d002d82b868c9c19b77ee562bc309811d537cf13 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 ec96c574f7589ec047a60c6792352f27631731b5..5101d5f95a47e65b988a754499105c90650eca10 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 454b0f0bceb4ff774fc70ec570026f45cd8f9e42..d04938fd59b08a64d6b90efe793f93c65071fc9f 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 d01e5c5d9bf25b46e43693a735973efd294f1d26..c91734fecec97b6820672af3b720ce4b3bef1e1f 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 3298859ee0c99bdc60c2414d36e9389579709294..64221a12cb96cfc1167379dcd35eb0f23d01103f 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 3a9c43c953976189af397f605e26007ca0afe44c..5c0a2b8dd307c7d50949b4a010c8c1c04433b5f1 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 3baf5d8abf74f3cd534c3cddbfbd13425ae29099..b40933c50cb058eed1fe5d3a7079e6979dd00974 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 cacbc6d6268aff9132a3f2eb932d8f444e381267..3d5125fc0758edee69d3064f73d98d9d29c75ca9 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 7c18b5c283a907bd6a5bb75d21663c51932383c1..106093d2531999f0aa38d2b96f134f6470152c0a 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 bb5b7aa69112a5bc3eb779102267d0730dfc5134..d3bf8a30792e20e8eb2765ae0b4125e42efbc19b 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 825e8b79a7d32b138088e8b5cfe1e5182dcaff14..e4599b2c30aaf39509568ec258a0243d7a421b48 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 59953659a2c79d38b033820da816f570ab90e1a9..840b16a4567cdc9875f788822558752e0f355a54 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 d5aa635f54810436d8d3d091ba0e603dba90825a..a168c9c30510500cbb59dcb428ca8a67303e0960 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 c5a756733f5bc92ab505c91d9a52d5687af2fe0c..0f5f9db2ee612f0a921c54246088b566cc08b7a6 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 23ce8cdeb210b05d982dff10dcef109276d6fc47..b86802340dcad1eeac596ba99998006bac204afb 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 ee885684e03dd010c6f4b25f8e3815b8fffc0d3c..26c043f796f4ae39528cbccdd2801a95de552861 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 cef4e23242da8eccc3833b82719a22d1e9575917..d8842256c22e61b0f1f2f2d1674cbf5b9db4b9df 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 6d0e15ea46e53c14c0bb774982ba1150c15fb1ee..b6ff547c93ec4432faced405edfc191e451d2f4c 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 a01f7301ec241e9462735ede10c81053d8c1bd35..29e0fcf302fff52d537aada71e60dc2d78bc99cb 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);