git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/5] ref-filter: add new formatting options

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2019, 18:17 UTC
Message-ID
<xmqqpnt42x7s.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAL21Bm=stCR8-yJ-eh396veQ2kAoGwLX5ci_T0N-6femAwk4jA@mail.gmail.com>
Оля Тележная  <olyatelezhnaya@gmail.com> writes:
> Just fixed 1 cast from (intmax_t) to (uintmax_t).
Thanks.

As the previous one already is in 'next', let's queue this on top of it instead.

-- >8 --
Subject: [PATCH] ref-filter: give uintmax_t to format with %PRIuMAX

As long as we are casting to a wider type, we should cast to the one with the correct signed-ness.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 ref-filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ref-filter.c b/ref-filter.c
index d8d3718abb..b22cab133e 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("%"PRIuMAX, (intmax_t)oi->disk_size);
+			v->s = xstrfmt("%"PRIuMAX, (uintmax_t)oi->disk_size);
 		} else if (!strcmp(name, "objectsize")) {
 			v->value = oi->size;
 			v->s = xstrfmt("%lu", oi->size);
-- 
2.20.1-98-gecbdaf0899
Previous: Olga Telezhnaya
Message 10 of 10 in “ref-filter: add new formatting options”
  1. 0/5 ref-filter: add new formatting optionsОля Тележная, Nov 9, 2018
  2. 0/5 ref-filter: add new formatting optionsОля Тележная, Dec 24, 2018
  3. Оля ТележнаяJan 10, 2019
  4. 1/6 ref-filter: add objectsize:disk optionOlga Telezhnaya, Jan 10, 2019
  5. 5/6 ref-filter: add tests for deltabaseOlga Telezhnaya, Jan 10, 2019
  6. 4/6 ref-filter: add deltabase optionOlga Telezhnaya, Jan 10, 2019
  7. 2/6 ref-filter: add check for negative file sizeOlga Telezhnaya, Jan 10, 2019
  8. 6/6 ref-filter: add docs for new optionsOlga Telezhnaya, Jan 10, 2019
  9. 3/6 ref-filter: add tests for objectsize:diskOlga Telezhnaya, Jan 10, 2019
  10. Junio C HamanoJan 10, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.