aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-11-10 20:57:49 +0100
committerMattias Andrée <maandree@operamail.com>2014-11-10 20:57:49 +0100
commit037b0beefc8f232a7c446b5ccd68b9692839cc36 (patch)
tree948e7668afc08ce450a67a2fabb482f6cf52dabd
parentmemory leak (diff)
downloadmds-037b0beefc8f232a7c446b5ccd68b9692839cc36.tar.gz
mds-037b0beefc8f232a7c446b5ccd68b9692839cc36.tar.bz2
mds-037b0beefc8f232a7c446b5ccd68b9692839cc36.tar.xz
mds-kbdc: better macro names
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/mds-kbdc/make-tree.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c
index 73c497b..f99201c 100644
--- a/src/mds-kbdc/make-tree.c
+++ b/src/mds-kbdc/make-tree.c
@@ -65,11 +65,11 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu
mds_kbdc_tree_##LOWERCASE##_t* node; \
fail_if (xcalloc(node, 1, mds_kbdc_tree_##LOWERCASE##_t)); \
node->type = MDS_KBDC_TREE_TYPE_##UPPERCASE
-#define NESTING(KEYWORD) \
+#define BRANCH(KEYWORD) \
*(tree_stack[stack_ptr]) = (mds_kbdc_tree_t*)node; \
tree_stack[stack_ptr + 1] = &(node->inner); \
keyword_stack[stack_ptr++] = KEYWORD
-#define FLAT \
+#define LEAF \
*(tree_stack[stack_ptr]) = (mds_kbdc_tree_t*)node; \
tree_stack[stack_ptr] = &(tree_stack[stack_ptr][0]->next)
#define NO_PARAMETERS(KEYWORD) \
@@ -156,31 +156,31 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu
{
NEW_NODE(information, INFORMATION);
NO_PARAMETERS("information");
- NESTING("information");
+ BRANCH("information");
}
else if (!strcmp(line, "assumption"))
{
NEW_NODE(assumption, ASSUMPTION);
NO_PARAMETERS("assumption");
- NESTING("assumption");
+ BRANCH("assumption");
}
else if (!strcmp(line, "return"))
{
NEW_NODE(return, RETURN);
NO_PARAMETERS("return");
- FLAT;
+ LEAF;
}
else if (!strcmp(line, "continue"))
{
NEW_NODE(continue, CONTINUE);
NO_PARAMETERS("continue");
- FLAT;
+ LEAF;
}
else if (!strcmp(line, "break"))
{
NEW_NODE(break, BREAK);
NO_PARAMETERS("break");
- FLAT;
+ LEAF;
}
else if (!strcmp(line, "language")) ;
else if (!strcmp(line, "country")) ;
@@ -247,8 +247,8 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu
return errno = saved_errno, -1;
#undef NO_PARAMETERS
-#undef FLAT
-#undef NESTING
+#undef LEAF
+#undef BRANCH
#undef NEW_NODE
#undef NEW_ERROR
#undef xasprintf