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>
Jeff King committed
Oct 17, 2022 at 21:05 UTC
7829746a6ceca69813348331833b0b6940f41d54
1 file changed
+3
-3
date.c
+3
-3
@@ -1101,7 +1101,7 @@ static void date_tea(struct tm *tm, struct tm *now, int *num)
1101
date_time(tm, now, 17);
1102
}
1103
1104
-static void date_pm(struct tm *tm, struct tm *now, int *num)
1104
+static void date_pm(struct tm *tm, struct tm *now UNUSED, int *num)
1105
{
1106
int hour, n = *num;
1107
*num = 0;
@@ -1115,7 +1115,7 @@ static void date_pm(struct tm *tm, struct tm *now, int *num)
1115
tm->tm_hour = (hour % 12) + 12;
1116
}
1117
1118
-static void date_am(struct tm *tm, struct tm *now, int *num)
1118
+static void date_am(struct tm *tm, struct tm *now UNUSED, int *num)
1119
{
1120
int hour, n = *num;
1121
*num = 0;
@@ -1129,7 +1129,7 @@ static void date_am(struct tm *tm, struct tm *now, int *num)
1129
tm->tm_hour = (hour % 12);
1130
}
1131
1132
-static void date_never(struct tm *tm, struct tm *now, int *num)
1132
+static void date_never(struct tm *tm, struct tm *now UNUSED, int *num)
1133
{
1134
time_t n = 0;
1135
localtime_r(&n, tm);