Re: [UrJTAG-dev] typedef's

2019-07-31 Thread karl
Karl:
> When trying to understand the urjtag program code, I needed to get 
> definitions of the types used. I many cases typedefs was used for 
> structs and unions, making it unnessesary hard to the understand the 
> type. The worst offenders was in include/urjtag/types.h where the 
> typedefs is in a different file than the actual definition.
...
> removing the line in types.h, and fixing any missing includes.

I see that this isn't feasably right now, since include/urjtag/cable.h
and include/urjtag/parport.h interdepend on each other.

But why should lowlevel drivers like thoose in src/tap/parport know
anything about the cable/dongle attached ?

The idea of having a urj_cable_t *cable in struct URJ_PARPORT might
have been ok once, but *_connect() in src/tap/parport should return
a busy error instead of trying to clean up older state, leaving that
to tap routines.

Regards,
/Karl Hammar




___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


[UrJTAG-dev] typedef's

2019-07-31 Thread karl
When trying to understand the urjtag program code, I needed to get 
definitions of the types used. I many cases typedefs was used for 
structs and unions, making it unnessesary hard to the understand the 
type. The worst offenders was in include/urjtag/types.h where the 
typedefs is in a different file than the actual definition.

Would you accept patches that moves the typedefs close the struct or 
union aliased (except for *_bison.[ch] *_flex.h) ?

I.e. instead of 

 file include/urjtag/types.h
typedef struct URJ_CABLE urj_cable_t;

 file include/urjtag/cable.h
struct URJ_CABLE
{
...
};

change it to:

 file include/urjtag/cable.h
typedef
struct URJ_CABLE
{
...
} urj_cable_t;

or possible

 file include/urjtag/cable.h
typedef struct URJ_CABLE urj_cable_t;
struct URJ_CABLE
{
...
};

removing the line in types.h, and fixing any missing includes.

///

In most if not all cases, the typedefs are completely unnessary,
and removing them would benefit the understanding of the code.

Regards,
/Karl Hammar




___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development