Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: AI cleanup: enum choice_type
Home

[Freeciv-Dev] Re: AI cleanup: enum choice_type

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Thue <thue@xxxxxxx>
Cc: Freeciv dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: AI cleanup: enum choice_type
From: Marko Lindqvist <caz@xxxxxxxxx>
Date: Mon, 15 Jan 2001 12:13:54 +0200 (EET)

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

--




[Prev in Thread] Current Thread [Next in Thread]