On Feb 27 2004, Andras Erdei wrote:
> On Thu, 26 Feb 2004 12:21:52 +0100 (MET), Szakacsits Szabolcs =3D
> <sz...@si...> wrote:
> >> > int stoucs( uchar_t * dst, char const * src, int size )
> >
[snip]
> all i found was /usr/src/linux/Documentation/CodingStyle
> but that does not contain anything about * or const:
>=20
> >Code can easily end up in the kernel in the future. The most often used
> >way is this (consider spacing and 'const char' order):
> >
> >=09int stoucs(uchar_t *dst, const char *src, int size)
>=20
> [i'm happy with whatever way of writing const (the compiler
> will spit it out in error messages my way anyways :O), but
> i need the doc to know how i should do things]
I don't think there is a document about such things but my belief has=20
always been that
const char *
and
char const *
and
char *const
are all different things depending on whether the pointer is const or the=
=20
referenced memory but maybe I have been wrong all along...
Anyway, normally I would write the qualified "const" first, then the rest,=
=20
so I would write
const char c;
const char *p;
const int i[20];
etc... as that is how it is usually done in the kernel.
Best regards,
Anton
--=20
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|