specialist iterator continue and break macros

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Lachu
Elite
Posts: 327
Joined: Sat May 04, 2013 2:19 pm

specialist iterator continue and break macros

Postby Lachu » Fri Dec 22, 2017 10:59 am

In some case that's not correct to use break or continue in Freeciv iterator macros. Why not create macros to handle break or continue inside iterator macros?

User avatar
dunnoob
Elite
Posts: 326
Joined: Mon Dec 23, 2013 3:13 am
Location: Hamburg
Contact:

Re: specialist iterator continue and break macros

Postby dunnoob » Sat Dec 23, 2017 6:22 am

Lachu wrote:In some case that's not correct to use break or continue in Freeciv iterator macros. Why not create macros to handle break or continue inside iterator macros?
I consider the SPECENUM and iterator stuff as holy code, a suggestion to change it is an auto-WONTFIX just like a suggestion to use Python or C++ instead of C. :P Seriously, utitlity/iterator.h mumbles something about invalid_iterator_init() at the end, and common/map.c actually uses invalid_iterator_init(), could this do what you want?