From: Jeff King Date: Thu, 04 Aug 2011 22:52:27 GMT Subject: Re: [PATCH 2/2] cache patch ids on disk Message-ID: <20110804225227.GA28241@sigill.intra.peff.net> In-Reply-To: <20110804224947.GB28215@sigill.intra.peff.net> On Thu, Aug 04, 2011 at 04:49:47PM -0600, Jeff King wrote: > +struct sha1 { > + unsigned char v[20]; > +}; > + > [...] > +DECLARE_MAP(object_sha1, const struct object *, struct sha1) I'm not altogether happy with this. But the generated code wants to treat the value type as something that can be instantiated as "vtype foo", so we need to wrap a struct around an array to make the compiler happy. We could do something a little fancier to avoid this, like separating "this is what it looks like to declare a value" from "this is what a passed value looks like". And then use "unsigned char v[20]" for the former and "unsigned char *" for the latter. -Peff