Re: [PATCH 5/8] Remove __P and convert to ANSI prototypes.
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On Feb 1 07:48, Sebastian Huber wrote: > On 31/01/2019 20:52, Corinna Vinschen wrote: > > On Jan 31 12:05, Craig Howland wrote: > > > On 1/31/19 8:05 AM, Sebastian Huber wrote: > > > > From: obrien<[email protected]> > > > > > > > > * Remove 'register'. (some functions had 7+ register functions...) > > > > * Fix SCM ID's. > > > > --- > > > > newlib/libc/posix/scandir.c | 15 ++++++--------- > > > > 1 file changed, 6 insertions(+), 9 deletions(-) > > > > > > > > diff --git a/newlib/libc/posix/scandir.c b/newlib/libc/posix/scandir.c > > > > index 97a16cf7b..8404cd0de 100644 > > > > --- a/newlib/libc/posix/scandir.c > > > > +++ b/newlib/libc/posix/scandir.c > > > > @@ -33,6 +33,7 @@ > > > > #include <sys/cdefs.h> > > > > __SCCSID("@(#)scandir.c 8.3 (Berkeley) 1/2/94"); > > > > +__FBSDID("$FreeBSD$"); > > > > /* > > > > * Scan the directory dirname calling select to make a list of selected > > > > @@ -64,18 +65,14 @@ __SCCSID("@(#)scandir.c 8.3 (Berkeley) 1/2/94"); > > > > (offsetof (struct dirent, d_name) + ((strlen((dp)->d_name)+1 + 3) &~ 3)) > > > > #endif > > > > -#ifndef __P > > > > -#define __P(args) () > > > > -#endif > > > > int > > > > -scandir (const char *dirname, > > > > - struct dirent ***namelist, > > > > - int (*select) __P((const struct dirent *)), > > > > - int (*dcomp) __P((const struct dirent **, const struct dirent **))) > > > > +scandir(const char *dirname, struct dirent ***namelist, > > > > + int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, > > > > + const struct dirent **)) > > > > { > > > > - register struct dirent *d, *p, **names; > > > > - register size_t nitems; > > > > + struct dirent *d, *p, **names; > > > > + size_t nitems; > > > > struct stat stb; > > > > long arraysz; > > > > DIR *dirp; > > > Why? This seems a step backwards, as the coder is giving a > > > recommendation to the compiler, presumably based on the coder's knowledge of > > > [...] > > I expect the compiler to use them wisely. > > I don't really care about the register keyword. I will remove this part of > the patch. > > What about the __P removal? Looks good. Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxUDMIACgkQ9TYGna5E T6DmaxAAlYHuMM1gaIH6V9wwVSNdgOVrdGEFGE66h3Hkqa2VevIOj1dodUFC7qXh g5x5POn26q8geBYkZQXV3H9MYR4lR5qcIvqb3sPKROmmiaTy9RJvqWKQ5ZAM77u3 7d8EOmta5073yOBFiCDeSmNrLCToz9potalectYXjGT7NZmyWzbeiklbEaeYa7th bbm83IQ71XW6CAm+hlHFcdvSK392HHPuQXxzf1f217x8da2UVwVFxDW5wLzOs/xc Hdh100x6QOdcWo9im22ciZqyoFlehKI5b7xftOf7JW7oFiwA9BjSQZePoSniyZmq babtmWwfJW/WzDR67x/RUmRt723ohymKcWzyrUt4XDqsCpRjIgGVfinI0TBGRoNc Ls1MbGxmSEvXZDYXGt6V9T8z7bQKHKjkvTUZDQOTZQfVMaknapY6vA4k50bSisQH T31iLWX8HpDvlR0Ty0mkEfSYPkTkpbjXYoA2DLy6wqJhnzoBNZQrTiWr9xYrEyS9 brsOnuQbctnlo78IV5AFiYuMW4E9lwvnQbjZJYL59hTrW234Es6hCciJ/qkjdO8I O+XMkQhKHcQzrZ3wl/lm91CRfIBBNKkeVLCQ4QowO2cjPO07DLmH1RwJTlfe1vGa lFUCM2+mntFsCVWyeVRUIHF9twkpna0z623T9+2sb8oghyQ8hks= =GxpQ -----END PGP SIGNATURE-----