From owner-svn-src-head@FreeBSD.ORG Mon Oct 10 15:15:02 2011 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 6198F1065670; Mon, 10 Oct 2011 15:15:02 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 149138FC15; Mon, 10 Oct 2011 15:15:01 +0000 (UTC) Received: from a91-153-123-205.elisa-laajakaista.fi (a91-153-123-205.elisa-laajakaista.fi [91.153.123.205]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 35F7C2169A1; Mon, 10 Oct 2011 17:56:43 +0300 (EEST) Date: Mon, 10 Oct 2011 17:56:43 +0300 From: Jaakko Heinonen To: Dag-Erling Smorgrav Message-ID: <20111010145642.GA2057@a91-153-123-205.elisa-laajakaista.fi> References: <201110081221.p98CLpWq062285@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201110081221.p98CLpWq062285@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226151 - head/usr.bin/kdump 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: Mon, 10 Oct 2011 15:15:02 -0000 Hi, On 2011-10-08, Dag-Erling Smorgrav wrote: > Fix casting. > > Modified: head/usr.bin/kdump/kdump.c > ============================================================================== > --- head/usr.bin/kdump/kdump.c Sat Oct 8 12:10:16 2011 (r226150) > +++ head/usr.bin/kdump/kdump.c Sat Oct 8 12:21:51 2011 (r226151) > @@ -110,15 +110,16 @@ struct ktr_header ktr_header; > #define TIME_FORMAT "%b %e %T %Y" > #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) > > -#define print_number(i,n,c) do { \ > - if (decimal) \ > - printf("%c%ld", c, (long)*i); \ > - else \ > - printf("%c%#lx", c, (long)*i); \ > - i++; \ > - n--; \ > - c = ','; \ > - } while (0); > +#define print_number(i,n,c) \ > + do { \ > + if (decimal) \ > + printf("%c%jd", c, (intmax_t)*i); \ > + else \ > + printf("%c%#jx", c, (intmax_t)*i); \ > + i++; \ > + n--; \ > + c = ','; \ > + } while (0) Are you sure that this change doesn't cause a regression on platforms where sizeof(long) != sizeof(intmax_t)? For example, previously, on i386 print_number() printed "0xffffffff" for -1 while after your change it will print "0xffffffffffffffff" (with %#jx). -- Jaakko