Thread (40 messages) flat view 40 messages, 12 authors, 2016-06-15

Re: What's cooking in git.git (topics)

From: Brian Downing <hidden>
Date: 2016-06-15 22:43:56

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help