Skip to content

Commit 9ec03b5

Browse files
peffgitster
authored andcommitted
mark unused parameters in signal handlers
Signal handlers receive their signal number as a parameter, but many don't care what it is (because they only handle one signal, or because their action is the same regardless of the signal). Mark such parameters to silence -Wunused-parameter. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ce41759 commit 9ec03b5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

builtin/fast-import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static void set_checkpoint_signal(void)
436436

437437
#else
438438

439-
static void checkpoint_signal(int signo)
439+
static void checkpoint_signal(int signo UNUSED)
440440
{
441441
checkpoint_requested = 1;
442442
}

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static void log_show_early(struct rev_info *revs, struct commit_list *list)
436436
setitimer(ITIMER_REAL, &early_output_timer, NULL);
437437
}
438438

439-
static void early_output(int signal)
439+
static void early_output(int signal UNUSED)
440440
{
441441
show_early_output = log_show_early;
442442
}

daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
928928
add_child(&cld, addr, addrlen);
929929
}
930930

931-
static void child_handler(int signo)
931+
static void child_handler(int signo UNUSED)
932932
{
933933
/*
934934
* Otherwise empty handler because systemcalls will get interrupted

progress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void progress_test_force_update(void)
5959
}
6060

6161

62-
static void progress_interval(int signum)
62+
static void progress_interval(int signum UNUSED)
6363
{
6464
progress_update = 1;
6565
}

0 commit comments

Comments
 (0)