From owner-svn-src-head@FreeBSD.ORG Thu Aug 12 17:45:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1209106564A; Thu, 12 Aug 2010 17:45:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0A48FC22; Thu, 12 Aug 2010 17:45:57 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 200DF46B37; Thu, 12 Aug 2010 13:45:57 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (75-48-78-116.lightspeed.cncrca.sbcglobal.net [75.48.78.116]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9A3C08A04E; Thu, 12 Aug 2010 13:45:55 -0400 (EDT) Message-ID: <4C643352.5010508@FreeBSD.org> Date: Thu, 12 Aug 2010 13:45:54 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201008121358.o7CDwk0d098768@svn.freebsd.org> <86pqxn50vr.fsf@ds4.des.no> <4C6414A7.6020306@FreeBSD.org> <868w4bda7e.fsf@ds4.des.no> In-Reply-To: <868w4bda7e.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 12 Aug 2010 13:45:56 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_DYNAMIC autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Takanori Watanabe , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211221 - head/usr.sbin/acpi/acpidump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 17:45:57 -0000 Dag-Erling Smørgrav wrote: > John Baldwin writes: >> Dag-Erling Smørgrav writes: >>> Slightly better: >>> >>> printf("\tClass %u Base Address 0x%jx Length %ju\n\n", >>> (unsigned int)tcpa->platform_class, (uintmax_t)paddr, (uintmax_t)len); >>> >>> but it would probably be easier to define paddr and len as unsigned long >>> long instead of the misspelled u_int64_t, and use %llx and %llu. >> Depends. If the table defines a field to be a 64-bit integer, it is >> better to use an explicitly-64-bit integer type such as uint64_t >> rather than assuming that 'long long' is 64-bit. > > Actually, paddr and len are a memory address and an object size, > respectively, so the logical thing would be to use uintptr_t and size_t > with uintmax_t casts... Except that physical addresses do not always fit in uintptr_t on i386 (think PAE with 36-bit physical addresses and 32-bit uintptr_t, same for the length). If they truly were a size_t you could use %z without a uintmax_t cast. -- John Baldwin