From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH 1/1] ref-filter: replace unportable `%lld` format
Date: Sat, 24 Nov 2018 11:53:31 +0900 [thread overview]
Message-ID: <xmqqsgzr2nkk.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <617f1e7b084ff95f4cc7c5a4b7b70b9a5c0d1af1.1542888057.git.gitgitgadget@gmail.com> (Johannes Schindelin via GitGitGadget's message of "Thu, 22 Nov 2018 04:01:00 -0800 (PST)")
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The `%lld` format is supported on Linux and macOS, but not on Windows.
> This issue has been reported ten days ago (Message-ID:
> nycvar.QRO.7.76.6.1811121300520.39@tvgsbejvaqbjf.bet), but the
> corresponding topic still advanced to `next` in the meantime, breaking
> the Windows build.
>
> Let's use `PRIdMAX` and a cast to `intmax_t` instead, which unbreaks the
> build, and imitates how we do things e.g. in `json-writer.c` already.
We seem to be already using PRIdMAX in 'master', so this is safe
thing to do and I will merge it directly to 'next', but the fact
that PRIdMAX is used without any fallback definition in
git-compat-util.h makes me suspect that we can now drop the fallback
for PRIuMAX.
Thanks.
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> ref-filter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ref-filter.c b/ref-filter.c
> index 3cfe01a039..69cdf2dbb5 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -897,7 +897,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_
> v->s = xstrdup(type_name(oi->type));
> else if (!strcmp(name, "objectsize:disk")) {
> v->value = oi->disk_size;
> - v->s = xstrfmt("%lld", (long long)oi->disk_size);
> + v->s = xstrfmt("%"PRIdMAX, (intmax_t)oi->disk_size);
> } else if (!strcmp(name, "objectsize")) {
> v->value = oi->size;
> v->s = xstrfmt("%lu", oi->size);
prev parent reply other threads:[~2018-11-24 2:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 12:00 [PATCH 0/1] Fix Windows build of next Johannes Schindelin via GitGitGadget
2018-11-22 12:01 ` [PATCH 1/1] ref-filter: replace unportable `%lld` format Johannes Schindelin via GitGitGadget
2018-11-24 2:53 ` Junio C Hamano [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqsgzr2nkk.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=johannes.schindelin@gmx.de \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).