Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-02-18 14:33:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-18 14:33:05 +0300
commit2bc952fdb6e1474e9e568224a37bcf5cff874aaf (patch)
tree8d7c3a99896415392035ba350a606d350b6d5e37 /source/blender
parent5d3f679013bbbb9f0c7aae47b5653c54266cf7ca (diff)
parent7ff3cd26932cbc93068eea4dc7438442216e4ee1 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c2
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c2
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c2
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c2
-rw-r--r--source/blender/blenkernel/intern/particle_system.c2
-rw-r--r--source/blender/blenlib/BLI_boxpack_2d.h (renamed from source/blender/blenlib/BLI_boxpack2d.h)10
-rw-r--r--source/blender/blenlib/BLI_convexhull_2d.h (renamed from source/blender/blenlib/BLI_convexhull2d.h)8
-rw-r--r--source/blender/blenlib/BLI_dial_2d.h (renamed from source/blender/blenlib/BLI_dial.h)8
-rw-r--r--source/blender/blenlib/BLI_ghash.h239
-rw-r--r--source/blender/blenlib/BLI_jitter_2d.h (renamed from source/blender/blenlib/BLI_jitter.h)8
-rw-r--r--source/blender/blenlib/BLI_lasso_2d.h (renamed from source/blender/blenlib/BLI_lasso.h)8
-rw-r--r--source/blender/blenlib/BLI_polyfill_2d.h (renamed from source/blender/blenlib/BLI_polyfill2d.h)6
-rw-r--r--source/blender/blenlib/BLI_polyfill_2d_beautify.h (renamed from source/blender/blenlib/BLI_polyfill2d_beautify.h)0
-rw-r--r--source/blender/blenlib/BLI_voronoi_2d.h (renamed from source/blender/blenlib/BLI_voronoi.h)2
-rw-r--r--source/blender/blenlib/CMakeLists.txt33
-rw-r--r--source/blender/blenlib/intern/BLI_dial_2d.c (renamed from source/blender/blenlib/intern/BLI_dial.c)6
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c251
-rw-r--r--source/blender/blenlib/intern/BLI_ghash_utils.c288
-rw-r--r--source/blender/blenlib/intern/boxpack_2d.c (renamed from source/blender/blenlib/intern/boxpack2d.c)2
-rw-r--r--source/blender/blenlib/intern/convexhull_2d.c (renamed from source/blender/blenlib/intern/convexhull2d.c)4
-rw-r--r--source/blender/blenlib/intern/jitter_2d.c (renamed from source/blender/blenlib/intern/jitter.c)2
-rw-r--r--source/blender/blenlib/intern/lasso_2d.c (renamed from source/blender/blenlib/intern/lasso.c)4
-rw-r--r--source/blender/blenlib/intern/polyfill_2d.c (renamed from source/blender/blenlib/intern/polyfill2d.c)4
-rw-r--r--source/blender/blenlib/intern/polyfill_2d_beautify.c (renamed from source/blender/blenlib/intern/polyfill2d_beautify.c)2
-rw-r--r--source/blender/blenlib/intern/voronoi_2d.c (renamed from source/blender/blenlib/intern/voronoi.c)10
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c4
-rw-r--r--source/blender/bmesh/operators/bmo_connect_concave.c4
-rw-r--r--source/blender/bmesh/tools/bmesh_beautify.c2
-rw-r--r--source/blender/bmesh/tools/bmesh_decimate_collapse.c4
-rw-r--r--source/blender/bmesh/tools/bmesh_triangulate.c4
-rw-r--r--source/blender/compositor/operations/COM_KeyingScreenOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp2
-rw-r--r--source/blender/editors/animation/keyframes_edit.c2
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c2
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c2
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c2
-rw-r--r--source/blender/editors/mask/mask_select.c2
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/space_action/action_select.c2
-rw-r--r--source/blender/editors/space_clip/tracking_select.c2
-rw-r--r--source/blender/editors/space_graph/graph_select.c2
-rw-r--r--source/blender/editors/space_node/node_select.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c4
-rw-r--r--source/blender/gpu/intern/gpu_batch.c2
-rw-r--r--source/blender/makesdna/intern/CMakeLists.txt1
-rw-r--r--source/blender/python/mathutils/mathutils_bvhtree.c2
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.c4
-rw-r--r--source/blender/render/intern/source/initrender.c2
-rw-r--r--source/blender/render/intern/source/shadbuf.c2
-rw-r--r--source/blender/render/intern/source/zbuf.c2
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2
59 files changed, 535 insertions, 449 deletions
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 0491cbd21f0..2018962eb62 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -44,7 +44,7 @@
#include "atomic_ops.h"
#include "BLI_math.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_bitmap.h"
#include "BLI_task.h"
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 531291c30bb..c7678be18c7 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -43,7 +43,7 @@
#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "BLI_bitmap.h"
-#include "BLI_polyfill2d.h"
+#include "BLI_polyfill_2d.h"
#include "BLI_linklist.h"
#include "BLI_linklist_stack.h"
#include "BLI_alloca.h"
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index f321c94bf00..0af4dae4506 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -36,7 +36,7 @@
#include "BLI_bitmap.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
-#include "BLI_polyfill2d.h"
+#include "BLI_polyfill_2d.h"
#include "BLI_rand.h"
#include "BKE_bvhutils.h"
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index ff8a638089f..767a17a34e7 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -36,7 +36,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_kdtree.h"
#include "BLI_math.h"
#include "BLI_math_geom.h"
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e00ae8537aa..9bc4da6f0d5 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -58,7 +58,7 @@
#include "BLI_utildefines.h"
#include "BLI_edgehash.h"
#include "BLI_rand.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_kdtree.h"
diff --git a/source/blender/blenlib/BLI_boxpack2d.h b/source/blender/blenlib/BLI_boxpack_2d.h
index b02e3423f88..80e89bdb04f 100644
--- a/source/blender/blenlib/BLI_boxpack2d.h
+++ b/source/blender/blenlib/BLI_boxpack_2d.h
@@ -25,10 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __BLI_BOXPACK2D_H__
-#define __BLI_BOXPACK2D_H__
+#ifndef __BLI_BOXPACK_2D_H__
+#define __BLI_BOXPACK_2D_H__
-/** \file BLI_boxpack2d.h
+/** \file BLI_boxpack_2d.h
* \ingroup bli
*/
@@ -39,7 +39,7 @@ typedef struct BoxPack {
float y;
float w;
float h;
-
+
/* Verts this box uses
* (BL,TR,TL,BR) / 0,1,2,3 */
struct BoxVert *v[4];
@@ -49,5 +49,5 @@ typedef struct BoxPack {
void BLI_box_pack_2d(BoxPack *boxarray, const unsigned int len, float *tot_width, float *tot_height);
-#endif
+#endif /* __BLI_BOXPACK_2D_H__ */
diff --git a/source/blender/blenlib/BLI_convexhull2d.h b/source/blender/blenlib/BLI_convexhull_2d.h
index 4b82071ede8..000d28acdde 100644
--- a/source/blender/blenlib/BLI_convexhull2d.h
+++ b/source/blender/blenlib/BLI_convexhull_2d.h
@@ -18,10 +18,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __BLI_CONVEXHULL2D_H__
-#define __BLI_CONVEXHULL2D_H__
+#ifndef __BLI_CONVEXHULL_2D_H__
+#define __BLI_CONVEXHULL_2D_H__
-/** \file BLI_convexhull2d.h
+/** \file BLI_convexhull_2d.h
* \ingroup bli
*/
@@ -31,4 +31,4 @@ int BLI_convexhull_2d(const float (*points)[2], const int n, int r_points[]);
float BLI_convexhull_aabb_fit_hull_2d(const float (*points_hull)[2], unsigned int n);
float BLI_convexhull_aabb_fit_points_2d(const float (*points)[2], unsigned int n);
-#endif /* __BLI_CONVEXHULL2D_H__ */
+#endif /* __BLI_CONVEXHULL_2D_H__ */
diff --git a/source/blender/blenlib/BLI_dial.h b/source/blender/blenlib/BLI_dial_2d.h
index 71ab57bb61a..dbd71a8ad3f 100644
--- a/source/blender/blenlib/BLI_dial.h
+++ b/source/blender/blenlib/BLI_dial_2d.h
@@ -18,10 +18,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __BLI_DIAL_H__
-#define __BLI_DIAL_H__
+#ifndef __BLI_DIAL_2D_H__
+#define __BLI_DIAL_2D_H__
-/** \file BLI_dial.h
+/** \file BLI_dial_2d.h
* \ingroup bli
*
* \note dials act similar to old rotation based phones and output an angle.
@@ -56,4 +56,4 @@ Dial *BLI_dial_initialize(const float start_position[2], float threshold);
float BLI_dial_angle(Dial *dial, const float current_position[2]);
-#endif /* __BLI_DIAL_H__ */
+#endif /* __BLI_DIAL_2D_H__ */
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h
index 7a2d9924904..ec591c6bb48 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -81,7 +81,10 @@ enum {
#endif
};
-/* *** */
+/** \name GHash API
+ *
+ * Defined in ``BLI_ghash.c``
+ * \{ */
GHash *BLI_ghash_new_ex(
GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info,
@@ -114,7 +117,10 @@ unsigned int BLI_ghash_len(GHash *gh) ATTR_WARN_UNUSED_RESULT;
void BLI_ghash_flag_set(GHash *gh, unsigned int flag);
void BLI_ghash_flag_clear(GHash *gh, unsigned int flag);
-/* *** */
+/** \} */
+
+/** \name GHash Iterator
+ * \{ */
GHashIterator *BLI_ghashIterator_new(GHash *gh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
@@ -149,94 +155,15 @@ BLI_INLINE bool BLI_ghashIterator_done(GHashIterator *ghi) { return !ghi
BLI_ghashIterator_done(&gh_iter_) == false; \
BLI_ghashIterator_step(&gh_iter_), i_++)
-/** \name Callbacks for GHash
- *
- * \note '_p' suffix denotes void pointer arg,
- * so we can have functions that take correctly typed args too.
- * \{ */
-
-unsigned int BLI_ghashutil_ptrhash(const void *key);
-bool BLI_ghashutil_ptrcmp(const void *a, const void *b);
-
-unsigned int BLI_ghashutil_strhash_n(const char *key, size_t n);
-#define BLI_ghashutil_strhash(key) ( \
- CHECK_TYPE_ANY(key, char *, const char *, const char * const), \
- BLI_ghashutil_strhash_p(key))
-unsigned int BLI_ghashutil_strhash_p(const void *key);
-unsigned int BLI_ghashutil_strhash_p_murmur(const void *key);
-bool BLI_ghashutil_strcmp(const void *a, const void *b);
-
-#define BLI_ghashutil_inthash(key) ( \
- CHECK_TYPE_ANY(&(key), int *, const int *), \
- BLI_ghashutil_uinthash((unsigned int)key))
-unsigned int BLI_ghashutil_uinthash(unsigned int key);
-unsigned int BLI_ghashutil_inthash_p(const void *ptr);
-unsigned int BLI_ghashutil_inthash_p_murmur(const void *ptr);
-unsigned int BLI_ghashutil_inthash_p_simple(const void *ptr);
-bool BLI_ghashutil_intcmp(const void *a, const void *b);
-
-size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b);
-
-
-unsigned int BLI_ghashutil_uinthash_v4(const unsigned int key[4]);
-#define BLI_ghashutil_inthash_v4(key) ( \
- CHECK_TYPE_ANY(key, int *, const int *), \
- BLI_ghashutil_uinthash_v4((const unsigned int *)key))
-#define BLI_ghashutil_inthash_v4_p \
- ((GSetHashFP)BLI_ghashutil_uinthash_v4)
-#define BLI_ghashutil_uinthash_v4_p \
- ((GSetHashFP)BLI_ghashutil_uinthash_v4)
-unsigned int BLI_ghashutil_uinthash_v4_murmur(const unsigned int key[4]);
-#define BLI_ghashutil_inthash_v4_murmur(key) ( \
- CHECK_TYPE_ANY(key, int *, const int *), \
- BLI_ghashutil_uinthash_v4_murmur((const unsigned int *)key))
-#define BLI_ghashutil_inthash_v4_p_murmur \
- ((GSetHashFP)BLI_ghashutil_uinthash_v4_murmur)
-#define BLI_ghashutil_uinthash_v4_p_murmur \
- ((GSetHashFP)BLI_ghashutil_uinthash_v4_murmur)
-bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b);
-#define BLI_ghashutil_inthash_v4_cmp \
- BLI_ghashutil_uinthash_v4_cmp
-
/** \} */
-GHash *BLI_ghash_ptr_new_ex(
- const char *info,
- const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_ptr_new(
- const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_str_new_ex(
- const char *info,
- const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_str_new(
- const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_int_new_ex(
- const char *info,
- const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_int_new(
- const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_pair_new_ex(
- const char *info,
- const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GHash *BLI_ghash_pair_new(
- const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-
-typedef struct GHashPair {
- const void *first;
- const void *second;
-} GHashPair;
-
-GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second);
-unsigned int BLI_ghashutil_pairhash(const void *ptr);
-bool BLI_ghashutil_paircmp(const void *a, const void *b);
-void BLI_ghashutil_pairfree(void *ptr);
-
-/**
- * GSet is a 'set' implementation (unordered collection of unique elements).
+/** \name GSet API
+ * A 'set' implementation (unordered collection of unique elements).
*
* Internally this is a 'GHash' without any keys,
* which is why this API's are in the same header & source file.
- */
+ *
+ * \{ */
typedef struct GSet GSet;
@@ -247,15 +174,6 @@ typedef GHashKeyCopyFP GSetKeyCopyFP;
typedef GHashIterState GSetIterState;
-/* so we can cast but compiler sees as different */
-typedef struct GSetIterator {
- GHashIterator _ghi
-#ifdef __GNUC__
- __attribute__ ((deprecated))
-#endif
- ;
-} GSetIterator;
-
GSet *BLI_gset_new_ex(
GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info,
const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
@@ -281,14 +199,20 @@ void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp);
void *BLI_gset_lookup(GSet *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
void *BLI_gset_pop_key(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
-GSet *BLI_gset_ptr_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GSet *BLI_gset_ptr_new(const char *info);
-GSet *BLI_gset_str_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GSet *BLI_gset_str_new(const char *info);
-GSet *BLI_gset_pair_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
-GSet *BLI_gset_pair_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+/** \name GSet Iterator
+ * \{ */
/* rely on inline api for now */
+
+/* so we can cast but compiler sees as different */
+typedef struct GSetIterator {
+ GHashIterator _ghi
+#ifdef __GNUC__
+ __attribute__ ((deprecated))
+#endif
+ ;
+} GSetIterator;
+
BLI_INLINE GSetIterator *BLI_gsetIterator_new(GSet *gs) { return (GSetIterator *)BLI_ghashIterator_new((GHash *)gs); }
BLI_INLINE void BLI_gsetIterator_init(GSetIterator *gsi, GSet *gs) { BLI_ghashIterator_init((GHashIterator *)gsi, (GHash *)gs); }
BLI_INLINE void BLI_gsetIterator_free(GSetIterator *gsi) { BLI_ghashIterator_free((GHashIterator *)gsi); }
@@ -306,6 +230,10 @@ BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi) { return BLI_ghashItera
BLI_gsetIterator_done(&gs_iter_) == false; \
BLI_gsetIterator_step(&gs_iter_), i_++)
+/** \} */
+
+/** \name GHash/GSet Debugging API's
+ * \{ */
/* For testing, debugging only */
#ifdef GHASH_INTERNAL_API
@@ -321,6 +249,10 @@ double BLI_gset_calc_quality_ex(
double BLI_ghash_calc_quality(GHash *gh);
double BLI_gset_calc_quality(GSet *gs);
#endif /* GHASH_INTERNAL_API */
+/** \} */
+
+/** \name GHash/GSet Macros
+ * \{ */
#define GHASH_FOREACH_BEGIN(type, var, what) \
do { \
@@ -342,6 +274,113 @@ double BLI_gset_calc_quality(GSet *gs);
} \
} while(0)
+/** \} */
+
+/** \name GHash/GSet Utils
+ *
+ * Defined in ``BLI_ghash_utils.c``
+ * \{ */
+
+/**
+ * Callbacks for GHash (``BLI_ghashutil_``)
+ *
+ * \note '_p' suffix denotes void pointer arg,
+ * so we can have functions that take correctly typed args too.
+ * \{ */
+
+unsigned int BLI_ghashutil_ptrhash(const void *key);
+bool BLI_ghashutil_ptrcmp(const void *a, const void *b);
+
+unsigned int BLI_ghashutil_strhash_n(const char *key, size_t n);
+#define BLI_ghashutil_strhash(key) ( \
+ CHECK_TYPE_ANY(key, char *, const char *, const char * const), \
+ BLI_ghashutil_strhash_p(key))
+unsigned int BLI_ghashutil_strhash_p(const void *key);
+unsigned int BLI_ghashutil_strhash_p_murmur(const void *key);
+bool BLI_ghashutil_strcmp(const void *a, const void *b);
+
+#define BLI_ghashutil_inthash(key) ( \
+ CHECK_TYPE_ANY(&(key), int *, const int *), \
+ BLI_ghashutil_uinthash((unsigned int)key))
+unsigned int BLI_ghashutil_uinthash(unsigned int key);
+unsigned int BLI_ghashutil_inthash_p(const void *ptr);
+unsigned int BLI_ghashutil_inthash_p_murmur(const void *ptr);
+unsigned int BLI_ghashutil_inthash_p_simple(const void *ptr);
+bool BLI_ghashutil_intcmp(const void *a, const void *b);
+
+size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b);
+
+
+unsigned int BLI_ghashutil_uinthash_v4(const unsigned int key[4]);
+#define BLI_ghashutil_inthash_v4(key) ( \
+ CHECK_TYPE_ANY(key, int *, const int *), \
+ BLI_ghashutil_uinthash_v4((const unsigned int *)key))
+#define BLI_ghashutil_inthash_v4_p \
+ ((GSetHashFP)BLI_ghashutil_uinthash_v4)
+#define BLI_ghashutil_uinthash_v4_p \
+ ((GSetHashFP)BLI_ghashutil_uinthash_v4)
+unsigned int BLI_ghashutil_uinthash_v4_murmur(const unsigned int key[4]);
+#define BLI_ghashutil_inthash_v4_murmur(key) ( \
+ CHECK_TYPE_ANY(key, int *, const int *), \
+ BLI_ghashutil_uinthash_v4_murmur((const unsigned int *)key))
+#define BLI_ghashutil_inthash_v4_p_murmur \
+ ((GSetHashFP)BLI_ghashutil_uinthash_v4_murmur)
+#define BLI_ghashutil_uinthash_v4_p_murmur \
+ ((GSetHashFP)BLI_ghashutil_uinthash_v4_murmur)
+bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b);
+#define BLI_ghashutil_inthash_v4_cmp \
+ BLI_ghashutil_uinthash_v4_cmp
+
+typedef struct GHashPair {
+ const void *first;
+ const void *second;
+} GHashPair;
+
+GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second);
+unsigned int BLI_ghashutil_pairhash(const void *ptr);
+bool BLI_ghashutil_paircmp(const void *a, const void *b);
+void BLI_ghashutil_pairfree(void *ptr);
+
+/**
+ * Wrapper GHash Creation Functions
+ */
+
+GHash *BLI_ghash_ptr_new_ex(
+ const char *info,
+ const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_ptr_new(
+ const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_str_new_ex(
+ const char *info,
+ const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_str_new(
+ const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_int_new_ex(
+ const char *info,
+ const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_int_new(
+ const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_pair_new_ex(
+ const char *info,
+ const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GHash *BLI_ghash_pair_new(
+ const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+
+GSet *BLI_gset_ptr_new_ex(
+ const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GSet *BLI_gset_ptr_new(
+ const char *info);
+GSet *BLI_gset_str_new_ex(
+ const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GSet *BLI_gset_str_new(
+ const char *info);
+GSet *BLI_gset_pair_new_ex(
+ const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+GSet *BLI_gset_pair_new(
+ const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
+
+/** \} */
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenlib/BLI_jitter.h b/source/blender/blenlib/BLI_jitter_2d.h
index 769fb445678..e2b1f21800c 100644
--- a/source/blender/blenlib/BLI_jitter.h
+++ b/source/blender/blenlib/BLI_jitter_2d.h
@@ -25,10 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __BLI_JITTER_H__
-#define __BLI_JITTER_H__
+#ifndef __BLI_JITTER_2D_H__
+#define __BLI_JITTER_2D_H__
-/** \file BLI_jitter.h
+/** \file BLI_jitter_2d.h
* \ingroup bli
*/
@@ -36,5 +36,5 @@ void BLI_jitter_init(float (*jitarr)[2], int num);
void BLI_jitterate1(float (*jit1)[2], float (*jit2)[2], int num, float radius1);
void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float radius2);
-#endif
+#endif /* __BLI_JITTER_2D_H__ */
diff --git a/source/blender/blenlib/BLI_lasso.h b/source/blender/blenlib/BLI_lasso_2d.h
index 28f21e5bd85..3644224f1d7 100644
--- a/source/blender/blenlib/BLI_lasso.h
+++ b/source/blender/blenlib/BLI_lasso_2d.h
@@ -25,10 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __BLI_LASSO_H__
-#define __BLI_LASSO_H__
+#ifndef __BLI_LASSO_2D_H__
+#define __BLI_LASSO_2D_H__
-/** \file BLI_lasso.h
+/** \file BLI_lasso_2d.h
* \ingroup bli
*/
@@ -38,4 +38,4 @@ void BLI_lasso_boundbox(struct rcti *rect, const int mcords[][2], const unsigned
bool BLI_lasso_is_point_inside(const int mcords[][2], const unsigned int moves, const int sx, const int sy, const int error_value);
bool BLI_lasso_is_edge_inside(const int mcords[][2], const unsigned int moves, int x0, int y0, int x1, int y1, const int error_value);
-#endif
+#endif /* __BLI_LASSO_2D_H__ */
diff --git a/source/blender/blenlib/BLI_polyfill2d.h b/source/blender/blenlib/BLI_polyfill_2d.h
index 798055f9240..099f08d4663 100644
--- a/source/blender/blenlib/BLI_polyfill2d.h
+++ b/source/blender/blenlib/BLI_polyfill_2d.h
@@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __BLI_POLYFILL2D_H__
-#define __BLI_POLYFILL2D_H__
+#ifndef __BLI_POLYFILL_2D_H__
+#define __BLI_POLYFILL_2D_H__
struct MemArena;
@@ -40,4 +40,4 @@ void BLI_polyfill_calc(
/* default size of polyfill arena */
#define BLI_POLYFILL_ARENA_SIZE MEM_SIZE_OPTIMAL(1 << 14)
-#endif /* __BLI_POLYFILL2D_H__ */
+#endif /* __BLI_POLYFILL_2D_H__ */
diff --git a/source/blender/blenlib/BLI_polyfill2d_beautify.h b/source/blender/blenlib/BLI_polyfill_2d_beautify.h
index 278771e9611..278771e9611 100644
--- a/source/blender/blenlib/BLI_polyfill2d_beautify.h
+++ b/source/blender/blenlib/BLI_polyfill_2d_beautify.h
diff --git a/source/blender/blenlib/BLI_voronoi.h b/source/blender/blenlib/BLI_voronoi_2d.h
index 9d32061bf97..51d1d5aa88e 100644
--- a/source/blender/blenlib/BLI_voronoi.h
+++ b/source/blender/blenlib/BLI_voronoi_2d.h
@@ -28,7 +28,7 @@
struct ListBase;
-/** \file BLI_voronoi.h
+/** \file BLI_voronoi_2d.h
* \ingroup bli
*/
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 9e7b4ed8b6f..ef36b5ac6bd 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -41,10 +41,11 @@ set(INC_SYS
set(SRC
intern/BLI_args.c
intern/BLI_array.c
- intern/BLI_dial.c
+ intern/BLI_dial_2d.c
intern/BLI_dynstr.c
intern/BLI_filelist.c
intern/BLI_ghash.c
+ intern/BLI_ghash_utils.c
intern/BLI_heap.c
intern/BLI_kdopbvh.c
intern/BLI_kdtree.c
@@ -58,10 +59,10 @@ set(SRC
intern/array_utils.c
intern/astar.c
intern/bitmap_draw_2d.c
- intern/boxpack2d.c
+ intern/boxpack_2d.c
intern/buffer.c
intern/callbacks.c
- intern/convexhull2d.c
+ intern/convexhull_2d.c
intern/dynlib.c
intern/easing.c
intern/edgehash.c
@@ -73,8 +74,8 @@ set(SRC
intern/gsqueue.c
intern/hash_md5.c
intern/hash_mm2a.c
- intern/jitter.c
- intern/lasso.c
+ intern/jitter_2d.c
+ intern/lasso_2d.c
intern/list_sort_impl.h
intern/listbase.c
intern/math_base.c
@@ -95,8 +96,8 @@ set(SRC
intern/memory_utils.c
intern/noise.c
intern/path_util.c
- intern/polyfill2d.c
- intern/polyfill2d_beautify.c
+ intern/polyfill_2d.c
+ intern/polyfill_2d_beautify.c
intern/quadric.c
intern/rand.c
intern/rct.c
@@ -117,7 +118,7 @@ set(SRC
intern/time.c
intern/timecode.c
intern/uvproject.c
- intern/voronoi.c
+ intern/voronoi_2d.c
intern/voxel.c
intern/winstuff.c
intern/winstuff_dir.c
@@ -132,14 +133,14 @@ set(SRC
BLI_bitmap.h
BLI_bitmap_draw_2d.h
BLI_blenlib.h
- BLI_boxpack2d.h
+ BLI_boxpack_2d.h
BLI_buffer.h
BLI_callbacks.h
BLI_compiler_attrs.h
BLI_compiler_compat.h
BLI_compiler_typecheck.h
- BLI_convexhull2d.h
- BLI_dial.h
+ BLI_convexhull_2d.h
+ BLI_dial_2d.h
BLI_dlrbTree.h
BLI_dynlib.h
BLI_dynstr.h
@@ -158,10 +159,10 @@ set(SRC
BLI_hash_mm2a.h
BLI_heap.h
BLI_iterator.h
- BLI_jitter.h
+ BLI_jitter_2d.h
BLI_kdopbvh.h
BLI_kdtree.h
- BLI_lasso.h
+ BLI_lasso_2d.h
BLI_link_utils.h
BLI_linklist.h
BLI_linklist_stack.h
@@ -185,8 +186,8 @@ set(SRC
BLI_mempool.h
BLI_noise.h
BLI_path_util.h
- BLI_polyfill2d.h
- BLI_polyfill2d_beautify.h
+ BLI_polyfill_2d.h
+ BLI_polyfill_2d_beautify.h
BLI_quadric.h
BLI_rand.h
BLI_rect.h
@@ -211,7 +212,7 @@ set(SRC
BLI_utildefines_variadic.h
BLI_uvproject.h
BLI_vfontdata.h
- BLI_voronoi.h
+ BLI_voronoi_2d.h
BLI_voxel.h
BLI_winstuff.h
PIL_time.h
diff --git a/source/blender/blenlib/intern/BLI_dial.c b/source/blender/blenlib/intern/BLI_dial_2d.c
index 89f18fa10b4..d31367c5e87 100644
--- a/source/blender/blenlib/intern/BLI_dial.c
+++ b/source/blender/blenlib/intern/BLI_dial_2d.c
@@ -18,7 +18,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include "BLI_dial.h"
+/** \file blender/blenlib/intern/BLI_dial_2d.c
+ * \ingroup bli
+ */
+
+#include "BLI_dial_2d.h"
#include "BLI_math.h"
#include "MEM_guardedalloc.h"
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index edfbccca660..fc8e786e5ff 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -43,11 +43,12 @@
#include "BLI_sys_types.h" /* for intptr_t support */
#include "BLI_utildefines.h"
-#include "BLI_hash_mm2a.h"
#include "BLI_mempool.h"
#define GHASH_INTERNAL_API
-#include "BLI_ghash.h"
+#include "BLI_ghash.h" /* own include */
+
+/* keep last */
#include "BLI_strict_flags.h"
/* -------------------------------------------------------------------- */
@@ -1161,219 +1162,6 @@ bool BLI_ghashIterator_done(GHashIterator *ghi)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Generic Key Hash & Comparison Functions
- * \{ */
-
-/***/
-
-#if 0
-/* works but slower */
-uint BLI_ghashutil_ptrhash(const void *key)
-{
- return (uint)(intptr_t)key;
-}
-#else
-/* based python3.3's pointer hashing function */
-uint BLI_ghashutil_ptrhash(const void *key)
-{
- size_t y = (size_t)key;
- /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
- * excessive hash collisions for dicts and sets */
- y = (y >> 4) | (y << (8 * sizeof(void *) - 4));
- return (uint)y;
-}
-#endif
-bool BLI_ghashutil_ptrcmp(const void *a, const void *b)
-{
- return (a != b);
-}
-
-uint BLI_ghashutil_uinthash_v4(const uint key[4])
-{
- uint hash;
- hash = key[0];
- hash *= 37;
- hash += key[1];
- hash *= 37;
- hash += key[2];
- hash *= 37;
- hash += key[3];
- return hash;
-}
-uint BLI_ghashutil_uinthash_v4_murmur(const uint key[4])
-{
- return BLI_hash_mm2((const unsigned char *)key, sizeof(int) * 4 /* sizeof(key) */, 0);
-}
-
-bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b)
-{
- return (memcmp(a, b, sizeof(uint[4])) != 0);
-}
-
-uint BLI_ghashutil_uinthash(uint key)
-{
- key += ~(key << 16);
- key ^= (key >> 5);
- key += (key << 3);
- key ^= (key >> 13);
- key += ~(key << 9);
- key ^= (key >> 17);
-
- return key;
-}
-
-uint BLI_ghashutil_inthash_p(const void *ptr)
-{
- uintptr_t key = (uintptr_t)ptr;
-
- key += ~(key << 16);
- key ^= (key >> 5);
- key += (key << 3);
- key ^= (key >> 13);
- key += ~(key << 9);
- key ^= (key >> 17);
-
- return (uint)(key & 0xffffffff);
-}
-
-uint BLI_ghashutil_inthash_p_murmur(const void *ptr)
-{
- uintptr_t key = (uintptr_t)ptr;
-
- return BLI_hash_mm2((const unsigned char *)&key, sizeof(key), 0);
-}
-
-uint BLI_ghashutil_inthash_p_simple(const void *ptr)
-{
- return GET_UINT_FROM_POINTER(ptr);
-}
-
-bool BLI_ghashutil_intcmp(const void *a, const void *b)
-{
- return (a != b);
-}
-
-size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b)
-{
- return hash_a ^ (hash_b + 0x9e3779b9 + (hash_a << 6) + (hash_a >> 2));
-}
-
-/**
- * This function implements the widely used "djb" hash apparently posted
- * by Daniel Bernstein to comp.lang.c some time ago. The 32 bit
- * unsigned hash value starts at 5381 and for each byte 'c' in the
- * string, is updated: ``hash = hash * 33 + c``. This
- * function uses the signed value of each byte.
- *
- * note: this is the same hash method that glib 2.34.0 uses.
- */
-uint BLI_ghashutil_strhash_n(const char *key, size_t n)
-{
- const signed char *p;
- uint h = 5381;
-
- for (p = (const signed char *)key; n-- && *p != '\0'; p++) {
- h = (uint)((h << 5) + h) + (uint)*p;
- }
-
- return h;
-}
-uint BLI_ghashutil_strhash_p(const void *ptr)
-{
- const signed char *p;
- uint h = 5381;
-
- for (p = ptr; *p != '\0'; p++) {
- h = (uint)((h << 5) + h) + (uint)*p;
- }
-
- return h;
-}
-uint BLI_ghashutil_strhash_p_murmur(const void *ptr)
-{
- const unsigned char *key = ptr;
-
- return BLI_hash_mm2(key, strlen((const char *)key) + 1, 0);
-}
-bool BLI_ghashutil_strcmp(const void *a, const void *b)
-{
- return (a == b) ? false : !STREQ(a, b);
-}
-
-GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second)
-{
- GHashPair *pair = MEM_mallocN(sizeof(GHashPair), "GHashPair");
- pair->first = first;
- pair->second = second;
- return pair;
-}
-
-uint BLI_ghashutil_pairhash(const void *ptr)
-{
- const GHashPair *pair = ptr;
- uint hash = BLI_ghashutil_ptrhash(pair->first);
- return hash ^ BLI_ghashutil_ptrhash(pair->second);
-}
-
-bool BLI_ghashutil_paircmp(const void *a, const void *b)
-{
- const GHashPair *A = a;
- const GHashPair *B = b;
-
- return (BLI_ghashutil_ptrcmp(A->first, B->first) ||
- BLI_ghashutil_ptrcmp(A->second, B->second));
-}
-
-void BLI_ghashutil_pairfree(void *ptr)
-{
- MEM_freeN(ptr);
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
-/** \name Convenience GHash Creation Functions
- * \{ */
-
-GHash *BLI_ghash_ptr_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_ghash_new_ex(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, info, nentries_reserve);
-}
-GHash *BLI_ghash_ptr_new(const char *info)
-{
- return BLI_ghash_ptr_new_ex(info, 0);
-}
-
-GHash *BLI_ghash_str_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_ghash_new_ex(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, info, nentries_reserve);
-}
-GHash *BLI_ghash_str_new(const char *info)
-{
- return BLI_ghash_str_new_ex(info, 0);
-}
-
-GHash *BLI_ghash_int_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_ghash_new_ex(BLI_ghashutil_inthash_p, BLI_ghashutil_intcmp, info, nentries_reserve);
-}
-GHash *BLI_ghash_int_new(const char *info)
-{
- return BLI_ghash_int_new_ex(info, 0);
-}
-
-GHash *BLI_ghash_pair_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_ghash_new_ex(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info, nentries_reserve);
-}
-GHash *BLI_ghash_pair_new(const char *info)
-{
- return BLI_ghash_pair_new_ex(info, 0);
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name GSet Public API
*
* Use ghash API to give 'set' functionality
@@ -1577,39 +1365,6 @@ void *BLI_gset_pop_key(GSet *gs, const void *key)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Convenience GSet Creation Functions
- * \{ */
-
-GSet *BLI_gset_ptr_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_gset_new_ex(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, info, nentries_reserve);
-}
-GSet *BLI_gset_ptr_new(const char *info)
-{
- return BLI_gset_ptr_new_ex(info, 0);
-}
-
-GSet *BLI_gset_str_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_gset_new_ex(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, info, nentries_reserve);
-}
-GSet *BLI_gset_str_new(const char *info)
-{
- return BLI_gset_str_new_ex(info, 0);
-}
-
-GSet *BLI_gset_pair_new_ex(const char *info, const uint nentries_reserve)
-{
- return BLI_gset_new_ex(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info, nentries_reserve);
-}
-GSet *BLI_gset_pair_new(const char *info)
-{
- return BLI_gset_pair_new_ex(info, 0);
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name Debugging & Introspection
* \{ */
diff --git a/source/blender/blenlib/intern/BLI_ghash_utils.c b/source/blender/blenlib/intern/BLI_ghash_utils.c
new file mode 100644
index 00000000000..6554ee7c92f
--- /dev/null
+++ b/source/blender/blenlib/intern/BLI_ghash_utils.c
@@ -0,0 +1,288 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenlib/intern/BLI_ghash_utils.c
+ * \ingroup bli
+ *
+ * Helper functions and implementations of standard data types for #GHash
+ * (not it's implementation).
+ */
+
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_hash_mm2a.h"
+#include "BLI_ghash.h" /* own include */
+
+/* keep last */
+#include "BLI_strict_flags.h"
+
+/* -------------------------------------------------------------------- */
+/** \name Generic Key Hash & Comparison Functions
+ * \{ */
+
+#if 0
+/* works but slower */
+uint BLI_ghashutil_ptrhash(const void *key)
+{
+ return (uint)(intptr_t)key;
+}
+#else
+/* based python3.3's pointer hashing function */
+uint BLI_ghashutil_ptrhash(const void *key)
+{
+ size_t y = (size_t)key;
+ /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
+ * excessive hash collisions for dicts and sets */
+ y = (y >> 4) | (y << (8 * sizeof(void *) - 4));
+ return (uint)y;
+}
+#endif
+bool BLI_ghashutil_ptrcmp(const void *a, const void *b)
+{
+ return (a != b);
+}
+
+uint BLI_ghashutil_uinthash_v4(const uint key[4])
+{
+ uint hash;
+ hash = key[0];
+ hash *= 37;
+ hash += key[1];
+ hash *= 37;
+ hash += key[2];
+ hash *= 37;
+ hash += key[3];
+ return hash;
+}
+uint BLI_ghashutil_uinthash_v4_murmur(const uint key[4])
+{
+ return BLI_hash_mm2((const unsigned char *)key, sizeof(int) * 4 /* sizeof(key) */, 0);
+}
+
+bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b)
+{
+ return (memcmp(a, b, sizeof(uint[4])) != 0);
+}
+
+uint BLI_ghashutil_uinthash(uint key)
+{
+ key += ~(key << 16);
+ key ^= (key >> 5);
+ key += (key << 3);
+ key ^= (key >> 13);
+ key += ~(key << 9);
+ key ^= (key >> 17);
+
+ return key;
+}
+
+uint BLI_ghashutil_inthash_p(const void *ptr)
+{
+ uintptr_t key = (uintptr_t)ptr;
+
+ key += ~(key << 16);
+ key ^= (key >> 5);
+ key += (key << 3);
+ key ^= (key >> 13);
+ key += ~(key << 9);
+ key ^= (key >> 17);
+
+ return (uint)(key & 0xffffffff);
+}
+
+uint BLI_ghashutil_inthash_p_murmur(const void *ptr)
+{
+ uintptr_t key = (uintptr_t)ptr;
+
+ return BLI_hash_mm2((const unsigned char *)&key, sizeof(key), 0);
+}
+
+uint BLI_ghashutil_inthash_p_simple(const void *ptr)
+{
+ return GET_UINT_FROM_POINTER(ptr);
+}
+
+bool BLI_ghashutil_intcmp(const void *a, const void *b)
+{
+ return (a != b);
+}
+
+size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b)
+{
+ return hash_a ^ (hash_b + 0x9e3779b9 + (hash_a << 6) + (hash_a >> 2));
+}
+
+/**
+ * This function implements the widely used "djb" hash apparently posted
+ * by Daniel Bernstein to comp.lang.c some time ago. The 32 bit
+ * unsigned hash value starts at 5381 and for each byte 'c' in the
+ * string, is updated: ``hash = hash * 33 + c``. This
+ * function uses the signed value of each byte.
+ *
+ * note: this is the same hash method that glib 2.34.0 uses.
+ */
+uint BLI_ghashutil_strhash_n(const char *key, size_t n)
+{
+ const signed char *p;
+ uint h = 5381;
+
+ for (p = (const signed char *)key; n-- && *p != '\0'; p++) {
+ h = (uint)((h << 5) + h) + (uint)*p;
+ }
+
+ return h;
+}
+uint BLI_ghashutil_strhash_p(const void *ptr)
+{
+ const signed char *p;
+ uint h = 5381;
+
+ for (p = ptr; *p != '\0'; p++) {
+ h = (uint)((h << 5) + h) + (uint)*p;
+ }
+
+ return h;
+}
+uint BLI_ghashutil_strhash_p_murmur(const void *ptr)
+{
+ const unsigned char *key = ptr;
+
+ return BLI_hash_mm2(key, strlen((const char *)key) + 1, 0);
+}
+bool BLI_ghashutil_strcmp(const void *a, const void *b)
+{
+ return (a == b) ? false : !STREQ(a, b);
+}
+
+GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second)
+{
+ GHashPair *pair = MEM_mallocN(sizeof(GHashPair), "GHashPair");
+ pair->first = first;
+ pair->second = second;
+ return pair;
+}
+
+uint BLI_ghashutil_pairhash(const void *ptr)
+{
+ const GHashPair *pair = ptr;
+ uint hash = BLI_ghashutil_ptrhash(pair->first);
+ return hash ^ BLI_ghashutil_ptrhash(pair->second);
+}
+
+bool BLI_ghashutil_paircmp(const void *a, const void *b)
+{
+ const GHashPair *A = a;
+ const GHashPair *B = b;
+
+ return (BLI_ghashutil_ptrcmp(A->first, B->first) ||
+ BLI_ghashutil_ptrcmp(A->second, B->second));
+}
+
+void BLI_ghashutil_pairfree(void *ptr)
+{
+ MEM_freeN(ptr);
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Convenience GHash Creation Functions
+ * \{ */
+
+GHash *BLI_ghash_ptr_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, info, nentries_reserve);
+}
+GHash *BLI_ghash_ptr_new(const char *info)
+{
+ return BLI_ghash_ptr_new_ex(info, 0);
+}
+
+GHash *BLI_ghash_str_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, info, nentries_reserve);
+}
+GHash *BLI_ghash_str_new(const char *info)
+{
+ return BLI_ghash_str_new_ex(info, 0);
+}
+
+GHash *BLI_ghash_int_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_inthash_p, BLI_ghashutil_intcmp, info, nentries_reserve);
+}
+GHash *BLI_ghash_int_new(const char *info)
+{
+ return BLI_ghash_int_new_ex(info, 0);
+}
+
+GHash *BLI_ghash_pair_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info, nentries_reserve);
+}
+GHash *BLI_ghash_pair_new(const char *info)
+{
+ return BLI_ghash_pair_new_ex(info, 0);
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Convenience GSet Creation Functions
+ * \{ */
+
+GSet *BLI_gset_ptr_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_gset_new_ex(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, info, nentries_reserve);
+}
+GSet *BLI_gset_ptr_new(const char *info)
+{
+ return BLI_gset_ptr_new_ex(info, 0);
+}
+
+GSet *BLI_gset_str_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_gset_new_ex(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, info, nentries_reserve);
+}
+GSet *BLI_gset_str_new(const char *info)
+{
+ return BLI_gset_str_new_ex(info, 0);
+}
+
+GSet *BLI_gset_pair_new_ex(const char *info, const uint nentries_reserve)
+{
+ return BLI_gset_new_ex(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info, nentries_reserve);
+}
+GSet *BLI_gset_pair_new(const char *info)
+{
+ return BLI_gset_pair_new_ex(info, 0);
+}
+
+/** \} */
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack_2d.c
index ff17d2ac28b..b3beff0b78b 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack_2d.c
@@ -30,7 +30,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
-#include "BLI_boxpack2d.h" /* own include */
+#include "BLI_boxpack_2d.h" /* own include */
#include "BLI_sort.h" /* qsort_r */
#define qsort_r BLI_qsort_r
diff --git a/source/blender/blenlib/intern/convexhull2d.c b/source/blender/blenlib/intern/convexhull_2d.c
index 1f1f214ce32..38928dbbaa0 100644
--- a/source/blender/blenlib/intern/convexhull2d.c
+++ b/source/blender/blenlib/intern/convexhull_2d.c
@@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/blenlib/intern/convexhull2d.c
+/** \file blender/blenlib/intern/convexhull_2d.c
* \ingroup bli
*/
@@ -28,7 +28,7 @@
#include "MEM_guardedalloc.h"
-#include "BLI_convexhull2d.h"
+#include "BLI_convexhull_2d.h"
#include "BLI_math.h"
#include "BLI_strict_flags.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter_2d.c
index bc2b5677fa5..6c51eeb36d9 100644
--- a/source/blender/blenlib/intern/jitter.c
+++ b/source/blender/blenlib/intern/jitter_2d.c
@@ -35,7 +35,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_rand.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_strict_flags.h"
diff --git a/source/blender/blenlib/intern/lasso.c b/source/blender/blenlib/intern/lasso_2d.c
index 710da09521a..663f3ffea22 100644
--- a/source/blender/blenlib/intern/lasso.c
+++ b/source/blender/blenlib/intern/lasso_2d.c
@@ -26,7 +26,7 @@
*
*/
-/** \file blender/blenlib/intern/lasso.c
+/** \file blender/blenlib/intern/lasso_2d.c
* \ingroup bli
*/
@@ -35,7 +35,7 @@
#include "BLI_math.h"
#include "BLI_strict_flags.h"
-#include "BLI_lasso.h" /* own include */
+#include "BLI_lasso_2d.h" /* own include */
void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const unsigned int moves)
{
diff --git a/source/blender/blenlib/intern/polyfill2d.c b/source/blender/blenlib/intern/polyfill_2d.c
index 018e2f9be5a..8c0870f0c07 100644
--- a/source/blender/blenlib/intern/polyfill2d.c
+++ b/source/blender/blenlib/intern/polyfill_2d.c
@@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/blenlib/intern/polyfill2d.c
+/** \file blender/blenlib/intern/polyfill_2d.c
* \ingroup bli
*
* An ear clipping algorithm to triangulate single boundary polygons.
@@ -53,7 +53,7 @@
#include "BLI_memarena.h"
#include "BLI_alloca.h"
-#include "BLI_polyfill2d.h" /* own include */
+#include "BLI_polyfill_2d.h" /* own include */
#include "BLI_strict_flags.h"
diff --git a/source/blender/blenlib/intern/polyfill2d_beautify.c b/source/blender/blenlib/intern/polyfill_2d_beautify.c
index 625c54d0e9b..93bfb02bce4 100644
--- a/source/blender/blenlib/intern/polyfill2d_beautify.c
+++ b/source/blender/blenlib/intern/polyfill_2d_beautify.c
@@ -44,7 +44,7 @@
#include "BLI_memarena.h"
#include "BLI_heap.h"
-#include "BLI_polyfill2d_beautify.h" /* own include */
+#include "BLI_polyfill_2d_beautify.h" /* own include */
#include "BLI_strict_flags.h"
diff --git a/source/blender/blenlib/intern/voronoi.c b/source/blender/blenlib/intern/voronoi_2d.c
index e0cbe278ffb..40e98d5914c 100644
--- a/source/blender/blenlib/intern/voronoi.c
+++ b/source/blender/blenlib/intern/voronoi_2d.c
@@ -23,20 +23,18 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/*
+/** \file blender/blenlib/intern/voronoi_2d.c
+ * \ingroup bli
+ *
* Fortune's algorithm implemented using explanation and some code snippets from
* http://blog.ivank.net/fortunes-algorithm-and-implementation.html
*/
-/** \file blender/blenlib/intern/voronoi.c
- * \ingroup bli
- */
-
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
-#include "BLI_voronoi.h"
+#include "BLI_voronoi_2d.h"
#include "BLI_utildefines.h"
#define VORONOI_EPS 1e-2f
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 66d0a83eb9f..bcb940f8b96 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -36,8 +36,8 @@
#include "BLI_alloca.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
-#include "BLI_polyfill2d.h"
-#include "BLI_polyfill2d_beautify.h"
+#include "BLI_polyfill_2d.h"
+#include "BLI_polyfill_2d_beautify.h"
#include "BLI_linklist.h"
#include "BLI_edgehash.h"
#include "BLI_heap.h"
diff --git a/source/blender/bmesh/operators/bmo_connect_concave.c b/source/blender/bmesh/operators/bmo_connect_concave.c
index 80774323d31..d1811ac6a83 100644
--- a/source/blender/bmesh/operators/bmo_connect_concave.c
+++ b/source/blender/bmesh/operators/bmo_connect_concave.c
@@ -39,8 +39,8 @@
#include "BLI_alloca.h"
#include "BLI_memarena.h"
#include "BLI_heap.h"
-#include "BLI_polyfill2d.h"
-#include "BLI_polyfill2d_beautify.h"
+#include "BLI_polyfill_2d.h"
+#include "BLI_polyfill_2d_beautify.h"
#include "BLI_linklist.h"
#include "bmesh.h"
diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c
index 81f0b4822a2..d3972363bb4 100644
--- a/source/blender/bmesh/tools/bmesh_beautify.c
+++ b/source/blender/bmesh/tools/bmesh_beautify.c
@@ -37,7 +37,7 @@
#include "BLI_math.h"
#include "BLI_heap.h"
-#include "BLI_polyfill2d_beautify.h"
+#include "BLI_polyfill_2d_beautify.h"
#include "MEM_guardedalloc.h"
diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
index 3aa9e5278bc..c1b2bc2625b 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
@@ -38,8 +38,8 @@
#include "BLI_alloca.h"
#include "BLI_memarena.h"
#include "BLI_edgehash.h"
-#include "BLI_polyfill2d.h"
-#include "BLI_polyfill2d_beautify.h"
+#include "BLI_polyfill_2d.h"
+#include "BLI_polyfill_2d_beautify.h"
#include "BLI_utildefines_stack.h"
diff --git a/source/blender/bmesh/tools/bmesh_triangulate.c b/source/blender/bmesh/tools/bmesh_triangulate.c
index bd201fa89bf..a3a3355d20f 100644
--- a/source/blender/bmesh/tools/bmesh_triangulate.c
+++ b/source/blender/bmesh/tools/bmesh_triangulate.c
@@ -38,8 +38,8 @@
#include "BLI_linklist.h"
/* only for defines */
-#include "BLI_polyfill2d.h"
-#include "BLI_polyfill2d_beautify.h"
+#include "BLI_polyfill_2d.h"
+#include "BLI_polyfill_2d_beautify.h"
#include "bmesh.h"
diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.h b/source/blender/compositor/operations/COM_KeyingScreenOperation.h
index b1a5c0c39c7..45195b1e98d 100644
--- a/source/blender/compositor/operations/COM_KeyingScreenOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.h
@@ -35,7 +35,7 @@
#include "BLI_string.h"
extern "C" {
-# include "BLI_voronoi.h"
+# include "BLI_voronoi_2d.h"
}
/**
diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
index 1145abd076a..75a85ad7e33 100644
--- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
+++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
@@ -28,7 +28,7 @@ extern "C" {
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_math_color.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BKE_movieclip.h"
#include "BKE_node.h"
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 9d25fc9e1a3..0ef6aa4bd4a 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -36,7 +36,7 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_math.h"
#include "DNA_anim_types.h"
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 3bb9dc6c11b..942aa861cec 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -41,7 +41,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
-#include "BLI_polyfill2d.h"
+#include "BLI_polyfill_2d.h"
#include "BLF_api.h"
#include "BLT_translation.h"
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index 07abab8af2e..dc3483163bf 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -37,7 +37,7 @@
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_utildefines.h"
#include "BLI_math_vector.h"
diff --git a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
index 0299a33d0fe..23c6030f091 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c
@@ -37,7 +37,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
-#include "BLI_dial.h"
+#include "BLI_dial_2d.h"
#include "BLI_rect.h"
#include "BKE_context.h"
diff --git a/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c
index d58cdb4b187..67fb2419931 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c
@@ -37,7 +37,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
-#include "BLI_dial.h"
+#include "BLI_dial_2d.h"
#include "BLI_rect.h"
#include "BKE_context.h"
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c
index 9f2f6de8a09..7ffd82e262c 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -33,7 +33,7 @@
#include "BLI_utildefines.h"
#include "BLI_rect.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_math.h"
#include "BKE_context.h"
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 4a807798c20..376e4659b92 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -46,7 +46,7 @@
#include "DNA_workspace_types.h"
#include "BLI_math.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_kdtree.h"
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index d8dcacbd981..64969075d89 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -39,7 +39,7 @@
#include "BLI_math_matrix.h"
#include "BLI_math_geom.h"
#include "BLI_utildefines.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_task.h"
#include "BKE_pbvh.h"
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 48633e2031e..8df3d4e9f90 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -37,7 +37,7 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "BLI_dial.h"
+#include "BLI_dial_2d.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 110c4d1789d..3c3a71d00fd 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -36,7 +36,7 @@
#include "BLI_blenlib.h"
#include "BLI_dlrbTree.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c
index 4ee85ace271..ecbc1f5ae1e 100644
--- a/source/blender/editors/space_clip/tracking_select.c
+++ b/source/blender/editors/space_clip/tracking_select.c
@@ -37,7 +37,7 @@
#include "BLI_utildefines.h"
#include "BLI_math.h"
#include "BLI_rect.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BKE_context.h"
#include "BKE_tracking.h"
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 392db4ef4b5..0b7ce7d7310 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -37,7 +37,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "DNA_anim_types.h"
#include "DNA_screen_types.h"
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index dc7863bb354..4b4add0e698 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -34,7 +34,7 @@
#include "BLI_utildefines.h"
#include "BLI_rect.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index a41b133a189..6e3a0883489 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -35,7 +35,7 @@
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_threads.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index ff9da162777..6a746ffe27c 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -48,7 +48,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_utildefines.h"
#include "BLI_endian_switch.h"
#include "BLI_threads.h"
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 27625a02daa..b352a2083a7 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -48,7 +48,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_rect.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 63f82c2b422..f66c9ee9951 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -49,7 +49,7 @@
#include "BLI_utildefines.h"
#include "BLI_alloca.h"
#include "BLI_math.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BLI_blenlib.h"
#include "BLI_array.h"
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index f8a93bd2ce3..c510c12ae53 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -32,8 +32,8 @@
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_heap.h"
-#include "BLI_boxpack2d.h"
-#include "BLI_convexhull2d.h"
+#include "BLI_boxpack_2d.h"
+#include "BLI_convexhull_2d.h"
#include "uvedit_parametrizer.h"
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index 0400fc1025b..332102aca46 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -34,7 +34,7 @@
#include "BLI_utildefines.h"
#include "BLI_rect.h"
#include "BLI_math.h"
-#include "BLI_polyfill2d.h"
+#include "BLI_polyfill_2d.h"
#include "BLI_sort_utils.h"
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index 8c758c33dc5..5b8dcd97108 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -107,6 +107,7 @@ set(INC_SYS
set(SRC
../../blenlib/intern/BLI_ghash.c
+ ../../blenlib/intern/BLI_ghash_utils.c
../../blenlib/intern/BLI_mempool.c
../../blenlib/intern/endian_switch.c
../../blenlib/intern/hash_mm2a.c
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c
index ba0b6eb11a5..88195700a50 100644
--- a/source/blender/python/mathutils/mathutils_bvhtree.c
+++ b/source/blender/python/mathutils/mathutils_bvhtree.c
@@ -33,7 +33,7 @@
#include "BLI_utildefines.h"
#include "BLI_kdopbvh.h"
-#include "BLI_polyfill2d.h"
+#include "BLI_polyfill_2d.h"
#include "BLI_math.h"
#include "BLI_ghash.h"
#include "BLI_memarena.h"
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index 72f92d210d7..fa0d271f7d3 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -34,8 +34,8 @@
#ifndef MATH_STANDALONE /* define when building outside blender */
# include "MEM_guardedalloc.h"
# include "BLI_blenlib.h"
-# include "BLI_boxpack2d.h"
-# include "BLI_convexhull2d.h"
+# include "BLI_boxpack_2d.h"
+# include "BLI_convexhull_2d.h"
# include "BKE_displist.h"
# include "BKE_curve.h"
#endif
diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c
index 731a5ec4e22..9182d545089 100644
--- a/source/blender/render/intern/source/initrender.c
+++ b/source/blender/render/intern/source/initrender.c
@@ -38,7 +38,7 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_utildefines.h"
#include "DNA_camera_types.h"
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 7c62bf4cd94..fb441662829 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -40,7 +40,7 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_memarena.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index f39936dc01f..770a270592c 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -42,7 +42,7 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "BLI_jitter.h"
+#include "BLI_jitter_2d.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 28775050211..6da9101156a 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -41,7 +41,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
-#include "BLI_lasso.h"
+#include "BLI_lasso_2d.h"
#include "BKE_context.h"
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 47df14cd647..53718841bc0 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -59,7 +59,7 @@
#include "PIL_time.h"
#include "BLI_blenlib.h"
-#include "BLI_dial.h"
+#include "BLI_dial_2d.h"
#include "BLI_dynstr.h" /*for WM_operator_pystring */
#include "BLI_math.h"
#include "BLI_utildefines.h"