linux-mips
[Top] [All Lists]

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

To: TJ <tj.trevelyan@gmail.com>
Subject: Re: Fwd: [RFC] SGI O2 MACE audio ALSA module
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Fri, 6 Jul 2007 11:01:40 +0200 (CEST)
Cc: "sknauert@wesleyan.edu" <sknauert@wesleyan.edu>, Linux MIPS List <linux-mips@linux-mips.org>
In-reply-to: <6849c8890707060130q79a2890eq51001b18fd21519f@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <6849c8890707020427q47704326od05ebb8241c3cf@mail.gmail.com> <6849c8890707040125x34cb2b0jf7acfabfa0bf351f@mail.gmail.com> <43914.129.133.92.31.1183709449.squirrel@webmail.wesleyan.edu> <6849c8890707060130q79a2890eq51001b18fd21519f@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
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@linux-m68k.org

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

<Prev in Thread] Current Thread [Next in Thread>