On Monday 11 May 2009, Øyvind Harboe wrote:
> I'm using a single callback function prototype w/4 arguments. Sometime
> an argument is an "int"'s other times a pointer,

Ugly...

If it has to be a pointer sometimes, make it *always* a pointer.
You can generally convert int->pointer without losing bits, but
the reverse will easily lose bits.


> so I could either go with a union or these fancy games.

How about using a design that doesn't rely on type punning?

It'll be more clear to read/understand, and less fragile for
folk using "other" systems (e.g. 64-bit) and for developers.


_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to