Declare unused parameters

When building with global CFLAGS=-Wunused-parameter the output from the
build looks terrible.  This commit explicitly declares unused variables
to prevent triggering -Wunused-parameter

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2025-07-02 14:29:52 +02:00
1 parent 5e2e273cad
commit ffd00f646c
10 files changed
+55

No files matched your search

+12
View File
@@ -59,6 +59,8 @@ static int call(int (*action)(svc_t *, void *), char *buf, size_t len)
static int stop(svc_t *svc, void *user_data) static int stop(svc_t *svc, void *user_data)
{ {
(void)user_data;
if (!svc) if (!svc)
return 1; return 1;
@@ -72,6 +74,8 @@ static int stop(svc_t *svc, void *user_data)
static int start(svc_t *svc, void *user_data) static int start(svc_t *svc, void *user_data)
{ {
(void)user_data;
if (!svc) if (!svc)
return 1; return 1;
@@ -105,6 +109,8 @@ static int restart(svc_t *svc, void *user_data)
static int reload(svc_t *svc, void *user_data) static int reload(svc_t *svc, void *user_data)
{ {
(void)user_data;
if (!svc) if (!svc)
return 1; return 1;
@@ -149,6 +155,8 @@ static int missing(char *job, char *id, void *user_data)
{ {
char buf[20]; char buf[20];
(void)user_data;
if (!job) if (!job)
job = ""; job = "";
if (!id) if (!id)
@@ -228,6 +236,8 @@ struct wq emergency = { .cb = bypass_shutdown };
static void bypass_shutdown(void *unused) static void bypass_shutdown(void *unused)
{ {
(void)unused;
cprintf("TIMEOUT TIMEOUT SHUTTING DOWN NOW!!\n"); cprintf("TIMEOUT TIMEOUT SHUTTING DOWN NOW!!\n");
do_shutdown(halt); do_shutdown(halt);
} }
@@ -332,6 +342,8 @@ static void api_cb(uev_t *w, void *arg, int events)
int sd, lvl; int sd, lvl;
svc_t *svc; svc_t *svc;
(void)arg;
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
dbg("%s(): api socket %d invalid.", __func__, w->fd); dbg("%s(): api socket %d invalid.", __func__, w->fd);
goto error; goto error;
+1
View File
@@ -267,6 +267,7 @@ static void cgroup_events_cb(uev_t *w, void *arg, int events)
ssize_t sz; ssize_t sz;
size_t off; size_t off;
(void)arg;
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
dbg("%s(): inotify socket %d invalid.", __func__, w->fd); dbg("%s(): inotify socket %d invalid.", __func__, w->fd);
return; return;
+5
View File
@@ -202,6 +202,9 @@ static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct
{ {
const char *cond, *ptr; const char *cond, *ptr;
(void)sb;
(void)tflag;
if (ftw->level == 0) if (ftw->level == 0)
return 1; return 1;
@@ -390,6 +393,8 @@ static int do_assert(const char *fpath, const struct stat *sb, int tflg, struct
{ {
char *nm; char *nm;
(void)sb;
if (ftw->level == 0) if (ftw->level == 0)
return 1; return 1;
+2
View File
@@ -1562,6 +1562,8 @@ static int conf_iwatch_read(int fd)
static void conf_cb(uev_t *w, void *arg, int events) static void conf_cb(uev_t *w, void *arg, int events)
{ {
(void)arg;
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
dbg("%s(): iwatch socket %d invalid.", __func__, w->fd); dbg("%s(): iwatch socket %d invalid.", __func__, w->fd);
return; return;
+4
View File
@@ -164,6 +164,8 @@ static void devmon_scandir(struct iwatch *iw, char *dir, int len)
size_t i; size_t i;
int rc; int rc;
(void)iw;
snprintf(path, sizeof(path), "%s/*", dir); snprintf(path, sizeof(path), "%s/*", dir);
rc = glob(path, GLOB_NOSORT, NULL, &gl); rc = glob(path, GLOB_NOSORT, NULL, &gl);
if (rc && rc != GLOB_NOMATCH) if (rc && rc != GLOB_NOMATCH)
@@ -207,6 +209,8 @@ static void devmon_cb(uev_t *w, void *arg, int events)
ssize_t sz; ssize_t sz;
size_t off; size_t off;
(void)arg;
sz = read(w->fd, ev_buf, sizeof(ev_buf) - 1); sz = read(w->fd, ev_buf, sizeof(ev_buf) - 1);
if (sz <= 0) { if (sz <= 0) {
err(1, "invalid inotify event"); err(1, "invalid inotify event");
+2
View File
@@ -293,6 +293,8 @@ static size_t print_timestamp(char *buf, size_t len)
sscanf(buf, "%f %f", &stamp, &dummy); sscanf(buf, "%f %f", &stamp, &dummy);
return snprintf(buf, len, "[ %.6f ]", stamp); return snprintf(buf, len, "[ %.6f ]", stamp);
#else #else
(void)buf;
(void)len;
return 0; return 0;
#endif #endif
} }
+2
View File
@@ -320,6 +320,8 @@ static int init_plugins(uev_ctx_t *ctx)
plugin_t *p, *tmp; plugin_t *p, *tmp;
int fail = 0; int fail = 0;
(void)ctx;
PLUGIN_ITERATOR(p, tmp) { PLUGIN_ITERATOR(p, tmp) {
if (plugin_io_init(p)) if (plugin_io_init(p))
fail++; fail++;
+1
View File
@@ -2823,6 +2823,7 @@ void service_step_all(int types)
void service_worker(void *unused) void service_worker(void *unused)
{ {
(void)unused;
service_step_all(SVC_TYPE_RESPAWN | SVC_TYPE_RUNTASK); service_step_all(SVC_TYPE_RESPAWN | SVC_TYPE_RUNTASK);
} }
+23
View File
@@ -260,6 +260,7 @@ static int status_cb(int pid, void *data)
{ {
int *has_proc = (int *)data; int *has_proc = (int *)data;
(void)pid;
*has_proc = 1; *has_proc = 1;
return 1; return 1;
@@ -425,6 +426,8 @@ void do_shutdown(shutop_t op)
*/ */
static void sighup_cb(uev_t *w, void *arg, int events) static void sighup_cb(uev_t *w, void *arg, int events)
{ {
(void)arg;
dbg("..."); dbg("...");
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
@@ -451,6 +454,9 @@ static void sighup_cb(uev_t *w, void *arg, int events)
*/ */
static void sigint_cb(uev_t *w, void *arg, int events) static void sigint_cb(uev_t *w, void *arg, int events)
{ {
(void)w;
(void)arg;
dbg("..."); dbg("...");
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
@@ -467,6 +473,9 @@ static void sigint_cb(uev_t *w, void *arg, int events)
*/ */
static void sigpwr_cb(uev_t *w, void *arg, int events) static void sigpwr_cb(uev_t *w, void *arg, int events)
{ {
(void)w;
(void)arg;
dbg("..."); dbg("...");
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
@@ -481,6 +490,8 @@ static void sigpwr_cb(uev_t *w, void *arg, int events)
*/ */
static void sigusr1_cb(uev_t *w, void *arg, int events) static void sigusr1_cb(uev_t *w, void *arg, int events)
{ {
(void)arg;
dbg("..."); dbg("...");
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
@@ -502,6 +513,9 @@ static void sigusr1_cb(uev_t *w, void *arg, int events)
*/ */
static void sigusr2_cb(uev_t *w, void *arg, int events) static void sigusr2_cb(uev_t *w, void *arg, int events)
{ {
(void)w;
(void)arg;
dbg("..."); dbg("...");
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
@@ -522,6 +536,9 @@ static void sigusr2_cb(uev_t *w, void *arg, int events)
*/ */
static void sigterm_cb(uev_t *w, void *arg, int events) static void sigterm_cb(uev_t *w, void *arg, int events)
{ {
(void)w;
(void)arg;
dbg("..."); dbg("...");
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
@@ -545,6 +562,9 @@ static void sigchld_cb(uev_t *w, void *arg, int events)
int status; int status;
pid_t pid; pid_t pid;
(void)w;
(void)arg;
if (UEV_ERROR == events) { if (UEV_ERROR == events) {
errx(1, "Unrecoverable error in signal watcher"); errx(1, "Unrecoverable error in signal watcher");
return; return;
@@ -601,6 +621,9 @@ const char *sig_name(int signo)
*/ */
static void chld_handler(int sig, siginfo_t *info, void *ctx) static void chld_handler(int sig, siginfo_t *info, void *ctx)
{ {
(void)sig;
(void)info;
(void)ctx;
/* NOP */ /* NOP */
} }
+3
View File
@@ -114,6 +114,9 @@ static int parse_mm(char *arg, int *major, int *minor)
static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw) static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw)
{ {
(void)sb;
(void)tflag;
if (ftw->level == 0) if (ftw->level == 0)
return 1; return 1;