Ticket #46172

Move counter initialization routine outside ruleset initialization code, so ruledit could use it

Open Date: 2022-12-04 01:08 Last Update: 2023-04-08 19:22

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Invalid
File:
3

Details

Currently, counter initialization code is placed inside ruleset loading code. This makes sense in past, because there was no other parts, which would use it. Currently, ruledit need to reinitialize and initialize counters, what means ruledit_enable is set to default value, name struct was free/reinitialized, etc.

Ticket History (3/16 Histories)

2022-12-04 01:08 Updated by: lachu
  • New Ticket "Move counter initialization routine outside ruleset initialization code, so ruledit could use it" created
2022-12-04 05:57 Updated by: lachu
Comment

Done.

I realized I still cannot remove code from ruleset.c, but with current code reinitialize counters should be possible. From what should I known, I can reuse counter entry in counter's array? Does ruledit do that for other artifacts?

2022-12-04 06:01 Updated by: lachu
Comment

One bug gets fixed, sorry.

2022-12-06 11:53 Updated by: cazfi
  • Type Update from Feature Requests to Patches
  • Priority Update from 4 to 5 - Medium
Comment

+ pcounter->ruledit_disabled = false;

Should be FALSE in freeciv C-code (we can use false in C++)

--

+#include <stdbool.h>

Include (utility/)support.h for getting bool defined by portable way (even when there's no stdbool.h header in the system)

2022-12-09 02:00 Updated by: lachu
  • File 0001-Further-work-to-integrate-counter-init-code-with-rul.patch (File ID: 11063) is attached
2022-12-09 02:01 Updated by: lachu
Comment

Reply To cazfi

+ pcounter->ruledit_disabled = false; Should be FALSE in freeciv C-code (we can use false in C++) -- +#include <stdbool.h> Include (utility/)support.h for getting bool defined by portable way (even when there's no stdbool.h header in the system)

0001-Further-work-to-integrate-counter-init-code-with-rul.patch(2KB)
Repair coding-style
2022-12-09 14:45 Updated by: cazfi
Comment

Patch seem to include unrelated changes (parts of #45891?), and build on top of the previous one instead of replacing it.

2022-12-17 22:24 Updated by: cazfi
  • Owner Update from cazfi to (None)
2023-01-03 20:44 Updated by: lachu
  • File 0001-Further-work-to-integrate-counter-init-code-with-rul.patch (File ID: 11063) is deleted
2023-03-26 19:52 Updated by: cazfi
Comment

Is this ticket still relevant? We have counters support in ruledit, so seems like it's not depending on this.

2023-03-27 22:40 Updated by: lachu
Comment

Reply To cazfi

Is this ticket still relevant? We have counters support in ruledit, so seems like it's not depending on this.

Let's close this ticket if I can reopen it.

2023-04-08 19:18 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Invalid
2023-04-08 19:22 Updated by: cazfi
  • Status Update from Open to Closed

Attachment File List

Edit

Please login to add comment to this ticket » Login