From owner-freebsd-current@FreeBSD.ORG Sun Aug 2 10:23:21 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8712F1065673 for ; Sun, 2 Aug 2009 10:23:21 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outR.internet-mail-service.net (outr.internet-mail-service.net [216.240.47.241]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6028FC12 for ; Sun, 2 Aug 2009 10:23:21 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 26F95B3F80 for ; Sun, 2 Aug 2009 03:23:21 -0700 (PDT) X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id A477F2D6019 for ; Sun, 2 Aug 2009 03:23:20 -0700 (PDT) Message-ID: <4A75691E.9070401@elischer.org> Date: Sun, 02 Aug 2009 03:23:26 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: FreeBSD Current Content-Type: multipart/mixed; boundary="------------040209070305050406080508" Cc: Subject: possible readability improvement for i386 pcpu macros: X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2009 10:23:21 -0000 This is a multi-part message in MIME format. --------------040209070305050406080508 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit if you have to ever look at the output of the cpp then this removes a number of things you have to puzzle over in the output of PCPU_SET() and friends. I don't know if it applies to the other architectures. --------------040209070305050406080508 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="pcpu2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pcpu2.diff" Index: include/pcpu.h =================================================================== --- include/pcpu.h (revision 196030) +++ include/pcpu.h (working copy) @@ -152,7 +152,7 @@ #define __PCPU_GET(name) __extension__ ({ \ __pcpu_type(name) __res; \ struct __s { \ - u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \ + u_char __b[MIN(sizeof(__res), 4)]; \ } __s; \ \ if (sizeof(__res) == 1 || sizeof(__res) == 2 || \ @@ -174,7 +174,7 @@ #define __PCPU_ADD(name, val) do { \ __pcpu_type(name) __val; \ struct __s { \ - u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \ + u_char __b[MIN(sizeof(__val), 4)]; \ } __s; \ \ __val = (val); \ @@ -217,7 +217,7 @@ #define __PCPU_SET(name, val) { \ __pcpu_type(name) __val; \ struct __s { \ - u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \ + u_char __b[MIN(sizeof(__val), 4)]; \ } __s; \ \ __val = (val); \ --------------040209070305050406080508--