From d1ebf813bf5f1fd7611bfa37dddfc779649e3668 Mon Sep 17 00:00:00 2001 From: midipix Date: Jan 31 2016 00:27:50 +0000 Subject: amgc_output_compound(): validate input type, wrap around output_compound_entity(). --- diff --git a/src/output/amgc_output_compound.c b/src/output/amgc_output_compound.c index bbc85d9..02923b4 100644 --- a/src/output/amgc_output_compound.c +++ b/src/output/amgc_output_compound.c @@ -271,7 +271,7 @@ static int output_compound( return 0; } -int amgc_output_compound( +static int output_compound_entity( const struct amgc_unit_ctx * uctx, const struct amgc_entity * aentity, const struct amgc_layout * layout, @@ -298,3 +298,19 @@ int amgc_output_compound( return 0; } + +int amgc_output_compound( + const struct amgc_unit_ctx * uctx, + const struct amgc_entity * aentity, + const struct amgc_layout * layout, + FILE * fout) +{ + union entity_t const * entity; + + entity = aentity->entity; + + if ((entity->kind == ENTITY_STRUCT) || (entity->kind == ENTITY_UNION)) + return output_compound_entity(uctx,aentity,layout,fout); + else + return -1; +}