Thread (14 messages) flat view 14 messages, 3 authors, 2016-06-15

Re: [PATCH 2/2] cache patch ids on disk

From: Jeff King <hidden>
Date: 2016-06-15 22:51:45

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