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: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Mon, 3 Dec 2001 00:29:09 +0100

> > > 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?
> > 
> > Another point for the style guide.
> However I generally suspect that does wrong thing. IIRC when using ","
> operator, the last value is value of whole expression. Thus, value of dy
> (abs(dy)) will get assigned to dx, not abs(dx). Please enlighten me :-).
Oops, looks like "," has highger precedence than "=". I need more cofee and
more sleep, I suppose ;-). Anyway it looks uselessly confusing to me.

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv hacking
.
  "A common mistake that people make, when trying to design
   something completely foolproof is to underestimate the
   ingenuity of complete fools."
     -- Douglas Adams in Mostly Harmless
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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