On Sun, 2009-05-31 at 21:00 -0700, David Brownell wrote:
> On Sunday 31 May 2009, Michael Bruck wrote:
> > and I imagined how much worse that that would get once we mix in
> > struct and enum.
> 
> Heck, I imagined how much *better* it would be, especially
> if the whitespace/layout bugs got fixed.  ;)

Amen.  The unreadability of code like that quoted has little to do with
the use of struct keywords.

On a related note, I am in favor of using typedef with enum types --
just not with structs.  In other words, I prefer:

typedef enum {
        ...
} name_t;

This difference stems from the simple fact that enum types are mostly
referenced by value; there, the code will be forced to have the full
definition of the type anyway.

In contrast, most structures are referenced by pointer, where the size
of the underlying type does not matter.

Cheers,

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

Reply via email to