Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 2004 16:32:37 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Peter Wemm <peter@wemm.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: dev_t / udev_t confusion ?
Message-ID:  <20040610161500.G7696@gamplex.bde.org>
In-Reply-To: <200406091637.00032.peter@wemm.org>
References:  <55790.1086796559@critter.freebsd.dk> <200406091637.00032.peter@wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 9 Jun 2004, Peter Wemm wrote:

> On Wednesday 09 June 2004 08:55 am, Poul-Henning Kamp wrote:
> > In message <53993.1086779790@critter.freebsd.dk>, Poul-Henning Kamp
> writes:
> > >The change proposed is more or less to do:
> > >	s/dev_t/struct cdev */
> > >	s/udev_t/dev_t/
> > >over all the kernel sources (366 files or so).
> >
> > Looks like a "yea" so far, so I have a couple of follow-up questions:
>
> I had a slight preference for 'kdev_t *' in the kernel, but 'struct cdev
> *' works for me as well so I've changed my mind.  No objection from me
> then.

This would be a large style bug (more of a design error, but not doing it
is documented in style(9)):

%%%
STYLE(9)               FreeBSD Kernel Developer's Manual              STYLE(9)

NAME
     style -- kernel source file style guide
...
     Avoid using typedefs for structure types.  Typedefs are problematic
     because they do not properly hide their underlying type; for example you
     need to know if the typedef is the structure itself or a pointer to the
     structure.  In addition they must be declared exactly once, whereas an
     incomplete structure type can be mentioned as many times as necessary.
     Typedefs are difficult to use in stand-alone header files: the header
     that defines the typedef must be included before the header that uses it,
     or by the header that uses it (which causes namespace pollution), or
     there must be a back-door mechanism for obtaining the typedef.
%%%

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040610161500.G7696>