Remove UNUSED() macro and disable the compiler warning instead

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-07-02 21:59:23 +02:00
1 parent e46e3cdcb6
commit 30822f0d68
27 files changed
+51 -52

No files matched your search

+4 -2
View File
@@ -34,7 +34,8 @@ if WATCHDOGD
finit_SOURCES += watchdog.c watchdog.h
endif
finit_CFLAGS = -W -Wall -Wextra -std=gnu99 $(lite_CFLAGS) $(uev_CFLAGS)
finit_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99
finit_CFLAGS += $(lite_CFLAGS) $(uev_CFLAGS)
finit_LDADD = $(lite_LIBS) $(uev_LIBS)
if STATIC
finit_LDADD += plugins/libplug.la
@@ -44,7 +45,8 @@ endif
initctl_SOURCES = initctl.c serv.c serv.h svc.c svc.h \
cond.c cond.h util.c util.h
initctl_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter $(lite_CFLAGS)
initctl_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter
initctl_CFLAGS += $(lite_CFLAGS)
initctl_LDADD = $(lite_LIBS)
reboot_SOURCES = reboot.c util.c util.h
+1 -1
View File
@@ -168,7 +168,7 @@ static int do_handle_emit(char *buf, size_t len)
* `initctl runlevel 0` is issued we default to POWERDOWN the system
* instead of just halting.
*/
static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events))
static void cb(uev_t *w, void *arg, int events)
{
int sd, lvl;
struct init_request rq;
+1 -1
View File
@@ -126,7 +126,7 @@ void cond_reload(void)
}
static int reassert(const char *fpath, const struct stat *UNUSED(sb), int tflg, struct FTW *ftw)
static int reassert(const char *fpath, const struct stat *sb, int tflg, struct FTW *ftw)
{
char *nm;
+1 -1
View File
@@ -290,7 +290,7 @@ static speed_t do_parse_speed(char *baud)
return B0;
}
int getty(char *tty, char *baud, char *UNUSED(term), char *user)
int getty(char *tty, char *baud, char *term, char *user)
{
int fd;
char name[30];
+1 -1
View File
@@ -137,7 +137,7 @@ static int get_stdin(svc_t *svc)
}
/* Socket callback, looks up correct svc and starts it as an inetd service */
static void socket_cb(uev_t *UNUSED(w), void *arg, int UNUSED(events))
static void socket_cb(uev_t *w, void *arg, int events)
{
svc_t *svc = (svc_t *)arg, *task;
int stdin;
+8 -11
View File
@@ -121,7 +121,7 @@ exit:
return result;
}
static int toggle_debug(char *UNUSED(arg))
static int toggle_debug(char *arg)
{
struct init_request rq = {
.magic = INIT_MAGIC,
@@ -271,10 +271,7 @@ static int do_cond_magic(char op, char *cond)
static int do_cond_set (char *cond) { return do_cond_magic('+', cond); }
static int do_cond_clear(char *cond) { return do_cond_magic('-', cond); }
static int
dump_one_cond(const char *fpath, const struct stat *UNUSED(sb),
int tflag, struct FTW *UNUSED(ftwbuf))
static int dump_one_cond(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf)
{
int len;
@@ -290,7 +287,7 @@ dump_one_cond(const char *fpath, const struct stat *UNUSED(sb),
return 0;
}
static int do_cond_dump(char *UNUSED(arg))
static int do_cond_dump(char *arg)
{
printf("Condition Status)\n");
printf("===============================================================================\n");
@@ -303,7 +300,7 @@ static int do_cond_dump(char *UNUSED(arg))
return 0;
}
static int do_cond_show(char *UNUSED(arg))
static int do_cond_show(char *arg)
{
svc_t *svc;
enum cond_state cond;
@@ -364,9 +361,9 @@ static int do_signal(int signo, const char *msg)
return 0;
}
static int do_halt (char *UNUSED(arg)) { return do_signal(SIGUSR1, "halt"); }
static int do_poweroff(char *UNUSED(arg)) { return do_signal(SIGUSR2, "power off"); }
static int do_reboot (char *UNUSED(arg)) { return do_signal(SIGTERM, "reboot"); }
static int do_halt (char *arg) { return do_signal(SIGUSR1, "halt"); }
static int do_poweroff(char *arg) { return do_signal(SIGUSR2, "power off"); }
static int do_reboot (char *arg) { return do_signal(SIGTERM, "reboot"); }
int utmp_show(char *file)
{
@@ -417,7 +414,7 @@ static int do_utmp(char *file)
utmp_show(_PATH_UTMP);
}
static int show_version(char *UNUSED(arg))
static int show_version(char *arg)
{
puts("v" PACKAGE_VERSION);
return 0;
+2 -2
View File
@@ -215,7 +215,7 @@ int plugin_io_init(plugin_t *p)
}
/* Setup any I/O callbacks for plugins that use them */
static int init_plugins(uev_ctx_t *UNUSED(ctx))
static int init_plugins(uev_ctx_t *ctx)
{
int fail = 0;
plugin_t *p, *tmp;
@@ -333,7 +333,7 @@ static int load_plugins(char *path)
return fail;
}
#else
static int load_plugins(char *UNUSED(path))
static int load_plugins(char *path)
{
print_desc("Initializing plugins", NULL);
return 0;
+1 -1
View File
@@ -77,7 +77,7 @@ int service_enabled(svc_t *svc)
* Calls the callback registered with the call to
* service_timeout_after().
*/
static void service_timeout_cb(uev_t *UNUSED(w), void *arg, int UNUSED(events))
static void service_timeout_cb(uev_t *w, void *arg, int events)
{
svc_t *svc = arg;
+9 -9
View File
@@ -221,7 +221,7 @@ void do_shutdown(shutop_t op)
/*
* Reload .conf files in /etc/finit.d/
*/
static void sighup_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sighup_cb(uev_t *w, void *arg, int events)
{
_d("...");
/* INIT_CMD_RELOAD: 'init q', 'initctl reload', and SIGHUP */
@@ -231,7 +231,7 @@ static void sighup_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGINT: Should generate <sys/key/ctrlaltdel> condition, for now reboot
*/
static void sigint_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigint_cb(uev_t *w, void *arg, int events)
{
_d("...");
halt = SHUT_REBOOT;
@@ -241,7 +241,7 @@ static void sigint_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGUSR1: BusyBox style halt
*/
static void sigusr1_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigusr1_cb(uev_t *w, void *arg, int events)
{
_d("...");
halt = SHUT_HALT;
@@ -251,7 +251,7 @@ static void sigusr1_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGUSR2: BusyBox style poweroff
*/
static void sigusr2_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigusr2_cb(uev_t *w, void *arg, int events)
{
_d("...");
halt = SHUT_OFF;
@@ -261,7 +261,7 @@ static void sigusr2_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGTERM: BusyBox style reboot
*/
static void sigterm_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigterm_cb(uev_t *w, void *arg, int events)
{
_d("...");
halt = SHUT_REBOOT;
@@ -271,7 +271,7 @@ static void sigterm_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGCHLD: one of our children has died
*/
static void sigchld_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigchld_cb(uev_t *w, void *arg, int events)
{
pid_t pid;
@@ -288,7 +288,7 @@ static void sigchld_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGSTOP/SIGTSTP: Paused by user or netflash
*/
static void sigstop_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigstop_cb(uev_t *w, void *arg, int events)
{
touch(SYNC_STOPPED);
stopped++;
@@ -297,7 +297,7 @@ static void sigstop_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
/*
* SIGCONT: Restart service monitor
*/
static void sigcont_cb(uev_t *UNUSED(w), void *UNUSED(arg), int UNUSED(events))
static void sigcont_cb(uev_t *w, void *arg, int events)
{
stopped = 0;
erase(SYNC_STOPPED);
@@ -314,7 +314,7 @@ int sig_stopped(void)
/*
* Inital signal setup - ignore everything but SIGCHLD until we're capable of responding
*/
static void chld_handler(int UNUSED(sig), siginfo_t *UNUSED(info), void *UNUSED(ctx))
static void chld_handler(int sig, siginfo_t *info, void *ctx)
{
/* NOP */
}