From owner-freebsd-arch Wed Sep 4 9:53:53 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E69E37B400 for ; Wed, 4 Sep 2002 09:53:48 -0700 (PDT) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9803D43E6A for ; Wed, 4 Sep 2002 09:53:47 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 7183 invoked from network); 4 Sep 2002 16:53:35 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 4 Sep 2002 16:53:35 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.5/8.12.5) with ESMTP id g84GrYBv008141; Wed, 4 Sep 2002 12:53:34 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020904162711.GO73747@elvis.mu.org> Date: Wed, 04 Sep 2002 12:53:34 -0400 (EDT) From: John Baldwin To: Alfred Perlstein Subject: Re: Process/thread states. Cc: arch@FreeBSD.ORG, Bruce Evans , Julian Elischer Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 04-Sep-2002 Alfred Perlstein wrote: > * Julian Elischer [020904 09:20] wrote: >> >> >> On Wed, 4 Sep 2002, Bruce Evans wrote: >> >> > >> > I'd rather see (td->td_state == TDS_RUNNING). Only very lay readers don't >> > want to know anything about the details hidden by the macro. >> >> Assembler would be the ultimate in that direction.. > > I have to agree with Julian on this one, it's really annoying when > we have bugs just because someone forgot that not only is > foo->flags == SOMETHING, but that foo->enum is SOMETHINGELSE. > > Since the macros will be pretty simple for the most part and the > compiler is somewhat smart about constant folding let's do it the > way that Julian suggested. OK. I GUESS NOW I NEED TO TURN ON MY CAPS LOCK AND USE MACROS EVERYTIME I WANT TO CHECK A VARIABLE. if (FOO_BAR_FLAG_IS_SET(f) { PRINT_OUT_INT(FOO_BAZ_FIELD(foo)); PRINT_OUT_STRING(FOO_DESC_FIELD(FOO)); } Yes, that is _much_ better than: if (f->f_flag & FOO_BAR != 0) printf("%d%s", f->f_baz, f->f_desc); -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message