Fix some C code that MSVC doesn't like
This commit is contained in:
parent
12623deb19
commit
3d351eac09
4 changed files with 7 additions and 9 deletions
|
|
@ -30,7 +30,7 @@ static inline void *ts_realloc(void *buffer, size_t size) {
|
|||
}
|
||||
|
||||
static inline void ts_free(void *buffer) {
|
||||
return ts_record_free(buffer);
|
||||
ts_record_free(buffer);
|
||||
}
|
||||
|
||||
static inline bool ts_toggle_allocation_recording(bool value) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ void ts_document_edit(TSDocument *self, TSInputEdit edit) {
|
|||
}
|
||||
|
||||
void ts_document_parse(TSDocument *self) {
|
||||
return ts_document_parse_with_options(self, (TSParseOptions){
|
||||
ts_document_parse_with_options(self, (TSParseOptions){
|
||||
.halt_on_error = false,
|
||||
.changed_ranges = NULL,
|
||||
.changed_range_count = NULL,
|
||||
|
|
@ -113,7 +113,7 @@ void ts_document_parse(TSDocument *self) {
|
|||
|
||||
void ts_document_parse_and_get_changed_ranges(TSDocument *self, TSRange **ranges,
|
||||
uint32_t *range_count) {
|
||||
return ts_document_parse_with_options(self, (TSParseOptions){
|
||||
ts_document_parse_with_options(self, (TSParseOptions){
|
||||
.halt_on_error = false,
|
||||
.changed_ranges = ranges,
|
||||
.changed_range_count = range_count,
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ static inline Length length_sub(Length len1, Length len2) {
|
|||
}
|
||||
|
||||
static inline Length length_zero() {
|
||||
return (Length){ 0, 0, {0, 0} };
|
||||
Length result = {0, 0, {0, 0}};
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,11 +7,8 @@ typedef struct {
|
|||
} ReusableNode;
|
||||
|
||||
static inline ReusableNode reusable_node_new(Tree *tree) {
|
||||
return (ReusableNode){
|
||||
.tree = tree,
|
||||
.byte_index = 0,
|
||||
.preceding_external_token = NULL,
|
||||
};
|
||||
ReusableNode result = {tree, 0, NULL};
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline void reusable_node_pop(ReusableNode *self) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue