From: Brian Downing Date: Tue, 04 Dec 2007 16:18:51 GMT Subject: Re: What's cooking in git.git (topics) Message-ID: <20071204161850.GW6212@lavos.net> In-Reply-To: <7vzlwv6sxr.fsf@gitster.siamese.dyndns.org> On Fri, Nov 30, 2007 at 06:37:52PM -0800, Junio C Hamano wrote: > * jc/api-doc (Sat Nov 24 23:48:04 2007 -0800) 1 commit > - Start preparing the API documents. > > The primary reason of this series is because I think we made the system > a lot less approachable by losing hackability. Although we still have > sample scripts in contrib/example for use of plumbing in scripts, they > will not help aspiring git-hacker-wannabees when our primary attention > has already shifted to moving things to C. > > This currently consists of mostly stubs, although I wrote about a few > topics as examples. One comment on this: +sometype *ary; +int nr; +int alloc + +for (i = 0; i < nr; i++) + if (you like ary[i]) + return; +/* you did not like any existing one, so add one */ +ALLOC_GROW(ary, nr+1, alloc); +ary[nr++] = value you like; Shouldn't we be encouraging the use of size_t here? I don't know of a 64-bit platform off hand that has an 'int' that's actually 64 bits, so encouraging this just seems like asking for 64-bit platform limitations when arrays get over 2GB. (Looking through the code it looks like there's a fair bit of using 'int' for array indices already, but I think it's probably best not to perpetuate that.) -bcd