Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: the directional system
Home

[Freeciv-Dev] Re: the directional system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Greg Wooledge <greg@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Fri, 07 Sep 2001 23:43:40 -0400

At 08:33 PM 01/09/07 -0400, Greg Wooledge wrote:
>Raimar Falke (hawk@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
>> On Fri, Sep 07, 2001 at 04:51:36AM -0700, Trent Piepho wrote:
>> > +#define DIR_REVERSE(dir) (((dir) + 4) % 8)
>> > +#define DIR_REVERSE(dir) (((dir) + 4) & 7)
>
>> $ gcc -S -O2 a.c
>> $ cat a.s
>
>Nice demonstration, but it only shows that your version of gcc can handle
>this optimization -- there may be other compilers out there that don't.
>It's safer to use the bitwise AND operation.

Thanks. 

"Safer" to choose the way that doesn't rely on fortuitious assistance, 
than the one that builds in heuristic conditions for success is somehow
so underappreciated.

Like the adage "Common sense is very uncommon".

>-- 
>Greg Wooledge                  |   "Truth belongs to everybody."
>greg@xxxxxxxxxxxx              |    - The Red Hot Chili Peppers
>http://wooledge.org/~greg/     |
>
>Attachment Converted: "c:\program files\eudora\attach\[Freeciv-Dev] Re the
direction"

Cheers,
RossW
=====



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