summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-11-30 21:10:39 -0800
committerVito Caputo <vcaputo@pengaru.com>2018-11-30 21:10:39 -0800
commit8269bfb5dc9448b7e245b2edf01e741ded3bab1c (patch)
tree776ffa886a0c75d3cde7beb5f1c43a4cf69ce72a
parentc2260346fe030bea18b2410cc673eddd6bbd836d (diff)
libix2: drop pointer from ix2_search_cb typedef
I despise hiding pointer types in typedefs, it makes usage less clear/obvious to the reader.
-rw-r--r--src/ix2.c4
-rw-r--r--src/ix2.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/ix2.c b/src/ix2.c
index 2ff7862..a7aea16 100644
--- a/src/ix2.c
+++ b/src/ix2.c
@@ -571,7 +571,7 @@ ix2_object_t * ix2_object_move(ix2_t *ix2, ix2_object_t *object, v2f_t *object_p
/* Search for objects overlapping a point in index ix2. */
/* Returns number of cb calls performed on hits, if cb is NULL calls will be skipped but hits still counted for return. */
-unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb cb, void *cb_context)
+unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb *cb, void *cb_context)
{
unsigned n_hits = 0;
ix2_object_ref_t *ref, *_ref;
@@ -677,7 +677,7 @@ static void search_node_by_aabb(ix2_node_t *node, bb2f_t *node_aabb, v2f_t *sear
/* Search for objects overlapping an aabb in index ix2. */
/* Returns number of cb calls performed on hits, if cb is NULL calls will be skipped but hits still counted for return. */
-unsigned ix2_search_by_aabb(ix2_t *ix2, v2f_t *search_position, v2f_t *search_origin, bb2f_t *search_aabb, ix2_search_cb cb, void *cb_context)
+unsigned ix2_search_by_aabb(ix2_t *ix2, v2f_t *search_position, v2f_t *search_origin, bb2f_t *search_aabb, ix2_search_cb *cb, void *cb_context)
{
unsigned n_hits = 0;
LIST_HEAD (hits);
diff --git a/src/ix2.h b/src/ix2.h
index 46f9727..2785f36 100644
--- a/src/ix2.h
+++ b/src/ix2.h
@@ -29,7 +29,7 @@ typedef enum ix2_search_status_t {
IX2_SEARCH_MORE_HIT, /* continue && current object is a miss */
} ix2_search_status_t;
-typedef ix2_search_status_t (*ix2_search_cb)(void *cb_context, ix2_object_t *ix2_object, v2f_t *ix2_object_position, bb2f_t *ix2_object_aabb, void *object);
+typedef ix2_search_status_t (ix2_search_cb)(void *cb_context, ix2_object_t *ix2_object, v2f_t *ix2_object_position, bb2f_t *ix2_object_aabb, void *object);
ix2_t * ix2_new(bb2f_t *aabb, unsigned max_per_node, unsigned max_depth);
void ix2_reset(ix2_t *ix2);
@@ -38,8 +38,8 @@ ix2_object_t * ix2_object_new(ix2_t *ix2, v2f_t *position, v2f_t *origin, bb2f_t
void ix2_object_free(ix2_t *ix2, ix2_object_t *object);
ix2_object_t * ix2_object_move(ix2_t *ix2, ix2_object_t *object, v2f_t *object_position, v2f_t *object_origin, bb2f_t *object_aabb);
int ix2_object_aabb_overlap(ix2_t *ix2, ix2_object_t *object, v2f_t *aabb_position, v2f_t *aabb_origin, bb2f_t *aabb);
-unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb cb, void *arg);
-unsigned ix2_search_by_aabb(ix2_t *ix2, v2f_t *search_position, v2f_t *search_origin, bb2f_t *search_aabb, ix2_search_cb cb, void *arg);
-unsigned ix2_search_by_ray(ix2_t *ix2, v2f_t *origin, v2f_t *direction, ix2_search_cb cb, void *arg);
+unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb *cb, void *arg);
+unsigned ix2_search_by_aabb(ix2_t *ix2, v2f_t *search_position, v2f_t *search_origin, bb2f_t *search_aabb, ix2_search_cb *cb, void *arg);
+unsigned ix2_search_by_ray(ix2_t *ix2, v2f_t *origin, v2f_t *direction, ix2_search_cb *cb, void *arg);
#endif
© 2021 All Rights Reserved