eolian: account for @by_ref when serializing return types

This fixes cases such as missing const when having a @by_ref
return type. The const should not be avoided there because it
is not returning the whole type as const, just what the pointer
dereferences to.
This commit is contained in:
Daniel Kolesa 2019-09-10 14:17:25 +02:00
parent 5cd851ea25
commit b6815a2f99
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ database_type_to_str(const Eolian_Type *tp,
|| tp->type == EOLIAN_TYPE_CLASS
|| tp->type == EOLIAN_TYPE_VOID)
&& tp->is_const
&& ((ctype != EOLIAN_C_TYPE_RETURN) || database_type_is_ownable(NULL, tp, EINA_FALSE)))
&& ((ctype != EOLIAN_C_TYPE_RETURN) || by_ref || database_type_is_ownable(NULL, tp, EINA_FALSE)))
{
eina_strbuf_append(buf, "const ");
}