On Wed, Jul 13, 2011 at 04:08:14PM -0400, Jeff King wrote:
I have to say, though, between the alignment issues and the strict
aliasing, I am tempted to scrap this whole approach and just use macros
to define the few functions we need. It's not like these containers are
heterogenous, or that we have a ton of types. Right now we want to map
"void *" and "uint32_t". In the future, I'd like to map a 20-byte sha1.
So here's what that would look like (at least the decorate part).
Doing macro meta-programming like this makes me feel a little dirty, but
I actually think the result is more readable.
[1/3]: implement generic key/value map
[2/3]: fast-export: use object to uint32 map instead of "decorate"
[3/3]: decorate: use "map" for the underlying implementation
What do you think?
-Peff