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

[PATCH 06/15] t/helper: mark more unused argv/argc arguments

From
Jeff King <peff@peff.net>
Date
Aug 17, 2024, 08:22 UTC
Message-ID
<20240817082252.GF10287@coredump.intra.peff.net>
In-Reply-To
<20240817082101.GA6761@coredump.intra.peff.net>

This is a continuation of 126e3b3d2a (t/helper: mark unused argv/argc arguments, 2023-03-28) to cover a few new cases:

 - test-example-tap was added since that commit
 - test-hashmap used to accept the "ignorecase" argument on the command
   line. But since most of its logic was moved to a unit-test in
   3469a23659 (t: port helper/test-hashmap.c to unit-tests/t-hashmap.c,
   2024-08-03), it now ignores its argv entirely.
Signed-off-by: Jeff King <peff@peff.net>
---
 t/helper/test-example-tap.c | 2 +-
 t/helper/test-hashmap.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/helper/test-example-tap.c b/t/helper/test-example-tap.c
index d072ad559f..f35667bd29 100644
--- a/t/helper/test-example-tap.c
+++ b/t/helper/test-example-tap.c
@@ -70,7 +70,7 @@ static void t_empty(void)
 	; /* empty */
 }
 
-int cmd__example_tap(int argc, const char **argv)
+int cmd__example_tap(int argc UNUSED, const char **argv UNUSED)
 {
 	test_res = TEST(check_res = check_int(1, ==, 1), "passing test");
 	TEST(t_res(1), "passing test and assertion return 1");
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index 195e6278be..7782ae585e 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -138,7 +138,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
  *
  * perfhashmap method rounds -> test hashmap.[ch] performance
  */
-int cmd__hashmap(int argc, const char **argv)
+int cmd__hashmap(int argc UNUSED, const char **argv UNUSED)
 {
 	struct string_list parts = STRING_LIST_INIT_NODUP;
 	struct strbuf line = STRBUF_INIT;
-- 
2.46.0.585.gd6679c16d8
Previous: Jeff KingNext: Jeff King
Message 7 of 18 in “marking some more unused parameters”
  1. 0/15 marking some more unused parametersJeff King, Aug 17, 2024
  2. 01/15 imap-send: mark unused parameter in ssl_socket_connect() fallbackJeff King, Aug 17, 2024
  3. 02/15 update-ref: mark more unused parameters in parser callbacksJeff King, Aug 17, 2024
  4. 03/15 refs: mark unused parameters in ref_store fsck callbacksJeff King, Aug 17, 2024
  5. 04/15 refs: mark unused parameters in do_for_each_reflog_helper()Jeff King, Aug 17, 2024
  6. 05/15 oss-fuzz: mark unused argv/argc argumentJeff King, Aug 17, 2024
  7. 06/15 t/helper: mark more unused argv/argc argumentsJeff King, Aug 17, 2024
  8. 07/15 unit-tests: ignore unused argc/argvJeff King, Aug 17, 2024
  9. 08/15 reftable: ignore unused argc/argv in test functionsJeff King, Aug 17, 2024
  10. 09/15 reftable: drop obsolete test function declarationsJeff King, Aug 17, 2024
  11. 10/15 reftable: mark unused parameters in virtual functionsJeff King, Aug 17, 2024
  12. 11/15 t-hashmap: mark unused parameters in callback functionJeff King, Aug 17, 2024
  13. Ghanshyam ThakkarAug 17, 2024
  14. Jeff KingAug 17, 2024
  15. 12/15 test-mergesort: mark unused parameters in trivial callbackJeff King, Aug 17, 2024
  16. 13/15 setup: mark unused parameter in config callbackJeff King, Aug 17, 2024
  17. 14/15 daemon: mark unused parameters in non-posix fallbacksJeff King, Aug 17, 2024
  18. 15/15 scalar: mark unused parameters in dummy functionJeff King, Aug 17, 2024

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.