Re: [PATCH v2 1/6] ref-filter: add objectsize:disk option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Olga Telezhnaya <olyatelezhnaya@xxxxxxxxx> writes:

> @@ -880,7 +886,10 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_
>  			name++;
>  		if (!strcmp(name, "objecttype"))
>  			v->s = xstrdup(type_name(oi->type));
> -		else if (!strcmp(name, "objectsize")) {
> +		else if (!strcmp(name, "objectsize:disk")) {
> +			v->value = oi->disk_size;
> +			v->s = xstrfmt("%"PRIuMAX, (intmax_t)oi->disk_size);

Shouldn't this cast the field to (uintmax_t) type, as we'd format
with %PRIuMAX and we know the size on-disk is not negative?

Other than that, looks good.

Let me rewind the tip of 'next' and replace the previous round with
this iteration.

Thanks.

> +		} else if (!strcmp(name, "objectsize")) {
>  			v->value = oi->size;
>  			v->s = xstrfmt("%"PRIuMAX , (uintmax_t)oi->size);
>  		}
>
> --
> https://github.com/git/git/pull/552



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux