On Mon, Apr 30, 2018 at 07:49:20PM -0300, Gleydson Soares wrote: > hi, > > following diff defines nitems locally and stop > including <sys/param.h>
Has this been done elsewhere in the tree? Is this the new paradigm we will be adopting? I don't have a strong opinion one way or the other, just want to be consistent. -ml > Index: control.c > =================================================================== > RCS file: /cvs/src/usr.sbin/vmd/control.c,v > retrieving revision 1.22 > diff -u -p -r1.22 control.c > --- control.c 8 Sep 2017 06:24:31 -0000 1.22 > +++ control.c 30 Apr 2018 22:45:22 -0000 > @@ -17,7 +17,6 @@ > * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > */ > > -#include <sys/param.h> /* nitems */ > #include <sys/queue.h> > #include <sys/stat.h> > #include <sys/socket.h> > Index: priv.c > =================================================================== > RCS file: /cvs/src/usr.sbin/vmd/priv.c,v > retrieving revision 1.13 > diff -u -p -r1.13 priv.c > --- priv.c 11 Nov 2017 02:50:07 -0000 1.13 > +++ priv.c 30 Apr 2018 22:45:22 -0000 > @@ -16,7 +16,6 @@ > * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > */ > > -#include <sys/param.h> /* nitems */ > #include <sys/queue.h> > #include <sys/stat.h> > #include <sys/socket.h> > Index: vmd.c > =================================================================== > RCS file: /cvs/src/usr.sbin/vmd/vmd.c,v > retrieving revision 1.84 > diff -u -p -r1.84 vmd.c > --- vmd.c 25 Apr 2018 15:49:48 -0000 1.84 > +++ vmd.c 30 Apr 2018 22:45:22 -0000 > @@ -16,7 +16,6 @@ > * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > */ > > -#include <sys/param.h> /* nitems */ > #include <sys/queue.h> > #include <sys/wait.h> > #include <sys/cdefs.h> > Index: vmd.h > =================================================================== > RCS file: /cvs/src/usr.sbin/vmd/vmd.h,v > retrieving revision 1.68 > diff -u -p -r1.68 vmd.h > --- vmd.h 27 Apr 2018 12:15:10 -0000 1.68 > +++ vmd.h 30 Apr 2018 22:45:22 -0000 > @@ -35,6 +35,10 @@ > #ifndef VMD_H > #define VMD_H > > +#ifndef nitems > +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) > +#endif > + > #define SET(_v, _m) ((_v) |= (_m)) > #define CLR(_v, _m) ((_v) &= ~(_m)) > #define ISSET(_v, _m) ((_v) & (_m)) > Index: vmm.c > =================================================================== > RCS file: /cvs/src/usr.sbin/vmd/vmm.c,v > retrieving revision 1.81 > diff -u -p -r1.81 vmm.c > --- vmm.c 13 Apr 2018 17:12:44 -0000 1.81 > +++ vmm.c 30 Apr 2018 22:45:22 -0000 > @@ -16,7 +16,6 @@ > * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > */ > > -#include <sys/param.h> /* nitems */ > #include <sys/ioctl.h> > #include <sys/queue.h> > #include <sys/wait.h>