Fix build warnings

This commit is contained in:
Max Brunsfeld 2016-02-12 14:07:30 -08:00
parent afed91661b
commit 3f08bfb264
7 changed files with 11 additions and 8 deletions

View file

@ -79,7 +79,9 @@ describe("Stack", [&]() {
);
for (size_t i = 0; i < tree_count; i++)
trees[i] = ts_tree_make_leaf(i, ts_length_zero(), tree_len, {});
trees[i] = ts_tree_make_leaf(i, ts_length_zero(), tree_len, {
true, true, false, true,
});
});
after_each([&]() {

View file

@ -81,7 +81,7 @@ class ParseTableBuilder {
mark_fragile_actions();
remove_duplicate_parse_states();
parse_table.symbols.insert({ rules::ERROR(), {} });
parse_table.symbols.insert({ rules::ERROR(), {true} });
return { parse_table, CompileError::none() };
}

View file

@ -321,7 +321,7 @@ error:
json_value_free(grammar_json);
}
return { "", Grammar{}, error_message };
return { "", Grammar(), error_message };
}
} // namespace tree_sitter

View file

@ -26,7 +26,7 @@ void ts_document_free(TSDocument *self) {
ts_parser_destroy(&self->parser);
if (self->tree)
ts_tree_release(self->tree);
ts_document_set_input(self, (TSInput){});
ts_document_set_input(self, (TSInput){NULL, NULL, NULL, TSInputEncodingUTF8});
ts_free(self);
}

View file

@ -281,7 +281,7 @@ static ParseActionResult ts_parser__shift(TSParser *self, int head,
LOG("merge head:%d", head);
vector_erase(&self->lookahead_states, head);
return RemovedStackHead;
case StackPushResultContinued:
default:
return UpdatedStackHead;
}
}
@ -473,7 +473,7 @@ static ParseActionResult ts_parser__reduce_error(TSParser *self, int head,
return FailedToUpdateStackHead;
case RemovedStackHead:
return RemovedStackHead;
case UpdatedStackHead: {
default: {
StackEntry *entry = ts_stack_head(self->stack, head);
entry->position = ts_length_add(entry->position, lookahead->padding);
entry->tree->size = ts_length_add(entry->tree->size, lookahead->padding);

View file

@ -288,7 +288,7 @@ void ts_stack_remove_head(Stack *self, int head_index) {
StackPushResult ts_stack_push(Stack *self, int head_index, TSStateId state,
TSTree *tree) {
assert(head_index < self->heads.size);
assert((size_t)head_index < self->heads.size);
assert(tree);
TSLength position = ts_tree_total_size(tree);

View file

@ -38,8 +38,9 @@ TSInput ts_string_input_make(const char *string) {
.payload = input,
.read_fn = ts_string_input_read,
.seek_fn = ts_string_input_seek,
.encoding = TSInputEncodingUTF8,
};
error:
return (TSInput){NULL, NULL, NULL};
return (TSInput){NULL, NULL, NULL, TSInputEncodingUTF8};
}