- cast ident argument because it is usually an fd (signed) and generates

conversion to unsigned warnings.
While here:
- name the macro parameters with meaningful names
- rename the internal inline function as _FOO instead of FOO_ because there
  is no other FOO_ name in the system headers.
This commit is contained in:
christos 2017-06-14 16:37:05 +00:00
parent c0e1dc2a73
commit b135ddeb66
1 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: event.h,v 1.28 2017/06/02 19:44:06 kamil Exp $ */
/* $NetBSD: event.h,v 1.29 2017/06/14 16:37:05 christos Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@ -54,12 +54,13 @@ struct kevent {
intptr_t udata; /* opaque user data identifier */
};
#define EV_SET(kevp, a, b, c, d, e, f) \
EV_SET_((kevp), (a), (b), (c), (d), (e), __CAST(intptr_t, (f)))
#define EV_SET(kevp, ident, filter, flags, fflags, data, udata) \
_EV_SET((kevp), __CAST(uintptr_t, (ident)), (filter), (flags), \
(fflags), (data), __CAST(intptr_t, (udata)))
static __inline void
EV_SET_(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
uint32_t _flags, uint32_t _fflags, int64_t _data, intptr_t _udata)
_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
uint32_t _flags, uint32_t _fflags, int64_t _data, intptr_t _udata)
{
_kevp->ident = _ident;
_kevp->filter = _filter;