Re: [PATCH 4/5] grep: Colorize filename, line number, and separator
On Sat, Feb 27, 2010 at 12:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
>
>>> - opt->output(opt, bol + match.rm_so,
>>> - (int)(match.rm_eo - match.rm_so));
>>
>> The third parameter of output_color() (and of ->output(), so you didn't
>> introduce this, of course) is a size_t, so why cast to int? Is a cast
>> needed at all?
>
> I don't think so.
>
> Earlier in 747a322 (grep: cast printf %.*s "precision" argument explicitly
> to int, 2009-03-08), I casted the difference between two regoff_t you were
> feeding to printf's "%.*s" as a length, introduced by 7e8f59d (grep: color
> patterns in output, 2009-03-07), and 5b594f4 (Threaded grep, 2010-01-25)
> carried that cast over without thinking.
Ok. I'll remove the cast. Should I note this in the commit message?