cvs commit: src/usr.sbin/memcontrol memcontrol.c

Eric Anholt anholt at FreeBSD.org
Tue Mar 29 19:10:29 PST 2005


On Tue, 2005-03-29 at 12:28 -0800, David O'Brien wrote:
> On Tue, Mar 29, 2005 at 08:17:47PM +0000, Eric Anholt wrote:
> > anholt      2005-03-29 20:17:47 UTC
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     usr.sbin/memcontrol  memcontrol.c 
> >   Log:
> >   Correct formatting of pointers in the listing by using "0x%" PRIx64 instead of
> >   "%" PRIu64 "x".
> 
> I'd like to tweak this even more:
> 
> +	printf("%#.*" PRIx64 "/%" PRIu64 " %.8s ",
> +	    sizeof mrd[i].mr_base, mrd[i].mr_base, mrd[i].mr_len,
> +	    mrd[i].mr_owner[0] ? mrd[i].mr_owner : "-");
> 
> This gives output like:
> 
> 0x00010000/65536 BIOS write-back fixed-base fixed-length set-by-firmware active 
> 0x00080000/16384 BIOS write-back fixed-base fixed-length set-by-firmware active 
> 
> I think lengths in decimal are more clear, and having addresses lined up
> also makes it easier to read the output.

I like the 0 prepending on the offset, for sure.  I'm ambivalent about
length being decimal (really could go either way).



More information about the cvs-src mailing list