diff options
| author | Albert Cervin <albert@acervin.com> | 2024-03-18 23:06:40 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-03-18 23:06:40 +0100 |
| commit | bea7258cd8a7fcc7b115cec466f70576bd55a1df (patch) | |
| tree | 77e2d597a1774a0f3861f19baef32a48f287b34c /src/dged | |
| parent | d28f9791c5a95ea0edbcfa65ccdcf31592df4483 (diff) | |
| download | dged-bea7258cd8a7fcc7b115cec466f70576bd55a1df.tar.gz dged-bea7258cd8a7fcc7b115cec466f70576bd55a1df.tar.xz dged-bea7258cd8a7fcc7b115cec466f70576bd55a1df.zip | |
Fix clang build
Diffstat (limited to 'src/dged')
| -rw-r--r-- | src/dged/s8.c | 2 | ||||
| -rw-r--r-- | src/dged/s8.h | 4 | ||||
| -rw-r--r-- | src/dged/syntax.c | 18 | ||||
| -rw-r--r-- | src/dged/syntax.h | 4 |
4 files changed, 19 insertions, 9 deletions
diff --git a/src/dged/s8.c b/src/dged/s8.c index c4544b9..71b6c6d 100644 --- a/src/dged/s8.c +++ b/src/dged/s8.c @@ -36,7 +36,7 @@ struct s8 s8dup(struct s8 s) { struct s8 new = {0}; new.l = s.l; - new.s = (char *)malloc(s.l); + new.s = (uint8_t *)malloc(s.l); memcpy(new.s, s.s, s.l); return new; diff --git a/src/dged/s8.h b/src/dged/s8.h index 76bcc34..5a2504e 100644 --- a/src/dged/s8.h +++ b/src/dged/s8.h @@ -4,10 +4,10 @@ #include <stdbool.h> #include <stdint.h> -#define s8(s) ((struct s8){s, strlen(s)}) +#define s8(s) ((struct s8){(uint8_t *)s, strlen(s)}) struct s8 { - char *s; + uint8_t *s; uint32_t l; }; diff --git a/src/dged/syntax.c b/src/dged/syntax.c index 3ee750c..f5c80d5 100644 --- a/src/dged/syntax.c +++ b/src/dged/syntax.c @@ -174,12 +174,12 @@ static void create_predicates(struct highlight *h, uint32_t pattern_index) { const TSQueryPredicateStep *step = &predicate_steps[predi]; switch (step->type) { case TSQueryPredicateStepTypeCapture: - capname.s = (char *)ts_query_capture_name_for_id(h->query, step->value_id, - &capname.l); + capname.s = (uint8_t *)ts_query_capture_name_for_id( + h->query, step->value_id, &capname.l); break; case TSQueryPredicateStepTypeString: - args[argc].s = (char *)ts_query_string_value_for_id( + args[argc].s = (uint8_t *)ts_query_string_value_for_id( h->query, step->value_id, &args[argc].l); ++argc; break; @@ -260,6 +260,14 @@ static TSQuery *setup_queries(const char *lang_root, TSTree *tree) { case TSQueryErrorCapture: msg = "capture"; break; + case TSQueryErrorStructure: + msg = "structure"; + break; + case TSQueryErrorLanguage: + msg = "language"; + break; + default: + break; } // calculate line @@ -344,8 +352,8 @@ static void update_parser(struct buffer *buffer, void *userdata, TSPoint end = ts_node_end_point(cap->node); struct s8 cname; - cname.s = - (char *)ts_query_capture_name_for_id(h->query, cap->index, &cname.l); + cname.s = (uint8_t *)ts_query_capture_name_for_id(h->query, cap->index, + &cname.l); if (!eval_predicates(h, buffer->text, start, end, match.pattern_index, cname)) { diff --git a/src/dged/syntax.h b/src/dged/syntax.h index 6a2d4a3..488406b 100644 --- a/src/dged/syntax.h +++ b/src/dged/syntax.h @@ -1,7 +1,9 @@ #ifndef _SYNTAX_H #define _SYNTAX_H -void syntax_init(); +#include <stdint.h> + +void syntax_init(uint32_t grammar_path_len, const char *grammar_path[]); void syntax_teardown(); #endif |
