Ticket #44930

unit_tech_reqs_iterate()

Eröffnet am: 2022-06-24 23:22 Letztes Update: 2022-07-17 15:11

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
2

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-Verlauf (3/10 Historien)

2022-06-24 23:22 Aktualisiert von: cazfi
  • New Ticket "unit_tech_reqs_iterate()" created
2022-06-25 10:12 Aktualisiert von: cazfi
Kommentar

Not strictly dependencies of implementing this, but make sense to implement first as they would conflict with this: #44926, #44941

2022-06-27 06:11 Aktualisiert von: cazfi
Kommentar

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?

2022-06-27 18:04 Aktualisiert von: alienvalkyrie
Kommentar

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.

2022-07-05 09:18 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
2022-07-05 20:35 Aktualisiert von: cazfi
  • Lösung Update from Accepted to Keine
Kommentar

The main unit_tech_reqs_iterate() confuses advance pointers and advance number A_NONE.

2022-07-06 01:13 Aktualisiert von: cazfi
  • Lösung Update from Keine to Accepted
Kommentar

- Many bugs with A_NONE used as a pointer, or compared against a pointer, fixed

2022-07-17 15:11 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden