Thread (1 message) 1 message, 1 author, 2019-01-10

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

From: Junio C Hamano <hidden>
Date: 2019-01-10 18:18:05
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Оля Тележная  [off-list ref] 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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help