]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.c
ref-filter: mark unused callback parameters
authorJeff King <peff@peff.net>
Fri, 24 Feb 2023 06:39:06 +0000 (01:39 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Feb 2023 17:13:30 +0000 (09:13 -0800)
commit5fe9e1ce2f7e0be5ea817f2e4ae2c7edecf771c0
tree8525e794f9e76c0868896e49041f625c81d893c5
parent2be1506a788a24e87ba4b53a1654c9ff40402750
ref-filter: mark unused callback parameters

The ref-filter code uses virtual functions to handle specific atoms, but
many of the functions ignore some parameters:

  - most atom parsers do not need the ref_format itself, unless they are
    looking at centralized options like use_color, quote_style, etc.

  - meta-atom handlers like append_atom(), align_atom_handler(), etc,
    can't generate errors, so ignore their "err" parameter

  - likewise, the handlers for then/else/end do not even need to look at
    their atom_value, as the "if" handler put everything they need into
    the ref_formatting_state stack

Since these functions all have to conform to virtual function
interfaces, we can't just drop the unused parameters, but must mark them
as UNUSED (to appease -Wunused-parameter).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c