待辦事項 #44930

unit_tech_reqs_iterate()

啟用日期: 2022-06-24 23:22 最後更新: 2022-07-17 15:11

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
2

細節

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 (無) to cazfi
  • 處理結果 Update from to Accepted
2022-07-05 20:35 Updated by: cazfi
  • 處理結果 Update from Accepted to
評語

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

2022-07-06 01:13 Updated by: cazfi
  • 處理結果 Update from 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
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入