Feature #1836
open
re-write/improve reqtext.c
Added by Dean Brown 28 days ago.
Updated 15 days ago.
Description
There's typos that need fixing -
"?good:Requires import of %s ." Extra space char
"?cityprop:Applies only to %s cities" Missing .
"?cityprop:Does not apply to %s cities" Missing .
I don't like a routine >3000 lines long, not good coding style IMO. I want to make it be like -
switch (preq->source.kind) {
case VUT_NONE:
return FALSE;
case VUT_COUNTER:
return req_text_counter();
case VUT_ADVANCE:
return req_text_advance();
case VUT_TECHFLAG:
return req_text_techflag();
...
extracting a bunch of new routines, one for each req type.
Files
Related issues
1 (1 open — 0 closed)
- Tracker changed from Tasks to Feature
- Category changed from client-common to General
Split to two tickets:
1) typofixes -> goes to all branches
2) refactoring -> goes to main branch
New issue #1839 for the typos.
Did a bunch of testing to make sure I didn't break anything.
What a huge patch file!
- File deleted (
1836.patch)
Sigh - I can't stop my text editor from sometimes putting in tab chars, have to always remember to check for that.
req_text_player_flag(), req_text_nation(), req_text_style(), req_text_nationality(), req_text_uclass(), req_text_unit_state(), req_text_ai_level(), and req_text_city_tile() have parameters with bad indentation.
So does req_text_max_tile_total_units(), but in that case it's likely better than to introduce overlong lines.

- File deleted (
1836.patch)
One more try.
For req_text_max_tile_total_units(), proper alignment pushes longest line to col 74, OK per the guidelines.
- Status changed from New to In Review
- Assignee set to Marko Lindqvist
- Target version set to 3.4.0
Also available in: Atom
PDF