* [PATCH 0/1] Fix Windows build of next
@ 2018-11-22 12:00 Johannes Schindelin via GitGitGadget
2018-11-22 12:01 ` [PATCH 1/1] ref-filter: replace unportable `%lld` format Johannes Schindelin via GitGitGadget
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-11-22 12:00 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
The topic ot/ref-filter-object-info broke the Windows build since it entered
pu, and as a consequence we have no test coverage of the other topics in pu.
Sadly, this topic now advanced to next. Junio, I would like to ask you to
merge this fix down to next and to advance to master together with
ot/ref-filter-object-info.
Johannes Schindelin (1):
ref-filter: replace unportable `%lld` format
ref-filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: d364d6b33e15dbc6e57d83f9f1457a8e8fe77046
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-87%2Fdscho%2Fno-percent-lld-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-87/dscho/no-percent-lld-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/87
--
gitgitgadget
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] ref-filter: replace unportable `%lld` format
2018-11-22 12:00 [PATCH 0/1] Fix Windows build of next Johannes Schindelin via GitGitGadget
@ 2018-11-22 12:01 ` Johannes Schindelin via GitGitGadget
2018-11-24 2:53 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-11-22 12:01 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
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.
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);
--
gitgitgadget
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] ref-filter: replace unportable `%lld` format
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
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2018-11-24 2:53 UTC (permalink / raw)
To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin
"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);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-24 2:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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).