Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#2745) Change style guide to favor a++ instead of +
Home

[Freeciv-Dev] Re: (PR#2745) Change style guide to favor a++ instead of +

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2745) Change style guide to favor a++ instead of ++a
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 23 Jan 2003 00:21:47 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Jan 21, 2003 at 11:53:13AM -0800, Jason Short via RT wrote:
> 
> [rfalke - Tue Jan  7 11:32:56 2003]:
> 
> > 
> > $ grep -Irn '[a-nA-Z][+][+]' .|fgrep .c|wc -l
> >    1961
> > $ grep -Irn '[+][+][a-nA-Z]' .|fgrep .c|wc -l
> >     132
> > 
> > From these 132 cases some are in intl/ (out of reach), some are
> > required:
> >   ./client/gui-sdl/gui_dither.c:516:      if (++h >=
> > NORMAL_TILE_HEIGHT / 2) {
> >   ./server/mapgen.c:1888:  && ++j < 500) {
> > but the larger part doesn't require it. for loops like
> >   ./client/gui-sdl/optiondlg.c:347:  for (i = 0; pModes[i]; ++i) {
> > can be replaced. And simple statements like:
> >   ./client/gui-mui/messagedlg.c:111:          ++err;
> >   ./common/rand.c:208:      ++behaviourchange;
> >   ./server/unithand.c:187:            ++number_of_upgraded_units;
> > also doesn't need it.
> 
> I like this change; I personally prefer a++ to ++a and in any case
> suggesting a single one of them does make the code slightly simpler.
> 
> Remember, though, that (IIRC) we've agreed not to make style-only pathes
> or to just fix style.  Your patch to change ++a to a++ in 100+ places
> does just this (this difference is purely style).  Not that that
> necessarily makes the patch bad...
> 
> I do think that we need to first adjust the style guide before changing
> any code.

Then split the patch and commit it in two parts.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Windows: Where do you want to go today?
 Linux: Where do you want to go tomorrow?
 BSD: Are you guys coming or what?




[Prev in Thread] Current Thread [Next in Thread]