Ticket #44930

unit_tech_reqs_iterate()

오픈 날짜: 2022-06-24 23:22 마지막 업데이트: 2022-07-17 15:11

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
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 History (3/10 Histories)

2022-06-24 23:22 Updated by: cazfi
  • New Ticket "unit_tech_reqs_iterate()" created
2022-06-25 10:12 Updated by: cazfi
댓글 올리기

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 Updated by: 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?

2022-06-27 18:04 Updated by: alienvalkyrie
댓글 올리기

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 Updated by: cazfi
  • 소유자 Update from (None) to cazfi
  • Resolution Update from None to Accepted
2022-07-05 20:35 Updated by: cazfi
  • Resolution Update from Accepted to None
댓글 올리기

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

2022-07-06 01:13 Updated by: cazfi
  • Resolution Update from None to Accepted
댓글 올리기

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

2022-07-17 15:11 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login