From b15d0583e75a79f434296327e0d5bdd484eddfe2 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 7 Oct 2016 12:58:22 +0200 Subject: [PATCH] eolian gen2: fix minor issues with c file generation --- src/bin/eolian2/sources.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/eolian2/sources.c b/src/bin/eolian2/sources.c index e51b5f3..2c95db5 100644 --- a/src/bin/eolian2/sources.c +++ b/src/bin/eolian2/sources.c @@ -173,7 +173,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, } eina_strbuf_append(params_full, prn); eina_strbuf_append(params_full_imp, prn); - if (is_empty) + if (is_empty || is_auto) eina_strbuf_append(params_full_imp, " EINA_UNUSED"); eina_stringshare_del(ptn); @@ -243,7 +243,7 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append_printf(params_init, " %s = pd->%s;\n", prn, prn); else { - eina_strbuf_append_printf(params_init, " if (%s) *%s = pd->%s\n", + eina_strbuf_append_printf(params_init, " if (%s) *%s = pd->%s;\n", prn, prn, prn); } } @@ -350,6 +350,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, eina_strbuf_append(buf, ", "); eina_strbuf_append(buf, adt); eina_strbuf_append(buf, " *pd"); + if (is_empty || (is_auto && !eina_strbuf_length_get(params_init))) + eina_strbuf_append(buf, " EINA_UNUSED"); eina_strbuf_append(buf, eina_strbuf_string_get(params_full_imp)); eina_strbuf_append(buf, ")\n{\n"); } -- 2.7.4