Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: PATCH: substituting whole_map_iterate (PR#943)
Home

[Freeciv-Dev] Re: PATCH: substituting whole_map_iterate (PR#943)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: PATCH: substituting whole_map_iterate (PR#943)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 7 Sep 2001 10:05:06 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Sep 07, 2001 at 12:49:31AM -0700, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> The attached patches substitute whole_map_iterate for the equivalent
> functionality in a lot of places.  Again they may duplicate Ross's code,
> but they're certainly in a simpler form.
> 
> Most substitutions should result in almost identical code once the
> preprocessor is through.  In one or two places I've substituted code in
> a slightly different order, but it should all give identical
> functionality.

The inner loop may depend on the xy-vs-yx order.

> Note that in the long run, a general topology may not be a perfect
> rectangle so it will be necessary to use whole_map_iterate (or a
> substitute) everywhere.  This patch makes the substitution into every
> place where it can be done without changing existing code (I don't think
> I've missed any).

Ack.

> All of the changes required re-indentation of the inner loop, so there
> are two versions of the patch.  The nospace one was diffed with the -b
> option so that whitespace was ignored; this one will not fix the
> indentation but is much easier to read.  The regular one includes all
> changes to the indentation.

Since I reindent anyway I'm happy with the nospace patch.

> As with my previous map_adjust patch, all changes should be independent
> so the patch should be easy to evaluate.

I really like it. I will check the inner loop for the order issue
(AFAIK this should only happen if the inner loop has a break or goto)
and then apply it.

Objections?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Q:  Do you know what the death rate around here is?
 A:  One per person.


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