From owner-cvs-all  Sat Jun  8  6:13:24 2002
Delivered-To: cvs-all@freebsd.org
Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16])
	by hub.freebsd.org (Postfix) with ESMTP
	id 04DB837B406; Sat,  8 Jun 2002 06:13:14 -0700 (PDT)
Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102])
	by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id XAA26349;
	Sat, 8 Jun 2002 23:13:11 +1000
Date: Sat, 8 Jun 2002 23:13:53 +1000 (EST)
From: Bruce Evans <bde@zeta.org.au>
X-X-Sender: bde@gamplex.bde.org
To: "J. Mallett" <jmallett@FreeBSD.ORG>
Cc: Bruce Evans <bde@FreeBSD.ORG>, <cvs-committers@FreeBSD.ORG>,
	<cvs-all@FreeBSD.ORG>
Subject: Re: cvs commit: src/bin/ps extern.h
In-Reply-To: <20020608000108.A42463@FreeBSD.ORG>
Message-ID: <20020608225458.Q19691-100000@gamplex.bde.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-cvs-all@FreeBSD.ORG
Precedence: bulk
List-ID: <cvs-all.FreeBSD.ORG>
List-Archive: <http://docs.freebsd.org/mail/> (Web Archive)
List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions)
List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20cvs-all>
List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20cvs-all>
X-Loop: FreeBSD.ORG

On Sat, 8 Jun 2002, J. Mallett wrote:

> * From Bruce Evans <bde@FreeBSD.org>
> > bde         2002/06/07 23:49:15 PDT
> >
> >   Modified files:
> >     bin/ps               extern.h
> >   Log:
> >   Fixed unsorting.
>
> Now, I understand this project has a hard time deciding what exactly it means
> "to sort" something, but nonetheless I would have to say that this appears to
> replace one possibly acceptable sorting method (sorting by type) with a wrong
> sort order of another sorting method (sorting by variable name).  In my mind,

I think sorting by type makes no sense for extern declarations.  (style.9
only says how to sort structs and local variables.  It says to sort
by size [largest first] (not type), then by name.  Sorting struct members
by size gives better packing, and sorting local variables by size
(perhaps smallest instead of largest first) may give gives better packing
for primitive compilers, but extern declarations don't allocate space so
size considerations don't apply.)

> we should be sorting as per LANG=C, and in that case, 'ra' definitely comes a
> bit after 'no', however 'no' comes happily after 'nl', therefore the lines in
> this locate could be written as:
>
> %%%
> extern int cflag, eval, fscale, mempages, nlistread;
> extern time_t now;
> extern int rawcpu, sumrusage, termwidth, totwidth;
> %%%
>
> But I don't think revision 1.24 fixes unsorting.

I didn't want to restructure the declarations to have only one variable
per line, so I followed my usual rule for insertion "sorting" in unsorted
list: insert before the first line whose first item is after the item
being inserted.  Since this gave a very trivial change, I should have
restructured the declarations.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message