From 9ea4a335eec614867318a1a280a38ad9d392a269 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 31 Dec 2015 10:58:48 -0500 Subject: ammgc_get_unit_entities(): obtain enum member values at initialization. --- src/logic/amgc_unit_entities.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/logic/amgc_unit_entities.c b/src/logic/amgc_unit_entities.c index b528a19..c86c1bc 100644 --- a/src/logic/amgc_unit_entities.c +++ b/src/logic/amgc_unit_entities.c @@ -6,6 +6,7 @@ #include #include +#include #include @@ -42,6 +43,7 @@ int amgc_get_unit_entities( struct amgc_unit_entities_impl *entities; size_t ndefs; size_t nelements; + int enumval; if (!meta) meta = &umeta; @@ -116,7 +118,10 @@ int amgc_get_unit_entities( break; case ENTITY_ENUM_VALUE: - uentities->enumvals[meta->nenumvals++].entity = entity; + enumval = (int)get_tarval_long(entity->enum_value.tv); + uentities->enumvals[meta->nenumvals].entity = entity; + uentities->enumvals[meta->nenumvals].enumval = enumval; + meta->nenumvals++; break; case ENTITY_TYPEDEF: -- cgit v1.2.3