{"thread":{"id":"49882","subject":"[PATCH 0/1] Fix Windows build of next","startedAt":"2018-11-22T12:01:02Z","lastAt":"2018-11-24T02:55:14Z","messageCount":3,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"363881","messageId":"pull.87.git.gitgitgadget@gmail.com","threadId":"49882","inReplyTo":null,"subject":"[PATCH 0/1] Fix Windows build of next","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-11-22T12:00:58Z","receivedAt":"2018-11-22T12:01:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The topic ot/ref-filter-object-info broke the Windows build since it entered \npu, and as a consequence we have no test coverage of the other topics in pu.\n\nSadly, this topic now advanced to next. Junio, I would like to ask you to\nmerge this fix down to next and to advance to master together with \not/ref-filter-object-info.\n\nJohannes Schindelin (1):\n  ref-filter: replace unportable `%lld` format\n\n ref-filter.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: d364d6b33e15dbc6e57d83f9f1457a8e8fe77046\nPublished-As: https://github.com/gitgitgadget/git/releases/tags/pr-87%2Fdscho%2Fno-percent-lld-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-87/dscho/no-percent-lld-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/87\n-- \ngitgitgadget\n"},{"id":"363882","messageId":"617f1e7b084ff95f4cc7c5a4b7b70b9a5c0d1af1.1542888057.git.gitgitgadget@gmail.com","threadId":"49882","inReplyTo":"pull.87.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] ref-filter: replace unportable `%lld` format","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-11-22T12:01:00Z","receivedAt":"2018-11-22T12:01:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe `%lld` format is supported on Linux and macOS, but not on Windows.\nThis issue has been reported ten days ago (Message-ID:\nnycvar.QRO.7.76.6.1811121300520.39@tvgsbejvaqbjf.bet), but the\ncorresponding topic still advanced to `next` in the meantime, breaking\nthe Windows build.\n\nLet's use `PRIdMAX` and a cast to `intmax_t` instead, which unbreaks the\nbuild, and imitates how we do things e.g. in `json-writer.c` already.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n ref-filter.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 3cfe01a039..69cdf2dbb5 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -897,7 +897,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_\n \t\t\tv->s = xstrdup(type_name(oi->type));\n \t\telse if (!strcmp(name, \"objectsize:disk\")) {\n \t\t\tv->value = oi->disk_size;\n-\t\t\tv->s = xstrfmt(\"%lld\", (long long)oi->disk_size);\n+\t\t\tv->s = xstrfmt(\"%\"PRIdMAX, (intmax_t)oi->disk_size);\n \t\t} else if (!strcmp(name, \"objectsize\")) {\n \t\t\tv->value = oi->size;\n \t\t\tv->s = xstrfmt(\"%lu\", oi->size);\n-- \ngitgitgadget\n"},{"id":"363985","messageId":"xmqqsgzr2nkk.fsf@gitster-ct.c.googlers.com","threadId":"49882","inReplyTo":"617f1e7b084ff95f4cc7c5a4b7b70b9a5c0d1af1.1542888057.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] ref-filter: replace unportable `%lld` format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-24T02:53:31Z","receivedAt":"2018-11-24T02:55:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> The `%lld` format is supported on Linux and macOS, but not on Windows.\n> This issue has been reported ten days ago (Message-ID:\n> nycvar.QRO.7.76.6.1811121300520.39@tvgsbejvaqbjf.bet), but the\n> corresponding topic still advanced to `next` in the meantime, breaking\n> the Windows build.\n>\n> Let's use `PRIdMAX` and a cast to `intmax_t` instead, which unbreaks the\n> build, and imitates how we do things e.g. in `json-writer.c` already.\n\nWe seem to be already using PRIdMAX in 'master', so this is safe\nthing to do and I will merge it directly to 'next', but the fact\nthat PRIdMAX is used without any fallback definition in\ngit-compat-util.h makes me suspect that we can now drop the fallback\nfor PRIuMAX.\n\nThanks.\n\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  ref-filter.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/ref-filter.c b/ref-filter.c\n> index 3cfe01a039..69cdf2dbb5 100644\n> --- a/ref-filter.c\n> +++ b/ref-filter.c\n> @@ -897,7 +897,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_\n>  \t\t\tv->s = xstrdup(type_name(oi->type));\n>  \t\telse if (!strcmp(name, \"objectsize:disk\")) {\n>  \t\t\tv->value = oi->disk_size;\n> -\t\t\tv->s = xstrfmt(\"%lld\", (long long)oi->disk_size);\n> +\t\t\tv->s = xstrfmt(\"%\"PRIdMAX, (intmax_t)oi->disk_size);\n>  \t\t} else if (!strcmp(name, \"objectsize\")) {\n>  \t\t\tv->value = oi->size;\n>  \t\t\tv->s = xstrfmt(\"%lu\", oi->size);\n"}]}