Fix missing initializer warning in gcc

This commit is contained in:
Max Brunsfeld 2014-07-29 12:59:18 -07:00
parent f1eb9a92a3
commit 048a479b5f
2 changed files with 8 additions and 5 deletions

View file

@ -8,12 +8,15 @@ struct TSDocument {
TSParser *parser;
const TSTree *tree;
TSInput input;
size_t error_count;
};
TSDocument *ts_document_make() {
TSDocument *document = malloc(sizeof(TSDocument));
*document = (TSDocument) { .input = (TSInput) {} };
*document = (TSDocument) {
.input = (TSInput) { .data = NULL, .read_fn = NULL, .seek_fn = NULL },
.parser = NULL,
.tree = NULL
};
return document;
}