From owner-cvs-src@FreeBSD.ORG Tue Mar 8 17:05:14 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 191DE16A4CF for ; Tue, 8 Mar 2005 17:05:14 +0000 (GMT) Received: from mail24.sea5.speakeasy.net (mail24.sea5.speakeasy.net [69.17.117.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 978AA43D2F for ; Tue, 8 Mar 2005 17:05:13 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 2072 invoked from network); 8 Mar 2005 17:05:13 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail24.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 8 Mar 2005 17:05:13 -0000 Received: from hydrogen.funkthat.com (tmzebi@localhost.funkthat.com [127.0.0.1])j28H5BGH011089; Tue, 8 Mar 2005 09:05:11 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id j28H5BOn011080; Tue, 8 Mar 2005 09:05:11 -0800 (PST) Date: Tue, 8 Mar 2005 09:05:10 -0800 From: John-Mark Gurney To: Giorgos Keramidas Message-ID: <20050308170510.GM89312@funkthat.com> References: <200503081314.j28DEl3i090934@repoman.freebsd.org> <20050308132021.GA88362@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050308132021.GA88362@orion.daedalusnetworks.priv> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/usr.bin/ipcs ipcs.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2005 17:05:14 -0000 Giorgos Keramidas wrote this message on Tue, Mar 08, 2005 at 15:20 +0200: > On 2005-03-08 13:14, Giorgos Keramidas wrote: > > keramida 2005-03-08 13:14:46 UTC > > > > FreeBSD src repository (doc committer) > > > > Modified files: > > usr.bin/ipcs ipcs.c > > Log: > > Use 12 columns for (int) values, 20 columns for (long) and align > > headers properly (right justified for numbers, left justified for > > everything else). > > > > This fixes the alignment of the fields on i386, sparc64 and amd64 > > today but does not dynamically assign column widths or bear in mind > > that some of the values may be 64-bit in the future. > > > > Reviewed by: alfred > > > > Revision Changes Path > > 1.26 +50 -47 src/usr.bin/ipcs/ipcs.c > > If anyone has a good idea for making the columns widths dynamically > adjustable, please do so :-) Yes, you can use a * instead of hard coding the widths, and then provide an integer on the printf line for the width... so: int foo, bar; int foowidth, barwidth; foowidth = barwidth = 8; foo = 0xa9201; bar = 0xab29023; printf("foo: %*d,\tbar: %*d\n", foowidth, foo, barwidth, bar); -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."