[Freeciv-Dev] Re: AI cleanup: enum choice_type
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, 12 Jan 2001, Thue wrote:
>
> What is happening here? (CT_NONE == CT_BUILDING) shouldn't need to be
> checked....
>
> +enum choice_type { CT_NONE = 0, CT_BUILDING = 0, CT_NONMIL, CT_ATTACKER,
> + CT_DEFENDER, CT_LAST };
> +
> +
> +#define ASSERT_REAL_CHOICE_TYPE(type) \
> + assert(type >= 0 && type < CT_LAST && \
> + (CT_NONE == CT_BUILDING || type != CT_NONE));
> +
>
I found some case where values were still hardcoded, so I'm going to make
new version from this patch anyway. I'll make this macro a bit easier to
understand. (In fact patch is already ready, but needs some
reggression testing just in case)
Caz
--
|
|