Follow-up Comment #2, bug #13810 (project freeciv):

The "*(op->value.bval)" and similar expressions would
make good candidates for wrapper macros, so that the
internal field names can be easily updated in the
future if needed.

Actually, probably static inline wrapper functions
would be best, e.g.:

/* In settings.h */
static inline bool setting_boolval(conct struct setting_s *op)
  return *(op->value.bval);
/* And similarly for int, str. */

I would suggest to call the pointer union something
other than "value", since it is not the value itself
(recall you were confused by this a while ago). Perhaps
"pvalue" or "valaddr" would be more fitting.



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to