#44930: unit_tech_reqs_iterate() Open Date: 2022-06-24 16:22 Last Update: 2022-06-27 11:04 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/44930 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44930 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-06-27 11:04 Updated by: alienvalkyrie Comment: Reply To cazfi My working version of the patch has something that has not been our convention, but might make sense to introduce here. It adds struct "_remove" within unit_type struct, and moves "require_advance" in there. The idea is that it should alert any contributors to the fact that no new code should use "require_advance" that's going to be retired (hmm.. maybe "_retire" would be better than "_remove"?) Thoughts? Might be sensible to make something like this a convention, some general way to mark code-internal things as deprecated; whether that's via moving those things into sub-structs, renaming them accordingly, or adding an attribute (or some other way) is a decision I'd rather leave to the people with more C experience. --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: (None) Type: Patches Status: Open Priority: 5 - Medium MileStone: 3.2.0 Component: General Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Add iterator macros unit_tech_reqs_iterate() and unit_tech_reqs_iterate_end, and use them instead of accessing unit_type->require_advance directly. That prepares us for later retire require_advance. -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/44930 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44930