On Sun, 2009-05-31 at 12:15 -0400, Duane Ellis wrote:
> zach> Move definition of 'struct target_type_s' into new 'target_type.h' 
> file.
> 
> Hmm,
> 
> why would this not be in:  
> 
>       #include <openocd/_types_.h>

Why put it in its own file?  Encapsulation, that's why.

> Or something like that, I specifically mean a file with a bunch of forward 
> structure definitions, really simple - the file would not have 'structure 
> contents' - only the names. 
> 
> ie: Something as little and as simple as this:
> 
>       struct foobar_s;
>       typedef struct foobar_s foobar_t;
> 
> That "forward decoration types header file" would in it self be very helpful. 
> "target_types.h" is no better then "target.h"

You want to expose every struct name to every module?  No thanks.

If you need help finding structures, use the Doxygen manual.  Oh, but
wait... there are virtually twice as many of these types as there could
be, because these typedefs are effectively redundant and serve to
clutter up the namespace.  They detract from the code and documentation
and should be removed completely.

> Reasoning: 90% of the time, all that is really needed/used is a *POINTER* to 
> the structure.

We would not need such forward declarations if if we used the 'struct
foo_s *' form instead of the typedefs.

For example, I have a patch to remove the jtag_tap_t forward declaration
from types.h and another to remove the jtag_tap_t symbol completely.
These will hit the list shortly.

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

Reply via email to