From b162faba0bc04b8584af6f536bef8d0525076a28 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 14 Jun 2022 21:04:52 -0700 Subject: [PATCH] Fix compile warnings and errors in treesit.c * src/treesit.c (ts_initialize): Fix. (Ftreesit_parser_set_included_ranges): Fix. (Ftreesit_query_compile): Fix. --- src/treesit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/treesit.c b/src/treesit.c index df8c992bb5d..dc64aef425a 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -123,7 +123,7 @@ ts_calloc_wrapper (size_t n, size_t size) } static void -ts_initialize () +ts_initialize (void) { if (!ts_initialized) { @@ -766,7 +766,7 @@ is nil, set PARSER to parse the whole buffer. */) /* If RANGES is nil, make parser to parse the whole document. To do that we give tree-sitter a 0 length, the range is a dummy. */ - TSRange ts_range = {0, 0, 0, 0}; + TSRange ts_range = {{0, 0}, {0, 0}, 0, 0}; success = ts_parser_set_included_ranges (XTS_PARSER (parser)->parser, &ts_range , 0); } @@ -1527,7 +1527,7 @@ goes wrong. You can use `treesit-query-validate' to debug the query. */) (Lisp_Object language, Lisp_Object query) { - if (!Ftreesit_query_p (query)) + if (NILP (Ftreesit_query_p (query))) wrong_type_argument (Qtreesit_query_p, query); CHECK_SYMBOL (language); if (TS_COMPILED_QUERY_P (query)) -- 2.39.5