From b91849c57cd0a1be58a9ff31526591d75e4b0b16 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 24 Oct 2017 04:59:52 -0400 Subject: MqTree: Add inserted node address to debugging output --- (limited to 'src') 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; } -- cgit v0.9.1