From: Kian Kasad <kian@kasad.com>
To: cgit@lists.zx2c4.com
Cc: Alexander Pickering <alex@cogarr.net>
Subject: Re: Typo introduced #2f50b47
Date: Sat, 3 Aug 2024 20:01:57 -0700 [thread overview]
Message-ID: <1BAC615F-471C-42B2-AABF-32A8D0A4F758@kasad.com> (raw)
In-Reply-To: <b3aa8a4c-57c0-4e91-b6a5-688a66fbf401@cogarr.net>
> On Aug 3, 2024, at 14:52, Alexander Pickering <alex@cogarr.net> wrote:
>
> ../scan-tree.c:57:65: error: parameter name omitted
> 57 | ic int gitconfig_config(const char *key, const char *value,
> const struct config_context *, void *cb)
>
> I think this line
>
> static int gitconfig_config(const char *key, const char *value, const struct config_context *, void *cb)
>
> should be
>
> static int gitconfig_config(const char *key, const char *value, void *cb)
I agree that that’s a mistake, but I disagree with your suggested change.
The gitconfig_config() function is passed as the first argument to the
git_config_from_file() function which is defined in git/config.c. That function
expects the first argument to be of type config_fn_t, which does have the
context argument. This is why it was added to gitconfig_config(). Therefore, the
proper solution is to just give that argument a name, as removing it completely
could cause further errors:
static int gitconfig_config(const char *key, const char *value, const struct config_context *UNUSED, void *cb)
Git seems to use the name “UNUSED” which is why I have followed suit here.
--
Kian Kasad
kian@kasad.com <mailto:kian@kasad.com>
(925) 871-9823 <tel:+19258719823>
next prev parent reply other threads:[~2024-08-04 3:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-03 21:52 Alexander Pickering
2024-08-04 3:01 ` Kian Kasad [this message]
2024-08-04 3:18 ` [PATCH] Fix error caused by missing parameter name Kian Kasad
2024-08-04 6:17 ` Денис Пронин
2024-08-04 18:43 ` [PATCH v2] " Kian Kasad
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=1BAC615F-471C-42B2-AABF-32A8D0A4F758@kasad.com \
--to=kian@kasad.com \
--cc=alex@cogarr.net \
--cc=cgit@lists.zx2c4.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).