summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 00:50:35 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 00:50:35 +0200
commit88a08db927629032d6d4c662e00f0dce2c112ce4 (patch)
treea280d1c66c221d823fc9c08697037fcd97d68db9 /src
parent2cabcc44858627f0951d9b702baf8120be7c5cf3 (diff)
style: Add void to function without arguments
After run `make CC=clang` we found the following problems: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'src')
-rw-r--r--src/ast.c2
-rw-r--r--src/ast.h2
-rw-r--r--src/pipac.c2
-rw-r--r--src/scope.c4
-rw-r--r--src/scope.h2
-rw-r--r--src/vector.c2
-rw-r--r--src/vector.h2
7 files changed, 8 insertions, 8 deletions
diff --git a/src/ast.c b/src/ast.c
index 7bad020..d3e9a28 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -20,7 +20,7 @@
#include <stdlib.h>
ast_node_t *
-ast_node_new()
+ast_node_new(void)
{
ast_node_t *node = (ast_node_t *)malloc(sizeof(ast_node_t));
if (node == NULL) {
diff --git a/src/ast.h b/src/ast.h
index 70d6100..e25f1bb 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -110,7 +110,7 @@ typedef struct ast_node_t
} ast_node_t;
ast_node_t *
-ast_node_new();
+ast_node_new(void);
void
ast_node_destroy(ast_node_t *node);
diff --git a/src/pipac.c b/src/pipac.c
index a0031a5..b31b8b5 100644
--- a/src/pipac.c
+++ b/src/pipac.c
@@ -33,7 +33,7 @@ generate_gas_x86_64_linux(ast_node_t *func)
}
static void
-print_usage()
+print_usage(void)
{
fputs("pipac <filename.pipa>\n", stderr);
}
diff --git a/src/scope.c b/src/scope.c
index de1295e..5b696ad 100644
--- a/src/scope.c
+++ b/src/scope.c
@@ -20,7 +20,7 @@
#include <string.h>
static scope_item_t *
-scope_item_new()
+scope_item_new(void)
{
scope_item_t *item = malloc(sizeof(scope_item_t));
if (item == NULL) {
@@ -37,7 +37,7 @@ scope_item_destroy(scope_item_t *item)
}
scope_t *
-scope_new()
+scope_new(void)
{
scope_t *scope = malloc(sizeof(scope_t));
diff --git a/src/scope.h b/src/scope.h
index bce3567..c221703 100644
--- a/src/scope.h
+++ b/src/scope.h
@@ -30,7 +30,7 @@ typedef struct scope_item_t
} scope_item_t;
scope_t *
-scope_new();
+scope_new(void);
void
scope_destroy(scope_t *scope);
diff --git a/src/vector.c b/src/vector.c
index 85368f6..704cbc4 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -22,7 +22,7 @@
#include <string.h>
vector_t *
-vector_new()
+vector_new(void)
{
vector_t *vector = (vector_t *)malloc(sizeof(vector_t));
diff --git a/src/vector.h b/src/vector.h
index de837b2..45144b6 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -29,7 +29,7 @@ typedef struct vector_t
} vector_t;
vector_t *
-vector_new();
+vector_new(void);
void
vector_push_back(vector_t *vector, void *item);
void *