eolian: account for @by_ref when serializing return types
authorDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Sep 2019 12:17:25 +0000 (14:17 +0200)
committerYeongjong Lee <yj34.lee@samsung.com>
Mon, 16 Sep 2019 01:23:00 +0000 (10:23 +0900)
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.

src/lib/eolian/database_type.c

index 6381cf8..52973fb 100644 (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 ");
      }