Update of patch #3394 (project freeciv):

                Category:                    None => general                
                  Status:                    None => Ready For Test         
         Planned Release:                         => 2.5.0                  


Follow-up Comment #1:

Attached patch adds some specenum side support for this.

> I think we can only define user flags (with no hardcoded
> meaning) as:
> #define SPECENUM_VALUE5NAME "User1"
> #define SPECENUM_VALUE6NAME "User2"

Giving VALUExNAME is not necessary. 

> and then either accept that user flags are named "User1",
> "User2"... or to use manually written flag name access
> functions instead of automatically generated xxx_name() &
> xxx_by_name().

User flag name access function must be written separately, but with this patch
access API stays as it is. This is big win in consistency between those
specenums that use user flags and those that don't - no need to remember
what's the right calling convention for each separate type. Instead of being
parallel to specenum xxx_name() and xxx_by_name() functions, manually written
function is called from those automatically generated functions. It's also
enough to handle just user flags in that function, by returning NULL for other
flags it gives responsibility back to automatically generated function.

This call to callback function foo_name_cb(enum type) is added if macro

(file #16288)

Additional Item Attachment:

File name: SpecenumNameCB.patch           Size:1 KB


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to