Skip to content

Commit 7829746

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1ee3471 commit 7829746

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

date.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ static void date_tea(struct tm *tm, struct tm *now, int *num)
11011101
date_time(tm, now, 17);
11021102
}
11031103

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)
11051105
{
11061106
int hour, n = *num;
11071107
*num = 0;
@@ -1115,7 +1115,7 @@ static void date_pm(struct tm *tm, struct tm *now, int *num)
11151115
tm->tm_hour = (hour % 12) + 12;
11161116
}
11171117

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)
11191119
{
11201120
int hour, n = *num;
11211121
*num = 0;
@@ -1129,7 +1129,7 @@ static void date_am(struct tm *tm, struct tm *now, int *num)
11291129
tm->tm_hour = (hour % 12);
11301130
}
11311131

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)
11331133
{
11341134
time_t n = 0;
11351135
localtime_r(&n, tm);

0 commit comments

Comments
 (0)