From owner-freebsd-current Thu Oct 3 19:34:12 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE63837B401 for ; Thu, 3 Oct 2002 19:34:10 -0700 (PDT) Received: from warez.scriptkiddie.org (uswest-dsl-142-38.cortland.com [209.162.142.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51CE443E4A for ; Thu, 3 Oct 2002 19:34:10 -0700 (PDT) (envelope-from lamont@scriptkiddie.org) Received: from [192.168.69.11] (unknown [192.168.69.11]) by warez.scriptkiddie.org (Postfix) with ESMTP id A441762D1A for ; Thu, 3 Oct 2002 19:34:09 -0700 (PDT) Date: Thu, 3 Oct 2002 19:34:09 -0700 (PDT) From: Lamont Granquist To: freebsd-current@freebsd.org Subject: sys/event.h EV_SET macro suggestion Message-ID: <20021003190315.W8258-100000@coredump.scriptkiddie.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'd suggest this: #define EV_SET(kevpin, a, b, c, d, e, f) do { \ struct kevent *kevp = kevpin; \ (kevp)->ident = (a); \ (kevp)->filter = (b); \ (kevp)->flags = (c); \ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f); \ } while(0) As opposed to what it is currently defined as: #define EV_SET(kevp, a, b, c, d, e, f) do { \ (kevp)->ident = (a); \ (kevp)->filter = (b); \ (kevp)->flags = (c); \ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f); \ } while(0) The alternative I'm suggesting will work in the use case: EV_SET(&kev_in[numchanges++], fd, EVFILT_READ, EV_DELETE, 0, 0, 0); Which is probably a common way to try to use the macro, and the existing behavior can certainly catch you off guard... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message