From owner-freebsd-current@FreeBSD.ORG Thu Jan 6 20:46:35 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8323816A4CE for ; Thu, 6 Jan 2005 20:46:35 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8351D43D54 for ; Thu, 6 Jan 2005 20:46:34 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b183.otenet.gr [212.205.244.191]) j06KkV5Q028036; Thu, 6 Jan 2005 22:46:32 +0200 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id j06KkUZQ035375; Thu, 6 Jan 2005 22:46:30 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id j06KkUC8035374; Thu, 6 Jan 2005 22:46:30 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Thu, 6 Jan 2005 22:46:30 +0200 From: Giorgos Keramidas To: Brooks Davis Message-ID: <20050106204630.GA35307@gothmog.gr> References: <20050106191201.GA30826@gothmog.gr> <20050106195719.GB24896@odin.ac.hmc.edu> <20050106195950.GA34916@gothmog.gr> <20050106200718.GD24896@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106200718.GD24896@odin.ac.hmc.edu> cc: freebsd-current@freebsd.org Subject: Re: human-readable swap partition sizes with pstat -sh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 20:46:35 -0000 On 2005-01-06 12:07, Brooks Davis wrote: > On Thu, Jan 06, 2005 at 09:59:50PM +0200, Giorgos Keramidas wrote: > > > On minor, mostly style nit is that while intmax_t is 64-bits, nothing > > > requires that so you should probably have conver return an int64_t. > > > > I lost you a bit here. > > The CONVERT macro used to case to (int). You removed that cast which > works because humanize_number takes an int64_t and intmax_t is the same > as int64_t on all architectures. I was suggesting that you should case > to int64_t. Alternativly, humanize_number could be fixed. I can't > think of any useful reason to add the complexity of 128-bit ints to > general purpose CPUs so this is probalby mostly paranoia. Ah, I see now. I didn't like the explicit cast to (int) because significant bits may be lost if sizeof(int) < sizeof(intmax_t) (which is true on all the architectures FreeBSD runs on now, IIRC). Adding an (int64_t) cast won't avoid the possibility of having problems later on when intmax_t is larger than int64_t, but you are 100% right :-) - Giorgos