From 3b5d1a8f495d5b6bda72f9962516d5a1e273481b Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 9 Feb 2023 17:38:29 +0100 Subject: lib: Fix prototypes missing 'void' Found by Clang version 15. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/lockfile.h | 2 +- src/ipcpd/ipcp.c | 10 +++++----- src/ipcpd/shim-data.c | 2 +- src/lib/dev.c | 6 +++--- src/lib/lockfile.c | 6 ++++-- src/lib/shm_rdrbuff.c | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/ouroboros/lockfile.h b/include/ouroboros/lockfile.h index 505c8e89..acc373d8 100644 --- a/include/ouroboros/lockfile.h +++ b/include/ouroboros/lockfile.h @@ -37,4 +37,4 @@ void lockfile_destroy(struct lockfile * lf); pid_t lockfile_owner(struct lockfile * lf); -#endif +#endif /* OUROBOROS_LOCKFILE_H */ diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 395e9b78..235c8eb4 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -808,7 +808,7 @@ int ipcp_init(int argc, return ret; } -int ipcp_start() +int ipcp_start(void) { sigset_t sigset; sigemptyset(&sigset); @@ -848,7 +848,7 @@ int ipcp_start() return -1; } -void ipcp_sigwait() +void ipcp_sigwait(void) { siginfo_t info; @@ -904,7 +904,7 @@ void ipcp_sigwait() } } -void ipcp_stop() +void ipcp_stop(void) { log_info("IPCP %d shutting down.", getpid()); @@ -914,7 +914,7 @@ void ipcp_stop() tpm_stop(ipcpi.tpm); } -void ipcp_fini() +void ipcp_fini(void) { tpm_destroy(ipcpi.tpm); @@ -951,7 +951,7 @@ void ipcp_set_state(enum ipcp_state state) pthread_mutex_unlock(&ipcpi.state_mtx); } -enum ipcp_state ipcp_get_state() +enum ipcp_state ipcp_get_state(void) { enum ipcp_state state; diff --git a/src/ipcpd/shim-data.c b/src/ipcpd/shim-data.c index a499b2d4..035d9ebb 100644 --- a/src/ipcpd/shim-data.c +++ b/src/ipcpd/shim-data.c @@ -139,7 +139,7 @@ static void dir_entry_destroy(struct dir_entry * entry) free(entry); } -struct shim_data * shim_data_create() +struct shim_data * shim_data_create(void) { struct shim_data * sd; diff --git a/src/lib/dev.c b/src/lib/dev.c index 8bc840a5..a68af46e 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -1466,7 +1466,7 @@ ssize_t flow_read(int fd, /* fqueue functions. */ -struct flow_set * fset_create() +struct flow_set * fset_create(void) { struct flow_set * set; @@ -1509,7 +1509,7 @@ void fset_destroy(struct flow_set * set) free(set); } -struct fqueue * fqueue_create() +struct fqueue * fqueue_create(void) { struct fqueue * fq = malloc(sizeof(*fq)); if (fq == NULL) @@ -1929,7 +1929,7 @@ int ipcp_flow_read(int fd, assert(flow->flow_id >= 0); - while ((idx = frcti_queued_pdu(flow->frcti)) < 0) { + while (frcti_queued_pdu(flow->frcti) < 0) { pthread_rwlock_unlock(&ai.lock); idx = flow_rx_sdb(flow, sdb, false, NULL); diff --git a/src/lib/lockfile.c b/src/lib/lockfile.c index 65970681..a340a98f 100644 --- a/src/lib/lockfile.c +++ b/src/lib/lockfile.c @@ -41,7 +41,8 @@ struct lockfile { pid_t * pid; }; -struct lockfile * lockfile_create() { +struct lockfile * lockfile_create(void) +{ int fd; mode_t mask; struct lockfile * lf = malloc(sizeof(*lf)); @@ -82,7 +83,8 @@ struct lockfile * lockfile_create() { return lf; } -struct lockfile * lockfile_open() { +struct lockfile * lockfile_open(void) +{ int fd; struct lockfile * lf = malloc(sizeof(*lf)); if (lf == NULL) diff --git a/src/lib/shm_rdrbuff.c b/src/lib/shm_rdrbuff.c index 23a2ebfc..3fe36766 100644 --- a/src/lib/shm_rdrbuff.c +++ b/src/lib/shm_rdrbuff.c @@ -205,7 +205,7 @@ static struct shm_rdrbuff * rdrb_create(int flags) return NULL; } -struct shm_rdrbuff * shm_rdrbuff_create() +struct shm_rdrbuff * shm_rdrbuff_create(void) { struct shm_rdrbuff * rdrb; mode_t mask; @@ -263,7 +263,7 @@ struct shm_rdrbuff * shm_rdrbuff_create() return NULL; } -struct shm_rdrbuff * shm_rdrbuff_open() +struct shm_rdrbuff * shm_rdrbuff_open(void) { return rdrb_create(O_RDWR); } -- cgit v1.2.3