From c5224f0f4cd53e3b205f54b98bc3dc66a9007c71 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 13 Dec 2022 06:12:58 -0500 Subject: ws: drop unused parameter from ws_blank_line() We take a ws_rule parameter, but have never looked at it since the function was added in 877f23ccb8 (Teach "diff --check" about new blank lines at end, 2008-06-26). A comment in the function does mention how we _could_ use it, but nobody has felt the need to do so for over a decade. We could keep it around as reminder of what could be done, but the comment serves that purpose. And in the meantime, it triggers -Wunused-parameter. So let's drop it, which in turn allows us to drop similar arguments further up the callstack. I've left the comment intact. It does still say "ws_rule", but that name is used consistently in the whitespace code, so the meaning is clear. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- apply.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apply.c') diff --git a/apply.c b/apply.c index bc33814313..8582228047 100644 --- a/apply.c +++ b/apply.c @@ -2913,7 +2913,7 @@ static int apply_one_fragment(struct apply_state *state, break; case ' ': if (plen && (ws_rule & WS_BLANK_AT_EOF) && - ws_blank_line(patch + 1, plen, ws_rule)) + ws_blank_line(patch + 1, plen)) is_blank_context = 1; /* fallthrough */ case '-': @@ -2942,7 +2942,7 @@ static int apply_one_fragment(struct apply_state *state, (first == '+' ? 0 : LINE_COMMON)); if (first == '+' && (ws_rule & WS_BLANK_AT_EOF) && - ws_blank_line(patch + 1, plen, ws_rule)) + ws_blank_line(patch + 1, plen)) added_blank_line = 1; break; case '@': case '\\': -- cgit v1.2.3