Re: Fwd: [RFC] SGI O2 MACE audio ALSA module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 6 Jul 2007, TJ wrote:
> I can see the case against other uses of typedef, but I really do not
> see why typedef struct is so bad. seeing 'struct mything_s *foo;'
> doesn't really tell you anything more about foo then 'mything_t *foo;'
> does. If a typedef was something other then a struct then I would want
> it to have an obvious name that said such, eg 'u64'. (I really don't
> like 'size_t')

You can have simple forward declarations for structs:

    struct mystruct;

    extern void myfunc(struct mystruct *p);

while you need the full struct definition for typedefs:

    typedef struct mystruct {
	int myfield;
    } mytype_t;

    extern void myfunc(mytype_t *p);

I.e. more (possibly circular) include dependencies.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux