]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compile warnings and errors in treesit.c
authorYuan Fu <yuan@debian-BULLSEYE-live-builder-AMD64>
Wed, 15 Jun 2022 04:04:52 +0000 (21:04 -0700)
committerYuan Fu <yuan@debian-BULLSEYE-live-builder-AMD64>
Wed, 15 Jun 2022 04:04:52 +0000 (21:04 -0700)
* src/treesit.c (ts_initialize): Fix.
(Ftreesit_parser_set_included_ranges): Fix.
(Ftreesit_query_compile): Fix.

src/treesit.c

index df8c992bb5d7c1fc893cdb5513cec5f64bd520f8..dc64aef425aa56f37f1ae1c19a542cc5c2bb3573 100644 (file)
@@ -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))