summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-01-03 07:16:01 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-01-03 07:16:01 +0000
commit4f74d075c6220615247fd9737ebd6e04ae74fc20 (patch)
treea5c4897d7deed9a8ee696d25e6c55f1fb6654b8c /legacy
parent039fe1e4bfe523d9074b80ef24f26802cf7ee77c (diff)
better namespace
SVN revision: 55813
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eina/src/lib/eina_quadtree.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/legacy/eina/src/lib/eina_quadtree.c b/legacy/eina/src/lib/eina_quadtree.c
index 9f66010521..0aa47e26ca 100644
--- a/legacy/eina/src/lib/eina_quadtree.c
+++ b/legacy/eina/src/lib/eina_quadtree.c
@@ -142,19 +142,19 @@ struct _Eina_QuadTree_Item
142 EINA_MAGIC 142 EINA_MAGIC
143}; 143};
144 144
145static int _eina_log_qd_dom = -1; 145static int _eina_quadtree_log_dom = -1;
146static Eina_Mempool *root_mp = NULL; 146static Eina_Mempool *eina_quadtree_root_mp = NULL;
147static Eina_Mempool *items_mp = NULL; 147static Eina_Mempool *_eina_quadtree_items_mp = NULL;
148 148
149#ifdef ERR 149#ifdef ERR
150#undef ERR 150#undef ERR
151#endif 151#endif
152#define ERR(...) EINA_LOG_DOM_ERR(_eina_log_qd_dom, __VA_ARGS__) 152#define ERR(...) EINA_LOG_DOM_ERR(_eina_quadtree_log_dom, __VA_ARGS__)
153 153
154#ifdef DBG 154#ifdef DBG
155#undef DBG 155#undef DBG
156#endif 156#endif
157#define DBG(...) EINA_LOG_DOM_DBG(_eina_log_qd_dom, __VA_ARGS__) 157#define DBG(...) EINA_LOG_DOM_DBG(_eina_quadtree_log_dom, __VA_ARGS__)
158 158
159 159
160static int 160static int
@@ -177,13 +177,13 @@ eina_quadtree_root_free(Eina_QuadTree *q, Eina_QuadTree_Root *root)
177 EINA_MAGIC_CHECK_QUADTREE_ROOT(root, NULL); 177 EINA_MAGIC_CHECK_QUADTREE_ROOT(root, NULL);
178 178
179 EINA_LIST_FREE(root->both, item) 179 EINA_LIST_FREE(root->both, item)
180 eina_mempool_free(items_mp, item); 180 eina_mempool_free(_eina_quadtree_items_mp, item);
181 181
182 root->left = eina_quadtree_root_free(q, root->left); 182 root->left = eina_quadtree_root_free(q, root->left);
183 root->right = eina_quadtree_root_free(q, root->right); 183 root->right = eina_quadtree_root_free(q, root->right);
184 184
185 EINA_MAGIC_SET(root, 0); 185 EINA_MAGIC_SET(root, 0);
186 eina_mempool_free(root_mp, root); 186 eina_mempool_free(eina_quadtree_root_mp, root);
187 187
188 return NULL; 188 return NULL;
189} 189}
@@ -215,7 +215,7 @@ eina_quadtree_root_rebuild_pre(Eina_QuadTree *q,
215 215
216 EINA_MAGIC_SET(root, 0); 216 EINA_MAGIC_SET(root, 0);
217 if (q->root_count > 50) 217 if (q->root_count > 50)
218 eina_mempool_free(root_mp, root); 218 eina_mempool_free(eina_quadtree_root_mp, root);
219 else 219 else
220 { 220 {
221 eina_trash_push(&q->root_trash, root); 221 eina_trash_push(&q->root_trash, root);
@@ -353,7 +353,7 @@ _eina_quadtree_update(Eina_QuadTree *q, Eina_QuadTree_Root *parent,
353 { 353 {
354 root = eina_trash_pop(&q->root_trash); 354 root = eina_trash_pop(&q->root_trash);
355 if (!root) 355 if (!root)
356 root = eina_mempool_malloc(root_mp, sizeof (Eina_QuadTree_Root)); 356 root = eina_mempool_malloc(eina_quadtree_root_mp, sizeof (Eina_QuadTree_Root));
357 else 357 else
358 q->root_count--; 358 q->root_count--;
359 359
@@ -571,7 +571,7 @@ _eina_quadtree_remove(Eina_QuadTree_Item *object)
571 object->quad->root = NULL; 571 object->quad->root = NULL;
572 572
573 if (object->quad->root_count > 50) 573 if (object->quad->root_count > 50)
574 eina_mempool_free(root_mp, object->root); 574 eina_mempool_free(eina_quadtree_root_mp, object->root);
575 else 575 else
576 { 576 {
577 eina_trash_push(&object->quad->root_trash, object->root); 577 eina_trash_push(&object->quad->root_trash, object->root);
@@ -625,18 +625,18 @@ eina_quadtree_free(Eina_QuadTree *q)
625 item = EINA_INLIST_CONTAINER_GET(q->change, Eina_QuadTree_Item); 625 item = EINA_INLIST_CONTAINER_GET(q->change, Eina_QuadTree_Item);
626 q->change = q->change->next; 626 q->change = q->change->next;
627 if (!item->hidden) 627 if (!item->hidden)
628 eina_mempool_free(items_mp, item); 628 eina_mempool_free(_eina_quadtree_items_mp, item);
629 } 629 }
630 630
631 EINA_LIST_FREE(q->hidden, item) 631 EINA_LIST_FREE(q->hidden, item)
632 eina_mempool_free(items_mp, item); 632 eina_mempool_free(_eina_quadtree_items_mp, item);
633 633
634 eina_quadtree_root_free(q, q->root); 634 eina_quadtree_root_free(q, q->root);
635 635
636 while (q->items_trash) 636 while (q->items_trash)
637 { 637 {
638 item = eina_trash_pop(&q->items_trash); 638 item = eina_trash_pop(&q->items_trash);
639 eina_mempool_free(items_mp, item); 639 eina_mempool_free(_eina_quadtree_items_mp, item);
640 } 640 }
641 641
642 while (q->root_trash) 642 while (q->root_trash)
@@ -644,7 +644,7 @@ eina_quadtree_free(Eina_QuadTree *q)
644 Eina_QuadTree_Root *root; 644 Eina_QuadTree_Root *root;
645 645
646 root = eina_trash_pop(&q->root_trash); 646 root = eina_trash_pop(&q->root_trash);
647 eina_mempool_free(root_mp, root); 647 eina_mempool_free(eina_quadtree_root_mp, root);
648 } 648 }
649 649
650 EINA_MAGIC_SET(q, 0); 650 EINA_MAGIC_SET(q, 0);
@@ -663,7 +663,7 @@ eina_quadtree_add(Eina_QuadTree *q, const void *object)
663 663
664 result = eina_trash_pop(&q->items_trash); 664 result = eina_trash_pop(&q->items_trash);
665 if (!result) 665 if (!result)
666 result = eina_mempool_malloc(items_mp, sizeof (Eina_QuadTree_Item)); 666 result = eina_mempool_malloc(_eina_quadtree_items_mp, sizeof (Eina_QuadTree_Item));
667 else 667 else
668 q->items_count--; 668 q->items_count--;
669 669
@@ -716,7 +716,7 @@ eina_quadtree_del(Eina_QuadTree_Item *object)
716 /* This object is not anymore inside the tree, we can remove it now !*/ 716 /* This object is not anymore inside the tree, we can remove it now !*/
717 EINA_MAGIC_SET(object, 0); 717 EINA_MAGIC_SET(object, 0);
718 if (object->quad->items_count > 256) 718 if (object->quad->items_count > 256)
719 eina_mempool_free(items_mp, object); 719 eina_mempool_free(_eina_quadtree_items_mp, object);
720 else 720 else
721 { 721 {
722 object->quad->items_count++; 722 object->quad->items_count++;
@@ -885,9 +885,9 @@ eina_quadtree_init(void)
885{ 885{
886 const char *choice, *tmp; 886 const char *choice, *tmp;
887 887
888 _eina_log_qd_dom = eina_log_domain_register("eina_quadtree", 888 _eina_quadtree_log_dom = eina_log_domain_register("eina_quadtree",
889 EINA_LOG_COLOR_DEFAULT); 889 EINA_LOG_COLOR_DEFAULT);
890 if (_eina_log_qd_dom < 0) 890 if (_eina_quadtree_log_dom < 0)
891 { 891 {
892 EINA_LOG_ERR("Could not register log domain: eina_quadtree"); 892 EINA_LOG_ERR("Could not register log domain: eina_quadtree");
893 return EINA_FALSE; 893 return EINA_FALSE;
@@ -908,10 +908,10 @@ eina_quadtree_init(void)
908 if (tmp && tmp[0]) 908 if (tmp && tmp[0])
909 choice = tmp; 909 choice = tmp;
910 910
911 items_mp = eina_mempool_add(choice, "QuadTree Item", NULL, 911 _eina_quadtree_items_mp = eina_mempool_add(choice, "QuadTree Item", NULL,
912 sizeof (Eina_QuadTree_Item), 320); 912 sizeof (Eina_QuadTree_Item), 320);
913 root_mp = eina_mempool_add(choice, "QuadTree Root", NULL, 913 eina_quadtree_root_mp = eina_mempool_add(choice, "QuadTree Root", NULL,
914 sizeof (Eina_QuadTree_Root), 32); 914 sizeof (Eina_QuadTree_Root), 32);
915 915
916 return EINA_TRUE; 916 return EINA_TRUE;
917} 917}
@@ -919,11 +919,11 @@ eina_quadtree_init(void)
919Eina_Bool 919Eina_Bool
920eina_quadtree_shutdown(void) 920eina_quadtree_shutdown(void)
921{ 921{
922 eina_mempool_del(root_mp); 922 eina_mempool_del(eina_quadtree_root_mp);
923 eina_mempool_del(items_mp); 923 eina_mempool_del(_eina_quadtree_items_mp);
924 924
925 eina_log_domain_unregister(_eina_log_qd_dom); 925 eina_log_domain_unregister(_eina_quadtree_log_dom);
926 _eina_log_qd_dom = -1; 926 _eina_quadtree_log_dom = -1;
927 return EINA_TRUE; 927 return EINA_TRUE;
928} 928}
929 929