Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] directional code cleanup: patch #1
Home

[Freeciv-Dev] Re: [PATCH] directional code cleanup: patch #1

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] directional code cleanup: patch #1
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Tue, 14 Aug 2001 22:56:45 -0700 (PDT)

On Wed, 15 Aug 2001, Jason Dorje Short wrote:
> This patch removes the magic numbers and expressions associated with the
> DIR_D[XY] macros, collecting all such implementation-dependent code into
> map.[ch].

I see that it doesn't change the directions, so there should be fewer
possibilities for bugs.  But if you changed them, then any missing magic bits
would be easier to find.  Of course, maybe you already did that when you
looked for things to change.

> Additions to map.[ch]:
>  - macros dir_reverse(dir) and dir_is_cardinal(dir) are created

Since these are macros, convention is to give them names in all caps.  Perhaps
shorter names..

>  - the directional names used for logging ("N") are defined globally

Wouldn't a function be better than a global variable?

I think this is a pretty good idea.  The directions are really a mess they way
they are now.



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