aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-18 09:27:40 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-18 09:27:40 -0800
commitd381716785d826084432eeb38b91be2fbbbfc081 (patch)
tree38d6c79a4dc42e4bd9e29885f2bb7d8bc3f2310d
parent80e5cf9c4af65ac627f3c612181d741babc85b1b (diff)
Initialize all fields in node when creating inlines.
-rw-r--r--src/inlines.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 6c90116..37ad768 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -90,6 +90,12 @@ static inline cmark_node* make_inlines(cmark_node_type t, cmark_node* contents)
e->type = t;
e->first_child = contents;
e->next = NULL;
+ e->prev = NULL;
+ e->parent = NULL;
+ // These fields aren't used for inlines:
+ e->start_line = 0;
+ e->start_column = 0;
+ e->end_line = 0;
}
return e;
}
@@ -102,6 +108,14 @@ static inline cmark_node* make_literal(cmark_node_type t, cmark_chunk s)
e->type = t;
e->as.literal = s;
e->next = NULL;
+ e->prev = NULL;
+ e->parent = NULL;
+ e->first_child = NULL;
+ e->last_child = NULL;
+ // These fields aren't used for inlines:
+ e->start_line = 0;
+ e->start_column = 0;
+ e->end_line = 0;
}
return e;
}
@@ -113,6 +127,14 @@ static inline cmark_node* make_simple(cmark_node_type t)
if(e != NULL) {
e->type = t;
e->next = NULL;
+ e->prev = NULL;
+ e->parent = NULL;
+ e->first_child = NULL;
+ e->last_child = NULL;
+ // These fields aren't used for inlines:
+ e->start_line = 0;
+ e->start_column = 0;
+ e->end_line = 0;
}
return e;
}