[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]
> > > 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/
|
|