summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-25 09:19:11 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-25 09:19:11 (EDT)
commitc0a7c41c530dfb0a0adba9cbe469347316c7ebe9 (patch)
treee24109cecb6378e3d5b3c18126515c5f0028281a /src
parent3923397ff2a40903ca51c30615557e6022031cda (diff)
downloadmarquee-c0a7c41c530dfb0a0adba9cbe469347316c7ebe9.zip
marquee-c0a7c41c530dfb0a0adba9cbe469347316c7ebe9.tar.gz
marquee-c0a7c41c530dfb0a0adba9cbe469347316c7ebe9.tar.bz2
MqTree: Rename debugging output functions
Diffstat (limited to 'src')
-rw-r--r--src/tree.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/tree.c b/src/tree.c
index 60396bb..313c76e 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -32,7 +32,7 @@
#if MQ_TREE_DEBUG
static void
-print_tree_recurse(MqTree *node, gsize indent)
+debug_print_tree_recurse(MqTree *node, gsize indent)
{
gsize i;
@@ -44,37 +44,37 @@ print_tree_recurse(MqTree *node, gsize indent)
(uintptr_t) node, node->size, node->position);
if (node->first_child) {
- print_tree_recurse(node->first_child, indent + 1);
+ debug_print_tree_recurse(node->first_child, indent + 1);
}
}
}
static void
-print_tree(const gchar *msg, MqTree *node)
+debug_print_tree(const gchar *msg, MqTree *node)
{
g_print("%s 0x%" PRIxPTR ", ", msg, (uintptr_t) node);
node = node->root;
g_print("new tree (size %d):\n", node->size);
- print_tree_recurse(node, 0);
+ debug_print_tree_recurse(node, 0);
}
static void
-print_node(MqTree *node)
+debug_print_node(MqTree *node)
{
g_print("\t0x%" PRIxPTR "\n", (uintptr_t) node);
}
static void
-print_head(const gchar *head, MqTree *node)
+debug_print_head(const gchar *head, MqTree *node)
{
g_print("%s, starting at 0x%" PRIxPTR "\n", head, (uintptr_t) node);
}
#else /* MQ_TREE_DEBUG */
-#define print_tree(node)
-#define print_node(node)
-#define print_head(head, node)
+#define debug_print_tree(node)
+#define debug_print_node(node)
+#define debug_print_head(head, node)
#endif /* MQ_TREE_DEBUG */
@@ -112,7 +112,7 @@ update_position(MqTree *node, gpointer user_data)
static void
update_positions(MqTree *node, gint step)
{
- print_head("Updating positions", node);
+ debug_print_head("Updating positions", node);
mq_tree_foreach_from(node, update_position, &step);
}
@@ -144,7 +144,7 @@ mq_tree_append_child_allocated(MqTree *node, MqTree *parent, gpointer data)
node->data = data;
- print_tree("Appended child", node);
+ debug_print_tree("Appended child", node);
return node;
}
@@ -173,7 +173,7 @@ mq_tree_append_sibling_allocated(MqTree *node, MqTree *sibling, gpointer data)
node->data = data;
- print_tree("Appended sibling", node);
+ debug_print_tree("Appended sibling", node);
return node;
}
@@ -224,7 +224,7 @@ foreach_down(MqTree *node, gboolean (*cb)(MqTree *node, gpointer user_data),
{
for (; node; node = node->next) {
/* XXX: Warning: Does not skip root node */
- print_node(node);
+ debug_print_node(node);
if (cb(node, user_data) == MQ_TREE_STOP) {
return MQ_TREE_STOP;
}
@@ -244,7 +244,7 @@ void
mq_tree_foreach(MqTree *node, gboolean (*cb)(MqTree *node, gpointer user_data),
gpointer user_data)
{
- print_head("Traversing full tree", node);
+ debug_print_head("Traversing full tree", node);
foreach_down(node->root->first_child, cb, user_data);
}
@@ -273,7 +273,7 @@ void
mq_tree_foreach_from(MqTree *node,
gboolean (*cb)(MqTree *node, gpointer user_data), gpointer user_data)
{
- print_head("Traversing tree from position", node);
+ debug_print_head("Traversing tree from position", node);
if (foreach_down(node, cb, user_data) == MQ_TREE_CONTINUE) {
foreach_up(node, cb, user_data);