{
int direction, count = 0;
- direction = it->direction(head, it->ptr);
+ direction = it->direction(head, (struct quadtree_iterator *)it);
if ((direction & QUADTREE_UPLEFT) && head->child[0])
count += _walk_tree(head->child[0], it);
count += _walk_tree(head->child[3], it);
if ((direction & QUADTREE_SELF) && it->callback) {
- it->callback(head, it->ptr);
+ it->callback(head, (struct quadtree_iterator *)it);
count++;
}
struct quadtree *head;
void *ptr;
- int (*direction)(struct quadtree *head, void *ptr);
- void (*callback)(struct quadtree *head, void *ptr);
+ int (*direction)(struct quadtree *head, struct quadtree_iterator *it);
+ void (*callback)(struct quadtree *head, struct quadtree_iterator *it);
};
struct quadtree *quadtree_add(struct quadtree *parent,