From owner-cvs-src@FreeBSD.ORG Tue Mar 8 17:11:40 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 CEA6416A4CE; Tue, 8 Mar 2005 17:11:40 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C0B643D2F; Tue, 8 Mar 2005 17:11:39 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])j28HBLLP032079; Tue, 8 Mar 2005 19:11:22 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) j28HBbUq037866; Tue, 8 Mar 2005 19:11:37 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)j28HBbkS037865; Tue, 8 Mar 2005 19:11:37 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 8 Mar 2005 19:11:37 +0200 From: Giorgos Keramidas To: John-Mark Gurney Message-ID: <20050308171137.GB37794@orion.daedalusnetworks.priv> References: <200503081314.j28DEl3i090934@repoman.freebsd.org> <20050308132021.GA88362@orion.daedalusnetworks.priv> <20050308170510.GM89312@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050308170510.GM89312@funkthat.com> 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 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:11:40 -0000 On 2005-03-08 09:05, John-Mark Gurney wrote: >Giorgos Keramidas wrote this message on Tue, Mar 08, 2005 at 15:20 +0200: >>On 2005-03-08 13:14, Giorgos Keramidas wrote: >>> Use 12 columns for (int) values, 20 columns for (long) and align >>> headers properly (right justified for numbers, left justified for >>> everything else). >> >> 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); Yes, that's a great idea. It will greatly simplify the formatting code and make it easier to change _all_ the instances of variables that have the same size to a new width. :-)