Merge pull request #307 from tree-sitter/pointer-sized-cancellation-flag

Make the cancellation flag a size_t, not a uint32_t
This commit is contained in:
Max Brunsfeld 2019-03-22 12:30:39 -07:00 committed by GitHub
commit 82358d3f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 31 additions and 30 deletions

View file

@ -70,7 +70,7 @@ struct TSParser {
TSDuration timeout_duration;
unsigned accept_count;
unsigned operation_count;
const volatile uint32_t *cancellation_flag;
const volatile size_t *cancellation_flag;
bool halt_on_error;
Subtree old_tree;
TSRangeArray included_range_differences;
@ -1589,12 +1589,12 @@ void ts_parser_halt_on_error(TSParser *self, bool should_halt_on_error) {
self->halt_on_error = should_halt_on_error;
}
const uint32_t *ts_parser_cancellation_flag(const TSParser *self) {
return (const uint32_t *)self->cancellation_flag;
const size_t *ts_parser_cancellation_flag(const TSParser *self) {
return (const size_t *)self->cancellation_flag;
}
void ts_parser_set_cancellation_flag(TSParser *self, const uint32_t *flag) {
self->cancellation_flag = (const volatile uint32_t *)flag;
void ts_parser_set_cancellation_flag(TSParser *self, const size_t *flag) {
self->cancellation_flag = (const volatile size_t *)flag;
}
uint64_t ts_parser_timeout_micros(const TSParser *self) {