[Bf-blender-cvs] [773652b] temp-ghash-basis: Tweak GHASH_INTERNAL_API use

Campbell Barton noreply at git.blender.org
Thu Mar 19 15:57:54 CET 2015


Commit: 773652b2aa4933c067ddfd059ac1aa80c1fd9ce5
Author: Campbell Barton
Date:   Fri Mar 20 01:57:06 2015 +1100
Branches: temp-ghash-basis
https://developer.blender.org/rB773652b2aa4933c067ddfd059ac1aa80c1fd9ce5

Tweak GHASH_INTERNAL_API use

===================================================================

M	source/blender/blenlib/BLI_ghash.h
M	source/blender/blenlib/intern/BLI_ghash.c
M	source/blender/blenlib/intern/hash_mm2a.c

===================================================================

diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h
index 4b84a31..16d18ef 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -59,8 +59,10 @@ enum {
 	GHASH_FLAG_ALLOW_DUPES  = (1 << 0),  /* Only checked for in debug mode */
 	GHASH_FLAG_ALLOW_SHRINK = (1 << 1),  /* Allow to shrink buckets' size. */
 
+#ifdef GHASH_INTERNAL_API
 	/* Internal usage only */
 	GHASH_FLAG_IS_GSET      = (1 << 16),  /* Whether the GHash is actually used as GSet (no value storage). */
+#endif
 };
 
 /* *** */
@@ -254,8 +256,9 @@ BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi) { return BLI_ghashItera
 	     BLI_gsetIterator_done(&gs_iter_) == false;                           \
 	     BLI_gsetIterator_step(&gs_iter_), i_++)
 
-#ifdef GHASH_INTERNAL_API
 
+/* For testing, debugging only */
+#ifdef GHASH_INTERNAL_API
 int BLI_ghash_buckets_size(GHash *gh);
 int BLI_gset_buckets_size(GSet *gs);
 
@@ -267,8 +270,8 @@ double BLI_gset_calc_quality_ex(
         double *r_prop_empty_buckets, double *r_prop_overloaded_buckets, int *r_biggest_bucket);
 double BLI_ghash_calc_quality(GHash *gh);
 double BLI_gset_calc_quality(GSet *gs);
+#endif  /* GHASH_INTERNAL_API */
 
-#endif
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 0d01624..7b9500b 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -45,6 +45,8 @@
 #include "BLI_utildefines.h"
 #include "BLI_hash_mm2a.h"
 #include "BLI_mempool.h"
+
+#define GHASH_INTERNAL_API
 #include "BLI_ghash.h"
 #include "BLI_strict_flags.h"
 
diff --git a/source/blender/blenlib/intern/hash_mm2a.c b/source/blender/blenlib/intern/hash_mm2a.c
index 30bd59b..87ba542 100644
--- a/source/blender/blenlib/intern/hash_mm2a.c
+++ b/source/blender/blenlib/intern/hash_mm2a.c
@@ -141,5 +141,5 @@ uint32_t BLI_hash_mm2(const unsigned char *data, size_t len, uint32_t seed)
 	MM2A_MIX_FINALIZE(h);
 
 	return h;
-} 
+}




More information about the Bf-blender-cvs mailing list