use ints for ghash/edgehash flags, since its allocated theres not much point to try...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 24 Aug 2013 20:16:14 +0000 (20:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 24 Aug 2013 20:16:14 +0000 (20:16 +0000)
source/blender/blenlib/BLI_edgehash.h
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/edgehash.c
source/blender/bmesh/intern/bmesh_mesh.c

index b79fe669f2041a132f79f89ef4c662d99b0699d5..bece13a99bfa514c92a5d1c0616f697315ea104b 100644 (file)
@@ -51,8 +51,8 @@ void          **BLI_edgehash_lookup_p(EdgeHash *eh, unsigned int v0, unsigned in
 bool            BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1);
 int             BLI_edgehash_size(EdgeHash *eh);
 void            BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp);
-void            BLI_edgehash_flag_set(EdgeHash *eh, unsigned short flag);
-void            BLI_edgehash_flag_clear(EdgeHash *eh, unsigned short flag);
+void            BLI_edgehash_flag_set(EdgeHash *eh, unsigned int flag);
+void            BLI_edgehash_flag_clear(EdgeHash *eh, unsigned int flag);
 
 EdgeHashIterator   *BLI_edgehashIterator_new(EdgeHash *eh);
 void                BLI_edgehashIterator_free(EdgeHashIterator *ehi);
@@ -65,5 +65,4 @@ bool                BLI_edgehashIterator_isDone(EdgeHashIterator *ehi);
 #define BLI_EDGEHASH_SIZE_GUESS_FROM_LOOPS(totloop)  ((totloop) / 2)
 #define BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS(totpoly)  ((totpoly) * 2)
 
-
-#endif
+#endif  /* __BLI_EDGEHASH_H__ */
index fe24d9a0069c8b67262203ae4f72f2f272743f84..aef1d1fa13835ac8ffcac7d4086ecbc91733b7d5 100644 (file)
@@ -71,8 +71,8 @@ void   BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfr
 void  *BLI_ghash_pop(GHash *gh, void *key, GHashKeyFreeFP keyfreefp);
 bool   BLI_ghash_haskey(GHash *gh, const void *key);
 int    BLI_ghash_size(GHash *gh);
-void   BLI_ghash_flag_set(GHash *gh, unsigned short flag);
-void   BLI_ghash_flag_clear(GHash *gh, unsigned short flag);
+void   BLI_ghash_flag_set(GHash *gh, unsigned int flag);
+void   BLI_ghash_flag_clear(GHash *gh, unsigned int flag);
 
 /* *** */
 
index edb29fa6d3e2ad806a925c52fb85bb4772794d3d..1ae3ac18f24da0409d7338d161ff02b7d3802dc1 100644 (file)
@@ -77,7 +77,7 @@ struct GHash {
        struct BLI_mempool *entrypool;
        unsigned int nbuckets;
        unsigned int nentries;
-       unsigned short cursize, flag;
+       unsigned int cursize, flag;
 };
 
 
@@ -343,14 +343,14 @@ void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreef
        MEM_freeN(gh);
 }
 
-void BLI_ghash_flag_set(GHash *gh, unsigned short flag)
+void BLI_ghash_flag_set(GHash *gh, unsigned int flag)
 {
        gh->flag |= flag;
 }
 
-void BLI_ghash_flag_clear(GHash *gh, unsigned short flag)
+void BLI_ghash_flag_clear(GHash *gh, unsigned int flag)
 {
-       gh->flag &= (unsigned short)~flag;
+       gh->flag &= ~flag;
 }
 
 
index 66c9eedaf1bd33d1ff515bb7d7443761301d5ad7..dac107187f3ede376b5afc0c05ffd13de123d57a 100644 (file)
@@ -75,7 +75,7 @@ struct EdgeHash {
        EdgeEntry **buckets;
        BLI_mempool *epool;
        unsigned int nbuckets, nentries;
-       unsigned short cursize, flag;
+       unsigned int cursize, flag;
 };
 
 
@@ -295,14 +295,14 @@ void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp)
 }
 
 
-void BLI_edgehash_flag_set(EdgeHash *eh, unsigned short flag)
+void BLI_edgehash_flag_set(EdgeHash *eh, unsigned int flag)
 {
        eh->flag |= flag;
 }
 
-void BLI_edgehash_flag_clear(EdgeHash *eh, unsigned short flag)
+void BLI_edgehash_flag_clear(EdgeHash *eh, unsigned int flag)
 {
-       eh->flag &= (unsigned short)~flag;
+       eh->flag &= ~flag;
 }
 
 
index 5ab6fe72f77c36a7ab82bd1e562c87044d082686..cc2324ba34afb9afc6be8e949f419acfd90def45 100644 (file)
@@ -667,7 +667,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
        if (!(vert_idx || edge_idx || face_idx))
                return;
 
-       /* Remap vertices */
+       /* Remap Verts */
        if (vert_idx) {
                BMVert **verts_pool, *verts_copy, **vep;
                int i, totvert = bm->totvert;
@@ -701,7 +701,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
                MEM_freeN(verts_copy);
        }
 
-       /* XXX Code not tested yet (though I don't why it would fail)! */
+       /* Remap Edges */
        if (edge_idx) {
                BMEdge **edges_pool, *edges_copy, **edp;
                int i, totedge = bm->totedge;
@@ -734,7 +734,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
                MEM_freeN(edges_copy);
        }
 
-       /* XXX Code not tested yet (though I don't why it would fail)! */
+       /* Remap Faces */
        if (face_idx) {
                BMFace **faces_pool, *faces_copy, **fap;
                int i, totface = bm->totface;