Date: Mon, 10 Oct 2011 17:56:43 +0300 From: Jaakko Heinonen <jh@FreeBSD.org> To: Dag-Erling Smorgrav <des@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226151 - head/usr.bin/kdump Message-ID: <20111010145642.GA2057@a91-153-123-205.elisa-laajakaista.fi> In-Reply-To: <201110081221.p98CLpWq062285@svn.freebsd.org> References: <201110081221.p98CLpWq062285@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111010145642.GA2057>