Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)
Home

[Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: Petr Baudis <pasky@xxxxxxxxxxx>, jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Dec 2001 17:18:22 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Dec 05, 2001 at 04:59:13AM -0800, Raahul Kumar wrote:
> 
> --- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
> > Hi,
> > 
> >   sorry I respond to so old mail, however I didn't find the patch which
> > just got into CVS here and this is only mail where I discovered this change.
> > I just had a look what changed in the code I actually clean, and basically
> > following:
> > 
> > > Index: server/settlers.c
> > > ===================================================================
> > > RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
> > > retrieving revision 1.112
> > > diff -u -r1.112 settlers.c
> > > --- server/settlers.c     2001/10/14 21:02:17     1.112
> > > +++ server/settlers.c     2001/11/01 14:09:33
> > > @@ -769,8 +769,8 @@
> > >    for (i = 0; i < game.nplayers; i++) {
> > >      city_list_iterate(game.players[i].cities, pcity) {
> > >        if (map_distance(x, y, pcity->x, pcity->y)<=8) {
> > > -        dx = xdist(pcity->x, x);
> > > -        dy = ydist(pcity->y, y);
> > > + base_real_map_distance(&dx, &dy, pcity->x, pcity->y, x, y);
> > > + dx = abs(dx), dy = abs(dy);
> > >   /* these are heuristics... */
> > >          if (dx<=5 && dy<5)
> > >            return 0;
> > 
> > Thing I have problem with is:
> > +     dx = abs(dx), dy = abs(dy);
> > I think it should be rather
> > +     dx = abs(dx); dy = abs(dy);
> > What do you think?
> > 
> > Sorry I'm so late, just please take this as an example of that inclusion
> > into CVS is best impulse for review ;-).
> > 
> I'd say Jason has been careless. I thought you already mentioned this buglet 
> to
> Raimar. Add that punctuation Raimar.

From the language syntax point of view both version are the same. I
know that Ross sometimes prefer the , version. It looks like also
Jason prefer it (Jason: under which conditions?). So I would like to
add this to the style guide questionnaire:


 <some number>
 This isn't about initialization!

/* A */
  x = punit->x, y = punit->y;

/* B */
  x = punit->x;
  y = punit->y;

Something like
  x = punit->x; y = punit->y;
will not work because it will be broken up by indent.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Heuer's Law: Any feature is a bug unless it can be turned off."


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