Use explicit syntax for functions with no parameters

This commit is contained in:
Max Brunsfeld 2019-03-21 16:06:06 -07:00
parent 2e5d3d3770
commit 5a59f19b69
8 changed files with 14 additions and 14 deletions

View file

@ -713,7 +713,7 @@ impl Generator {
let external_scanner_name = format!("{}_external_scanner", language_function_name);
if !self.syntax_grammar.external_tokens.is_empty() {
add_line!(self, "void *{}_create();", external_scanner_name);
add_line!(self, "void *{}_create(void);", external_scanner_name);
add_line!(self, "void {}_destroy(void *);", external_scanner_name);
add_line!(
self,
@ -740,7 +740,7 @@ impl Generator {
add_line!(
self,
"extern const TSLanguage *{}() {{",
"extern const TSLanguage *{}(void) {{",
language_function_name
);
indent!(self);

View file

@ -77,7 +77,7 @@ typedef struct {
uint32_t context[2];
} TSTreeCursor;
TSParser *ts_parser_new();
TSParser *ts_parser_new(void);
void ts_parser_delete(TSParser *);
const TSLanguage *ts_parser_language(const TSParser *);
bool ts_parser_set_language(TSParser *, const TSLanguage *);

View file

@ -92,7 +92,7 @@ struct TSLanguage {
struct {
const bool *states;
const TSSymbol *symbol_map;
void *(*create)();
void *(*create)(void);
void (*destroy)(void *);
bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist);
unsigned (*serialize)(void *, char *);

View file

@ -26,11 +26,11 @@ static inline uint64_t duration_to_micros(TSDuration self) {
return self * 1000000 / (uint64_t)frequency.QuadPart;
}
static inline TSClock clock_null() {
static inline TSClock clock_null(void) {
return 0;
}
static inline TSClock clock_now() {
static inline TSClock clock_now(void) {
LARGE_INTEGER result;
QueryPerformanceCounter(&result);
return (uint64_t)result.QuadPart;
@ -68,13 +68,13 @@ static inline uint64_t duration_to_micros(TSDuration self) {
return self;
}
static inline TSClock clock_now() {
static inline TSClock clock_now(void) {
TSClock result;
clock_gettime(CLOCK_MONOTONIC, &result);
return result;
}
static inline TSClock clock_null() {
static inline TSClock clock_null(void) {
return (TSClock) {0, 0};
}
@ -116,11 +116,11 @@ static inline uint64_t duration_to_micros(TSDuration self) {
return self * 1000000 / (uint64_t)CLOCKS_PER_SEC;
}
static inline TSClock clock_null() {
static inline TSClock clock_null(void) {
return 0;
}
static inline TSClock clock_now() {
static inline TSClock clock_now(void) {
return (uint64_t)clock();
}

View file

@ -36,7 +36,7 @@ static inline Length length_sub(Length len1, Length len2) {
return result;
}
static inline Length length_zero() {
static inline Length length_zero(void) {
Length result = {0, {0, 0}};
return result;
}

View file

@ -22,7 +22,7 @@ TSNode ts_node_new(const TSTree *tree, const Subtree *subtree, Length position,
};
}
static inline TSNode ts_node__null() {
static inline TSNode ts_node__null(void) {
return ts_node_new(NULL, NULL, length_zero(), 0);
}

View file

@ -1501,7 +1501,7 @@ static bool ts_parser_has_outstanding_parse(TSParser *self) {
// Parser - Public
TSParser *ts_parser_new() {
TSParser *ts_parser_new(void) {
TSParser *self = ts_calloc(1, sizeof(TSParser));
ts_lexer_init(&self->lexer);
array_init(&self->reduce_actions);

View file

@ -11,7 +11,7 @@ typedef struct {
Subtree last_external_token;
} ReusableNode;
static inline ReusableNode reusable_node_new() {
static inline ReusableNode reusable_node_new(void) {
return (ReusableNode) {array_new(), NULL_SUBTREE};
}