eolian gen2: fix generation of legacy class method wrappers
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 30 Sep 2016 12:27:22 +0000 (14:27 +0200)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 7 Oct 2016 09:54:23 +0000 (11:54 +0200)
src/bin/eolian2/sources.c

index ba3f47a..c64d05c 100644 (file)
@@ -431,13 +431,17 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
              eina_strbuf_append(lbuf, lfn);
              /* param list */
              eina_strbuf_append_char(lbuf, '(');
+             /* for class funcs, offset the params to remove comma */
+             int poff = 2;
              if (!eolian_function_is_class(fid))
                {
+                  /* non-class funcs have the obj though */
+                  poff = 0;
                   if ((ftype == EOLIAN_PROP_GET) || eolian_function_object_is_const(fid))
                     eina_strbuf_append(lbuf, "const ");
                   eina_strbuf_append_printf(lbuf, "%s *obj", cname);
                }
-             eina_strbuf_append(lbuf, eina_strbuf_string_get(params_full));
+             eina_strbuf_append(lbuf, eina_strbuf_string_get(params_full) + poff);
              eina_strbuf_append(lbuf, ")\n{\n");
              /* body */
              if (strcmp(rtpn, "void"))