aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-29 13:00:07 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-29 13:00:07 +0200
commitf73d794132fe0c23eefa84e253099e80fdf5a2ac (patch)
treeb640e445716eb341229074badda84784151eaed2 /src/bin/eolian
parentefl_ui_focus_manager_calc: correctly specify owned where its needed (diff)
downloadefl-f73d794132fe0c23eefa84e253099e80fdf5a2ac.tar.gz
eolian gen: simplify generate_normal_free a bit
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/sources.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index cdf65a03ce..353c78b7d6 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -154,47 +154,18 @@ _append_defval(const Eolian_Unit *src, Eina_Strbuf *buf,
static void
_generate_normal_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eina_Strbuf *parameter, const char *additional_intention)
{
- //simply append the free function
- const char *free_func;
-
- Eolian_Type_Builtin_Type t = eolian_type_builtin_type_get(type);
-
- if (t == EOLIAN_TYPE_BUILTIN_LIST)
- {
- free_func = "eina_list_free";
- }
- else if (t == EOLIAN_TYPE_BUILTIN_ITERATOR)
- {
- free_func = "eina_iterator_free";
- }
- else if (t == EOLIAN_TYPE_BUILTIN_ACCESSOR)
- {
- free_func = "eina_accessor_free";
- }
- else if (t == EOLIAN_TYPE_BUILTIN_MSTRING)
- {
- free_func = "free";
- }
- else if (t == EOLIAN_TYPE_BUILTIN_STRINGSHARE)
+ const char *free_func = eolian_type_free_func_get(type);
+ if (!free_func)
{
- free_func = "eina_stringshare_del";
+ printf("No free type %s\n", eolian_type_name_get(type));
+ return;
}
- else if (t == EOLIAN_TYPE_BUILTIN_HASH)
+
+ if (eolian_type_builtin_type_get(type) == EOLIAN_TYPE_BUILTIN_HASH)
{
eina_strbuf_append_printf(*buf," eina_hash_free_cb_set(");
eina_strbuf_append_buffer(*buf, parameter);
eina_strbuf_append(*buf, ",NULL);\n");
- free_func = "eina_hash_free";
- }
- else
- {
- free_func = eolian_type_free_func_get(type);
- }
-
- if (!free_func)
- {
- printf("No free type %s\n", eolian_type_name_get(type));
- return;
}
eina_strbuf_append_printf(*buf," %s%s(", additional_intention, free_func);