From owner-svn-src-head@FreeBSD.ORG Tue Mar 30 20:41:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C30EF1065670; Tue, 30 Mar 2010 20:41:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 56B278FC17; Tue, 30 Mar 2010 20:41:20 +0000 (UTC) Received: from besplex.bde.org (c122-106-158-90.carlnfd1.nsw.optusnet.com.au [122.106.158.90]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o2UKfD2X000871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 31 Mar 2010 07:41:16 +1100 Date: Wed, 31 Mar 2010 07:41:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Giovanni Trematerra In-Reply-To: <4e6cba831003300839u5eac26d2n142ecb69502a64b0@mail.gmail.com> Message-ID: <20100331072023.E2216@besplex.bde.org> References: <201003131117.o2DBHek2003410@svn.freebsd.org> <4e6cba831003300839u5eac26d2n142ecb69502a64b0@mail.gmail.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1128807053-1269981673=:2216" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Randall Stewart , Bruce Cran Subject: Re: svn commit: r205119 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:41:20 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1128807053-1269981673=:2216 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 30 Mar 2010, Giovanni Trematerra wrote: > On Sat, Mar 13, 2010 at 1:17 PM, Bruce Cran wrote: >> Author: brucec >> Date: Sat Mar 13 11:17:39 2010 >> New Revision: 205119 >> URL: http://svn.freebsd.org/changeset/base/205119 >> >> Log: >> =A0Change the 'amt' parameter in format_k2 from int to unsigned long lon= g >> =A0to match the values passed in and prevent the SIZE field being corrup= ted >> =A0when more than 2TB is allocated. >> >> =A0PR: =A0 =A0 =A0 =A0 =A0 bin/129706 >> =A0Approved by: =A0rrs (mentor) >> =A0MFC after: =A0 =A01 week Grrr, where are the ASCII ribbon campaigners? mav@ (?) just reported a type error in this. I may have already complained about this :-). unsigned long long should be a syntax error... >> >> Modified: >> =A0head/contrib/top/utils.c >> >> Modified: head/contrib/top/utils.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/contrib/top/utils.c =A0 =A0Sat Mar 13 11:08:57 2010 =A0 =A0 =A0= =A0(r205118) >> +++ head/contrib/top/utils.c =A0 =A0Sat Mar 13 11:17:39 2010 =A0 =A0 =A0= =A0(r205119) >> @@ -476,7 +476,7 @@ int amt; >> >> =A0char *format_k2(amt) >> >> -int amt; >> +unsigned long long amt; >> >> =A0{ >> =A0 =A0 static char retarray[NUM_STRINGS][16]; > > While here wouldn't be good thing to ansify the function? No, ansi doesn't exist, and this is contribed code which is already hundreds if not thousands of versions behind the "vendor" version, partly because even non-gratuitous changes in it are hard to maintain. contrib/top doesn't have many local changes, but usr.bin/top does (including an almost complete reformatting to KNF), and unfortunately the "vendor" changed almost everything in that too. format_k2() is a FreeBSD addition. In the "vendor" version 3.8b1, there is still only format_k(). This has been converted to a new-style definitio= n so that it can no longer be compiled by old compilers, and its parameter type has been changed from int to long, which is hopefully long enough. Even its style has been improved. Bruce --0-1128807053-1269981673=:2216--