Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: unit type iterate (PR#1297)
Home

[Freeciv-Dev] Re: unit type iterate (PR#1297)

[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: unit type iterate (PR#1297)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 4 Mar 2002 18:01:13 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Mar 04, 2002 at 05:22:33AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> Raimar Falke wrote:
> > On Mon, Mar 04, 2002 at 05:28:47AM -0500, Jason Short wrote:
> > 
> >>Gregory Berkolaiko wrote:
> >>
> >>>Hey you iterate wizards.  How about making unit_type_iterate.
> >>>Here's grep to help you:
> >>>
> >>Are we talking about something like
> >>
> >>#define unit_type_iterate(id) {                  \
> >>   int id;                                        \
> >>   for (id = 0; id < game.num_unit_types; id++) {
> >>
> >>or something a bit more forward-thinking (and slower) like
> >>
> >>#define unit_type_iterate(id, type) {            \
> >>   int id;                                        \
> >>   for (id = 0; id < game.num_unit_types; id++) { \
> >>     struct unit_type *type = get_unit_type(id);
> >>
> >>or even something completely forward-thinking (and currently useless) like
> >>
> >>#define unit_type_iterate(type) {                   \
> >>   int _id;                                          \
> >>   for (_id = 0; _id < game.num_unit_types; _id++) { \
> >>     struct unit_type *type = get_unit_type(_id);
> >>
> > 
> > The first for the start. For the others we have to first change the
> > signatures of the functions in common/unittype.
> 
> How about this?

You are too fast. I planned to create such a patch for myself. I
waited till the impr_type_iterate is in since both changes touch
sometimes the same areas in the code.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "At the beginning of the week, we sealed ten BSD programmers
  into a computer room with a single distribution of BSD Unix.
  Upon opening the room after seven days, we found all ten programmers 
  dead, clutching each other's throats, and thirteen new flavors of BSD."


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