1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 01:56:15 +02:00

date: mark unused parameters in handler functions

When parsing approxidates, we use a table to map special strings (like
"noon") to functions which handle them. Not all functions need the "now"
parameter, as they are not relative (e.g., "yesterday" does, but "pm"
does not). Let's annotate those to make -Wunused-parameter happy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2022-10-17 21:05:52 -04:00 committed by Junio C Hamano
parent 1ee3471045
commit 7829746a6c

6
date.c
View File

@ -1101,7 +1101,7 @@ static void date_tea(struct tm *tm, struct tm *now, int *num)
date_time(tm, now, 17);
}
static void date_pm(struct tm *tm, struct tm *now, int *num)
static void date_pm(struct tm *tm, struct tm *now UNUSED, int *num)
{
int hour, n = *num;
*num = 0;
@ -1115,7 +1115,7 @@ static void date_pm(struct tm *tm, struct tm *now, int *num)
tm->tm_hour = (hour % 12) + 12;
}
static void date_am(struct tm *tm, struct tm *now, int *num)
static void date_am(struct tm *tm, struct tm *now UNUSED, int *num)
{
int hour, n = *num;
*num = 0;
@ -1129,7 +1129,7 @@ static void date_am(struct tm *tm, struct tm *now, int *num)
tm->tm_hour = (hour % 12);
}
static void date_never(struct tm *tm, struct tm *now, int *num)
static void date_never(struct tm *tm, struct tm *now UNUSED, int *num)
{
time_t n = 0;
localtime_r(&n, tm);