git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/6] xdiff: drop unused mmfile parameters from xdl_do_histogram_diff()

From
Jeff King <peff@peff.net>
Date
Aug 20, 2022, 06:58 UTC
Message-ID
<YwCGJLJU2+ui+hvn@coredump.intra.peff.net>
In-Reply-To
<CAPoeCOa6BDsunamy7_GtaSy-gL_0r3kAwDJ7ffA_uiFUzhen9w@mail.gmail.com>
On Fri, Aug 19, 2022 at 02:32:13PM +0100, Phillip Wood wrote:
> Thanks, I seem to have a blind spot for unused parameters (I think
> this is at least the third such fix from you for one of my commits),
> I'm really looking forward to having -Wunused-parameter enabled,
> thanks for working on it.

I think everyone does. ;) I know I couldn't have found these without help from the compiler.

Show 5 quoted lines
> Looking at the xpatience.c I think we can remove the mmfile_t
> parameters there as well, they are only end up being used because
> patience_diff() gets called recursively. I'm about to go off list for
> a week, but I can look at putting a patch together for that when I get
> back unless you want to.

I wondered that, too, but they also get passed in to fill_hashmap(), which records the pointers in its "struct hashmap". It looks like those fields are never accessed, though, and could even be removed from the struct entirely!

So I think there is some room for cleanup.
-Peff
Previous: Phillip WoodNext: Jeff King
Message 4 of 21 in “unused function parameter potpourri”
  1. 0/6 unused function parameter potpourriJeff King, Aug 19, 2022
  2. 1/6 xdiff: drop unused mmfile parameters from xdl_do_histogram_diff()Jeff King, Aug 19, 2022
  3. Phillip WoodAug 19, 2022
  4. Jeff KingAug 20, 2022
  5. 7/6 xdiff: drop unused mmfile parameters from xdl_do_patience_diff()Jeff King, Aug 20, 2022
  6. Phillip WoodAug 26, 2022
  7. 2/6 log-tree: drop unused commit param in remerge_diff()Jeff King, Aug 19, 2022
  8. Elijah NewrenAug 19, 2022
  9. Jeff KingAug 20, 2022
  10. 3/6 match_pathname(): drop unused "flags" parameterJeff King, Aug 19, 2022
  11. 4/6 verify_one_sparse(): drop unused repository parameterJeff King, Aug 19, 2022
  12. Derrick StoleeAug 19, 2022
  13. Jeff KingAug 20, 2022
  14. René ScharfeAug 20, 2022
  15. 4/6 verify_one_sparse(): drop unused repository parameterJeff King, Aug 20, 2022
  16. 5/6 reftable: drop unused parameter from reader_seek_linear()Jeff King, Aug 19, 2022
  17. Derrick StoleeAug 19, 2022
  18. Han-Wen NienhuysAug 22, 2022
  19. 6/6 reflog: assert PARSE_OPT_NONEG in parse-options callbacksJeff King, Aug 19, 2022
  20. Derrick StoleeAug 19, 2022
  21. Elijah NewrenAug 19, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.