Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys - cast ident argument because it is usually an fd (s...



details:   https://anonhg.NetBSD.org/src/rev/cae624246db1
branches:  trunk
changeset: 824685:cae624246db1
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jun 14 16:37:05 2017 +0000

description:
- 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.

diffstat:

 sys/sys/event.h |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (27 lines):

diff -r 3b5aa8e33e85 -r cae624246db1 sys/sys/event.h
--- a/sys/sys/event.h   Wed Jun 14 14:17:15 2017 +0000
+++ b/sys/sys/event.h   Wed Jun 14 16:37:05 2017 +0000
@@ -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@localhost>
@@ -54,12 +54,13 @@
        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;



Home | Main Index | Thread Index | Old Index