From: "Ghanshyam Thakkar" <shyamthakkar001@gmail.com>
To: "Jeff King" <peff@peff.net>, <git@vger.kernel.org>
Subject: Re: [PATCH 11/15] t-hashmap: mark unused parameters in callback function
Date: Sat, 17 Aug 2024 20:02:36 +0530 [thread overview]
Message-ID: <D3I9DJRMAQD4.UIBX5HG0XYL2@gmail.com> (raw)
In-Reply-To: <20240817082447.GK10287@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
> The t_intern() setup function doesn't operate on a hashmap, so it
> ignores its parameters. But we can't drop them since it is passed as a
> pointer to setup(), so we have to match the other setup functions. Mark
> them to silence -Wunused-parameter.
Sorry, but I didn't understand why we can't drop them and just call
t_intern() instead of setup(t_intern) (I should've done that, when
writing this). By 'other setup functions', do you mean other test
functions which use setup()? I don't think it is necessary to have
uniformity in function signatures of all the test functions.
diff --git a/t/unit-tests/t-hashmap.c b/t/unit-tests/t-hashmap.c
index 09a48c2c4e..83b79dff39 100644
--- a/t/unit-tests/t-hashmap.c
+++ b/t/unit-tests/t-hashmap.c
@@ -322,7 +322,7 @@ static void t_alloc(struct hashmap *map, unsigned int ignore_case)
free(removed);
}
-static void t_intern(struct hashmap *map, unsigned int ignore_case)
+static void t_intern(void)
{
const char *values[] = { "value1", "Value1", "value2", "value2" };
@@ -356,6 +356,6 @@ int cmd_main(int argc UNUSED, const char **argv UNUSED)
TEST(setup(t_iterate, 0), "iterate works");
TEST(setup(t_iterate, 1), "iterate (case insensitive) works");
TEST(setup(t_alloc, 0), "grow / shrink works");
- TEST(setup(t_intern, 0), "string interning works");
+ TEST(t_intern(), "string interning works");
return test_done();
}
Thanks.
next prev parent reply other threads:[~2024-08-17 14:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-17 8:21 [PATCH 0/15] marking some more unused parameters Jeff King
2024-08-17 8:21 ` [PATCH 01/15] imap-send: mark unused parameter in ssl_socket_connect() fallback Jeff King
2024-08-17 8:21 ` [PATCH 02/15] update-ref: mark more unused parameters in parser callbacks Jeff King
2024-08-17 8:22 ` [PATCH 03/15] refs: mark unused parameters in ref_store fsck callbacks Jeff King
2024-08-17 8:22 ` [PATCH 04/15] refs: mark unused parameters in do_for_each_reflog_helper() Jeff King
2024-08-17 8:22 ` [PATCH 05/15] oss-fuzz: mark unused argv/argc argument Jeff King
2024-08-17 8:22 ` [PATCH 06/15] t/helper: mark more unused argv/argc arguments Jeff King
2024-08-17 8:23 ` [PATCH 07/15] unit-tests: ignore unused argc/argv Jeff King
2024-08-17 8:23 ` [PATCH 08/15] reftable: ignore unused argc/argv in test functions Jeff King
2024-08-17 8:24 ` [PATCH 09/15] reftable: drop obsolete test function declarations Jeff King
2024-08-17 8:24 ` [PATCH 10/15] reftable: mark unused parameters in virtual functions Jeff King
2024-08-17 8:24 ` [PATCH 11/15] t-hashmap: mark unused parameters in callback function Jeff King
2024-08-17 14:32 ` Ghanshyam Thakkar [this message]
2024-08-17 17:18 ` Jeff King
2024-08-17 8:25 ` [PATCH 12/15] test-mergesort: mark unused parameters in trivial callback Jeff King
2024-08-17 8:25 ` [PATCH 13/15] setup: mark unused parameter in config callback Jeff King
2024-08-17 8:25 ` [PATCH 14/15] daemon: mark unused parameters in non-posix fallbacks Jeff King
2024-08-17 8:25 ` [PATCH 15/15] scalar: mark unused parameters in dummy function Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D3I9DJRMAQD4.UIBX5HG0XYL2@gmail.com \
--to=shyamthakkar001@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.