summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-23 06:15:51 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-23 06:15:51 (EDT)
commitccaf66f3506ecc4cbdf02bcf44454727c78b16a7 (patch)
treed208e9379cde81c80799c8125f68f0f074c1d41f
parent48d0b09b8db17f698eb4627981ec2a98bad5f515 (diff)
downloadmarquee-ccaf66f3506ecc4cbdf02bcf44454727c78b16a7.zip
marquee-ccaf66f3506ecc4cbdf02bcf44454727c78b16a7.tar.gz
marquee-ccaf66f3506ecc4cbdf02bcf44454727c78b16a7.tar.bz2
mq_tree_size(), mq_tree_position(): Fix conditional expressions
Fixes: CC src/marquee-notebook.o In file included from src/notebook.c:29:0: src/notebook.c: In function ‘mq_notebook_get_n_pages’: src/tree.h:67:70: warning: pointer/integer type mismatch in conditional expression #define mq_tree_size(node) ((node) ? (((MqTree *) (node))->size) : NULL) ^ src/notebook.c:253:9: note: in expansion of macro ‘mq_tree_size’ return mq_tree_size(MQ_TREE(notebook->tree)); ^ src/notebook.c:253:2: warning: return makes integer from pointer without a cast return mq_tree_size(MQ_TREE(notebook->tree)); ^
-rw-r--r--src/tree.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tree.h b/src/tree.h
index 412ebfe..3d2c113 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -64,8 +64,8 @@ mq_tree_insert_sibling_allocated(MqTree *node, MqTree *sibling, gpointer data);
void
mq_tree_remove(MqTree *node);
-#define mq_tree_size(node) ((node) ? (((MqTree *) (node))->size) : NULL)
-#define mq_tree_position(node) ((node) ? (((MqTree *) (node))->position) : NULL)
+#define mq_tree_size(node) ((node) ? (((MqTree *) (node))->size) : -1)
+#define mq_tree_position(node) ((node) ? (((MqTree *) (node))->position) : -1)
#define mq_tree_root(node) ((node) ? (((MqTree *) (node))->root) : NULL)
#define mq_tree_previous(node) ((node) ? (((MqTree *) (node))->prev) : NULL)
#define mq_tree_next(node) ((node) ? (((MqTree *) (node))->prev) : NULL)