From d1ebf813bf5f1fd7611bfa37dddfc779649e3668 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 30 Jan 2016 19:27:50 -0500 Subject: amgc_output_compound(): validate input type, wrap around output_compound_entity(). --- src/output/amgc_output_compound.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') 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; +} -- cgit v1.2.3