libcaps question

Matthew Dillon dillon at apollo.backplane.com
Sun Dec 14 10:38:43 PST 2003


:Dave Leimbach wrote:
:
:> It really is nothing more than a matter of preference of idiom.
:> 
:> I will just learn to do it your way :).  Thanks for the explanation.
:
:	Alternatively, just do a "typedef struct caps_port _caps_port_t"
:	in your private header file.  OFcourse, this is not something
:	you haven't thought of already I suppose. :-)
:
:	Regards,
:
:	-- Hiten

    Generally speaking I prefer people to use 'struct name' when embedding
    or declaring whole structures rather then pointers.  The reason is that
    this is how it is done in most of the kernel, and it makes the code
    more readable (less confusion over what a typedef type means when you
    see a typedef), because most typedefs are just typedef'ing core integer
    and pointer types and if you start mixing in typedefs which represent
    whole structures it gets real confusing real fast.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list