#48792: is_<enum>_user_flag() Open Date: 2023-10-02 20:16 Last Update: 2023-10-05 15:48 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/48792 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48792 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-10-05 15:48 Updated by: alienvalkyrie Comment: Seems reasonable. Short-term, adding new things now does mean that the code gets split between <file>_enums_gen.h and specenum_gen.h, but long-term, we'll want to phase out the latter anyway. I'm not sure about the name, given that codegen-side, I called them "generic"; so I'd probably make it bool is_<enum>_generic(enum <enum>). Then again, we are only using them for user flags, so it could instead be reasonable to use that language codegen-side. Depending on the use cases, we might want to have a bunch more general #defines; e.g. for the last generic value (like EF_LAST_USER_FLAG or TER_USER_LAST) or the total number of generic values (like MAX_NUM_USER_EXTRA/TER_FLAGS). --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: (None) Type: Patches Status: Open Priority: 5 - Medium MileStone: 3.3.0 Component: Bootstrap Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Follow-up idea to #48790 : when specenum has user flags defined, specenum generator could output inline function "bool is_<enum>_user_flag(enum <enum>)" This would also at least reduce the need for defining likes of TER_USER_LAST. -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/48792 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48792