Fix a few compiler warnings

This commit is contained in:
Damien Guard 2019-11-20 10:21:10 -08:00
parent 594da085ef
commit 599e4f0ec4
No known key found for this signature in database
GPG key ID: DAD197427166C0C6

View file

@ -998,7 +998,7 @@ static inline bool ts_query_cursor__advance(TSQueryCursor *self) {
QueryState *state = &self->states.contents[i];
QueryStep *step = &self->query->steps.contents[state->step_index];
if (state->start_depth + step->depth > self->depth) {
if ((uint32_t)state->start_depth + (uint32_t)step->depth > self->depth) {
LOG(
" failed to match. pattern:%u, step:%u\n",
state->pattern_index,
@ -1130,7 +1130,7 @@ static inline bool ts_query_cursor__advance(TSQueryCursor *self) {
// Check that the node matches all of the criteria for the next
// step of the pattern.if (
if (state->start_depth + step->depth != self->depth) continue;
if ((uint32_t)state->start_depth + (uint32_t)step->depth != self->depth) continue;
// Determine if this node matches this step of the pattern, and also
// if this node can have later siblings that match this step of the
@ -1225,7 +1225,7 @@ static inline bool ts_query_cursor__advance(TSQueryCursor *self) {
i--;
n--;
} else {
array_pop(&self->states);
self->states.size--;
}
}
}