Re: [dwm] C coding question

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Wed, 10 Oct 2007 18:40:55 +0200

On Wed, Oct 10, 2007 at 06:32:11PM +0200, Sylvain Bertrand wrote:
> 2007/10/10, Anselm R. Garbe <arg_AT_suckless.org>:
> > On Tue, Oct 02, 2007 at 05:49:02PM +0200, Enno Gottox Boland wrote:
> > > That brings me to another style question:
> > >
> > > For me, it is easier to read and to understand when I write linked
> > > structures that way:
> > >
> > > typedef struct Abc {
> > > ...
> > > struct Abc *next;
> > > } Abc;
> > > ...
> > > Abc abc;
> > >
> > > Is there a reason not to do so?
> >
> > I though a while about this, and yes I thing k
> >
> > [...]
> > Client *next;
> > Client *prev;
> > Client *snext;
> > [...]
> >
> > looks less clunky than
> >
> > [...]
> > struct Client *next;
> > struct Client *prev;
> > struct Client *snext;
> > [...]
> >
> > But I agree with you in the general case.
> >
> > Regards,
> > Anselm
> >
> What about that one? :)
> typedef struct client_t client_t;
>
> [...]
> client_t *next;
> client_t *prev;
> client_t *snext;
> [...]

That's how it is done in dwm.c, however I prefer Client to
client_t.

Regards,

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Wed Oct 10 2007 - 18:40:55 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:58:58 UTC