Re: [PATCH 8/5] combine-diff.c: use strbuf_readlink()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2008, 21:34 UTC
- Message-ID
- <7vmyeujxjp.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.00.0812171300070.14014@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 10 quoted lines
> On Wed, 17 Dec 2008, Junio C Hamano wrote: >> - result[len] = 0; >> + result_size = buf.len; >> + result = strbuf_detach(&buf, NULL); > > If result_size was made size_t, this would be > > result = strbuf_detach(&buf, &result_size); > > But whether it makes any difference, I dunno.
Yeah, use of "unsigned long" where "size_t" could be more appropriate stems from the very initial commit e83c516 (Initial revision of "git", the information manager from hell, 2005-04-07) and it is everywhere, and updating them one by one like you suggest would take forever ;-)
Perhaps libgit2 would settle with a better typing system. The original draft by Shawn looked a bit too overengineered in its use of typedefs, but if I recall correctly later revisions were made saner. I haven't checked its current status.