diff options
author | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-30 00:43:25 +0200 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-30 00:43:25 +0200 |
commit | 2cabcc44858627f0951d9b702baf8120be7c5cf3 (patch) | |
tree | dd634dd1813c0b5b40a9aaf2ef420883703d5fc2 /src/pipac.c | |
parent | 9f034b4ebfe15844ea610ec2dd2fca1a9f7ce338 (diff) |
style: Add -Wmissing-declarations to CC CFLAGS
The refactoring also replace a if statement by switch statement.
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'src/pipac.c')
-rw-r--r-- | src/pipac.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/pipac.c b/src/pipac.c index d5781a5..a0031a5 100644 --- a/src/pipac.c +++ b/src/pipac.c @@ -24,7 +24,7 @@ #include "parser.h" #include "string_view.h" -void +static void generate_gas_x86_64_linux(ast_node_t *func) { gas_assembly_generator_t gen; @@ -32,27 +32,13 @@ generate_gas_x86_64_linux(ast_node_t *func) gas_assembly_generator_compile(&gen, func); } -void +static void print_usage() { fputs("pipac <filename.pipa>\n", stderr); } -void -print_tokens(lexer_t *lexer) -{ - token_t token; - for (lexer_next_token(lexer, &token); token.kind != TOKEN_EOF; lexer_next_token(lexer, &token)) { - printf("%s:%d:%d: [kind=%d, value='" SVFMT "']\n", - lexer->filepath, - token.row + 1, - token.col + 1, - token.kind, - SVARG(&token.value)); - } -} - -void +static void parser_print_errors(parser_t *parser) { for (int i = 0; i < parser->errors_len; i++) { |