<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39476 >

second batch:
   base_type_iterate
   client_options_iterate

This seems better to remain an indexing iterator (almost all usage is the
index number, no pointer needed), but the name translation and other
standard accessors were needed.  Several obscure bugs fixed!
   specialist_type_iterate

Others that seem better to remain indexing iterators, side-effects removed:
   shuffled_players_iterate
   sorted_event_iterate

   (city.h)
   city_map_iterate_outwards
   city_map_checked_iterate
   map_city_radius_iterate
   cities_iterate

   (map.h)
   iterate_outward_dxy
   circle_dxyr_iterate
   adjc_dirlist_iterate
   whole_map_iterate

Committed revision 13169.

===

At this point, all the "_index" overloading has been eliminated or
qualified (usually _tile##_index, where _tile is a variable parameter).
Of course, there are more that use other (unqualified) overloading.

Both base and specialist had (minor) name translation problems --
converted to use the new translation structure.

Also, in client/tilespec, citizen specialist names were accessed
(they don't exist, so it generated a random memory location) and then a
quick test skipped using the bad value.  When I added more tests, and
returned NULL instead of something random, it became a reliable crash!

So, I changed the order of the enum, and run the for loop only up to
CITIZEN_SPECIALIST.  I don't see any problem with the change, but the
code assumptions aren't well documented.  So, we'll wait and see....

Meanwhile, I added some error checking in client/packhand for passed
array sizes, matching similar stuff in server/ruleset.  Lots more to do
in that regard.

Folks, you cannot trust data that comes over the network!



_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to