summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-24 04:59:52 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-24 04:59:52 (EDT)
commitb91849c57cd0a1be58a9ff31526591d75e4b0b16 (patch)
tree5eda62599abfd9274ca453c6f6b58a89b48a2060 /src
parente05680312031f31ba72217b58c5f086f5d132f56 (diff)
downloadmarquee-b91849c57cd0a1be58a9ff31526591d75e4b0b16.zip
marquee-b91849c57cd0a1be58a9ff31526591d75e4b0b16.tar.gz
marquee-b91849c57cd0a1be58a9ff31526591d75e4b0b16.tar.bz2
MqTree: Add inserted node address to debugging output
Diffstat (limited to 'src')
-rw-r--r--src/tree.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tree.c b/src/tree.c
index 9d35291..490ccaf 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -50,12 +50,11 @@ print_tree_recurse(MqTree *node, gsize indent)
}
static void
-print_tree(MqTree *node)
+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);
-
+ g_print("new tree (size %d):\n", node->size);
print_tree_recurse(node, 0);
}
@@ -145,7 +144,7 @@ mq_tree_insert_child_allocated(MqTree *node, MqTree *parent, gpointer data)
node->data = data;
- print_tree(node);
+ print_tree("Inserted child", node);
return node;
}
@@ -175,7 +174,7 @@ mq_tree_insert_sibling_allocated(MqTree *node, MqTree *sibling, gpointer data)
node->data = data;
- print_tree(node);
+ print_tree("Inserted sibling", node);
return node;
}