From owner-freebsd-arch@FreeBSD.ORG Wed Jun 28 09:53:53 2006 Return-Path: X-Original-To: arch@freebsd.org 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 4618516A400 for ; Wed, 28 Jun 2006 09:53:53 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4CFA43D5D for ; Wed, 28 Jun 2006 09:53:52 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 8498B1703F; Wed, 28 Jun 2006 09:53:50 +0000 (UTC) To: Yar Tikhiy From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 28 Jun 2006 13:42:21 +0400." <20060628094221.GA50978@comp.chem.msu.su> Date: Wed, 28 Jun 2006 09:53:46 +0000 Message-ID: <75461.1151488426@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: arch@freebsd.org Subject: Re: SET, CLR, ISSET in types.h for _KERNEL builds X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2006 09:53:53 -0000 In message <20060628094221.GA50978@comp.chem.msu.su>, Yar Tikhiy writes: >On Tue, Jun 27, 2006 at 01:58:17PM -0600, M. Warner Losh wrote: >> NetBSD recently added SET, CLR, ISSET to sys/types.h (only if _KERNEL >> is defined). As one of the people who have worked with the original /bin/sh source code, I have a slight alergic reaction to attempts to paste over the implementation language with macros like these. Setting a bit in 'C' is spelled variable |= bit; not SET(variable, bit); Higher order macros like roundup(), ispow2() are fine with me, because they implement something on top of the language and make the source code more compact and thus faster to read. But all of the three proposed macros take up more space than the native language they obfuscate, what is the sense in that ? If we want to have them for NETBSD compatibility, they should be enclosed in #ifdef NETBSD_COMPAT #endif Or better yet: be put in sys/sys/netbsd_compat.h -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.