From: Junio C Hamano Date: Sat, 27 Feb 2010 17:08:33 GMT Subject: Re: [PATCH 4/5] grep: Colorize filename, line number, and separator Message-ID: <7vy6ie1u9a.fsf@alter.siamese.dyndns.org> In-Reply-To: <4B89079C.8030206@lsrfire.ath.cx> René Scharfe 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.