From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 25 18:47:09 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9475A106566B; Fri, 25 Mar 2011 18:47:09 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 510078FC08; Fri, 25 Mar 2011 18:47:09 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63] (may be forged)) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p2PIZDK8050088; Fri, 25 Mar 2011 12:35:14 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110325024658.GA19544@freebsd.org> Date: Fri, 25 Mar 2011 12:35:13 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <336A9ACD-29BF-41C9-BC25-917CC1E4587D@bsdimp.com> References: <20110325002115.GA323@freebsd.org> <20110325015508.GA14565@freebsd.org> <20110325024658.GA19544@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1082) Cc: freebsd-hackers@FreeBSD.org Subject: Re: Switching to [KMGTPE]i prefixes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2011 18:47:09 -0000 One difference between this patch, and the patch I came up with, was = that I used arrays of character pointers to the names of the symbols to = use. This got around the problem that you have with the 'shift' you had = to introduce to get things more or less correct. It also made for the = possibility of having different kinds of units in the future that = weren't a power of 2 -1 bytes long. It also simplified the code a = little. Perhaps you would consider this improvement when devising future = patches. Warner On Mar 24, 2011, at 8:46 PM, Alexander Best wrote: > here is a revised patch. it also includes the necessary changes to the > humanize_number(3) man page. >=20 > cheers. > alex >=20 > --=20 > a13x > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to = "freebsd-hackers-unsubscribe@freebsd.org"