Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2010 07:41:13 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Giovanni Trematerra <giovanni.trematerra@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Randall Stewart <rrs@lakerest.net>, Bruce Cran <brucec@freebsd.org>
Subject:   Re: svn commit: r205119 - head/contrib/top
Message-ID:  <20100331072023.E2216@besplex.bde.org>
In-Reply-To: <4e6cba831003300839u5eac26d2n142ecb69502a64b0@mail.gmail.com>
References:  <201003131117.o2DBHek2003410@svn.freebsd.org> <4e6cba831003300839u5eac26d2n142ecb69502a64b0@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  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 <brucec@freebsd.org> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100331072023.E2216>