From 048a479b5f96154268deb07a7effbe25804fca6f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 29 Jul 2014 12:59:18 -0700 Subject: [PATCH] Fix missing initializer warning in gcc --- src/compiler/build_tables/build_parse_table.cc | 6 +++--- src/runtime/document.c | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/compiler/build_tables/build_parse_table.cc b/src/compiler/build_tables/build_parse_table.cc index b11b0967..d9118b5a 100644 --- a/src/compiler/build_tables/build_parse_table.cc +++ b/src/compiler/build_tables/build_parse_table.cc @@ -135,9 +135,9 @@ class ParseTableBuilder { conflict_manager(ParseConflictManager(grammar, lex_grammar)) {} pair > build() { - auto start_symbol = grammar.rules.empty() ? - make_shared(0, rules::SymbolOptionToken) : - make_shared(0); + auto start_symbol = grammar.rules.empty() + ? make_shared(0, rules::SymbolOptionToken) + : make_shared(0); ParseItem start_item(rules::START(), start_symbol, 0); add_parse_state( item_set_closure(start_item, { rules::END_OF_INPUT() }, grammar)); diff --git a/src/runtime/document.c b/src/runtime/document.c index 59f24eb1..02b0172c 100644 --- a/src/runtime/document.c +++ b/src/runtime/document.c @@ -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; }