summaryrefslogtreecommitdiff
path: root/src/lib/eolian/database_type.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eolian/database_type.c')
-rw-r--r--src/lib/eolian/database_type.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index eec9621efe..31517d6487 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -61,7 +61,7 @@ database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
61} 61}
62 62
63Eina_Bool 63Eina_Bool
64database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp) 64database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void)
65{ 65{
66 if (tp->is_ptr) 66 if (tp->is_ptr)
67 return EINA_TRUE; 67 return EINA_TRUE;
@@ -77,11 +77,13 @@ database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp)
77 if (tpp->type == EOLIAN_TYPEDECL_FUNCTION_POINTER) 77 if (tpp->type == EOLIAN_TYPEDECL_FUNCTION_POINTER)
78 return EINA_TRUE; 78 return EINA_TRUE;
79 if (tpp->type == EOLIAN_TYPEDECL_ALIAS) 79 if (tpp->type == EOLIAN_TYPEDECL_ALIAS)
80 return database_type_is_ownable(unit, tpp->base_type); 80 return database_type_is_ownable(unit, tpp->base_type, allow_void);
81 return EINA_FALSE; 81 return EINA_FALSE;
82 } 82 }
83 return (ct[strlen(ct) - 1] == '*'); 83 return (ct[strlen(ct) - 1] == '*');
84 } 84 }
85 if (allow_void && (tp->type == EOLIAN_TYPE_VOID))
86 return EINA_TRUE;
85 return (tp->type == EOLIAN_TYPE_CLASS); 87 return (tp->type == EOLIAN_TYPE_CLASS);
86} 88}
87 89
@@ -117,7 +119,7 @@ database_type_to_str(const Eolian_Type *tp,
117 || tp->type == EOLIAN_TYPE_CLASS 119 || tp->type == EOLIAN_TYPE_CLASS
118 || tp->type == EOLIAN_TYPE_VOID) 120 || tp->type == EOLIAN_TYPE_VOID)
119 && tp->is_const 121 && tp->is_const
120 && ((ctype != EOLIAN_C_TYPE_RETURN) || database_type_is_ownable(NULL, tp))) 122 && ((ctype != EOLIAN_C_TYPE_RETURN) || database_type_is_ownable(NULL, tp, EINA_FALSE)))
121 { 123 {
122 eina_strbuf_append(buf, "const "); 124 eina_strbuf_append(buf, "const ");
123 } 125 }